diff options
| author | Artamedes <ownedned123@gmail.com> | 2019-09-05 02:37:44 -0400 |
|---|---|---|
| committer | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-09-05 08:37:44 +0200 |
| commit | 0b3a9e2a2b2537e7224d103947ad6028c6d2e5fe (patch) | |
| tree | 95913a025bcf4666f86c572faf5aff8087c0f82b /src/server/scripts | |
| parent | 6ebe1afeeccb847702c12e522bddaa7b5694dc38 (diff) | |
Scripts/Outland: Fix npc_ancestral_wolf not starting waypoint (#23763)
* Scripts/Outlands: Fix npc_ancestral_wolf not starting waypoint, and also add a way to not follow owner automatically in CreatureAI::JustAppeared() for tempsummons
* fix nopch
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Outland/zone_hellfire_peninsula.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 68be3572bf9..6cd12990a06 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -39,6 +39,7 @@ EndContentData */ #include "Player.h" #include "ScriptedEscortAI.h" #include "ScriptedGossip.h" +#include "TemporarySummon.h" #include "WorldSession.h" /*###### @@ -154,15 +155,21 @@ public: struct npc_ancestral_wolfAI : public EscortAI { - npc_ancestral_wolfAI(Creature* creature) : EscortAI(creature) + npc_ancestral_wolfAI(Creature* creature) : EscortAI(creature) { } + + void InitializeAI() override { - if (creature->GetOwner() && creature->GetOwner()->GetTypeId() == TYPEID_PLAYER) - Start(false, false, creature->GetOwner()->GetGUID()); + if (me->GetOwner() && me->GetOwner()->GetTypeId() == TYPEID_PLAYER) + { + EscortAI::Start(false, false, me->GetOwner()->GetGUID()); + + me->SetSpeedRate(MOVE_WALK, 1.5f); + + if (auto tempSummon = me->ToTempSummon()) + tempSummon->SetCanFollowOwner(false); + } else TC_LOG_ERROR("scripts", "TRINITY: npc_ancestral_wolf can not obtain owner or owner is not a player."); - - creature->SetSpeedRate(MOVE_WALK, 1.5f); - Reset(); } void Reset() override @@ -189,33 +196,31 @@ public: break; // Move Ryga into position case 48: - if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70)) + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70.0f)) { if (ryga->IsAlive() && !ryga->IsInCombat()) { ryga->SetWalk(true); ryga->SetSpeedRate(MOVE_WALK, 1.5f); ryga->GetMotionMaster()->MovePoint(0, 517.340698f, 3885.03975f, 190.455978f, true); - Reset(); } } break; // Ryga Kneels and welcomes spirit wolf case 50: - if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70)) + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70.0f)) { if (ryga->IsAlive() && !ryga->IsInCombat()) { ryga->SetFacingTo(0.776773f); ryga->SetStandState(UNIT_STAND_STATE_KNEEL); ryga->AI()->Talk(SAY_WOLF_WELCOME); - Reset(); } } break; // Ryga returns to spawn point case 51: - if (Creature* ryga = me->FindNearestCreature(NPC_RYGA,70)) + if (Creature* ryga = me->FindNearestCreature(NPC_RYGA, 70.0f)) { if (ryga->IsAlive() && !ryga->IsInCombat()) { @@ -224,7 +229,6 @@ public: ryga->SetHomePosition(fRetX, fRetY, fRetZ, fRetO); ryga->SetStandState(UNIT_STAND_STATE_STAND); ryga->GetMotionMaster()->MoveTargetedHome(); - Reset(); } } break; |
