diff options
| author | offl <11556157+offl@users.noreply.github.com> | 2025-11-09 00:53:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-08 23:53:55 +0100 |
| commit | 475808d626958ccf22563f1415ae3381d173c062 (patch) | |
| tree | 102ae6cfb442b9161ce3d4c8b043bd27005cf0e4 | |
| parent | 5a2cfd095c31b7785bf8a61e1b071873ffa25937 (diff) | |
Scripts/World: Rewrite Cairne (#31338)
| -rw-r--r-- | sql/updates/world/3.3.5/2025_11_08_02_world.sql | 8 | ||||
| -rw-r--r-- | src/server/scripts/Kalimdor/zone_thunder_bluff.cpp | 190 |
2 files changed, 84 insertions, 114 deletions
diff --git a/sql/updates/world/3.3.5/2025_11_08_02_world.sql b/sql/updates/world/3.3.5/2025_11_08_02_world.sql new file mode 100644 index 00000000000..73a451b3515 --- /dev/null +++ b/sql/updates/world/3.3.5/2025_11_08_02_world.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 5851; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15,5851,0,0,0,47,0,925,10,0,0,0,0,'',"Group 0: Show Gossip Option 0 if player has taken quest 'Cairne's Hoofprint'"); + +DELETE FROM `creature_text` WHERE `CreatureID` = 3057; +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(3057,0,0,"The attackers have fled! Strength and honor to the Horde!",14,0,100,0,0,0,10632,0,"Cairne Bloodhoof"); diff --git a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp index f6fd975dc62..288532310f9 100644 --- a/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp +++ b/src/server/scripts/Kalimdor/zone_thunder_bluff.cpp @@ -15,153 +15,115 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Thunder_Bluff -SD%Complete: 100 -SDComment: Quest support: 925 -SDCategory: Thunder Bluff -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" #include "Player.h" -/*##### -# npc_cairne_bloodhoof -######*/ - enum CairneBloodhoof { - SPELL_BERSERKER_CHARGE = 16636, - SPELL_CLEAVE = 16044, + SAY_EVADE = 0, + + SPELL_CLEAVE = 15284, SPELL_MORTAL_STRIKE = 16856, SPELL_THUNDERCLAP = 23931, - SPELL_UPPERCUT = 22916 -}; + SPELL_UPPERCUT = 22916, + SPELL_WAR_STOMP = 59705, -enum Sounds -{ - SOUND_AGGRO = 5884 -}; + SPELL_CAIRNES_HOOFPRINT = 23123, -enum Gossips -{ - GOSSIP_MENU_HCB = 5851, - GOSSIP_OPTION_HCB = 0 + EVENT_CLEAVE = 1, + EVENT_MORTAL_STRIKE = 2, + EVENT_THUNDERCLAP = 3, + EVENT_UPPERCUT = 4, + EVENT_WAR_STOMP = 5, + + SOUND_AGGRO = 5884 }; -/// @todo verify abilities/timers -class npc_cairne_bloodhoof : public CreatureScript +// 3057 - Cairne Bloodhoof +struct npc_cairne_bloodhoof : public ScriptedAI { -public: - npc_cairne_bloodhoof() : CreatureScript("npc_cairne_bloodhoof") { } + npc_cairne_bloodhoof(Creature* creature) : ScriptedAI(creature) { } - struct npc_cairne_bloodhoofAI : public ScriptedAI + void Reset() override { - npc_cairne_bloodhoofAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - BerserkerChargeTimer = 30000; - CleaveTimer = 5000; - MortalStrikeTimer = 10000; - ThunderclapTimer = 15000; - UppercutTimer = 10000; - } - - uint32 BerserkerChargeTimer; - uint32 CleaveTimer; - uint32 MortalStrikeTimer; - uint32 ThunderclapTimer; - uint32 UppercutTimer; - - void Reset() override - { - Initialize(); - } - - void JustEngagedWith(Unit* /*who*/) override - { - DoPlaySoundToSet(me, SOUND_AGGRO); - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; + _events.Reset(); + } - if (BerserkerChargeTimer <= diff) - { - if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0)) - DoCast(target, SPELL_BERSERKER_CHARGE); - BerserkerChargeTimer = 25000; - } else BerserkerChargeTimer -= diff; + void JustEngagedWith(Unit* /*who*/) override + { + DoPlaySoundToSet(me, SOUND_AGGRO); - if (UppercutTimer <= diff) - { - DoCastVictim(SPELL_UPPERCUT); - UppercutTimer = 20000; - } else UppercutTimer -= diff; + _events.ScheduleEvent(EVENT_CLEAVE, 5s, 10s); + _events.ScheduleEvent(EVENT_MORTAL_STRIKE, 10s, 15s); + _events.ScheduleEvent(EVENT_THUNDERCLAP, 15s, 20s); + _events.ScheduleEvent(EVENT_UPPERCUT, 10s, 20s); + _events.ScheduleEvent(EVENT_WAR_STOMP, 25s, 30s); + } - if (ThunderclapTimer <= diff) - { - DoCastVictim(SPELL_THUNDERCLAP); - ThunderclapTimer = 15000; - } else ThunderclapTimer -= diff; + void EnterEvadeMode(EvadeReason why) override + { + Talk(SAY_EVADE); + ScriptedAI::EnterEvadeMode(why); + } - if (MortalStrikeTimer <= diff) - { - DoCastVictim(SPELL_MORTAL_STRIKE); - MortalStrikeTimer = 15000; - } else MortalStrikeTimer -= diff; + void UpdateAI(uint32 diff) override + { + if (!UpdateVictim()) + return; - if (CleaveTimer <= diff) - { - DoCastVictim(SPELL_CLEAVE); - CleaveTimer = 7000; - } else CleaveTimer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - DoMeleeAttackIfReady(); - } + _events.Update(diff); - bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override + while (uint32 eventId = _events.ExecuteEvent()) { - uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId); - ClearGossipMenuFor(player); - if (action == GOSSIP_SENDER_INFO) + switch (eventId) { - player->CastSpell(player, 23123, false); - SendGossipMenuFor(player, 7014, me->GetGUID()); + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE); + _events.Repeat(5s, 10s); + break; + case EVENT_MORTAL_STRIKE: + DoCastVictim(SPELL_MORTAL_STRIKE); + _events.Repeat(10s, 15s); + break; + case EVENT_THUNDERCLAP: + DoCastSelf(SPELL_THUNDERCLAP); + _events.Repeat(15s, 20s); + break; + case EVENT_UPPERCUT: + DoCastVictim(SPELL_UPPERCUT); + _events.Repeat(20s, 25s); + break; + case EVENT_WAR_STOMP: + DoCastSelf(SPELL_WAR_STOMP); + _events.Repeat(25s, 30s); + break; + default: + break; } - return true; - } - - bool OnGossipHello(Player* player) override - { - InitGossipMenuFor(player, GOSSIP_MENU_HCB); - if (me->IsQuestGiver()) - player->PrepareQuestMenu(me->GetGUID()); - - if (player->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) - AddGossipItemFor(player, GOSSIP_MENU_HCB, GOSSIP_OPTION_HCB, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); - SendGossipMenuFor(player, 7013, me->GetGUID()); - - return true; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } - }; - CreatureAI* GetAI(Creature* creature) const override + DoMeleeAttackIfReady(); + } + + bool OnGossipSelect(Player* player, uint32 /*menuId*/, uint32 /*gossipListId*/) override { - return new npc_cairne_bloodhoofAI(creature); + DoCast(player, SPELL_CAIRNES_HOOFPRINT); + return false; } + +private: + EventMap _events; }; void AddSC_thunder_bluff() { - new npc_cairne_bloodhoof(); + RegisterCreatureAI(npc_cairne_bloodhoof); } |
