From 67c84b1f3d74985fd2521feb9e536e56b9c9f2e9 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 21 May 2009 10:48:00 -0500 Subject: Mobs fleeing and getting assistance feature implementaion. Author: Neo2003 --HG-- branch : trunk --- src/game/PointMovementGenerator.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/game/PointMovementGenerator.cpp') diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp index dedb4f0829c..c972683ce0b 100644 --- a/src/game/PointMovementGenerator.cpp +++ b/src/game/PointMovementGenerator.cpp @@ -23,6 +23,7 @@ #include "Creature.h" #include "CreatureAI.h" #include "DestinationHolderImp.h" +#include "World.h" //----- Point Movement Generator template @@ -92,3 +93,11 @@ template void PointMovementGenerator::Finalize(Player&); template void PointMovementGenerator::Initialize(Creature&); template bool PointMovementGenerator::Update(Creature&, const uint32 &diff); template void PointMovementGenerator::Finalize(Creature&); + +void AssistanceMovementGenerator::Finalize(Unit &unit) +{ + ((Creature*)&unit)->SetNoCallAssistance(false); + ((Creature*)&unit)->CallAssistance(); + if (unit.isAlive()) + unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY)); +} -- cgit v1.2.3