From 6e9d4708764f1337e4633097c07fbbeac2a93441 Mon Sep 17 00:00:00 2001 From: avarishd <46330494+avarishd@users.noreply.github.com> Date: Mon, 9 May 2022 02:52:22 +0300 Subject: [PATCH] fix(Scripts/Auriaya): Move hardcoded text/gossips to DB (#11658) * auriaya * Update boss_auriaya.cpp * cs * Update boss_auriaya.cpp --- .../rev_1651872810987186100.sql | 12 ++++++ .../Northrend/Ulduar/Ulduar/boss_auriaya.cpp | 42 +++++++------------ 2 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1651872810987186100.sql diff --git a/data/sql/updates/pending_db_world/rev_1651872810987186100.sql b/data/sql/updates/pending_db_world/rev_1651872810987186100.sql new file mode 100644 index 000000000..8958ce7eb --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1651872810987186100.sql @@ -0,0 +1,12 @@ +-- Clear Auriaya's creature_text (duplicate and EMOTE_DEATH missing), CN locale is also wrong +DELETE FROM `creature_text` WHERE `CreatureID`=33515; + +-- EMOTE_DEATH has no BroadcastTextID +INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(33515, 0, 0, 'Some things are better left alone!', 14, 0, 100, 0, 0, 15473, 34341, 0, 'Auriaya SAY_AGGRO'), +(33515, 1, 0, 'The secret dies with you.', 14, 0, 100, 0, 0, 15474, 34354, 0, 'Auriaya SAY_SLAY_1'), +(33515, 1, 1, 'There is no escape!', 14, 0, 100, 0, 0, 15475, 37177, 0, 'Auriaya SAY_SLAY_2'), +(33515, 2, 0, 'You waste my time!', 14, 0, 100, 0, 0, 15477, 34358, 0, 'Auriaya SAY_BERSERK'), +(33515, 3, 0, '%s screams in agony.', 16, 0, 100, 0, 0, 15476, 0, 0, 'Auriaya EMOTE_DEATH'), +(33515, 4, 0, '%s begins to cast Terrifying Screech.', 41, 0, 100, 0, 0, 0, 34450, 0, 'Auriaya EMOTE_FEAR'), +(33515, 5, 0, '%s begins to activate the Feral Defender!', 41, 0, 100, 0, 0, 0, 34162, 0, 'Auriaya EMOTE_DEFENDER'); diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp index ae3a28aa8..17001fc61 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_auriaya.cpp @@ -80,14 +80,14 @@ enum AuriayaEvents EVENT_ENRAGE = 10, }; -enum AuriayaSounds +enum Texts { - SOUND_AGGRO = 15473, - SOUND_SLAY1 = 15474, - SOUND_SLAY2 = 15475, - SOUND_DEATH = 15476, - SOUND_BERSERK = 15477, - SOUND_WOUND = 15478, + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_BERSERK = 2, + EMOTE_DEATH = 3, + EMOTE_FEAR = 4, + EMOTE_DEFFENDER = 5, }; enum Misc @@ -186,26 +186,16 @@ public: summons.DoZoneInCombat(NPC_SANCTUM_SENTRY); - me->Yell("Some things are better left alone!", LANG_UNIVERSAL); - me->PlayDirectSound(SOUND_AGGRO); + Talk(SAY_AGGRO); me->setActive(true); } - void KilledUnit(Unit* /*victim*/) override + void KilledUnit(Unit* victim) override { - if (urand(0, 2)) + if (victim->GetTypeId() != TYPEID_PLAYER || urand(0, 2)) return; - if (urand(0, 1)) - { - me->Yell("The secret dies with you!", LANG_UNIVERSAL); - me->PlayDirectSound(SOUND_SLAY1); - } - else - { - me->Yell("There is no escape!", LANG_UNIVERSAL); - me->PlayDirectSound(SOUND_SLAY2); - } + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) override @@ -216,8 +206,7 @@ public: EntryCheckPredicate pred(NPC_FERAL_DEFENDER); summons.DoAction(ACTION_DESPAWN_ADDS, pred); summons.DespawnAll(); - me->TextEmote("Auriaya screams in agony.", nullptr, true); - me->PlayDirectSound(SOUND_DEATH); + Talk(EMOTE_DEATH); } void DoAction(int32 param) override @@ -240,7 +229,7 @@ public: switch (events.ExecuteEvent()) { case EVENT_SUMMON_FERAL_DEFENDER: - me->TextEmote("Auriaya begins to activate Feral Defender.", nullptr, true); + Talk(EMOTE_DEFFENDER); me->CastSpell(me, SPELL_ACTIVATE_FERAL_DEFENDER, true); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); events.ScheduleEvent(EVENT_REMOVE_IMMUNE, 3000); @@ -249,7 +238,7 @@ public: me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); break; case EVENT_TERRIFYING_SCREECH: - me->TextEmote("Auriaya begins to cast Terrifying Screech.", nullptr, true); + Talk(EMOTE_FEAR); me->CastSpell(me, SPELL_TERRIFYING_SCREECH, false); events.RepeatEvent(35000); break; @@ -273,8 +262,7 @@ public: break; } case EVENT_ENRAGE: - me->TextEmote("You waste my time!", nullptr, true); - me->PlayDirectSound(SOUND_BERSERK); + Talk(SAY_BERSERK); me->CastSpell(me, SPELL_ENRAGE, true); break; }