Core/Escort: few modifications to add the IMMUNE_TO_NPC flag after npc does a full reset.
This commit is contained in:
@@ -32,7 +32,8 @@ npc_escortAI::npc_escortAI(Creature* creature) : ScriptedAI(creature),
|
|||||||
m_bCanReturnToStart(false),
|
m_bCanReturnToStart(false),
|
||||||
DespawnAtEnd(true),
|
DespawnAtEnd(true),
|
||||||
DespawnAtFar(true),
|
DespawnAtFar(true),
|
||||||
ScriptWP(false)
|
ScriptWP(false),
|
||||||
|
HasImmuneToNPCFlags(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void npc_escortAI::AttackStart(Unit* who)
|
void npc_escortAI::AttackStart(Unit* who)
|
||||||
@@ -179,6 +180,8 @@ void npc_escortAI::EnterEvadeMode()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
me->GetMotionMaster()->MoveTargetedHome();
|
me->GetMotionMaster()->MoveTargetedHome();
|
||||||
|
if (HasImmuneToNPCFlags)
|
||||||
|
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||||
Reset();
|
Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -462,7 +465,11 @@ void npc_escortAI::Start(bool isActiveAttacker /* = true*/, bool run /* = false
|
|||||||
|
|
||||||
//disable npcflags
|
//disable npcflags
|
||||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC))
|
||||||
|
{
|
||||||
|
HasImmuneToNPCFlags = true;
|
||||||
|
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
|
||||||
|
}
|
||||||
|
|
||||||
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
|
sLog->outDebug(LOG_FILTER_TSCR, "TSCR: EscortAI started with " UI64FMTD " waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = " UI64FMTD "", uint64(WaypointList.size()), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID);
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ struct npc_escortAI : public ScriptedAI
|
|||||||
bool DespawnAtEnd;
|
bool DespawnAtEnd;
|
||||||
bool DespawnAtFar;
|
bool DespawnAtFar;
|
||||||
bool ScriptWP;
|
bool ScriptWP;
|
||||||
|
bool HasImmuneToNPCFlags;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user