fix(Script/Ulduar): Thorim - misc fixes & hardcode removal (#11711)

* Remove unused SAY_SPECIAL from Thorim/Ulduar

Remove duplicates from creature_text for Thorim/Ulduar

* missing ;

* Fix chest rotation & set trigger creature flag to traps

* Change SAY_SPECIAL & start at 6/6 adds

* remove urand from KilledUnit

was there because TYPEID_PLAYER wasn't there, prior to now

* Update SQL comment

* Remove unnecessary GetInstanceScript
This commit is contained in:
avarishd
2022-05-22 00:25:37 +03:00
committed by GitHub
parent 324112ff4f
commit 75c65ce9b0
2 changed files with 80 additions and 95 deletions

View File

@@ -267,29 +267,36 @@ const Position ArenaNPCs[] =
{2087.46f, -298.71f, 440.5f, 0.59f}
};
enum ThorimSounds
enum Texts
{
SOUND_AGGRO1 = 15733,
SOUND_AGGRO2 = 15734,
SOUND_SPECIAL1 = 15735,
SOUND_SPECIAL2 = 15736,
SOUND_SPECIAL3 = 15737,
SOUND_JUMPDOWN = 15738,
SOUND_SLAY1 = 15739,
SOUND_SLAY2 = 15740,
SOUND_BERSERK = 15741,
SOUND_AWIPE = 15742,
SOUND_DEFEATED = 15743,
SOUND_NORM1 = 15744,
SOUND_NORM2 = 15745,
SOUND_NORM3 = 15746,
SOUND_HARD1 = 15747,
SOUND_HARD2 = 15748,
SOUND_HARD3 = 15749,
// Thorim
SAY_AGGRO_1 = 0,
SAY_AGGRO_2 = 1,
SAY_SPECIAL_1 = 2, // Unused
SAY_SPECIAL_2 = 3,
SAY_SPECIAL_3 = 4, // Unused
SAY_JUMPDOWN = 5,
SAY_SLAY = 6,
SAY_BERSERK = 7,
SAY_WIPE = 8,
SAY_DEATH = 9,
SAY_END_NORMAL_1 = 10,
SAY_END_NORMAL_2 = 11,
SAY_END_NORMAL_3 = 12,
SAY_END_HARD_1 = 13,
SAY_END_HARD_2 = 14,
SAY_END_HARD_3 = 15,
SOUND_SIF_START = 15668,
SOUND_SIF_DESPAWN = 15669,
SOUND_SIF_EVENT = 15670,
// Sif
SAY_SIF_AGGRO = 0,
SAY_SIF_HM_MISSED = 1,
SAY_SIF_HM_REACHED = 2,
// Ancient Rune Giant
SAY_GIANT_RUNIC_MIGHT = 0,
// Runic Colossus
SAY_COLOSSUS_RUNIC_BARRIER = 0,
};
enum Misc
@@ -487,32 +494,20 @@ public:
if (GameObject* go = GetThorimObject(DATA_THORIM_LEVER))
go->RemoveGameObjectFlag((GameObjectFlags)48);
events.ScheduleEvent(EVENT_THORIM_AGGRO, 0);
events.SetPhase(EVENT_PHASE_START);
events.ScheduleEvent(EVENT_THORIM_START_PHASE1, 20000);
_trashCounter = 0;
}
else if (_trashCounter == 5)
events.ScheduleEvent(EVENT_THORIM_AGGRO, 0);
}
else if (param == ACTION_ALLOW_HIT)
_isHitAllowed = true;
}
void KilledUnit(Unit*) override
void KilledUnit(Unit* victim) override
{
if (urand(0, 2))
return;
if (urand(0, 1))
{
me->Yell("Can't you at least put up a fight!?", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SLAY1);
}
else
{
me->Yell("Pathetic!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SLAY2);
}
if (victim->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_SLAY);
}
void JustReachedHome() override { me->setActive(false); }
@@ -544,8 +539,7 @@ public:
me->GetMotionMaster()->MoveJump(Middle.GetPositionX(), Middle.GetPositionY(), Middle.GetPositionZ(), 20, 20);
me->RemoveAura(SPELL_SHEATH_OF_LIGHTNING);
me->Yell("Impertinent whelps! You dare challenge me atop my pedestal! I will crush you myself!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_JUMPDOWN);
Talk(SAY_JUMPDOWN);
// Hard Mode
if (!me->HasAura(62565 /*TOUCH OF DOMINION TRIGGER*/))
@@ -577,8 +571,7 @@ public:
events.Reset();
DisableThorim(true);
me->Yell("Stay your arms! I yield!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_DEFEATED);
Talk(SAY_DEATH);
events.SetPhase(EVENT_PHASE_OUTRO);
events.ScheduleEvent(EVENT_THORIM_OUTRO1, 2000, 0, EVENT_PHASE_OUTRO);
@@ -591,7 +584,7 @@ public:
if (_hardMode)
chestId += 1; // hard mode offset
if ((go = me->SummonGameObject(chestId, 2134.73f, -286.32f, 419.51f, 0.0f, 0, 0, 0, 0, 0)))
if ((go = me->SummonGameObject(chestId, 2134.73f, -286.32f, 419.51f, 4.65f, 0, 0, 0, 0, 0)))
{
go->ReplaceAllGameObjectFlags((GameObjectFlags)0);
go->SetLootRecipient(me->GetMap());
@@ -642,28 +635,6 @@ public:
_hitByLightning = true;
}
void PlaySpecial()
{
if (urand(0, 9))
return;
switch (urand(0, 2))
{
case 0:
me->Yell("Behold the power of the storms and despair!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SPECIAL1);
break;
case 1:
me->Yell("Do not hold back! Destroy them!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SPECIAL2);
break;
case 2:
me->Yell("Have you begun to regret your intrusion? ", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SPECIAL3);
break;
}
}
Player* GetArenaPlayer()
{
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
@@ -686,8 +657,7 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_THORIM_AGGRO:
me->Yell("Interlopers! You mortals who dare to interfere with my sport will pay... Wait--you...", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_AGGRO1);
Talk(SAY_AGGRO_1);
events.ScheduleEvent(EVENT_THORIM_AGGRO2, 9000);
if (GameObject* go = GetThorimObject(DATA_THORIM_FENCE))
@@ -696,8 +666,7 @@ public:
break;
case EVENT_THORIM_AGGRO2:
{
me->Yell("I remember you... In the mountains... But you... what is this? Where am--", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_AGGRO2);
Talk(SAY_AGGRO_2);
EntryCheckPredicate pred(NPC_SIF);
summons.DoAction(ACTION_SIF_START_TALK, pred);
@@ -718,12 +687,10 @@ public:
case EVENT_THORIM_STORMHAMMER:
me->CastCustomSpell(SPELL_STORMHAMMER, SPELLVALUE_MAX_TARGETS, 1, me->GetVictim(), false);
events.RepeatEvent(16000);
PlaySpecial();
break;
case EVENT_THORIM_CHARGE_ORB:
me->CastCustomSpell(SPELL_CHARGE_ORB, SPELLVALUE_MAX_TARGETS, 1, me, false);
events.RepeatEvent(16000);
PlaySpecial();
break;
case EVENT_THORIM_LIGHTNING_ORB:
{
@@ -735,8 +702,7 @@ public:
}
// No players found
me->Yell("Failures! Weaklings!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_AWIPE);
Talk(SAY_WIPE);
me->SummonCreature(NPC_LIGHTNING_ORB, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
_isArenaEmpty = true;
@@ -752,7 +718,6 @@ public:
case EVENT_THORIM_FILL_ARENA:
SpawnArenaNPCs();
events.RepeatEvent(10000);
PlaySpecial();
break;
case EVENT_THORIM_UNBALANCING_STRIKE:
me->CastSpell(me->GetVictim(), SPELL_UNBALANCING_STRIKE, false);
@@ -768,49 +733,42 @@ public:
break;
case EVENT_THORIM_BERSERK:
me->CastSpell(me, SPELL_BERSERK, true);
me->Yell("My patience has reached its limit!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_BERSERK);
Talk(SAY_BERSERK);
break;
case EVENT_THORIM_OUTRO1:
if (_hardMode)
{
me->Yell("You! Fiend! You are not my beloved! Be gone!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_HARD1);
Talk(SAY_END_HARD_1);
events.ScheduleEvent(EVENT_THORIM_OUTRO2, 5000, 0, 3);
EntryCheckPredicate pred(NPC_SIF);
summons.DoAction(ACTION_SIF_TRANSFORM, pred);
}
else
{
me->Yell("I feel as though I am awakening from a nightmare, but the shadows in this place yet linger.", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_NORM1);
Talk(SAY_END_NORMAL_1);
events.ScheduleEvent(EVENT_THORIM_OUTRO2, 9000, 0, 3);
}
break;
case EVENT_THORIM_OUTRO2:
if (_hardMode)
{
me->Yell("Behold the hand behind all the evil that has befallen Ulduar! Left my kingdom in ruins, corrupted my brother and slain my wife!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_HARD2);
Talk(SAY_END_HARD_2);
events.ScheduleEvent(EVENT_THORIM_OUTRO3, 12000, 0, 3);
}
else
{
me->Yell("Sif... was Sif here? Impossible--she died by my brother's hand. A dark nightmare indeed....", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_NORM2);
Talk(SAY_END_NORMAL_2);
events.ScheduleEvent(EVENT_THORIM_OUTRO3, 10000, 0, 3);
}
break;
case EVENT_THORIM_OUTRO3:
if (_hardMode)
{
me->Yell("And now it falls to you, champions, to avenge us all! The task before you is great, but I will lend you my aid as I am able. You must prevail!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_HARD3);
Talk(SAY_END_HARD_3);
}
else
{
me->Yell("I need time to reflect.... I will aid your cause if you should require it. I owe you at least that much. Farewell.", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_NORM3);
Talk(SAY_END_NORMAL_3);
}
// Defeat credit
@@ -891,17 +849,14 @@ public:
switch (events.ExecuteEvent())
{
case EVENT_SIF_FINISH_DOMINION:
me->PlayDirectSound(SOUND_SIF_DESPAWN);
me->Yell("This pathetic morons are harmless. Relive my station, dispose of them!", LANG_UNIVERSAL);
Talk(SAY_SIF_HM_MISSED);
me->DespawnOrUnsummon(5000);
break;
case EVENT_SIF_START_TALK:
me->Yell("Thorim, my lord, why else would these invaders have come into your sanctum but to slay you? They must be stopped!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SIF_START);
Talk(SAY_SIF_AGGRO);
break;
case EVENT_SIF_JOIN_TALK:
me->PlayDirectSound(SOUND_SIF_EVENT);
me->Yell("Impossible! Lord Thorim, I will bring your foes a frigid death!", LANG_UNIVERSAL);
Talk(SAY_SIF_HM_REACHED);
events.ScheduleEvent(EVENT_SIF_FROST_NOVA_START, 1000);
events.ScheduleEvent(EVENT_SIF_FROSTBOLT_VALLEY, 11000);
events.ScheduleEvent(EVENT_SIF_BLIZZARD, 15000);
@@ -1420,8 +1375,13 @@ public:
void JustDied(Unit*) override
{
if (me->GetInstanceScript())
{
if (GameObject* go = ObjectAccessor::GetGameObject(*me, me->GetInstanceScript()->GetGuidData(DATA_THORIM_FIRST_DOORS)))
go->SetGoState(GO_STATE_ACTIVE);
if (Creature* cr = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetGuidData(TYPE_THORIM)))
cr->AI()->Talk(SAY_SPECIAL_2);
}
}
void EnterCombat(Unit*) override
@@ -1494,7 +1454,7 @@ public:
break;
case EVENT_RC_RUNIC_BARRIER:
me->CastSpell(me, SPELL_RUNIC_BARRIER, false);
me->TextEmote("Runic Colossus surrounds itself with a crackling Runic Barrier!", nullptr, true);
Talk(SAY_COLOSSUS_RUNIC_BARRIER);
events.RepeatEvent(20000);
break;
case EVENT_RC_SMASH:
@@ -1544,7 +1504,7 @@ public:
events.ScheduleEvent(EVENT_ARG_STOMP, 8000);
me->CastSpell(me, SPELL_RUNIC_FORTIFICATION, false);
me->TextEmote("Ancient Rune Giant fortifies nearby allies with runic might", nullptr, true);
Talk(SAY_GIANT_RUNIC_MIGHT);
}
void JustDied(Unit*) override