mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-28 16:06:25 +00:00
Warlock Soulstone/Soulshard hotfix (#1452)
Hello everybody, This PR is to address issues #1439 and #1451. I added a 1 second cooldown to the createsoulshard action, as the warlock wouldn't ever use more than 1 soul shard per second. I also added a cooldown check to the soulstone trigger, so it doesn't simply try to use the ss healer, ss self, ss tank, or ss master if the soulstone is present in the inventory. I checked the logs, and was able to recreate the issue of #1451 - the bot was shifting targets over and over again, and that was because previously the trigger was just checking to see if a soulstone was present at all. Now it won't fire if it's on cooldown.
This commit is contained in:
@@ -72,8 +72,18 @@ public:
|
||||
|
||||
bool IsActive() override
|
||||
{
|
||||
// Just check if we have a soulstone item available
|
||||
return AI_VALUE2(uint32, "item count", "soulstone") > 0;
|
||||
static const std::vector<uint32> soulstoneSpellIds = {20707, 20762, 20763, 20764, 20765, 27239, 47883};
|
||||
|
||||
if (AI_VALUE2(uint32, "item count", "soulstone") == 0)
|
||||
return false;
|
||||
|
||||
for (uint32 spellId : soulstoneSpellIds)
|
||||
{
|
||||
if (!bot->HasSpellCooldown(spellId))
|
||||
return true; // Ready to use
|
||||
}
|
||||
|
||||
return false; // All are on cooldown
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user