fix(Scripts/Auriaya): Move hardcoded text/gossips to DB (#11658)

* auriaya

* Update boss_auriaya.cpp

* cs

* Update boss_auriaya.cpp
This commit is contained in:
avarishd
2022-05-09 02:52:22 +03:00
committed by GitHub
parent 13f9149916
commit 6e9d470876
2 changed files with 27 additions and 27 deletions
@@ -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');
@@ -80,14 +80,14 @@ enum AuriayaEvents
EVENT_ENRAGE = 10, EVENT_ENRAGE = 10,
}; };
enum AuriayaSounds enum Texts
{ {
SOUND_AGGRO = 15473, SAY_AGGRO = 0,
SOUND_SLAY1 = 15474, SAY_SLAY = 1,
SOUND_SLAY2 = 15475, SAY_BERSERK = 2,
SOUND_DEATH = 15476, EMOTE_DEATH = 3,
SOUND_BERSERK = 15477, EMOTE_FEAR = 4,
SOUND_WOUND = 15478, EMOTE_DEFFENDER = 5,
}; };
enum Misc enum Misc
@@ -186,26 +186,16 @@ public:
summons.DoZoneInCombat(NPC_SANCTUM_SENTRY); summons.DoZoneInCombat(NPC_SANCTUM_SENTRY);
me->Yell("Some things are better left alone!", LANG_UNIVERSAL); Talk(SAY_AGGRO);
me->PlayDirectSound(SOUND_AGGRO);
me->setActive(true); 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; return;
if (urand(0, 1)) Talk(SAY_SLAY);
{
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);
}
} }
void JustDied(Unit* /*killer*/) override void JustDied(Unit* /*killer*/) override
@@ -216,8 +206,7 @@ public:
EntryCheckPredicate pred(NPC_FERAL_DEFENDER); EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
summons.DoAction(ACTION_DESPAWN_ADDS, pred); summons.DoAction(ACTION_DESPAWN_ADDS, pred);
summons.DespawnAll(); summons.DespawnAll();
me->TextEmote("Auriaya screams in agony.", nullptr, true); Talk(EMOTE_DEATH);
me->PlayDirectSound(SOUND_DEATH);
} }
void DoAction(int32 param) override void DoAction(int32 param) override
@@ -240,7 +229,7 @@ public:
switch (events.ExecuteEvent()) switch (events.ExecuteEvent())
{ {
case EVENT_SUMMON_FERAL_DEFENDER: 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->CastSpell(me, SPELL_ACTIVATE_FERAL_DEFENDER, true);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
events.ScheduleEvent(EVENT_REMOVE_IMMUNE, 3000); events.ScheduleEvent(EVENT_REMOVE_IMMUNE, 3000);
@@ -249,7 +238,7 @@ public:
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
break; break;
case EVENT_TERRIFYING_SCREECH: case EVENT_TERRIFYING_SCREECH:
me->TextEmote("Auriaya begins to cast Terrifying Screech.", nullptr, true); Talk(EMOTE_FEAR);
me->CastSpell(me, SPELL_TERRIFYING_SCREECH, false); me->CastSpell(me, SPELL_TERRIFYING_SCREECH, false);
events.RepeatEvent(35000); events.RepeatEvent(35000);
break; break;
@@ -273,8 +262,7 @@ public:
break; break;
} }
case EVENT_ENRAGE: case EVENT_ENRAGE:
me->TextEmote("You waste my time!", nullptr, true); Talk(SAY_BERSERK);
me->PlayDirectSound(SOUND_BERSERK);
me->CastSpell(me, SPELL_ENRAGE, true); me->CastSpell(me, SPELL_ENRAGE, true);
break; break;
} }