mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Pet/Misc: Improve Egbert's AI even more
(cherry picked from commit af5f4ae85b)
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
SET @ENTRY:=23258;
|
||||
SET @AURA:=40670;
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` = @ENTRY;
|
||||
INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES (@ENTRY, @AURA);
|
||||
@@ -2516,9 +2516,8 @@ class npc_train_wrecker : public CreatureScript
|
||||
|
||||
enum EgbertMisc
|
||||
{
|
||||
SPELL_EGBERT = 40670,
|
||||
SPELL_EGBERT2 = 40669,
|
||||
EVENT_RETURN = 3,
|
||||
SPELL_EGBERT = 40669,
|
||||
EVENT_RETURN = 3
|
||||
};
|
||||
|
||||
class npc_egbert : public CreatureScript
|
||||
@@ -2540,7 +2539,6 @@ public:
|
||||
_events.Reset();
|
||||
if (Unit* owner = me->GetCharmerOrOwner())
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
|
||||
me->CastSpell(me, SPELL_EGBERT);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
@@ -2559,12 +2557,12 @@ public:
|
||||
{
|
||||
if (!me->IsWithinDist(owner, 40.f))
|
||||
{
|
||||
me->RemoveAura(SPELL_EGBERT2);
|
||||
me->RemoveAura(SPELL_EGBERT);
|
||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle());
|
||||
}
|
||||
}
|
||||
|
||||
if (me->HasAura(SPELL_EGBERT2))
|
||||
if (me->HasAura(SPELL_EGBERT))
|
||||
_events.ScheduleEvent(EVENT_RETURN, urandms(5, 20));
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
@@ -2572,7 +2570,7 @@ public:
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_RETURN:
|
||||
me->RemoveAura(SPELL_EGBERT2);
|
||||
me->RemoveAura(SPELL_EGBERT);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user