feat(Core/Unit): New helpers for DynamicFlags (#11230)

* feat(Core/Unit): New helpers for DynamicFlags

* cherry-pick commit (d611925dc7)

Co-Authored-By: Shauren <shauren.trinity@gmail.com>

* oopsie

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
Kitzunu
2022-04-01 12:14:29 +02:00
committed by GitHub
parent 45577d30ca
commit 535c7451a2
38 changed files with 85 additions and 73 deletions

View File

@@ -400,7 +400,7 @@ void hyjal_trashAI::JustDied(Unit* /*killer*/)
instance->SetData(DATA_TRASH, 0);//signal trash is dead
if ((instance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !me->isWorldBoss()) || (damageTaken < me->GetMaxHealth() / 4 && me->isWorldBoss()))
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);//no loot
}
class npc_giant_infernal : public CreatureScript

View File

@@ -83,7 +83,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
@@ -173,7 +173,7 @@ public:
{
instance->SetData(DATA_VEM_DEATH, 0);
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
}
@@ -262,7 +262,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
me->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
instance->SetData(DATA_BUG_TRIO_DEATH, 1);
for (uint8 i = 0; i < 10; ++i)

View File

@@ -115,7 +115,7 @@ struct boss_twinemperorsAI : public ScriptedAI
if (ohealth <= 0)
{
pOtherBoss->setDeathState(JUST_DIED);
pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pOtherBoss->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
}
}
}
@@ -127,7 +127,7 @@ struct boss_twinemperorsAI : public ScriptedAI
{
pOtherBoss->SetHealth(0);
pOtherBoss->setDeathState(JUST_DIED);
pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
pOtherBoss->SetDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true;
}
if (!DontYellWhenDead) // I hope AI is not threaded