diff options
author | SnapperRy <snapperryen@gmail.com> | 2016-09-24 01:32:20 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2017-03-03 21:55:01 +0100 |
commit | 6ad12301b48c6d8be57334e6d89ae33f6d4d67fa (patch) | |
tree | 292bc578412b24a2ed06fc4ac26045df2b8d248a /src | |
parent | 6a7ef793ca743186e60f0ebb5c794475e4d7f2b0 (diff) |
Script/Quest: The Exorcism of Colonel Jules:
- Summoned NPCs will no longer give experience on kill.
- Require quests Fel Spirits and Digging for Prayer Beads to be completed.
- Reduce number of Foul Purges spawned in a single wave (only two should spawn each time).
- Properly give quest credit when talking with Colonel Jules after the exorcism.
(cherry picked from commit 0d70a7349d7b245adba72f9a15410a5b3d22dc77)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Outland/zone_hellfire_peninsula.cpp | 302 |
1 files changed, 158 insertions, 144 deletions
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp index 98d5070f4cf..8e353b66014 100644 --- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp +++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp @@ -470,12 +470,161 @@ enum ExorcismMisc enum ExorcismEvents { EVENT_BARADAS_TALK = 1, + EVENT_RESET = 2, //Colonel Jules EVENT_SUMMON_SKULL = 1, }; /*###### +## npc_colonel_jules +######*/ + +class npc_colonel_jules : public CreatureScript +{ +public: + npc_colonel_jules() : CreatureScript("npc_colonel_jules") { } + + bool OnGossipHello(Player* player, Creature* creature) override + { + if (ENSURE_AI(npc_colonel_jules::npc_colonel_julesAI, creature->AI())->success) + player->KilledMonsterCredit(NPC_COLONEL_JULES, ObjectGuid::Empty); + + SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + struct npc_colonel_julesAI : public ScriptedAI + { + npc_colonel_julesAI(Creature* creature) : ScriptedAI(creature), summons(me) + { + Initialize(); + } + + void Initialize() + { + point = 3; + wpreached = false; + success = false; + } + + void Reset() override + { + events.Reset(); + + summons.DespawnAll(); + Initialize(); + } + + bool success; + + void DoAction(int32 action) override + { + switch (action) + { + case ACTION_JULES_HOVER: + me->AddAura(SPELL_JULES_GOES_PRONE, me); + me->AddAura(SPELL_JULES_THREATENS_AURA, me); + + me->SetCanFly(true); + me->SetSpeedRate(MOVE_RUN, 0.2f); + + me->SetFacingTo(3.207566f); + me->GetMotionMaster()->MoveJump(exorcismPos[2], 2.0f, 2.0f); + + success = false; + + events.ScheduleEvent(EVENT_SUMMON_SKULL, 10000); + break; + case ACTION_JULES_FLIGHT: + me->RemoveAura(SPELL_JULES_GOES_PRONE); + + me->AddAura(SPELL_JULES_GOES_UPRIGHT, me); + me->AddAura(SPELL_JULES_VOMITS_AURA, me); + + wpreached = true; + me->GetMotionMaster()->MovePoint(point, exorcismPos[point]); + break; + case ACTION_JULES_MOVE_HOME: + wpreached = false; + me->SetSpeedRate(MOVE_RUN, 1.0f); + me->GetMotionMaster()->MovePoint(11, exorcismPos[2]); + + events.CancelEvent(EVENT_SUMMON_SKULL); + break; + } + } + + void JustSummoned(Creature* summon) override + { + summons.Summon(summon); + summon->GetMotionMaster()->MoveRandom(10.0f); + } + + void MovementInform(uint32 type, uint32 id) override + { + if (type != POINT_MOTION_TYPE) + return; + + if (id < 10) + wpreached = true; + + if (id == 8) + { + for (uint8 i = 0; i < 2; i++) + DoSummon(NPC_FOUL_PURGE, exorcismPos[8]); + } + + if (id == 10) + { + wpreached = true; + point = 3; + } + } + + void UpdateAI(uint32 diff) override + { + if (wpreached) + { + me->GetMotionMaster()->MovePoint(point, exorcismPos[point]); + point++; + wpreached = false; + } + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_SUMMON_SKULL: + uint8 summonCount = urand(1, 3); + + for (uint8 i = 0; i < summonCount; i++) + me->SummonCreature(NPC_DARKNESS_RELEASED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 1.5f, 0, TEMPSUMMON_MANUAL_DESPAWN); + + events.ScheduleEvent(EVENT_SUMMON_SKULL, urand(10000, 15000)); + break; + } + } + } + + private: + EventMap events; + SummonList summons; + + uint8 point; + + bool wpreached; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_colonel_julesAI(creature); + } +}; + +/*###### ## npc_barada ######*/ @@ -706,11 +855,11 @@ public: break; case 21: //End - if (Player* player = ObjectAccessor::FindPlayer(playerGUID)) - player->KilledMonsterCredit(NPC_COLONEL_JULES, ObjectGuid::Empty); - if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID)) + { + ENSURE_AI(npc_colonel_jules::npc_colonel_julesAI, jules->AI())->success = true; jules->RemoveAllAuras(); + } me->RemoveAura(SPELL_BARADAS_COMMAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED); @@ -718,9 +867,14 @@ public: Talk(SAY_BARADA_8); me->GetMotionMaster()->MoveTargetedHome(); EnterEvadeMode(); + events.ScheduleEvent(EVENT_RESET, Minutes(2)); break; } break; + case EVENT_RESET: + if (Creature* jules = ObjectAccessor::GetCreature(*me, julesGUID)) + ENSURE_AI(npc_colonel_jules::npc_colonel_julesAI, jules->AI())->success = false; + break; } } } @@ -738,152 +892,12 @@ public: } }; -/*###### -## npc_colonel_jules -######*/ - -class npc_colonel_jules : public CreatureScript -{ -public: - npc_colonel_jules() : CreatureScript("npc_colonel_jules") { } - - struct npc_colonel_julesAI : public ScriptedAI - { - npc_colonel_julesAI(Creature* creature) : ScriptedAI(creature), summons(me) - { - Initialize(); - } - - void Initialize() - { - circleRounds = 0; - point = 0; - } - - void Reset() override - { - events.Reset(); - - summons.DespawnAll(); - circleRounds = 0; - point = 3; - wpreached = false; - } - - void DoAction(int32 action) override - { - switch (action) - { - case ACTION_JULES_HOVER: - me->AddAura(SPELL_JULES_GOES_PRONE, me); - me->AddAura(SPELL_JULES_THREATENS_AURA, me); - - me->SetCanFly(true); - me->SetSpeedRate(MOVE_RUN, 0.2f); - - me->SetFacingTo(3.207566f); - me->GetMotionMaster()->MoveJump(exorcismPos[2], 2.0f, 2.0f); - - events.ScheduleEvent(EVENT_SUMMON_SKULL, 10000); - break; - case ACTION_JULES_FLIGHT: - circleRounds++; - - me->RemoveAura(SPELL_JULES_GOES_PRONE); - - me->AddAura(SPELL_JULES_GOES_UPRIGHT, me); - me->AddAura(SPELL_JULES_VOMITS_AURA, me); - - wpreached = true; - me->GetMotionMaster()->MovePoint(point, exorcismPos[point]); - break; - case ACTION_JULES_MOVE_HOME: - wpreached = false; - me->SetSpeedRate(MOVE_RUN, 1.0f); - me->GetMotionMaster()->MovePoint(11, exorcismPos[2]); - - events.CancelEvent(EVENT_SUMMON_SKULL); - break; - } - } - - void JustSummoned(Creature* summon) override - { - summons.Summon(summon); - summon->GetMotionMaster()->MoveRandom(10.0f); - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type != POINT_MOTION_TYPE) - return; - - if (id < 10) - wpreached = true; - - if (id == 8) - { - for (uint8 i = 0; i < circleRounds; i++) - DoSummon(NPC_FOUL_PURGE, exorcismPos[8]); - } - - if (id == 10) - { - wpreached = true; - point = 3; - circleRounds++; - } - } - - void UpdateAI(uint32 diff) override - { - if (wpreached) - { - me->GetMotionMaster()->MovePoint(point, exorcismPos[point]); - point++; - wpreached = false; - } - - events.Update(diff); - - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_SUMMON_SKULL: - uint8 summonCount = urand(1,3); - - for (uint8 i = 0; i < summonCount; i++) - me->SummonCreature(NPC_DARKNESS_RELEASED, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 1.5f, 0, TEMPSUMMON_MANUAL_DESPAWN); - - events.ScheduleEvent(EVENT_SUMMON_SKULL, urand(10000, 15000)); - break; - } - } - } - - private: - EventMap events; - SummonList summons; - - uint8 circleRounds; - uint8 point; - - bool wpreached; - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_colonel_julesAI(creature); - } -}; - void AddSC_hellfire_peninsula() { new npc_aeranas(); new npc_ancestral_wolf(); new npc_wounded_blood_elf(); new npc_fel_guard_hound(); - new npc_barada(); new npc_colonel_jules(); + new npc_barada(); } |