diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2017-08-12 01:40:25 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2020-08-23 00:45:46 +0200 |
| commit | 97585597f0b1aff93873fe4d757556731bc0c1b2 (patch) | |
| tree | fda9b11c6e7abb9e4d3a6108a09def640c3eb2af /src/server/scripts/EasternKingdoms | |
| parent | a86870622dd02921c4d2e32983a5a98ee91e5263 (diff) | |
Core/Movement: waypoint movement (#20121)
Following the work done in #19361 this is the cleanup and improvement of the related logic of waypoint management.
Ref 28050f3 #18020
(taking the good parts and ignoring the incomplete work)
(cherry picked from commit 7fff83d67526efff63867d41b9e036a19a9287b3)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
13 files changed, 56 insertions, 57 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp index eb9ed8dd7ac..c9998ea1547 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockDepths/blackrock_depths.cpp @@ -136,9 +136,9 @@ public: return GetBlackrockDepthsAI<npc_grimstoneAI>(creature); } - struct npc_grimstoneAI : public npc_escortAI + struct npc_grimstoneAI : public EscortAI { - npc_grimstoneAI(Creature* creature) : npc_escortAI(creature) + npc_grimstoneAI(Creature* creature) : EscortAI(creature) { Initialize(); instance = creature->GetInstanceScript(); @@ -203,7 +203,7 @@ public: MobDeath_Timer = 2500; } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -350,7 +350,7 @@ public: } if (CanWalk) - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); } }; }; @@ -511,9 +511,9 @@ class npc_rocknot : public CreatureScript public: npc_rocknot() : CreatureScript("npc_rocknot") { } - struct npc_rocknotAI : public npc_escortAI + struct npc_rocknotAI : public EscortAI { - npc_rocknotAI(Creature* creature) : npc_escortAI(creature) + npc_rocknotAI(Creature* creature) : EscortAI(creature) { Initialize(); instance = creature->GetInstanceScript(); @@ -544,7 +544,7 @@ public: go->SetGoState((GOState)state); } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -598,7 +598,7 @@ public: } else BreakDoor_Timer -= diff; } - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); } void QuestReward(Player* /*player*/, Quest const* quest, uint32 /*item*/) override diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp index d4971961a79..aaa280fdbe1 100644 --- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp +++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp @@ -93,9 +93,9 @@ public: return GetGnomereganAI<npc_blastmaster_emi_shortfuseAI>(creature); } - struct npc_blastmaster_emi_shortfuseAI : public npc_escortAI + struct npc_blastmaster_emi_shortfuseAI : public EscortAI { - npc_blastmaster_emi_shortfuseAI(Creature* creature) : npc_escortAI(creature) + npc_blastmaster_emi_shortfuseAI(Creature* creature) : EscortAI(creature) { instance = creature->GetInstanceScript(); creature->RestoreFaction(); @@ -218,7 +218,7 @@ public: } } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { //just in case if (GetPlayerForEscort()) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp index 44178f09b08..b0300ec3b4b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/karazhan.cpp @@ -130,9 +130,9 @@ class npc_barnes : public CreatureScript public: npc_barnes() : CreatureScript("npc_barnes") { } - struct npc_barnesAI : public npc_escortAI + struct npc_barnesAI : public EscortAI { - npc_barnesAI(Creature* creature) : npc_escortAI(creature) + npc_barnesAI(Creature* creature) : EscortAI(creature) { Initialize(); RaidWiped = false; @@ -183,7 +183,7 @@ public: void EnterCombat(Unit* /*who*/) override { } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -283,7 +283,7 @@ public: void UpdateAI(uint32 diff) override { - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); if (HasEscortState(STATE_ESCORT_PAUSED)) { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 82b4a915627..f26876e8f3f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -1104,9 +1104,9 @@ class npc_scarlet_miner : public CreatureScript public: npc_scarlet_miner() : CreatureScript("npc_scarlet_miner") { } - struct npc_scarlet_minerAI : public npc_escortAI + struct npc_scarlet_minerAI : public EscortAI { - npc_scarlet_minerAI(Creature* creature) : npc_escortAI(creature) + npc_scarlet_minerAI(Creature* creature) : EscortAI(creature) { Initialize(); me->SetReactState(REACT_PASSIVE); @@ -1135,7 +1135,7 @@ class npc_scarlet_miner : public CreatureScript void InitWaypoint() { - AddWaypoint(1, 2389.03f, -5902.74f, 109.014f, 5000); + AddWaypoint(1, 2389.03f, -5902.74f, 109.014f, 0.f, 5000); AddWaypoint(2, 2341.812012f, -5900.484863f, 102.619743f); AddWaypoint(3, 2306.561279f, -5901.738281f, 91.792419f); AddWaypoint(4, 2300.098389f, -5912.618652f, 86.014885f); @@ -1154,7 +1154,7 @@ class npc_scarlet_miner : public CreatureScript AddWaypoint(14, 2172.516602f, -6146.752441f, 1.074235f); AddWaypoint(15, 2138.918457f, -6158.920898f, 1.342926f); AddWaypoint(16, 2129.866699f, -6174.107910f, 4.380779f); - AddWaypoint(17, 2117.709473f, -6193.830078f, 13.3542f, 10000); + AddWaypoint(17, 2117.709473f, -6193.830078f, 13.3542f, 0.f, 10000); } else { @@ -1162,7 +1162,7 @@ class npc_scarlet_miner : public CreatureScript AddWaypoint(14, 2234.265625f, -6163.741211f, 0.916021f); AddWaypoint(15, 2268.071777f, -6158.750977f, 1.822252f); AddWaypoint(16, 2270.028320f, -6176.505859f, 6.340538f); - AddWaypoint(17, 2271.739014f, -6195.401855f, 13.3542f, 10000); + AddWaypoint(17, 2271.739014f, -6195.401855f, 13.3542f, 0.f, 10000); } } @@ -1173,7 +1173,7 @@ class npc_scarlet_miner : public CreatureScript SetDespawnAtFar(false); } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -1223,7 +1223,7 @@ class npc_scarlet_miner : public CreatureScript else IntroTimer -= diff; } - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); } }; diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp index a8bbb1af174..934de238055 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter2.cpp @@ -201,9 +201,9 @@ class npc_koltira_deathweaver : public CreatureScript public: npc_koltira_deathweaver() : CreatureScript("npc_koltira_deathweaver") { } - struct npc_koltira_deathweaverAI : public npc_escortAI + struct npc_koltira_deathweaverAI : public EscortAI { - npc_koltira_deathweaverAI(Creature* creature) : npc_escortAI(creature) + npc_koltira_deathweaverAI(Creature* creature) : EscortAI(creature) { Initialize(); me->SetReactState(REACT_DEFENSIVE); @@ -228,7 +228,7 @@ public: } } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -281,7 +281,7 @@ public: void UpdateAI(uint32 uiDiff) override { - npc_escortAI::UpdateAI(uiDiff); + EscortAI::UpdateAI(uiDiff); if (HasEscortState(STATE_ESCORT_PAUSED)) { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp index ed43d895d26..35ddd4ab784 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter5.cpp @@ -274,9 +274,9 @@ class npc_highlord_darion_mograine : public CreatureScript public: npc_highlord_darion_mograine() : CreatureScript("npc_highlord_darion_mograine") { } - struct npc_highlord_darion_mograineAI : public npc_escortAI + struct npc_highlord_darion_mograineAI : public EscortAI { - npc_highlord_darion_mograineAI(Creature* creature) : npc_escortAI(creature) + npc_highlord_darion_mograineAI(Creature* creature) : EscortAI(creature) { Reset(); } @@ -453,7 +453,7 @@ public: SetEscortPaused(bOnHold); } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -571,12 +571,12 @@ public: void EnterEvadeMode(EvadeReason why) override { if (!bIsBattle)//do not reset self if we are in battle - npc_escortAI::EnterEvadeMode(why); + EscortAI::EnterEvadeMode(why); } void UpdateAI(uint32 diff) override { - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); if (!bIsBattle) { diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp index 1957c9531fc..4e3a71bbe71 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_herod.cpp @@ -148,9 +148,9 @@ public: return GetScarletMonasteryAI<npc_scarlet_traineeAI>(creature); } - struct npc_scarlet_traineeAI : public npc_escortAI + struct npc_scarlet_traineeAI : public EscortAI { - npc_scarlet_traineeAI(Creature* creature) : npc_escortAI(creature) + npc_scarlet_traineeAI(Creature* creature) : EscortAI(creature) { Start_Timer = urand(1000, 6000); } @@ -158,7 +158,6 @@ public: uint32 Start_Timer; void Reset() override { } - void WaypointReached(uint32 /*waypointId*/) override { } void EnterCombat(Unit* /*who*/) override { } void UpdateAI(uint32 diff) override @@ -172,7 +171,7 @@ public: } else Start_Timer -= diff; } - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); } }; }; diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp index 1ab0e46a377..db50a0c8f34 100644 --- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp +++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp @@ -66,16 +66,16 @@ class npc_shadowfang_prisoner : public CreatureScript public: npc_shadowfang_prisoner() : CreatureScript("npc_shadowfang_prisoner") { } - struct npc_shadowfang_prisonerAI : public npc_escortAI + struct npc_shadowfang_prisonerAI : public EscortAI { - npc_shadowfang_prisonerAI(Creature* creature) : npc_escortAI(creature) + npc_shadowfang_prisonerAI(Creature* creature) : EscortAI(creature) { instance = creature->GetInstanceScript(); } InstanceScript* instance; - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp index 0225040f053..08967a5fd32 100644 --- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp @@ -64,11 +64,11 @@ class npc_professor_phizzlethorpe : public CreatureScript public: npc_professor_phizzlethorpe() : CreatureScript("npc_professor_phizzlethorpe") { } - struct npc_professor_phizzlethorpeAI : public npc_escortAI + struct npc_professor_phizzlethorpeAI : public EscortAI { - npc_professor_phizzlethorpeAI(Creature* creature) : npc_escortAI(creature) { } + npc_professor_phizzlethorpeAI(Creature* creature) : EscortAI(creature) { } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { Player* player = GetPlayerForEscort(); if (!player) @@ -111,7 +111,7 @@ class npc_professor_phizzlethorpe : public CreatureScript if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) { Talk(SAY_PROGRESS_1, player); - npc_escortAI::Start(false, false, player->GetGUID(), quest); + EscortAI::Start(false, false, player->GetGUID(), quest); me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); } } @@ -142,7 +142,7 @@ class npc_professor_phizzlethorpe : public CreatureScript break; } } - npc_escortAI::UpdateAI(diff); + EscortAI::UpdateAI(diff); } EventMap events; diff --git a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp index b00f3a0ee9d..8e4a1f0b499 100644 --- a/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_ghostlands.cpp @@ -60,11 +60,11 @@ class npc_ranger_lilatha : public CreatureScript public: npc_ranger_lilatha() : CreatureScript("npc_ranger_lilatha") { } - struct npc_ranger_lilathaAI : public npc_escortAI + struct npc_ranger_lilathaAI : public EscortAI { - npc_ranger_lilathaAI(Creature* creature) : npc_escortAI(creature) { } + npc_ranger_lilathaAI(Creature* creature) : EscortAI(creature) { } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { Player* player = GetPlayerForEscort(); if (!player) diff --git a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp index 96f5b757c88..1751bf9c77c 100644 --- a/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_hinterlands.cpp @@ -53,9 +53,9 @@ class npc_oox09hl : public CreatureScript public: npc_oox09hl() : CreatureScript("npc_oox09hl") { } - struct npc_oox09hlAI : public npc_escortAI + struct npc_oox09hlAI : public EscortAI { - npc_oox09hlAI(Creature* creature) : npc_escortAI(creature) { } + npc_oox09hlAI(Creature* creature) : EscortAI(creature) { } void Reset() override { } @@ -79,11 +79,11 @@ public: me->SetStandState(UNIT_STAND_STATE_STAND); me->SetFaction(player->GetTeam() == ALLIANCE ? FACTION_ESCORTEE_A_PASSIVE : FACTION_ESCORTEE_H_PASSIVE); Talk(SAY_OOX_START, player); - npc_escortAI::Start(false, false, player->GetGUID(), quest); + EscortAI::Start(false, false, player->GetGUID(), quest); } } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { @@ -101,7 +101,7 @@ public: } } - void WaypointStart(uint32 pointId) override + void WaypointStarted(uint32 pointId, uint32 /*pathId*/) override { switch (pointId) { diff --git a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp index 137b779878e..429e38b79d9 100644 --- a/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp @@ -60,11 +60,11 @@ class npc_deathstalker_erland : public CreatureScript public: npc_deathstalker_erland() : CreatureScript("npc_deathstalker_erland") { } - struct npc_deathstalker_erlandAI : public npc_escortAI + struct npc_deathstalker_erlandAI : public EscortAI { - npc_deathstalker_erlandAI(Creature* creature) : npc_escortAI(creature) { } + npc_deathstalker_erlandAI(Creature* creature) : EscortAI(creature) { } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { Player* player = GetPlayerForEscort(); if (!player) diff --git a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp index 451095dfe8c..e7b70226d6e 100644 --- a/src/server/scripts/EasternKingdoms/zone_wetlands.cpp +++ b/src/server/scripts/EasternKingdoms/zone_wetlands.cpp @@ -55,9 +55,9 @@ public: return new npc_tapoke_slim_jahnAI(creature); } - struct npc_tapoke_slim_jahnAI : public npc_escortAI + struct npc_tapoke_slim_jahnAI : public EscortAI { - npc_tapoke_slim_jahnAI(Creature* creature) : npc_escortAI(creature) + npc_tapoke_slim_jahnAI(Creature* creature) : EscortAI(creature) { Initialize(); } @@ -75,7 +75,7 @@ public: Initialize(); } - void WaypointReached(uint32 waypointId) override + void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override { switch (waypointId) { |
