diff options
author | CraftedRO <24683355+CraftedRO@users.noreply.github.com> | 2025-02-02 21:21:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-02 20:21:44 +0100 |
commit | 7782a17bc2fd663e6c7ec8420bade36c40c4ad25 (patch) | |
tree | 51accf874029561ccc73dc260d099b9085ba2d82 /src | |
parent | 8268ab34b74353ed6a4a07f69f3cc16e4ca3e3d7 (diff) |
DB/Quest: Move Priest Garments quest series from c++ to database (#30627)
Co-authored-by: Jonne733 <40151102+Jonne733@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/World/npcs_special.cpp | 170 |
1 files changed, 0 insertions, 170 deletions
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index b44cd950b87..df0e4b1e3e8 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -913,175 +913,6 @@ void npc_doctor::npc_doctorAI::UpdateAI(uint32 diff) } /*###### -## npc_garments_of_quests -######*/ - -/// @todo get text for each NPC - -enum Garments -{ - SPELL_LESSER_HEAL_R2 = 2052, - SPELL_FORTITUDE_R1 = 1243, - - QUEST_MOON = 5621, - QUEST_LIGHT_1 = 5624, - QUEST_LIGHT_2 = 5625, - QUEST_SPIRIT = 5648, - QUEST_DARKNESS = 5650, - - ENTRY_SHAYA = 12429, - ENTRY_ROBERTS = 12423, - ENTRY_DOLF = 12427, - ENTRY_KORJA = 12430, - ENTRY_DG_KEL = 12428, - - // used by 12429, 12423, 12427, 12430, 12428, but signed for 12429 - SAY_THANKS = 0, - SAY_GOODBYE = 1, - SAY_HEALED = 2, -}; - -class npc_garments_of_quests : public CreatureScript -{ -public: - npc_garments_of_quests() : CreatureScript("npc_garments_of_quests") { } - - struct npc_garments_of_questsAI : public EscortAI - { - npc_garments_of_questsAI(Creature* creature) : EscortAI(creature) - { - switch (me->GetEntry()) - { - case ENTRY_SHAYA: - quest = QUEST_MOON; - break; - case ENTRY_ROBERTS: - quest = QUEST_LIGHT_1; - break; - case ENTRY_DOLF: - quest = QUEST_LIGHT_2; - break; - case ENTRY_KORJA: - quest = QUEST_SPIRIT; - break; - case ENTRY_DG_KEL: - quest = QUEST_DARKNESS; - break; - default: - quest = 0; - break; - } - - Initialize(); - } - - void Initialize() - { - IsHealed = false; - CanRun = false; - - RunAwayTimer = 5000; - } - - ObjectGuid CasterGUID; - - bool IsHealed; - bool CanRun; - - uint32 RunAwayTimer; - uint32 quest; - - void Reset() override - { - CasterGUID.Clear(); - - Initialize(); - - me->SetStandState(UNIT_STAND_STATE_KNEEL); - // expect database to have RegenHealth=0 - me->SetHealth(me->CountPctFromMaxHealth(70)); - } - - void JustEngagedWith(Unit* /*who*/) override { } - - void SpellHit(WorldObject* caster, SpellInfo const* spellInfo) override - { - if (spellInfo->Id == SPELL_LESSER_HEAL_R2 || spellInfo->Id == SPELL_FORTITUDE_R1) - { - //not while in combat - if (me->IsInCombat()) - return; - - //nothing to be done now - if (IsHealed && CanRun) - return; - - if (Player* player = caster->ToPlayer()) - { - if (quest && player->GetQuestStatus(quest) == QUEST_STATUS_INCOMPLETE) - { - if (IsHealed && !CanRun && spellInfo->Id == SPELL_FORTITUDE_R1) - { - Talk(SAY_THANKS, player); - CanRun = true; - } - else if (!IsHealed && spellInfo->Id == SPELL_LESSER_HEAL_R2) - { - CasterGUID = player->GetGUID(); - me->SetStandState(UNIT_STAND_STATE_STAND); - Talk(SAY_HEALED, player); - IsHealed = true; - } - } - - // give quest credit, not expect any special quest objectives - if (CanRun) - player->TalkedToCreature(me->GetEntry(), me->GetGUID()); - } - } - } - - void UpdateAI(uint32 diff) override - { - if (CanRun && !me->IsInCombat()) - { - if (RunAwayTimer <= diff) - { - if (Unit* unit = ObjectAccessor::GetUnit(*me, CasterGUID)) - { - switch (me->GetEntry()) - { - case ENTRY_SHAYA: - case ENTRY_ROBERTS: - case ENTRY_DOLF: - case ENTRY_KORJA: - case ENTRY_DG_KEL: - Talk(SAY_GOODBYE, unit); - break; - } - - Start(false, true); - } - else - EnterEvadeMode(); //something went wrong - - RunAwayTimer = 30000; - } - else - RunAwayTimer -= diff; - } - - EscortAI::UpdateAI(diff); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_garments_of_questsAI(creature); - } -}; - -/*###### ## npc_guardian ######*/ @@ -2456,7 +2287,6 @@ void AddSC_npcs_special() new npc_midsummer_bunny_pole(); new npc_doctor(); new npc_injured_patient(); - new npc_garments_of_quests(); new npc_guardian(); new npc_steam_tonk(); new npc_tournament_mount(); |