Skip to content

Commit

Permalink
- Fixed mage pocket pets logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpleMQ2 committed Mar 10, 2024
1 parent 5bae501 commit 7b41bc3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
46 changes: 29 additions & 17 deletions class_configs/mag_class_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,14 @@ _ClassConfig = {
{
name = 'Pet Management',
targetId = function(self) return { mq.TLO.Me.ID(), } end,
cond = function(self, combat_state) return true end,
cond = function(self, combat_state) return combat_state == "Downtime" end,
},
{
name = 'Combat Pet Management',
state = 1,
steps = 1,
targetId = function(self) return { mq.TLO.Me.ID(), } end,
cond = function(self, combat_state) return combat_state ~= "Downtime" end,
},
-- Downtime doesn't have state because we run the whole rotation at once.
{
Expand Down Expand Up @@ -1187,7 +1194,7 @@ _ClassConfig = {
custom_func = function(self) return self.ClassConfig.HelperFunctions.summon_pet(self) end,
},
{
name = "Pocket Pet",
name = "Store Pocket Pet",
type = "CustomFunc",
active_cond = function(self)
return self.TempSettings.PocketPet == true
Expand All @@ -1199,32 +1206,37 @@ _ClassConfig = {
custom_func = function(self) return self.ClassConfig.HelperFunctions.pet_management(self) end,
},
{
name = "Engage Pocket Pet",
name = "Drop Cursor Items",
type = "CustomFunc",
cond = function(self)
if self.TempSettings.PocketPet == nil then self.TempSettings.PocketPet = false end
return self.TempSettings.PocketPet and RGMercUtils.GetSetting('DoPocketPet') and RGMercUtils.GetXTHaterCount() > 0
return mq.TLO.Cursor() and mq.TLO.Cursor.ID() > 0
end,
custom_func = function(self)
if not self.TempSettings.Pocket then return false end

RGMercUtils.UseAA("Companion's Suspension", 0)
self.TempSettings.PocketPet = false

return true
if mq.TLO.Cursor() and mq.TLO.Cursor.ID() > 0 then
RGMercsLogger.log_info("Sending Item(%s) on Cursor to Bag", mq.TLO.Cursor())
RGMercUtils.DoCmd("/autoinventory")
end
end,
},
},
['Combat Pet Management'] = {
{
name = "Drop Cursor Items",
name = "Engage Pocket Pet",
type = "CustomFunc",
active_cond = function(self)
return self.TempSettings.PocketPet == true and mq.TLO.Me.Pet.ID() == 0
end,
cond = function(self)
return mq.TLO.Cursor() and mq.TLO.Cursor.ID() > 0
if self.TempSettings.PocketPet == nil then self.TempSettings.PocketPet = false end
return self.TempSettings.PocketPet and RGMercUtils.GetSetting('DoPocketPet') and mq.TLO.Me.Pet.ID() == 0 and RGMercUtils.GetXTHaterCount() > 0
end,
custom_func = function(self)
if mq.TLO.Cursor() and mq.TLO.Cursor.ID() > 0 then
RGMercsLogger.log_info("Sending Item(%s) on Cursor to Bag", mq.TLO.Cursor())
RGMercUtils.DoCmd("/autoinventory")
end
RGMercsLogger.log_info("\atPocketPet: \arNo pet while in combat! \agPulling out pocket pet")
RGMercUtils.SetTarget(mq.TLO.Me.ID())
RGMercUtils.UseAA("Companion's Suspension", mq.TLO.Me.ID())
self.TempSettings.PocketPet = false

return true
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 = '377a89a 2024-03-10' }
return { commitId = '5bae501 2024-03-10' }

0 comments on commit 7b41bc3

Please sign in to comment.