feat(Core/GameObject): Expand IsSummonedBy() to GameObjects (#14789)

Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
Skjalf
2023-01-29 09:44:33 -03:00
committed by GitHub
parent 4ecf96c379
commit bf30c66ba4
44 changed files with 191 additions and 95 deletions

View File

@@ -459,13 +459,18 @@ public:
{
}
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
if (!summoner)
return;
if (summoner->GetTypeId() != TYPEID_UNIT)
{
return;
}
_summonerGuid = summoner->GetGUID();
me->GetMotionMaster()->MoveFollow(summoner, 0.0f, 0.0f);
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), 0.0f, 0.0f);
}
void MovementInform(uint32 moveType, uint32 data) override

View File

@@ -2521,7 +2521,7 @@ public:
{
npc_venomhide_hatchlingAI(Creature* creature) : ScriptedAI(creature) {}
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
if (summoner->GetTypeId() != TYPEID_PLAYER)
{
@@ -2597,9 +2597,14 @@ public:
events.ScheduleEvent(EVENT_FLAME_BREATH, 12s);
}
void IsSummonedBy(Unit* summoner) override
void IsSummonedBy(WorldObject* summoner) override
{
me->GetMotionMaster()->MoveFollow(summoner, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
if (summoner->GetTypeId() != TYPEID_UNIT)
{
return;
}
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
void UpdateAI(uint32 diff) override