From 6c4b8215fa840ad8e23159b2ac635d7564fe3d0b Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 26 Oct 2021 05:35:45 -0300 Subject: [PATCH] fix(Core/DB) Quest 925 Cairne's Hoofprint (#8721) Fixed to use proper gossip from db. --- .../rev_1635085785347733398.sql | 15 ++ .../scripts/Kalimdor/zone_thunder_bluff.cpp | 182 +++++++++--------- 2 files changed, 103 insertions(+), 94 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1635085785347733398.sql diff --git a/data/sql/updates/pending_db_world/rev_1635085785347733398.sql b/data/sql/updates/pending_db_world/rev_1635085785347733398.sql new file mode 100644 index 000000000..569c934a4 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1635085785347733398.sql @@ -0,0 +1,15 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1635085785347733398'); + +-- Add missing gossip text +DELETE FROM `gossip_menu` WHERE `MenuID`=5852 AND `TextID`=7014; +INSERT INTO `gossip_menu` (`MenuID`,`TextID`) VALUES (5852, 7014); + +-- Add missing Gossip Option +DELETE FROM `gossip_menu_option` WHERE `MenuID`=5851; +INSERT INTO `gossip_menu_option` (`MenuID`,`OptionID`,`OptionIcon`,`OptionText`,`OptionBroadcastTextID`,`OptionType`,`OptionNpcFlag`,`ActionMenuID`,`ActionPoiID`,`BoxCoded`,`BoxMoney`,`BoxText`,`BoxBroadcastTextID`,`VerifiedBuild`) VALUES +(5851,0,0,"Chief Bloodhoof, this may sound like an odd request... but I have a young ward who is quite shy. You are a hero to him, and he asked me to get your hoofprint.",9670,1,1,5852,0,0,0,NULL,0,0); + +-- Condition for Cairne Bloodhoof Gossip menu option condition type Quest taken +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=5851 AND `SourceEntry`=0 AND `SourceId`=0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 5851, 0, 0, 0, 9, 0, 925, 0, 0, 0, 0, 0, '', 'Show gossip menu 5851 option id 0 if quest Cairne''s Hoofprint has been taken.'); diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp index a7eb9539a..8d495b018 100644 --- a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp @@ -15,132 +15,126 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Thunder_Bluff -SD%Complete: 100 -SDComment: Quest support: 925 -SDCategory: Thunder Bluff -EndScriptData */ - #include "Player.h" #include "ScriptedCreature.h" -#include "ScriptedGossip.h" #include "ScriptMgr.h" /*##### -# npc_cairne_bloodhoof +# Support for Quest 925: Cairne's Hoofprint ######*/ +// NPC 3057: Cairne Bloodhoof enum CairneBloodhoof { SPELL_BERSERKER_CHARGE = 16636, SPELL_CLEAVE = 16044, SPELL_MORTAL_STRIKE = 16856, SPELL_THUNDERCLAP = 23931, - SPELL_UPPERCUT = 22916 + SPELL_UPPERCUT = 22916, + SPELL_CAIRNES_HOOFPRINT = 23123 }; -#define GOSSIP_HCB "I know this is rather silly but a young ward who is a bit shy would like your hoofprint." -/// @todo verify abilities/timers +// @todo verify abilities/timers class npc_cairne_bloodhoof : public CreatureScript { public: npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override + struct npc_cairne_bloodhoofAI : public ScriptedAI { - ClearGossipMenuFor(player); - if (action == GOSSIP_SENDER_INFO) + npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() override { - player->CastSpell(player, 23123, false); - SendGossipMenuFor(player, 7014, creature->GetGUID()); + _berserkerChargeTimer = 30000; + _cleaveTimer = 5000; + _mortalStrikeTimer = 10000; + _thunderclapTimer = 15000; + _uppercutTimer = 10000; } - return true; - } - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) override + { + if (action == 0) + { + player->CastSpell(player, SPELL_CAIRNES_HOOFPRINT, false); + } + } - if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + { + return; + } - SendGossipMenuFor(player, 7013, creature->GetGUID()); + if (_berserkerChargeTimer <= diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_BERSERKER_CHARGE); + } + _berserkerChargeTimer = 25000; + } + else + { + _berserkerChargeTimer -= diff; + } - return true; - } + if (_uppercutTimer <= diff) + { + DoCastVictim(SPELL_UPPERCUT); + _uppercutTimer = 20000; + } + else + { + _uppercutTimer -= diff; + } + + if (_thunderclapTimer <= diff) + { + DoCastVictim(SPELL_THUNDERCLAP); + _thunderclapTimer = 15000; + } + else + { + _thunderclapTimer -= diff; + } + + if (_mortalStrikeTimer <= diff) + { + DoCastVictim(SPELL_MORTAL_STRIKE); + _mortalStrikeTimer = 15000; + } + else + { + _mortalStrikeTimer -= diff; + } + + if (_cleaveTimer <= diff) + { + DoCastVictim(SPELL_CLEAVE); + _cleaveTimer = 7000; + } + else + { + _cleaveTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + private: + uint32 _berserkerChargeTimer; + uint32 _cleaveTimer; + uint32 _mortalStrikeTimer; + uint32 _thunderclapTimer; + uint32 _uppercutTimer; + }; CreatureAI* GetAI(Creature* creature) const override { return new npc_cairne_bloodhoofAI(creature); } - - struct npc_cairne_bloodhoofAI : public ScriptedAI - { - npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 BerserkerChargeTimer; - uint32 CleaveTimer; - uint32 MortalStrikeTimer; - uint32 ThunderclapTimer; - uint32 UppercutTimer; - - void Reset() override - { - BerserkerChargeTimer = 30000; - CleaveTimer = 5000; - MortalStrikeTimer = 10000; - ThunderclapTimer = 15000; - UppercutTimer = 10000; - } - - void EnterCombat(Unit* /*who*/) override { } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (BerserkerChargeTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_BERSERKER_CHARGE); - BerserkerChargeTimer = 25000; - } - else BerserkerChargeTimer -= diff; - - if (UppercutTimer <= diff) - { - DoCastVictim(SPELL_UPPERCUT); - UppercutTimer = 20000; - } - else UppercutTimer -= diff; - - if (ThunderclapTimer <= diff) - { - DoCastVictim(SPELL_THUNDERCLAP); - ThunderclapTimer = 15000; - } - else ThunderclapTimer -= diff; - - if (MortalStrikeTimer <= diff) - { - DoCastVictim(SPELL_MORTAL_STRIKE); - MortalStrikeTimer = 15000; - } - else MortalStrikeTimer -= diff; - - if (CleaveTimer <= diff) - { - DoCastVictim(SPELL_CLEAVE); - CleaveTimer = 7000; - } - else CleaveTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; }; void AddSC_thunder_bluff()