feat(Core/SmartScripts): SMART_ACTION_DISABLE_EVADE (#9772)

* Update SmartScriptMgr.h

* Update SmartScript.cpp

* Update SmartAI.h

* Update SmartAI.cpp
This commit is contained in:
IntelligentQuantum
2021-12-20 01:00:55 +03:30
committed by GitHub
parent 7a612f3dd9
commit f7ff583b7e
4 changed files with 29 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
// spawn in run mode
// Xinef: spawn in run mode and set mRun to run... this overrides SetWalk EVERYWHERE
mRun = true;
mEvadeDisabled = false;
mCanAutoAttack = true;
mCanCombatMove = true;
@@ -623,6 +624,12 @@ void SmartAI::EnterEvadeMode()
if (!me->IsAlive() || me->IsInEvadeMode())
return;
if (mEvadeDisabled)
{
GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);
return;
}
if (me->GetCharmerGUID().IsPlayer() || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_POSSESSED))
{
me->AttackStop();
@@ -935,6 +942,11 @@ void SmartAI::SetSwim(bool swim)
me->SetSwim(swim);
}
void SmartAI::SetEvadeDisabled(bool disable)
{
mEvadeDisabled = disable;
}
void SmartAI::sGossipHello(Player* player)
{
GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player);