mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Mobs fleeing and getting assistance feature implementaion.
Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also rename ACTION_T_FLEE to ACTION_T_FLEE_FOR_ASSIST for clear use
This commit is contained in:
parent
f332c000d1
commit
fa03b3663a
21 changed files with 238 additions and 19 deletions
|
|
@ -17,7 +17,8 @@
|
|||
*/
|
||||
|
||||
#include "IdleMovementGenerator.h"
|
||||
#include "Unit.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "Creature.h"
|
||||
|
||||
IdleMovementGenerator si_idleMovement;
|
||||
|
||||
|
|
@ -47,3 +48,17 @@ DistractMovementGenerator::Update(Unit& /*owner*/, const uint32& time_diff)
|
|||
m_timer -= time_diff;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
AssistanceDistractMovementGenerator::Finalize(Unit &unit)
|
||||
{
|
||||
unit.clearUnitState(UNIT_STAT_DISTRACTED);
|
||||
if (Unit* victim = unit.getVictim())
|
||||
{
|
||||
if (unit.isAlive())
|
||||
{
|
||||
unit.AttackStop(true);
|
||||
((Creature*)&unit)->AI()->AttackStart(victim);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue