diff options
author | Dr-J <daniel.jarrott0@gmail.com> | 2014-07-30 13:45:42 +0100 |
---|---|---|
committer | Dr-J <daniel.jarrott0@gmail.com> | 2014-07-30 13:45:42 +0100 |
commit | 3199f2ba90952f1de36a2d4675dc3ea6ddf5b71e (patch) | |
tree | a9b7769008abb8652e70c860bf9c8cfd804fd82b | |
parent | c5394842bb17e30535e0b65eb9f429a2529c6c94 (diff) |
Remove Script from zone_eversong_woods.cpp
Remove Apprentice Mirvedas script from eversong woods cpp scripts as is not longer required.
-rw-r--r-- | src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp | 150 |
1 files changed, 1 insertions, 149 deletions
diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp index 82212972f45..9e20f6c5cb1 100644 --- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp +++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp @@ -19,12 +19,11 @@ /* ScriptData SDName: Eversong_Woods SD%Complete: 95 -SDComment: Quest support: 8487, 8488, 8490 +SDComment: Quest support: 8490 SDCategory: Eversong Woods EndScriptData */ /* ContentData -npc_apprentice_mirveda npc_infused_crystal EndContentData */ @@ -34,152 +33,6 @@ EndContentData */ #include "ScriptedEscortAI.h" #include "Player.h" -enum UnexpectedResults -{ - // Quest - QUEST_CORRUPTED_SOIL = 8487, - QUEST_UNEXPECTED_RESULT = 8488, - - // Creatures - NPC_GHARZUL = 15958, // Quest 8488 - NPC_ANGERSHADE = 15656, // Quest 8488 - - // Factions - FACTION_NORMAL = 1604, // Quest 8488 - FACTION_COMBAT = 232, // Quest 8488 - - // Spells - SPELL_TEST_SOIL = 29535, // Quest 8487 - SPELL_FIREBALL = 20811, // Quest 8488 - - // Text - SAY_TEST_SOIL = 0, // Quest 8487 - - // Events - EVENT_TALK = 1, // Quest 8487 - EVENT_ADD_QUEST_GIVER_FLAG = 2, // Quest 8487 - EVENT_SUMMON = 3, // Quest 8488 - EVENT_FIREBALL = 4 // Quest 8488 -}; - -class npc_apprentice_mirveda : public CreatureScript -{ -public: - npc_apprentice_mirveda() : CreatureScript("npc_apprentice_mirveda") { } - - struct npc_apprentice_mirvedaAI : public ScriptedAI - { - npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) { } - - uint32 KillCount; - uint64 PlayerGUID; - SummonList Summons; - EventMap events; - - void Reset() override - { - SetCombatMovement(false); - KillCount = 0; - PlayerGUID = 0; - Summons.DespawnAll(); - } - - void sQuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) override - { - if (quest->GetQuestId() == QUEST_CORRUPTED_SOIL) - { - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - events.ScheduleEvent(EVENT_TALK, 2000); - } - } - - void sQuestAccept(Player* player, Quest const* quest) override - { - if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT) - { - me->setFaction(FACTION_COMBAT); - me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - events.ScheduleEvent(EVENT_SUMMON, 1000); - PlayerGUID = player->GetGUID(); - } - } - - void EnterCombat(Unit* /*who*/) override - { - events.ScheduleEvent(EVENT_FIREBALL, 1000); - } - - void JustSummoned(Creature* summoned) override - { - // This is the best I can do because AttackStart does nothing - summoned->GetMotionMaster()->MovePoint(1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); - // summoned->AI()->AttackStart(me); - Summons.Summon(summoned); - } - - void SummonedCreatureDies(Creature* summoned, Unit* /*who*/) override - { - Summons.Despawn(summoned); - ++KillCount; - } - - void JustDied(Unit* /*killer*/) override - { - me->setFaction(FACTION_NORMAL); - - if (PlayerGUID) - if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) - player->FailQuest(QUEST_UNEXPECTED_RESULT); - } - - void UpdateAI(uint32 diff) override - { - if (KillCount >= 3 && PlayerGUID) - if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) - if (player->GetQuestStatus(QUEST_UNEXPECTED_RESULT) == QUEST_STATUS_INCOMPLETE) - { - player->CompleteQuest(QUEST_UNEXPECTED_RESULT); - me->setFaction(FACTION_NORMAL); - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - } - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_TALK: - Talk(SAY_TEST_SOIL); - events.ScheduleEvent(EVENT_ADD_QUEST_GIVER_FLAG, 7000); - break; - case EVENT_ADD_QUEST_GIVER_FLAG: - me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); - break; - case EVENT_SUMMON: - me->SummonCreature(NPC_GHARZUL, 8749.505f, -7132.595f, 35.31983f, 3.816502f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 180000); - me->SummonCreature(NPC_ANGERSHADE, 8755.38f, -7131.521f, 35.30957f, 3.816502f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 180000); - me->SummonCreature(NPC_ANGERSHADE, 8753.199f, -7125.975f, 35.31986f, 3.816502f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 180000); - break; - case EVENT_FIREBALL: - if (!UpdateVictim()) - continue; - DoCastVictim(SPELL_FIREBALL, true); // Not casting in combat - events.ScheduleEvent(EVENT_FIREBALL, 3000); - break; - default: - break; - } - } - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_apprentice_mirvedaAI(creature); - } -}; /*###### ## npc_infused_crystal @@ -299,6 +152,5 @@ public: void AddSC_eversong_woods() { - new npc_apprentice_mirveda(); new npc_infused_crystal(); } |