From 5bd3d5dc307c01e88f3e4c627103a6d70d5d1270 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Fri, 14 Jun 2019 13:44:39 +0200 Subject: [PATCH] Scripts/Quest: Remove unused code --- .../zone_dun_morogh_area_coldridge_valley.cpp | 80 ------------------- .../scripts/Kalimdor/zone_azuremyst_isle.cpp | 44 ---------- 2 files changed, 124 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp index 8fdc9cfb84f63..ff4acaa0cc4c6 100644 --- a/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp +++ b/src/server/scripts/EasternKingdoms/zone_dun_morogh_area_coldridge_valley.cpp @@ -115,85 +115,6 @@ class npc_wounded_coldridge_mountaineer : public CreatureScript } }; -/*#### -## npc_wounded_milita -####*/ - -enum WoundedMilita -{ - QUEST_KILL_CREDIT = 44175, - SPELL_FLASH_HEAL = 2061, - EVENT_RESET_HEALTH = 4 -}; - -class npc_wounded_milita : public CreatureScript -{ -public: - npc_wounded_milita() : CreatureScript("npc_wounded_milita") { } - - struct npc_wounded_militaAI : public ScriptedAI - { - npc_wounded_militaAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - _hitBySpell = false; - _percentHP = urand(15, 55); - } - - void Reset() override - { - Initialize(); - me->SetHealth(me->CountPctFromMaxHealth(_percentHP)); - } - - void SpellHit(Unit* caster, SpellInfo const* spell) override - { - if (!_hitBySpell) - { - _hitBySpell = true; - _events.ScheduleEvent(EVENT_RESET_HEALTH, Seconds(30)); - } - if (spell->Id == SPELL_FLASH_HEAL) - if (Player* player = caster->ToPlayer()) - player->KilledMonsterCredit(QUEST_KILL_CREDIT); - } - - void UpdateAI(uint32 diff) override - { - if (!_hitBySpell) - return; - - _events.Update(diff); - - while (uint32 eventId = _events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_RESET_HEALTH: - me->SetHealth(me->CountPctFromMaxHealth(_percentHP)); - _hitBySpell = false; - break; - default: - break; - } - } - } - private: - EventMap _events; - int8 _percentHP; - bool _hitBySpell; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_wounded_militaAI(creature); - } -}; - /*###### ## npc_milos_gyro ######*/ @@ -463,7 +384,6 @@ class spell_low_health: public SpellScriptLoader void AddSC_dun_morogh_area_coldridge_valley() { new npc_wounded_coldridge_mountaineer(); - new npc_wounded_milita(); new npc_milos_gyro(); new spell_a_trip_to_ironforge_quest_complete(); new spell_follow_that_gyrocopter_quest_start(); diff --git a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp index d1483d1913cb2..5b6b5201e74f8 100644 --- a/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/zone_azuremyst_isle.cpp @@ -26,7 +26,6 @@ EndScriptData */ /* ContentData npc_draenei_survivor npc_engineer_spark_overgrind -npc_injured_draenei npc_magwin go_ravager_cage npc_death_ravager @@ -278,48 +277,6 @@ class npc_engineer_spark_overgrind : public CreatureScript } }; -/*###### -## npc_injured_draenei -######*/ - -class npc_injured_draenei : public CreatureScript -{ -public: - npc_injured_draenei() : CreatureScript("npc_injured_draenei") { } - - struct npc_injured_draeneiAI : public ScriptedAI - { - npc_injured_draeneiAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); - me->SetHealth(me->CountPctFromMaxHealth(15)); - switch (urand(0, 1)) - { - case 0: - me->SetStandState(UNIT_STAND_STATE_SIT); - break; - - case 1: - me->SetStandState(UNIT_STAND_STATE_SLEEP); - break; - } - } - - void JustEngagedWith(Unit* /*who*/) override { } - - void MoveInLineOfSight(Unit* /*who*/) override { } - - void UpdateAI(uint32 /*diff*/) override { } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_injured_draeneiAI(creature); - } -}; - /*###### ## npc_magwin ######*/ @@ -721,7 +678,6 @@ void AddSC_azuremyst_isle() { new npc_draenei_survivor(); new npc_engineer_spark_overgrind(); - new npc_injured_draenei(); new npc_magwin(); new npc_death_ravager(); new go_ravager_cage();