Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Feb 24, 2024
2 parents 730249b + e508fb6 commit 78e86cc
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 32 deletions.
39 changes: 36 additions & 3 deletions class_configs/shd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,32 @@ local _ClassConfig = {
"Lifespike",
"LifeTap",
},
['LifeTap2'] = {
"Touch of Flariton",
"Touch of Txiki",
"Touch of the Wailing Three",
"Touch of the Soulbleeder",
"Touch of Lanys",
"Touch of Dyalgem",
"Touch of Urash",
"Touch of Falsin",
"Touch of Lutzen",
"Touch of T`Vem",
"Touch of Drendar",
"Touch of Severan",
"Touch of the Devourer",
"Touch of Draygun",
"Touch of Innoruuk",
"Touch of Volatis",
"Drain Soul",
"Drain Spirit",
"Spirit Tap",
"Siphon Life",
"Life Leech",
"Lifedraw",
"Lifespike",
"LifeTap",
},
['BuffTap'] = {
"Touch of Mortimus",
"Touch of Namdrows",
Expand Down Expand Up @@ -581,7 +607,6 @@ local _ClassConfig = {
"Dire Convulsion",
"Dire Seizure",
"Dire Squelch",
"Dark Constriction",
},
['AllianceNuke'] = {
"Bloodletting Coalition",
Expand Down Expand Up @@ -1112,6 +1137,14 @@ local _ClassConfig = {
return mq.TLO.Me.PctHPs() <= RGMercUtils.GetSetting('StartLifeTap')
end,
},
{
name = "LifeTap2",
type = "Spell",
tooltip = Tooltips.LifeTap,
cond = function(self, spell)
return mq.TLO.Me.PctHPs() <= RGMercUtils.GetSetting('StartLifeTap')
end,
},
{
name = "Bash",
type = "Ability",
Expand All @@ -1136,9 +1169,8 @@ local _ClassConfig = {
{
gem = 1,
spells = {
-- On a TLP we might not have 9 gem slots so load Terror here
{ name = "Terror", cond = function(self) return mq.TLO.Me.NumGems() <= 8 end, },
{ name = "DireDot", },
{ name = "LifeTap2", },
},
},
{
Expand Down Expand Up @@ -1189,6 +1221,7 @@ local _ClassConfig = {
spells = {
{ name = "AeTaunt", cond = function(self) return RGMercUtils.GetSetting('DoAE') and mq.TLO.Me.AltAbility("Explosion of Hatred")() == nil end, },
{ name = "ForPower", },
{ name = "Terror", },
},
},
{
Expand Down
65 changes: 36 additions & 29 deletions modules/movement.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
-- Sample Basic Class Module
local mq = require('mq')
local RGMercUtils = require("utils.rgmercs_utils")
local ICONS = require('mq.Icons')
local Set = require("mq.Set")

local Module = { _version = '0.1a', _name = "Movement", _author = 'Derple', }
Module.__index = Module
Module.ModuleLoaded = false
Module.TempSettings = {}
Module.TempSettings.CampZoneId = 0
Module.TempSettings.Go2GGH = 0
Module.TempSettings.LastCmd = ""

Module.Constants = {}
Module.Constants.GGHZones = Set.new({ "poknowledge", "potranquility", "stratos", "guildlobby", "moors", "crescent", "guildhalllrg_int", "guildhall", })

Module.DefaultConfig = {
local mq = require('mq')
local RGMercUtils = require("utils.rgmercs_utils")
local ICONS = require('mq.Icons')
local Set = require("mq.Set")

local Module = { _version = '0.1a', _name = "Movement", _author = 'Derple', }
Module.__index = Module
Module.ModuleLoaded = false
Module.TempSettings = {}
Module.TempSettings.CampZoneId = 0
Module.TempSettings.Go2GGH = 0
Module.TempSettings.LastCmd = ""

Module.Constants = {}
Module.Constants.GGHZones = Set.new({ "poknowledge", "potranquility", "stratos", "guildlobby", "moors", "crescent", "guildhalllrg_int", "guildhall", })
Module.Constants.CampfireNameToKit = {
['Regular Fellowship'] = 1,
['Empowered Fellowship'] = 2,
['EScaled Wolf'] = 36,
}

Module.DefaultConfig = {
['AutoCampRadius'] = { DisplayName = "Auto Camp Radius", Category = "Camp", Tooltip = "Return to camp after you get this far away", Default = (RGMercConfig.Constants.RGMelee:contains(mq.TLO.Me.Class.ShortName()) and 15 or 60), Min = 10, Max = 300, },
['ChaseOn'] = { DisplayName = "Chase On", Category = "Chase", Tooltip = "Chase your Chase Target.", Default = false, },
['ChaseDistance'] = { DisplayName = "Chase Distance", Category = "Chase", Tooltip = "How Far your Chase Target can get before you Chase.", Default = 25, Min = 5, Max = 100, },
['ChaseTarget'] = { DisplayName = "Chase Target", Category = "Chase", Tooltip = "Character you are Chasing", Type = "Custom", Default = "", },
['ReturnToCamp'] = { DisplayName = "Return To Camp", Category = "Camp", Tooltip = "Return to Camp After Combat (requires you to /rgl campon)", Default = (not RGMercConfig.Constants.RGTank:contains(mq.TLO.Me.Class.ShortName())), },
['MaintainCampfire'] = { DisplayName = "Maintain Campfire", Category = "Camp", Tooltip = "0: Off; 1: Regular Fellowship; 2: Empowered Fellowship; 36: Scaled Wolf", Default = 1, Min = 0, Max = 36, },
['MaintainCampfire'] = { DisplayName = "Maintain Campfire", Category = "Camp", Tooltip = "1: Off; 2: Regular Fellowship; 3: Empowered Fellowship; 4: Scaled Wolf", Type = "Combo", ComboOptions = { 'Off', 'Regular Fellowship', 'Empowered Fellowship', "Scaled Wolf", }, Default = 2, Min = 1, Max = 4, },
['RequireLoS'] = { DisplayName = "Require LOS", Category = "Chase", Tooltip = "Require LOS when using /nav", Default = RGMercConfig.Constants.RGCasters:contains(mq.TLO.Me.Class.ShortName()), },
}

Module.CommandHandlers = {
Module.CommandHandlers = {
chaseon = {
usage = "/rgl chaseon <name?>",
about = "Chase your current target or <name>",
Expand Down Expand Up @@ -63,7 +68,7 @@ Module.CommandHandlers = {
},
}

Module.DefaultCategories = Set.new({})
Module.DefaultCategories = Set.new({})
for _, v in pairs(Module.DefaultConfig) do
if v.Type ~= "Custom" then
Module.DefaultCategories:add(v.Category)
Expand Down Expand Up @@ -214,7 +219,7 @@ function Module:Campfire(camptype)

if self.settings.MaintainCampfire then
if mq.TLO.FindItemCount("Fellowship Campfire Materials") == 0 then
self.settings.MaintainCampfire = 1
self.settings.MaintainCampfire = 2 -- Regular Fellowship
self:SaveSettings(false)
RGMercsLogger.log_info("Fellowship Campfire Materials Not Found. Setting to Regular Fellowship.")
end
Expand Down Expand Up @@ -251,16 +256,17 @@ function Module:Campfire(camptype)

mq.TLO.Window("FellowshipWnd").Child("FP_RefreshList").LeftMouseUp()
mq.delay("1s")
mq.TLO.Window("FellowshipWnd").Child("FP_CampsiteKitList").Select(self.settings.MaintainCampfire or camptype)
mq.TLO.Window("FellowshipWnd").Child("FP_CampsiteKitList").Select(self.Constants.CampfireNameToKit[self.settings.MaintainCampfire] or camptype)
mq.delay("1s")
mq.TLO.Window("FellowshipWnd").Child("FP_CreateCampsite").LeftMouseUp()
mq.delay("5s", function() return mq.TLO.Me.Fellowship.Campfire() ~= nil end)
mq.TLO.Window("FellowshipWnd").DoClose()
mq.delay("2s", function() return mq.TLO.Me.Fellowship.CampfireZone.ID() == mq.TLO.Zone.ID() end)

RGMercsLogger.log_info("\agCampfire Dropped")
else
RGMercsLogger.log_info("\ayCan't create campfire. Only %d nearby. Setting MaintainCampfire to 0.", fellowCount)
self.settings.MaintainCampfire = 0
self.settings.MaintainCampfire = 1 -- off
end
end

Expand Down Expand Up @@ -460,6 +466,13 @@ function Module:GiveTime(combat_state)
RGMercUtils.AutoCampCheck(self.settings, self.TempSettings)
end

if RGMercUtils.DoBuffCheck() and not RGMercUtils.GetSetting('PriorityHealing') then
if not mq.TLO.Me.Fellowship.CampfireZone() and mq.TLO.Zone.ID() == self.TempSettings.CampZoneId and self.settings.MaintainCampfire > 1 then
RGMercsLogger.log_debug("Doing campfire maintainance")
self:Campfire()
end
end

if not self:ShouldFollow() then
RGMercsLogger.log_super_verbose("ShouldFollow() check failed.")
return
Expand Down Expand Up @@ -522,12 +535,6 @@ function Module:GiveTime(combat_state)
end
end
end

if RGMercUtils.DoBuffCheck() and not RGMercUtils.GetSetting('PriorityHealing') then
if mq.TLO.Me.Fellowship.CampfireZone() and mq.TLO.Zone.ID() == self.TempSettings.CampZoneId and self.settings.MaintainCampfire then
self:Campfire()
end
end
end

function Module:OnCombatModeChanged()
Expand Down

0 comments on commit 78e86cc

Please sign in to comment.