mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +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);
|
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
|
void UpdateAI(uint32 diff) override
|
||||||
{
|
{
|
||||||
if (_timer)
|
if (_timer)
|
||||||
@@ -387,16 +397,6 @@ struct npc_demonic_vapor : public NullCreatureAI
|
|||||||
_timer = 0;
|
_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:
|
private:
|
||||||
uint32 _timer;
|
uint32 _timer;
|
||||||
|
|||||||
Reference in New Issue
Block a user