Scripts/EmeraldDragons: Fix a few small snaggs:
- Teleport highest aggro player to front of dragon if exceeding 50 yards - Clean up target selection/handling slightly - Remove UpdateAI-segments from the dragons, it's already handled in the base AI
This commit is contained in:
@@ -85,9 +85,6 @@ enum Events
|
|||||||
* ---
|
* ---
|
||||||
* --- Emerald Dragons : Base AI-structure used for all the Emerald dragons
|
* --- Emerald Dragons : Base AI-structure used for all the Emerald dragons
|
||||||
* ---
|
* ---
|
||||||
*
|
|
||||||
* TODO
|
|
||||||
* - Fix player teleportation when running off too far from the dragon (emerald_dragonAI)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct emerald_dragonAI : public WorldBossAI
|
struct emerald_dragonAI : public WorldBossAI
|
||||||
@@ -153,10 +150,8 @@ struct emerald_dragonAI : public WorldBossAI
|
|||||||
while (uint32 eventId = events.ExecuteEvent())
|
while (uint32 eventId = events.ExecuteEvent())
|
||||||
ExecuteEvent(eventId);
|
ExecuteEvent(eventId);
|
||||||
|
|
||||||
std::list<HostileReference*> threats = me->getThreatManager().getThreatList();
|
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, -50.0f, true))
|
||||||
if (Unit* target = threats.front()->getTarget())
|
DoCast(target, SPELL_SUMMON_PLAYER);
|
||||||
if ((target->GetTypeId() == TYPEID_PLAYER) && (me->GetDistance(target) > 20.0f))
|
|
||||||
DoCast(target, SPELL_SUMMON_PLAYER);
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
DoMeleeAttackIfReady();
|
||||||
}
|
}
|
||||||
@@ -190,8 +185,7 @@ class npc_dream_fog : public CreatureScript
|
|||||||
if (!_roamTimer)
|
if (!_roamTimer)
|
||||||
{
|
{
|
||||||
// Chase target, but don't attack - otherwise just roam around
|
// Chase target, but don't attack - otherwise just roam around
|
||||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true);
|
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||||
if (target)
|
|
||||||
{
|
{
|
||||||
_roamTimer = urand(15000, 30000);
|
_roamTimer = urand(15000, 30000);
|
||||||
me->GetMotionMaster()->Clear(false);
|
me->GetMotionMaster()->Clear(false);
|
||||||
@@ -397,22 +391,6 @@ class boss_ysondre : public CreatureScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 const diff)
|
|
||||||
{
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
events.Update(diff);
|
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
|
||||||
return;
|
|
||||||
|
|
||||||
while (uint32 eventId = events.ExecuteEvent())
|
|
||||||
ExecuteEvent(eventId);
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8 _stage;
|
uint8 _stage;
|
||||||
};
|
};
|
||||||
@@ -496,22 +474,6 @@ class boss_lethon : public CreatureScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 const diff)
|
|
||||||
{
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
events.Update(diff);
|
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
|
||||||
return;
|
|
||||||
|
|
||||||
while (uint32 eventId = events.ExecuteEvent())
|
|
||||||
ExecuteEvent(eventId);
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8 _stage;
|
uint8 _stage;
|
||||||
};
|
};
|
||||||
@@ -597,22 +559,6 @@ class boss_emeriss : public CreatureScript
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateAI(uint32 const diff)
|
|
||||||
{
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
events.Update(diff);
|
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
|
||||||
return;
|
|
||||||
|
|
||||||
while (uint32 eventId = events.ExecuteEvent())
|
|
||||||
ExecuteEvent(eventId);
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint8 _stage;
|
uint8 _stage;
|
||||||
};
|
};
|
||||||
@@ -738,12 +684,7 @@ class boss_taerar : public CreatureScript
|
|||||||
|
|
||||||
void UpdateAI(uint32 const diff)
|
void UpdateAI(uint32 const diff)
|
||||||
{
|
{
|
||||||
if (!UpdateVictim())
|
if (!me->isInCombat())
|
||||||
return;
|
|
||||||
|
|
||||||
events.Update(diff);
|
|
||||||
|
|
||||||
if (me->HasUnitState(UNIT_STAT_CASTING))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_banished)
|
if (_banished)
|
||||||
@@ -760,13 +701,14 @@ class boss_taerar : public CreatureScript
|
|||||||
// _banishtimer has not expired, and we still have active shades:
|
// _banishtimer has not expired, and we still have active shades:
|
||||||
else
|
else
|
||||||
_banishedTimer -= diff;
|
_banishedTimer -= diff;
|
||||||
|
|
||||||
|
// Update the events before we return (handled under emerald_dragonAI::UpdateAI(diff); if we're not inside this check)
|
||||||
|
events.Update(diff);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (uint32 eventId = events.ExecuteEvent())
|
emerald_dragonAI::UpdateAI(diff);
|
||||||
ExecuteEvent(eventId);
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user