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 25, 2024
2 parents e20fa56 + 5c70527 commit 6a76535
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 93 deletions.
13 changes: 12 additions & 1 deletion class_configs/brd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,18 @@ local _ClassConfig = {

},
},

['PullAbilities'] = {
{
id = 'Boastful Bellow',
Type = "AA",
DisplayName = 'Boastful Bellow',
AbilityName = 'Boastful Bellow',
AbilityRange = 250,
cond = function(self)
return mq.TLO.Me.AltAbility('Boastful Bellow')
end,
},
},
['DefaultConfig'] = {
['Mode'] = { DisplayName = "Mode", Category = "Combat", Tooltip = "Select the Combat Mode for this Toon", Type = "Custom", RequiresLoadoutChange = true, Default = 1, Min = 1, Max = 4, },
['UseAASelo'] = { DisplayName = "Use AA Selo", Category = "Buffs", Tooltip = "Do Selo's AAs", Default = true, },
Expand Down
4 changes: 4 additions & 0 deletions class_configs/nec_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ local _ClassConfig = {
},
['SwarmPet'] = {
---SwarmPet >= LVL85
"Call Relentless Skeleton",
"Call Ruthless Skeleton",
"Call Ruinous Skeleton",
"Call Rumbling Skeleton",
"Call Skeleton Thrall",
"Call Skeleton Mass",
"Call Skeleton Horde",
Expand Down
12 changes: 12 additions & 0 deletions class_configs/shd_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,18 @@ local _ClassConfig = {
return mq.TLO.Me.Gem(resolvedSpell.RankName.Name() or "")() ~= nil
end,
},
{
id = 'ForPower',
Type = "Spell",
DisplayName = function() return RGMercUtils.GetResolvedActionMapItem('ForPower')() or "" end,
AbilityName = function() return RGMercUtils.GetResolvedActionMapItem('ForPower')() or "" end,
AbilityRange = 150,
cond = function(self)
local resolvedSpell = RGMercUtils.GetResolvedActionMapItem('ForPower')
if not resolvedSpell then return false end
return mq.TLO.Me.Gem(resolvedSpell.RankName.Name() or "")() ~= nil
end,
},
},
['DefaultConfig'] = {
['Mode'] = { DisplayName = "Mode", Category = "Combat", Tooltip = "Select the Combat Mode for this Toon", Type = "Custom", RequiresLoadoutChange = true, Default = 1, Min = 1, Max = 2, },
Expand Down
7 changes: 6 additions & 1 deletion class_configs/shm_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,12 @@ local _ClassConfig = {
cond = function(self, spell, target, uiCheck)
-- force the target for StacksTarget to work.
if not uiCheck then RGMercUtils.SetTarget(target.ID() or 0) end
return not RGMercUtils.TargetHasBuff(spell, target) and spell.StacksTarget()
local stacks = spell.StacksTarget()
local numEffects = spell.NumEffects()
for i = 1, numEffects do
stacks = stacks and spell.Trigger(i).StacksTarget()
end
return not RGMercUtils.TargetHasBuff(spell, target) and stacks
end,
},
{
Expand Down
2 changes: 1 addition & 1 deletion extras/version.lua
Original file line number Diff line number Diff line change
@@ -1 +1 @@
return { commitId = '7dc951c 2024-02-24' }
return { commitId = '18c91cf 2024-02-25' }
13 changes: 9 additions & 4 deletions modules/movement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Module.DefaultConfig = {
['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())), },
['CampHard'] = { DisplayName = "Camp Hard", Category = "Camp", Tooltip = "Return to Camp Loc Everytime", Default = false, },
['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()), },
}
Expand Down Expand Up @@ -226,11 +227,11 @@ function Module:Campfire(camptype)
end
end

local spawnCount = mq.TLO.SpawnCount("PC radius 50")()
local spawnCount = mq.TLO.SpawnCount("PC radius 100")()
local fellowCount = 0

for i = 1, spawnCount do
local spawn = mq.TLO.NearestSpawn(i, "PC radius 50")
local spawn = mq.TLO.NearestSpawn(i, "PC radius 100")

if spawn() and mq.TLO.Me.Fellowship.Member(spawn.CleanName()) then
fellowCount = fellowCount + 1
Expand Down Expand Up @@ -278,7 +279,7 @@ end
function Module:Render()
ImGui.Text("Chase Module")

if self.settings and self.ModuleLoaded then
if self.settings and self.ModuleLoaded and RGMercConfig.Globals.SubmodulesLoaded then
ImGui.Text(string.format("Chase Distance: %d", self.settings.ChaseDistance))
ImGui.Text(string.format("Chase LOS Required: %s", self.settings.LineOfSight and "On" or "Off"))

Expand Down Expand Up @@ -407,6 +408,10 @@ function Module:OnZone()
self:CampOff()
end

function Module:DoAutoCampCheck()
RGMercUtils.AutoCampCheck(self.TempSettings)
end

function Module:GiveTime(combat_state)
if mq.TLO.Me.Hovering() and self.settings.ChaseOn then
RGMercsLogger.log_warn("\awNOTICE:\ax You're dead. I'm not chasing \am%s\ax anymore.",
Expand Down Expand Up @@ -464,7 +469,7 @@ function Module:GiveTime(combat_state)
end

if RGMercUtils.DoCamp() then
RGMercUtils.AutoCampCheck(self.settings, self.TempSettings)
self:DoAutoCampCheck()
end

if RGMercUtils.DoBuffCheck() and not RGMercUtils.GetSetting('PriorityHealing') then
Expand Down
15 changes: 10 additions & 5 deletions modules/pull.lua
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,9 @@ function Module:ShouldPull()
return false, string.format("Corrupted")
end

if self:IsPullMode("Chain") and RGMercUtils.GetXTHaterCount() > self.settings.ChainCount then
RGMercsLogger.log_super_verbose("\ay::PULL:: \arAborted!\ax XTargetCount(%d) > ChainCount(%d)", RGMercUtils.GetXTHaterCount(), self.settings.ChainCount)
RGMercsLogger.log_debug("%d >= %d", RGMercUtils.GetXTHaterCount(), self.settings.ChainCount)
if self:IsPullMode("Chain") and RGMercUtils.GetXTHaterCount() >= self.settings.ChainCount then
RGMercsLogger.log_super_verbose("\ay::PULL:: \arAborted!\ax XTargetCount(%d) >= ChainCount(%d)", RGMercUtils.GetXTHaterCount(), self.settings.ChainCount)
return false, string.format("XTargetCount(%d) > ChainCount(%d)", RGMercUtils.GetXTHaterCount(), self.settings.ChainCount)
end

Expand Down Expand Up @@ -776,7 +777,7 @@ function Module:CheckGroupForPull(classes, resourceStartPct, resourceStopPct, ca
if member.ID() == RGMercUtils.GetMainAssistId() then
if returnToCamp and RGMercUtils.GetDistance(member.X(), member.Y(), campData.AutoCampX, campData.AutoCampY) > RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius then
RGMercUtils.PrintGroupMessage("%s (assist target) is beyond AutoCampRadius from %d, %d, %d : %d. Holding pulls.", member.CleanName(), campData.AutoCampY,
campData.AutoCampX, campData.AutoCampZ, RGMercConfig.SubModuleSettings.settings.Movement.settings.AutoCampRadius)
campData.AutoCampX, campData.AutoCampZ, RGMercConfig.SubModuleSettings.Movement.settings.AutoCampRadius)
return false, string.format("%s Beyond AutoCampRadius", member.CleanName())
end
else
Expand Down Expand Up @@ -1218,7 +1219,7 @@ function Module:GiveTime(combat_state)
while mq.TLO.Navigation.Active() and mq.TLO.Navigation.Velocity() > 0 do
RGMercsLogger.log_super_verbose("Pathing to pull id...")
if self:IsPullMode("Chain") then
if RGMercUtils.GetXTHaterCount() > self.settings.ChainCount then
if RGMercUtils.GetXTHaterCount() >= self.settings.ChainCount then
RGMercsLogger.log_info("\awNOTICE:\ax Gained aggro -- aborting chain pull!")
abortPull = true
break
Expand Down Expand Up @@ -1270,7 +1271,7 @@ function Module:GiveTime(combat_state)
local successFn = function() return RGMercUtils.GetXTHaterCount() > 0 end

if self:IsPullMode("Chain") then
successFn = function() return RGMercUtils.GetXTHaterCount() > self.settings.ChainCount end
successFn = function() return RGMercUtils.GetXTHaterCount() >= self.settings.ChainCount end
end

if self.settings.PullAbility == PullAbilityIDToName.PetPull then -- PetPull
Expand Down Expand Up @@ -1382,6 +1383,10 @@ function Module:GiveTime(combat_state)
local abilityName = pullAbility.AbilityName
if type(abilityName) == 'function' then abilityName = abilityName() end
RGMercUtils.UseSpell(abilityName, self.TempSettings.PullID, false)
elseif pullAbility.Type:lower() == "aa" then
local aaName = pullAbility.AbilityName
if type(aaName) == 'function' then aaName = aaName() end
RGMercUtils.UseAA(aaName, self.TempSettings.PullID)
else
RGMercsLogger.log_error("\arInvalid PullAbilityType: %s :: %s", pullAbility.Type, pullAbility.id)
end
Expand Down
84 changes: 8 additions & 76 deletions utils/rgmercs_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -297,81 +297,13 @@ function Config:UpdateCommandHandlers()
local handled, usageString = self:GetUsageText(config, true, moduleData.defaults)

if handled then
if type(configData.Default) == 'number' then
self.CommandHandlers[config:lower()] = {
name = config,
usage = usageString,
subModule = moduleName,
category = configData.Category,
about = configData.Tooltip,
handler = function(self, value)
value = tonumber(value)
if value > (moduleData.defaults[config].Max or 999) or value < (moduleData.defaults[config].Min or 0) then
RGMercsLogger.log_info("\ayError: %s is not a valid setting for %s.", value, config)
local _, update = self:GetUsageText(config, true, moduleData.defaults)
RGMercsLogger.log_info(update)
return
end
local _, update = self:GetUsageText(config, false, moduleData.defaults)
RGMercsLogger.log_info("\a-y%s :: Before :: %s", config, update)
moduleData.settings[config] = value
_, update = self:GetUsageText(config, false, moduleData.defaults)
RGMercsLogger.log_info("\ag%s :: After :: %s", config, update)
if moduleName == "Core" then
self:SaveSettings(true)
else
RGMercModules:ExecModule(moduleName, "SaveSettings", true)
end
end,
}
end
if type(configData.Default) == 'boolean' then
self.CommandHandlers[config:lower()] = {
name = config,
usage = usageString,
subModule = moduleName,
category = configData.Category,
about = configData.Tooltip,
handler = function(self, value)
local boolValue = false
if value == "true" or value == "on" or (tonumber(value) or 0) >= 1 then
boolValue = true
end

local _, update = self:GetUsageText(config, false, moduleData.defaults)
RGMercsLogger.log_info("\a-y%s :: Before :: %-5s", config, update)
moduleData.settings[config] = boolValue
_, update = self:GetUsageText(config, false, moduleData.defaults)
RGMercsLogger.log_info("\ag%s :: After :: %-5ss", config, update)
if moduleName == "Core" then
self:SaveSettings(true)
else
RGMercModules:ExecModule(moduleName, "SaveSettings", true)
end
end,
}
end
if type(configData.Default) == 'string' then
self.CommandHandlers[config:lower()] = {
name = config,
usage = usageString,
subModule = moduleName,
category = configData.Category,
about = configData.Tooltip,
handler = function(self, value)
local _, update = self:GetUsageText(config, false, moduleData.defaults)
RGMercsLogger.log_info("\a-y%s :: Before :: \"%s\"", config, update)
moduleData.settings[config] = value
_, update = self:GetUsageText(config, false, moduleData.defaults)
RGMercsLogger.log_info("\ag%s :: After :: \"%s\"", config, update)
if moduleName == "Core" then
self:SaveSettings(true)
else
RGMercModules:ExecModule(moduleName, "SaveSettings", true)
end
end,
}
end
self.CommandHandlers[config:lower()] = {
name = config,
usage = usageString,
subModule = moduleName,
category = configData.Category,
about = configData.Tooltip,
}
end
end
end
Expand Down Expand Up @@ -495,7 +427,7 @@ function Config:HandleBind(config, value)
end

if self.CommandHandlers[config:lower()] ~= nil then
self.CommandHandlers[config:lower()].handler(self, value)
RGMercUtils.SetSetting(config, value)
handled = true
else
RGMercsLogger.log_error("\at%s\aw - \arNot a valid config setting!\ax", config)
Expand Down
11 changes: 11 additions & 0 deletions utils/rgmercs_events.lua
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,17 @@ end)

-- [ END MEZ HANDLERS ] --

-- [ SUMMONED HANDLERS ] --

mq.event('Summoned', "You have been summoned!", function(_)
if RGMercUtils.GetSetting('DoAutoEngage') and not RGMercUtils.GetSetting('DoMelee') and not RGMercUtils.IAmMA() and RGMercUtils.GetSetting('ReturnToCamp') then
RGMercUtils.PrintGroupMessage("%s was just summoned -- returning to camp!", mq.TLO.Me.DisplayName())
RGMercModules:ExecModule("Movement", "DoAutoCampCheck")
end
end)

-- [ END SUMMONED HANDLERS ] --

-- [ GAME EVENT HANDLERS ] --

mq.event('Camping', "It will take you about #1# seconds to prepare your camp.", function(_, seconds)
Expand Down

0 comments on commit 6a76535

Please sign in to comment.