refactor(Core/Unit): clean MonsterText methods (#6957)

This commit is contained in:
Kitzunu
2021-10-15 10:25:29 +02:00
committed by GitHub
parent 3c42a7d72d
commit bc82f36f1f
75 changed files with 750 additions and 672 deletions

View File

@@ -698,7 +698,7 @@ public:
switch (events.ExecuteEvent())
{
case 1:
me->MonsterYell("Prepare yourselves, the bells have tolled! Shelter your weak, your young and your old! Each of you shall pay the final sum! Cry for mercy; the reckoning has come!", LANG_UNIVERSAL, 0);
me->Yell("Prepare yourselves, the bells have tolled! Shelter your weak, your young and your old! Each of you shall pay the final sum! Cry for mercy; the reckoning has come!", LANG_UNIVERSAL);
me->PlayDirectSound(11966);
break;
case 2:
@@ -729,12 +729,12 @@ public:
}
if (counter == 5)
{
me->MonsterYell("The sky is dark. The fire burns. You strive in vain as Fate's wheel turns.", LANG_UNIVERSAL, 0);
me->Yell("The sky is dark. The fire burns. You strive in vain as Fate's wheel turns.", LANG_UNIVERSAL);
me->PlayDirectSound(12570);
}
else if (counter == 10)
{
me->MonsterYell("The town still burns. A cleansing fire! Time is short, I'll soon retire!", LANG_UNIVERSAL, 0);
me->Yell("The town still burns. A cleansing fire! Time is short, I'll soon retire!", LANG_UNIVERSAL);
me->PlayDirectSound(12571);
}
@@ -786,7 +786,7 @@ public:
{
if (failed)
{
me->MonsterYell("Fire consumes! You've tried and failed. Let there be no doubt, justice prevailed!", LANG_UNIVERSAL, 0);
me->Yell("Fire consumes! You've tried and failed. Let there be no doubt, justice prevailed!", LANG_UNIVERSAL);
me->PlayDirectSound(11967);
for (ObjectGuid const& guid : unitList)
if (Unit* c = ObjectAccessor::GetUnit(*me, guid))
@@ -796,7 +796,7 @@ public:
}
else
{
me->MonsterYell("My flames have died, left not a spark! I shall send you now to the lifeless dark!", LANG_UNIVERSAL, 0);
me->Yell("My flames have died, left not a spark! I shall send you now to the lifeless dark!", LANG_UNIVERSAL);
me->PlayDirectSound(11968);
float x, y, z;
GetPosToLand(x, y, z);
@@ -814,7 +814,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
me->MonsterYell("So eager you are, for my blood to spill. Yet to vanquish me, 'tis my head you must kill!", LANG_UNIVERSAL, 0);
me->Yell("So eager you are, for my blood to spill. Yet to vanquish me, 'tis my head you must kill!", LANG_UNIVERSAL);
me->PlayDirectSound(11969);
float x, y, z;
GetPosToLand(x, y, z);
@@ -979,7 +979,7 @@ public:
void JustDied(Unit* /*killer*/) override
{
summons.DespawnAll();
me->MonsterSay("This end have I reached before. What new adventure lies in store?", LANG_UNIVERSAL, 0);
me->Say("This end have I reached before. What new adventure lies in store?", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_DEATH);
std::list<Creature*> unitList;
me->GetCreaturesWithEntryInRange(unitList, 100.0f, NPC_PUMPKIN_FIEND);
@@ -993,7 +993,7 @@ public:
void KilledUnit(Unit* /*who*/) override
{
me->MonsterYell("Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken.", LANG_UNIVERSAL, 0);
me->Yell("Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken.", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SLAY);
}
@@ -1025,7 +1025,7 @@ public:
events.CancelEvent(EVENT_HORSEMAN_WHIRLWIND);
events.CancelEvent(EVENT_HORSEMAN_CONFLAGRATION);
events.CancelEvent(EVENT_SUMMON_PUMPKIN);
me->MonsterYell("Here's my body, fit and pure! Now, your blackened souls I'll cure!", LANG_UNIVERSAL, 0);
me->Yell("Here's my body, fit and pure! Now, your blackened souls I'll cure!", LANG_UNIVERSAL);
if (phase == 1)
events.ScheduleEvent(EVENT_HORSEMAN_CONFLAGRATION, 6000);
@@ -1126,23 +1126,23 @@ public:
switch (talkCount)
{
case 1:
player->MonsterSay("Horseman rise...", LANG_UNIVERSAL, 0);
player->Say("Horseman rise...", LANG_UNIVERSAL);
break;
case 2:
player->MonsterSay("Your time is nigh...", LANG_UNIVERSAL, 0);
player->Say("Your time is nigh...", LANG_UNIVERSAL);
if (Creature* trigger = me->SummonTrigger(1765.28f, 1347.46f, 17.5514f, 0.0f, 15 * IN_MILLISECONDS))
trigger->CastSpell(trigger, SPELL_EARTH_EXPLOSION, true);
break;
case 3:
me->GetMotionMaster()->MovePath(236820, false);
me->CastSpell(me, SPELL_SHAKE_CAMERA_SMALL, true);
player->MonsterSay("You felt death once...", LANG_UNIVERSAL, 0);
me->MonsterSay("It is over, your search is done. Let fate choose now, the righteous one.", LANG_UNIVERSAL, 0);
player->Say("You felt death once...", LANG_UNIVERSAL);
me->Say("It is over, your search is done. Let fate choose now, the righteous one.", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_AGGRO);
break;
case 4:
me->CastSpell(me, SPELL_SHAKE_CAMERA_MEDIUM, true);
player->MonsterSay("Now, know demise!", LANG_UNIVERSAL, 0);
player->Say("Now, know demise!", LANG_UNIVERSAL);
talkCount = 0;
return; // pop and return, skip repeat
}
@@ -1206,7 +1206,7 @@ public:
}
else
{
me->MonsterSay("Soldiers arise, stand and fight! Bring victory at last to this fallen knight!", LANG_UNIVERSAL, 0);
me->Say("Soldiers arise, stand and fight! Bring victory at last to this fallen knight!", LANG_UNIVERSAL);
me->PlayDirectSound(SOUND_SPROUT);
events.RepeatEvent(15000);
talkCount = 0;
@@ -1346,7 +1346,7 @@ public:
}
me->CastSpell(me, SPELL_HORSEMAN_SPEAKS, true);
me->MonsterTextEmote("Headless Horseman laughs", 0);
me->TextEmote("Headless Horseman laughs");
me->PlayDirectSound(sound);
}
}