diff options
author | dr-j <dr-j@users.noreply.github.com> | 2020-05-20 23:20:37 +0200 |
---|---|---|
committer | Killyana <morphone1@gmail.com> | 2020-05-20 23:20:37 +0200 |
commit | e80b66fd528b3fe38db5392957adf1aa82f19f9b (patch) | |
tree | 3f6841a48e7fcd7cc83725363d03ae1557b5a2f8 /src | |
parent | cc5bea023a0c43f1c58e2cd93267d9e339659442 (diff) |
DB/Quest: With a little help from my friends
Closes #24639
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/zone_ungoro_crater.cpp | 204 |
1 files changed, 0 insertions, 204 deletions
diff --git a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp index 9516d0bb8ff..52fffe7aecb 100644 --- a/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp +++ b/src/server/scripts/Kalimdor/zone_ungoro_crater.cpp @@ -24,7 +24,6 @@ EndScriptData */ /* ContentData npc_a-me -npc_ringo EndContentData */ #include "ScriptMgr.h" @@ -147,211 +146,8 @@ public: } }; -/*#### -# npc_ringo -####*/ - -enum Ringo -{ - SAY_RIN_START = 0, - - SAY_FAINT = 1, - - SAY_WAKE = 2, - - SAY_RIN_END_1 = 3, - SAY_SPR_END_2 = 0, - SAY_RIN_END_3 = 4, - EMOTE_RIN_END_4 = 5, - EMOTE_RIN_END_5 = 6, - SAY_RIN_END_6 = 7, - SAY_SPR_END_7 = 1, - EMOTE_RIN_END_8 = 8, - - SPELL_REVIVE_RINGO = 15591, - QUEST_A_LITTLE_HELP = 4491, - NPC_SPRAGGLE = 9997 -}; - -class npc_ringo : public CreatureScript -{ -public: - npc_ringo() : CreatureScript("npc_ringo") { } - - struct npc_ringoAI : public FollowerAI - { - npc_ringoAI(Creature* creature) : FollowerAI(creature) - { - Initialize(); - } - - void Initialize() - { - FaintTimer = urand(30000, 60000); - EndEventProgress = 0; - EndEventTimer = 1000; - SpraggleGUID.Clear(); - } - - uint32 FaintTimer; - uint32 EndEventProgress; - uint32 EndEventTimer; - - ObjectGuid SpraggleGUID; - - void Reset() override - { - Initialize(); - } - - void MoveInLineOfSight(Unit* who) override - - { - FollowerAI::MoveInLineOfSight(who); - - if (!me->GetVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && who->GetEntry() == NPC_SPRAGGLE) - { - if (me->IsWithinDistInMap(who, INTERACTION_DISTANCE)) - { - if (Player* player = GetLeaderForFollower()) - { - if (player->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE) - player->GroupEventHappens(QUEST_A_LITTLE_HELP, me); - } - - SpraggleGUID = who->GetGUID(); - SetFollowComplete(true); - } - } - } - - void SpellHit(Unit* /*pCaster*/, SpellInfo const* pSpell) override - { - if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) - ClearFaint(); - } - - void SetFaint() - { - if (!HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - SetFollowPaused(true); - - Talk(SAY_FAINT); - } - - //what does actually happen here? Emote? Aura? - me->SetStandState(UNIT_STAND_STATE_SLEEP); - } - - void ClearFaint() - { - me->SetStandState(UNIT_STAND_STATE_STAND); - - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - return; - - Talk(SAY_WAKE); - - SetFollowPaused(false); - } - - void UpdateFollowerAI(uint32 Diff) override - { - if (!UpdateVictim()) - { - if (HasFollowState(STATE_FOLLOW_POSTEVENT)) - { - if (EndEventTimer <= Diff) - { - Creature* spraggle = ObjectAccessor::GetCreature(*me, SpraggleGUID); - if (!spraggle || !spraggle->IsAlive()) - { - SetFollowComplete(); - return; - } - - switch (EndEventProgress) - { - case 1: - Talk(SAY_RIN_END_1); - EndEventTimer = 3000; - break; - case 2: - spraggle->AI()->Talk(SAY_SPR_END_2); - EndEventTimer = 5000; - break; - case 3: - Talk(SAY_RIN_END_3); - EndEventTimer = 1000; - break; - case 4: - Talk(EMOTE_RIN_END_4); - SetFaint(); - EndEventTimer = 9000; - break; - case 5: - Talk(EMOTE_RIN_END_5); - ClearFaint(); - EndEventTimer = 1000; - break; - case 6: - Talk(SAY_RIN_END_6); - EndEventTimer = 3000; - break; - case 7: - spraggle->AI()->Talk(SAY_SPR_END_7); - EndEventTimer = 10000; - break; - case 8: - Talk(EMOTE_RIN_END_8); - EndEventTimer = 5000; - break; - case 9: - SetFollowComplete(); - break; - } - - ++EndEventProgress; - } - else - EndEventTimer -= Diff; - } - else if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !HasFollowState(STATE_FOLLOW_PAUSED)) - { - if (FaintTimer <= Diff) - { - SetFaint(); - FaintTimer = urand(60000, 120000); - } - else - FaintTimer -= Diff; - } - - return; - } - - DoMeleeAttackIfReady(); - } - - void QuestAccept(Player* player, Quest const* quest) override - { - if (quest->GetQuestId() == QUEST_A_LITTLE_HELP) - { - me->SetStandState(UNIT_STAND_STATE_STAND); - StartFollow(player, FACTION_ESCORTEE_N_NEUTRAL_PASSIVE, QUEST_A_LITTLE_HELP); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_ringoAI(creature); - } -}; void AddSC_ungoro_crater() { new npc_ame(); - new npc_ringo(); } |