feat(Unit/Misc): HasAnyAuras() HasAllAuras() HasAuras() (#21040)

This commit is contained in:
Kitzunu
2024-12-26 09:51:54 +01:00
committed by GitHub
parent aa24f50a03
commit bff594c4f5
19 changed files with 95 additions and 30 deletions

View File

@@ -447,7 +447,7 @@ class spell_mutate_explode_bug : public SpellScript
if (target->GetEntry() != NPC_QIRAJI_SCARAB && target->GetEntry() != NPC_QIRAJI_SCORPION)
return true;
if (Creature const* creature = target->ToCreature())
if (creature->HasAura(SPELL_EXPLODE_BUG) || creature->HasAura(SPELL_MUTATE_BUG))
if (creature->HasAnyAuras(SPELL_EXPLODE_BUG, SPELL_MUTATE_BUG))
return true;
return false;

View File

@@ -473,7 +473,7 @@ public:
{
if (spell->Id == SPELL_KODO_KOMBO_ITEM)
{
if (!(caster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || me->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
if (!caster->HasAnyAuras(SPELL_KODO_KOMBO_PLAYER_BUFF, SPELL_KODO_KOMBO_DESPAWN_BUFF)
&& (me->GetEntry() == NPC_AGED_KODO || me->GetEntry() == NPC_DYING_KODO || me->GetEntry() == NPC_ANCIENT_KODO))
{
me->UpdateEntry(NPC_TAMED_KODO, nullptr, false);
@@ -494,7 +494,7 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF))
if (player->HasAllAuras(SPELL_KODO_KOMBO_PLAYER_BUFF, SPELL_KODO_KOMBO_DESPAWN_BUFF))
{
player->TalkedToCreature(creature->GetEntry(), ObjectGuid::Empty);
player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF);