fix(Core/Scripts): Fix Aeranas reset loop during quest Avruu's Orb (#25290)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
@@ -83,6 +83,9 @@ public:
|
|||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
{
|
{
|
||||||
|
if (_defeated)
|
||||||
|
return;
|
||||||
|
|
||||||
faction_Timer = 8000;
|
faction_Timer = 8000;
|
||||||
envelopingWinds_Timer = 9000;
|
envelopingWinds_Timer = 9000;
|
||||||
shock_Timer = 5000;
|
shock_Timer = 5000;
|
||||||
@@ -93,6 +96,15 @@ public:
|
|||||||
Talk(SAY_SUMMON);
|
Talk(SAY_SUMMON);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void JustReachedHome() override
|
||||||
|
{
|
||||||
|
if (_defeated)
|
||||||
|
{
|
||||||
|
Talk(SAY_FREE);
|
||||||
|
me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (faction_Timer)
|
if (faction_Timer)
|
||||||
@@ -110,12 +122,11 @@ public:
|
|||||||
|
|
||||||
if (HealthBelowPct(30))
|
if (HealthBelowPct(30))
|
||||||
{
|
{
|
||||||
me->SetFaction(FACTION_FRIENDLY);
|
_defeated = true;
|
||||||
me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
|
|
||||||
me->RemoveAllAuras();
|
me->RemoveAllAuras();
|
||||||
me->GetThreatMgr().ClearAllThreat();
|
me->SetFaction(FACTION_FRIENDLY);
|
||||||
me->CombatStop(true);
|
me->CombatStop(true);
|
||||||
Talk(SAY_FREE);
|
me->GetThreatMgr().ClearAllThreat();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,6 +151,7 @@ public:
|
|||||||
uint32 faction_Timer;
|
uint32 faction_Timer;
|
||||||
uint32 envelopingWinds_Timer;
|
uint32 envelopingWinds_Timer;
|
||||||
uint32 shock_Timer;
|
uint32 shock_Timer;
|
||||||
|
bool _defeated = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
CreatureAI* GetAI(Creature* creature) const override
|
||||||
|
|||||||
Reference in New Issue
Block a user