mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Pet/Misc: Improve Egbert's AI even more
This commit is contained in:
4
sql/updates/world/2016_02_13_00_world.sql
Normal file
4
sql/updates/world/2016_02_13_00_world.sql
Normal file
@@ -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);
|
||||
@@ -2575,9 +2575,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
|
||||
@@ -2599,7 +2598,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
|
||||
@@ -2618,12 +2616,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())
|
||||
@@ -2631,7 +2629,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