mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
fix(Scripts/SunwellPlateau): Vapor should chase the player targeted b… (#21740)
This commit is contained in:
@@ -376,6 +376,16 @@ struct npc_demonic_vapor : public NullCreatureAI
|
||||
me->CastSpell(me, SPELL_DEMONIC_VAPOR_SPAWN_TRIGGER, true);
|
||||
}
|
||||
|
||||
void IsSummonedBy(WorldObject* summoner) override
|
||||
{
|
||||
if (!summoner || !summoner->ToUnit())
|
||||
return;
|
||||
|
||||
me->m_Events.AddEventAtOffset([this, summoner] {
|
||||
me->GetMotionMaster()->MoveFollow(summoner->ToUnit(), 0.0f, 0.0f, MOTION_SLOT_CONTROLLED);
|
||||
}, 2s);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (_timer)
|
||||
@@ -387,16 +397,6 @@ struct npc_demonic_vapor : public NullCreatureAI
|
||||
_timer = 0;
|
||||
}
|
||||
}
|
||||
else if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_CONTROLLED) == NULL_MOTION_TYPE)
|
||||
{
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (me->GetDistance2d(itr->GetSource()) < 20.0f && itr->GetSource()->IsAlive())
|
||||
{
|
||||
me->GetMotionMaster()->MoveFollow(itr->GetSource(), 0.0f, 0.0f, MOTION_SLOT_CONTROLLED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
private:
|
||||
uint32 _timer;
|
||||
|
||||
Reference in New Issue
Block a user