Core/DB: Update all locales to actual TrinityCore (#1160)

* Core/Misc Update all locales table structure to simple system. Port from TrinityCore
Co-Authored-By: Winfidonarleyan <dowlandtop@yandex.com>
* Core/Db/Gossip Update structure gossip_menu and gossip_menu_action to actual TrinityCore
* Core/DB Update Broadcast system to actual TC
* Core/Mail: implement Quest Mail Sender
* Core/Quest Split quest template locales
This commit is contained in:
Kargatum
2019-01-13 05:56:06 +07:00
committed by Viste(Кирилл)
parent 76772e434d
commit b34bc28e5b
26 changed files with 59397 additions and 525 deletions

View File

@@ -277,17 +277,17 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
recvData >> textID;
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY ID '%u'", textID);
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_NPC_TEXT_QUERY TextId: %u", textID);
#endif
recvData >> guid;
GossipText const* pGossip = sObjectMgr->GetGossipText(textID);
GossipText const* gossip = sObjectMgr->GetGossipText(textID);
WorldPacket data(SMSG_NPC_TEXT_UPDATE, 100); // guess size
data << textID;
if (!pGossip)
if (!gossip)
{
for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
{
@@ -307,10 +307,10 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
{
std::string text0[MAX_GOSSIP_TEXT_OPTIONS], text1[MAX_GOSSIP_TEXT_OPTIONS];
LocaleConstant locale = GetSessionDbLocaleIndex();
for (uint8 i = 0; i < MAX_GOSSIP_TEXT_OPTIONS; ++i)
{
BroadcastText const* bct = sObjectMgr->GetBroadcastText(pGossip->Options[i].BroadcastTextID);
BroadcastText const* bct = sObjectMgr->GetBroadcastText(gossip->Options[i].BroadcastTextID);
if (bct)
{
text0[i] = bct->GetText(locale, GENDER_MALE, true);
@@ -318,8 +318,8 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
}
else
{
text0[i] = pGossip->Options[i].Text_0;
text1[i] = pGossip->Options[i].Text_1;
text0[i] = gossip->Options[i].Text_0;
text1[i] = gossip->Options[i].Text_1;
}
if (locale != DEFAULT_LOCALE && !bct)
@@ -331,7 +331,7 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
}
}
data << pGossip->Options[i].Probability;
data << gossip->Options[i].Probability;
if (text0[i].empty())
data << text1[i];
@@ -343,12 +343,12 @@ void WorldSession::HandleNpcTextQueryOpcode(WorldPacket & recvData)
else
data << text1[i];
data << pGossip->Options[i].Language;
data << gossip->Options[i].Language;
for (uint8 j = 0; j < MAX_GOSSIP_TEXT_EMOTES; ++j)
{
data << pGossip->Options[i].Emotes[j]._Delay;
data << pGossip->Options[i].Emotes[j]._Emote;
data << gossip->Options[i].Emotes[j]._Delay;
data << gossip->Options[i].Emotes[j]._Emote;
}
}
}