grobbulus fixed

This commit is contained in:
Yunfan Li
2023-06-09 23:19:33 +08:00
parent 634ce3d183
commit b11fad1a46
9 changed files with 54 additions and 32 deletions

View File

@@ -33,6 +33,11 @@
#include "GuildMgr.h"
#include "SayAction.h"
std::vector<std::string> PlayerbotAI::dispel_whitelist = {
"mutating injection",
"frostbolt",
};
std::vector<std::string>& split(std::string const s, char delim, std::vector<std::string>& elems);
std::vector<std::string> split(std::string const s, char delim);
char* strstri(char const* str1, char const* str2);
@@ -2748,6 +2753,16 @@ bool PlayerbotAI::canDispel(SpellInfo const* spellInfo, uint32 dispelType)
{
if (spellInfo->Dispel != dispelType)
return false;
if (!spellInfo->SpellName[0]) {
return true;
}
for (std::string &wl : dispel_whitelist) {
if (strcmpi((const char*)spellInfo->SpellName[0], wl.c_str()) == 0) {
return false;
}
}
return !spellInfo->SpellName[0] || (strcmpi((const char*)spellInfo->SpellName[0], "demon skin") && strcmpi((const char*)spellInfo->SpellName[0], "mage armor") &&
strcmpi((const char*)spellInfo->SpellName[0], "frost armor") && strcmpi((const char*)spellInfo->SpellName[0], "wavering will") &&