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

@@ -926,7 +926,7 @@ void hyjalAI::WaypointReached(uint32 waypointId)
{
if (waypointId == 1 || (waypointId == 0 && me->GetEntry() == THRALL))
{
me->MonsterYell(YELL_HURRY, LANG_UNIVERSAL, nullptr);
me->Yell(YELL_HURRY, LANG_UNIVERSAL);
WaitForTeleport = true;
TeleportTimer = 20000;
if (me->GetEntry() == JAINA)

View File

@@ -194,15 +194,12 @@ public:
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->GetSource())
if (Player* player = i->GetSource())
{
WorldPacket packet;
ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, i->GetSource(), YELL_EFFORTS);
i->GetSource()->GetSession()->SendPacket(&packet);
WorldPacket data2(SMSG_PLAY_SOUND, 4);
data2 << 10986;
i->GetSource()->GetSession()->SendPacket(&data2);
ChatHandler::BuildChatPacket(packet, CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, unit, player, YELL_EFFORTS);
player->SendDirectMessage(&packet);
player->PlayDirectSound(10986, player);
}
}
}

View File

@@ -98,7 +98,7 @@ public:
{
cr->DespawnOrUnsummon(5000);
cr->RemoveAllAuras();
cr->MonsterSay("You have my thanks for saving my existence in this timeline. Now i must report back to my superiors. They must know immediately of what i just experienced.", LANG_UNIVERSAL, 0);
cr->Say("You have my thanks for saving my existence in this timeline. Now i must report back to my superiors. They must know immediately of what i just experienced.", LANG_UNIVERSAL);
}
}
}

View File

@@ -566,7 +566,7 @@ public:
case 11:
if (Creature* cityman = GetEventNpc(NPC_CITY_MAN2))
{
cityman->MonsterSay("Oh no...", LANG_UNIVERSAL, 0); // missing script_text
cityman->Say("Oh no...", LANG_UNIVERSAL); // missing script_text
me->CastSpell(cityman, SPELL_ARTHAS_CRUSADER_STRIKE, true);
}
me->SetReactState(REACT_DEFENSIVE);
@@ -1026,7 +1026,7 @@ public:
}
summons.DespawnAll();
me->MonsterSay("I can't afford to spare you.", LANG_UNIVERSAL, 0);
me->Say("I can't afford to spare you.", LANG_UNIVERSAL);
me->SetFacingTo(0.0f);
ScheduleNextEvent(currentEvent, 5000);
break;

View File

@@ -467,7 +467,7 @@ public:
case EVENT_PHASE_2_STEP_ACROSS:
{
me->SetFacingTo(OnyxiaMoveData[CurrentWP].o);
me->MonsterTextEmote("Onyxia takes in a deep breath...", 0, true);
me->TextEmote("Onyxia takes in a deep breath...", nullptr, true);
me->CastSpell(me, OnyxiaMoveData[CurrentWP].spellId, false);
events.ScheduleEvent(EVENT_SPELL_BREATH, 8250);

View File

@@ -213,7 +213,7 @@ struct boss_twinemperorsAI : public ScriptedAI
Creature* pOtherBoss = GetOtherBoss();
if (pOtherBoss)
{
//me->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0);
//me->Yell("Teleporting ...", LANG_UNIVERSAL);
Position thisPos;
thisPos.Relocate(me);
Position otherPos;
@@ -257,7 +257,7 @@ struct boss_twinemperorsAI : public ScriptedAI
me->ClearUnitState(UNIT_STATE_STUNNED);
if (Unit* nearu = me->SelectNearestTarget(100))
{
//DoYell(nearu->GetName(), LANG_UNIVERSAL, 0);
//DoYell(nearu->GetName(), LANG_UNIVERSAL);
AttackStart(nearu);
me->AddThreat(nearu, 10000);
}