mirror of
https://github.com/mangosfour/server.git
synced 2025-12-30 19:37:04 +00:00
[9229] Add AI function SummonedMovementInform
Informing summoner of summoned when it reach a movement point (MovePoint)
This commit is contained in:
parent
4178d5bb6a
commit
0ed769c828
3 changed files with 19 additions and 2 deletions
|
|
@ -118,6 +118,9 @@ class MANGOS_DLL_SPEC CreatureAI
|
|||
// Called at waypoint reached or point movement finished
|
||||
virtual void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) {}
|
||||
|
||||
// Called if a temporary summoned of m_creature reach a move point
|
||||
virtual void SummonedMovementInform(Creature* /*summoned*/, uint32 /*motion_type*/, uint32 /*point_id*/) {}
|
||||
|
||||
// Called at text emote receive from player
|
||||
virtual void ReceiveEmote(Player* /*pPlayer*/, uint32 /*text_emote*/) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "Errors.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "TemporarySummon.h"
|
||||
#include "DestinationHolderImp.h"
|
||||
#include "World.h"
|
||||
|
||||
|
|
@ -90,7 +91,20 @@ void PointMovementGenerator<Player>::MovementInform(Player&)
|
|||
template <>
|
||||
void PointMovementGenerator<Creature>::MovementInform(Creature &unit)
|
||||
{
|
||||
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
|
||||
if (unit.AI())
|
||||
unit.AI()->MovementInform(POINT_MOTION_TYPE, id);
|
||||
|
||||
if (TemporarySummon* pSummon = dynamic_cast<TemporarySummon*>(&unit))
|
||||
{
|
||||
if (Unit* pSummoner = pSummon->GetSummoner())
|
||||
{
|
||||
if (pSummoner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (((Creature*)pSummoner)->AI())
|
||||
((Creature*)pSummoner)->AI()->SummonedMovementInform(&unit, POINT_MOTION_TYPE, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template void PointMovementGenerator<Player>::Initialize(Player&);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue