diff --git a/data/sql/updates/pending_db_world/fix_quest_9410.sql b/data/sql/updates/pending_db_world/fix_quest_9410.sql new file mode 100644 index 000000000..74323ce76 --- /dev/null +++ b/data/sql/updates/pending_db_world/fix_quest_9410.sql @@ -0,0 +1,7 @@ +-- add a time to script_waypoint +DELETE FROM `script_waypoint` WHERE `entry`=17077 AND `pointid` IN (50, 51, 52, 53); +INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES +(17077, 50, 519.146, 3886.7, 190.128, 8000, 'RYGA_MOVEMENT_TO_WOLF'), +(17077, 51, 519.146, 3886.7, 190.128, 13000, 'RYGA_TIME_MOVEMENT_TO_WOLF'), +(17077, 52, 519.146, 3886.7, 190.128, 5000, 'RYGA_TIME_RETURN_SPAWN'), +(17077, 53, 519.146, 3886.7, 190.128, 50000, 'DESPAWN_WOLF'); diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index e66a3f7f6..66bff74f3 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -158,8 +158,8 @@ enum AncestralWolf { EMOTE_WOLF_LIFT_HEAD = 0, EMOTE_WOLF_HOWL = 1, - SAY_WOLF_WELCOME = 2, - SPELL_ANCESTRAL_WOLF_BUFF = 29981, + SAY_WOLF_WELCOME = 0, + SPELL_GUIDED_BY_THE_SPIRITS = 29938, NPC_RYGA = 17123 }; @@ -173,18 +173,19 @@ public: npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature) { if (creature->GetOwner() && creature->GetOwner()->GetTypeId() == TYPEID_PLAYER) - Start(false, true, creature->GetOwner()->GetGUID()); + Start(false, false, creature->GetOwner()->GetGUID()); + creature->SetSpeed(MOVE_WALK, 1.5f); + DoCast(SPELL_GUIDED_BY_THE_SPIRITS); + Reset(); } void Reset() override { ryga = nullptr; - me->CastSpell(me, SPELL_ANCESTRAL_WOLF_BUFF, false); me->SetReactState(REACT_PASSIVE); } void MoveInLineOfSight(Unit* who) override - { if (!ryga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f)) if (Creature* temp = who->ToCreature()) @@ -195,7 +196,6 @@ public: void WaypointReached(uint32 waypointId) override { - me->CastSpell(me, SPELL_ANCESTRAL_WOLF_BUFF, false); switch (waypointId) { case 0: @@ -205,8 +205,51 @@ public: Talk(EMOTE_WOLF_HOWL); break; case 50: - if (ryga && ryga->IsAlive() && !ryga->IsInCombat()) - ryga->AI()->Talk(SAY_WOLF_WELCOME); + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + ryga->SetWalk(true); + ryga->SetSpeed(MOVE_WALK, 1.0f); + ryga->GetMotionMaster()->MovePoint(0, 515.877991f, 3885.67627f, 190.470535f, true); + Reset(); + } + } + break; + case 51: + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + ryga->SetFacingTo(0.2602f); + ryga->SetStandState(UNIT_STAND_STATE_KNEEL); + ryga->AI()->Talk(SAY_WOLF_WELCOME); + Reset(); + } + } + break; + case 52: + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + ryga->SetStandState(UNIT_STAND_STATE_STAND); + ryga->SetWalk(true); + ryga->SetSpeed(MOVE_WALK, 1.0f); + ryga->GetMotionMaster()->MovePoint(0, 504.59201f, 3882.12988f, 192.156006f, true); + Reset(); + } + } + break; + case 53: + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70)) + { + if (ryga->IsAlive() && !ryga->IsInCombat()) + { + ryga->SetFacingTo(5.79449f); + Reset(); + } + } break; } }