AI/SmartScripts: Add SMART_ACTION_DISABLE_EVADE (117).

This commit is contained in:
treeston authored and Aokromes committed 2016-08-20 06:19:41 +02:00
1 parent c2fd73c95d
commit 0e47f961c9
5 files changed
+31 -1

No files matched your search

@@ -42,6 +42,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
// spawn in run mode
me->SetWalk(false);
mRun = false;
mEvadeDisabled = false;
mLastOOCPos = me->GetPosition();
@@ -415,6 +416,12 @@ void SmartAI::EnterEvadeMode(EvadeReason /*why*/)
if (!me->IsAlive() || me->IsInEvadeMode())
return;
if (mEvadeDisabled)
{
GetScript()->ProcessEventsFor(SMART_EVENT_EVADE);
return;
}
me->RemoveAurasOnEvade();
me->AddUnitState(UNIT_STATE_EVADE);
@@ -693,6 +700,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);