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;