From ebb8824103361eb14fb054a08472c3ae4dffc2da Mon Sep 17 00:00:00 2001 From: Grimfeather <88028633+Grimfeather@users.noreply.github.com> Date: Wed, 21 May 2025 04:17:11 +0200 Subject: [PATCH] Update IndividualProgressionAwarenessScripts.cpp --- src/IndividualProgressionAwarenessScripts.cpp | 105 ++++++++++++++---- 1 file changed, 84 insertions(+), 21 deletions(-) diff --git a/src/IndividualProgressionAwarenessScripts.cpp b/src/IndividualProgressionAwarenessScripts.cpp index 7005f7f..74c4530 100644 --- a/src/IndividualProgressionAwarenessScripts.cpp +++ b/src/IndividualProgressionAwarenessScripts.cpp @@ -97,6 +97,41 @@ public: } }; +class gobject_ipp_si : public GameObjectScript +{ +public: + gobject_ipp_si() : GameObjectScript("gobject_ipp_si") { } + + struct gobject_ipp_siAI: GameObjectAI + { + explicit gobject_ipp_siAI(GameObject* object) : GameObjectAI(object) { }; + + bool CanBeSeen(Player const* player) override + { + if (player->IsGameMaster()) + { + return true; + } + + Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); + + if (sIndividualProgression->hasPassedProgression(target, PROGRESSION_NAXX40)) + { + return sIndividualProgression->isBeforeProgression(target, PROGRESSION_NAXX40); + } + else + { + return sIndividualProgression->hasPassedProgression(target, PROGRESSION_AQ); + } + } + }; + + GameObjectAI* GetAI(GameObject* object) const override + { + return new gobject_ipp_siAI(object); + } +}; + class gobject_ipp_naxx40 : public GameObjectScript { public: @@ -236,14 +271,49 @@ public: } }; -class npc_ipp_aqwar : public CreatureScript +class npc_ipp_si : public CreatureScript { public: - npc_ipp_aqwar() : CreatureScript("npc_ipp_aqwar") { } + npc_ipp_si() : CreatureScript("npc_ipp_si") { } - struct npc_ipp_aqwarAI: ScriptedAI + struct npc_ipp_siAI: ScriptedAI { - explicit npc_ipp_aqwarAI(Creature* creature) : ScriptedAI(creature) { }; + explicit npc_ipp_siAI(Creature* creature) : ScriptedAI(creature) { }; + + bool CanBeSeen(Player const* player) override + { + if (player->IsGameMaster()) + { + return true; + } + + Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); + + if (sIndividualProgression->hasPassedProgression(target, PROGRESSION_NAXX40)) + { + return sIndividualProgression->isBeforeProgression(target, PROGRESSION_NAXX40); + } + else + { + return sIndividualProgression->hasPassedProgression(target, PROGRESSION_AQ); + } + } + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_ipp_siAI(creature); + } +}; + +class npc_ipp_pre_naxx40 : public CreatureScript +{ +public: + npc_ipp_pre_naxx40() : CreatureScript("npc_ipp_pre_naxx40") { } + + struct npc_ipp_pre_naxx40AI: ScriptedAI + { + explicit npc_ipp_pre_naxx40AI(Creature* creature) : ScriptedAI(creature) { }; bool CanBeSeen(Player const* player) override { @@ -251,23 +321,14 @@ public: { return true; } - Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID()); - - if (sIndividualProgression->hasPassedProgression(target, PROGRESSION_AQ_WAR)) - { - return sIndividualProgression->isBeforeProgression(target, PROGRESSION_AQ_WAR); - } - else - { - return sIndividualProgression->hasPassedProgression(target, PROGRESSION_PRE_AQ); - } + return sIndividualProgression->isBeforeProgression(target, PROGRESSION_AQ); } }; CreatureAI* GetAI(Creature* creature) const override { - return new npc_ipp_aqwarAI(creature); + return new npc_ipp_pre_naxx40AI(creature); } }; @@ -538,15 +599,17 @@ public: // Add all scripts in one void AddSC_mod_individual_progression_awareness() { - new gobject_ipp_preaq(); // wanted poster cenarion hold - new gobject_ipp_we(); // war effort supplies in cities - new gobject_ipp_aqwar(); // aq war crystals + new gobject_ipp_preaq(); // wanted poster Cenarion Hold + new gobject_ipp_we(); // War Effort supplies in cities + new gobject_ipp_aqwar(); // AQ war crystals + new gobject_ipp_si(); // Scourge Invasion new gobject_ipp_naxx40(); new gobject_ipp_tbc(); new gobject_ipp_wotlk(); - new npc_ipp_preaq(); // cenarion hold npcs - new npc_ipp_we(); // war effort npcs in cities - // new npc_ipp_aqwar(); // not used atm + new npc_ipp_preaq(); // Cenarion Hold NPCs + new npc_ipp_we(); // War Effort NPCs in cities + new npc_ipp_si(); // Scourge Invasion + new npc_ipp_pre_naxx40(); // Scourge Invasion new npc_ipp_naxx40(); new npc_ipp_tbc(); new npc_ipp_tbc_pre_t4();