diff options
author | joschiwald <joschiwald.trinity@gmail.com> | 2014-09-18 23:33:59 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2014-09-18 23:33:59 +0200 |
commit | e567ab95972508adc85a36f867723114a04fe227 (patch) | |
tree | 2d7c34ccaef30f87207ef522f2fc2fe5184b29aa /src | |
parent | 46193d6a1437ff5f488eb265c1718d02ca233ad8 (diff) |
Core/Texts: added TextRange parameter to creature_text
Ranges:
0 - Normal (Default)
1 - Area
2 - Zone
3 - Map
4 - World
Ref #13116
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/CreatureAI.cpp | 7 | ||||
-rw-r--r-- | src/server/game/AI/CreatureAI.h | 8 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Battleground.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp | 14 | ||||
-rw-r--r-- | src/server/game/Groups/Group.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Groups/Group.h | 18 | ||||
-rw-r--r-- | src/server/game/Texts/CreatureTextMgr.cpp | 49 | ||||
-rw-r--r-- | src/server/game/Texts/CreatureTextMgr.h | 53 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp | 8 | ||||
-rw-r--r-- | src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 4 | ||||
-rw-r--r-- | src/server/shared/Database/Implementation/WorldDatabase.cpp | 2 |
12 files changed, 97 insertions, 74 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp index 7a79bb722a0..933cb38aef5 100644 --- a/src/server/game/AI/CreatureAI.cpp +++ b/src/server/game/AI/CreatureAI.cpp @@ -38,16 +38,11 @@ void CreatureAI::OnCharmed(bool /*apply*/) AISpellInfoType* UnitAI::AISpellInfo; AISpellInfoType* GetAISpellInfo(uint32 i) { return &CreatureAI::AISpellInfo[i]; } -void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= NULL*/) +void CreatureAI::Talk(uint8 id, WorldObject const* whisperTarget /*= nullptr*/) { sCreatureTextMgr->SendChat(me, id, whisperTarget); } -void CreatureAI::TalkToMap(uint8 id, WorldObject const* whisperTarget /*= NULL*/) -{ - sCreatureTextMgr->SendChat(me, id, whisperTarget, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP); -} - void CreatureAI::DoZoneInCombat(Creature* creature /*= NULL*/, float maxRangeToNearestTarget /* = 50.0f*/) { if (!creature) diff --git a/src/server/game/AI/CreatureAI.h b/src/server/game/AI/CreatureAI.h index b79dd6abbc8..83ecb11a8ef 100644 --- a/src/server/game/AI/CreatureAI.h +++ b/src/server/game/AI/CreatureAI.h @@ -78,8 +78,8 @@ class CreatureAI : public UnitAI Creature* DoSummonFlyer(uint32 entry, WorldObject* obj, float flightZ, float radius = 5.0f, uint32 despawnTime = 30000, TempSummonType summonType = TEMPSUMMON_CORPSE_TIMED_DESPAWN); public: - void Talk(uint8 id, WorldObject const* whisperTarget = NULL); - void TalkToMap(uint8 id, WorldObject const* whisperTarget = NULL); + void Talk(uint8 id, WorldObject const* whisperTarget = nullptr); + explicit CreatureAI(Creature* creature) : UnitAI(creature), me(creature), m_MoveInLineOfSight_locked(false) { } virtual ~CreatureAI() { } @@ -165,14 +165,12 @@ class CreatureAI : public UnitAI /// == Fields ======================================= - // Pointer to controlled by AI creature - //Creature* const me; - virtual void PassengerBoarded(Unit* /*passenger*/, int8 /*seatId*/, bool /*apply*/) { } virtual void OnSpellClick(Unit* /*clicker*/, bool& /*result*/) { } virtual bool CanSeeAlways(WorldObject const* /*obj*/) { return false; } + protected: virtual void MoveInLineOfSight(Unit* /*who*/); diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 90a84774a81..86081c7f074 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -620,7 +620,7 @@ void Battleground::SendPacketToTeam(uint32 TeamID, WorldPacket* packet, Player* void Battleground::SendChatMessage(Creature* source, uint8 textId, WorldObject* target /*= NULL*/) { - sCreatureTextMgr->SendChat(source, textId, target, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP); + sCreatureTextMgr->SendChat(source, textId, target); } void Battleground::PlaySoundToAll(uint32 SoundID) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index c028698f5ae..0490923510c 100644 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -119,7 +119,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer) DelCreature(AV_CPLACE_TRIGGER16); if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD)) - herold->AI()->TalkToMap(TEXT_STORMPIKE_GENERAL_DEAD); + herold->AI()->Talk(TEXT_STORMPIKE_GENERAL_DEAD); } else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN]) { @@ -138,7 +138,7 @@ void BattlegroundAV::HandleKillUnit(Creature* unit, Player* killer) DelCreature(AV_CPLACE_TRIGGER18); if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD)) - herold->AI()->TalkToMap(TEXT_FROSTWOLF_GENERAL_DEAD); + herold->AI()->Talk(TEXT_FROSTWOLF_GENERAL_DEAD); } else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4]) ChangeMineOwner(AV_NORTH_MINE, killer->GetTeam()); @@ -603,7 +603,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node)) if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD)) - herold->AI()->TalkToMap(owner == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture); + herold->AI()->Talk(owner == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture); } void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) @@ -679,9 +679,9 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD)) { if (mine == AV_NORTH_MINE) - herold->AI()->TalkToMap(team == ALLIANCE ? TEXT_IRONDEEP_MINE_ALLIANCE_TAKEN : TEXT_IRONDEEP_MINE_HORDE_TAKEN); + herold->AI()->Talk(team == ALLIANCE ? TEXT_IRONDEEP_MINE_ALLIANCE_TAKEN : TEXT_IRONDEEP_MINE_HORDE_TAKEN); else if (mine == AV_SOUTH_MINE) - herold->AI()->TalkToMap(team == ALLIANCE ? TEXT_COLDTOOTH_MINE_ALLIANCE_TAKEN : TEXT_COLDTOOTH_MINE_HORDE_TAKEN); + herold->AI()->Talk(team == ALLIANCE ? TEXT_COLDTOOTH_MINE_ALLIANCE_TAKEN : TEXT_COLDTOOTH_MINE_HORDE_TAKEN); } } else @@ -923,7 +923,7 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node)) if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD)) - herold->AI()->TalkToMap(team == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture); + herold->AI()->Talk(team == ALLIANCE ? nodeInfo->TextIds.AllianceCapture : nodeInfo->TextIds.HordeCapture); // update the statistic for the defending player UpdatePlayerScore(player, IsTower(node) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1); @@ -1014,7 +1014,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) if (StaticNodeInfo const* nodeInfo = GetStaticNodeInfo(node)) if (Creature* herold = GetBGCreature(AV_CPLACE_HERALD)) - herold->AI()->TalkToMap(team == ALLIANCE ? nodeInfo->TextIds.AllianceAttack : nodeInfo->TextIds.HordeAttack); + herold->AI()->Talk(team == ALLIANCE ? nodeInfo->TextIds.AllianceAttack : nodeInfo->TextIds.HordeAttack); // update the statistic for the assaulting player UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_ASSAULTED : SCORE_GRAVEYARDS_ASSAULTED, 1); diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index df34c12e332..b203ccb8bb9 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1591,12 +1591,12 @@ void Group::UpdatePlayerOutOfRange(Player* player) } } -void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group, ObjectGuid ignore) +void Group::BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group /*= -1*/, ObjectGuid ignoredPlayer /*= ObjectGuid::Empty*/) { for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player* player = itr->GetSource(); - if (!player || (!ignore.IsEmpty() && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this)) + if (!player || (!ignoredPlayer.IsEmpty() && player->GetGUID() == ignoredPlayer) || (ignorePlayersInBGRaid && player->GetGroup() != this)) continue; if (player->GetSession() && (group == -1 || itr->getSubGroup() == group)) diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 6abfd5b667d..5e9ab911292 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -269,8 +269,22 @@ class Group void SendUpdate(); void SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot = NULL); void UpdatePlayerOutOfRange(Player* player); - // ignore: GUID of player that will be ignored - void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, ObjectGuid ignore = ObjectGuid::Empty); + + template<class Worker> + void BroadcastWorker(Worker& worker) + { + for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next()) + worker(itr->GetSource()); + } + + template<class Worker> + void BroadcastWorker(Worker const& worker) const + { + for (GroupReference const* itr = GetFirstMember(); itr != nullptr; itr = itr->next()) + worker(itr->GetSource()); + } + + void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, ObjectGuid ignoredPlayer = ObjectGuid::Empty); void BroadcastReadyCheck(WorldPacket* packet); void OfflineReadyCheck(); diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 0412128754c..05769c84f94 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -91,7 +91,6 @@ void CreatureTextMgr::LoadCreatureTexts() } uint32 textCount = 0; - uint32 creatureCount = 0; do { @@ -109,25 +108,26 @@ void CreatureTextMgr::LoadCreatureTexts() temp.duration = fields[8].GetUInt32(); temp.sound = fields[9].GetUInt32(); temp.BroadcastTextId = fields[10].GetUInt32(); + temp.TextRange = CreatureTextRange(fields[11].GetUInt8()); if (temp.sound) { if (!sSoundEntriesStore.LookupEntry(temp.sound)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound); temp.sound = 0; } } if (!GetLanguageDescByID(temp.lang)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang)); temp.lang = LANG_UNIVERSAL; } if (temp.type >= MAX_CHAT_MSG_TYPE) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type)); temp.type = CHAT_MSG_SAY; } @@ -135,7 +135,7 @@ void CreatureTextMgr::LoadCreatureTexts() { if (!sEmotesStore.LookupEntry(temp.emote)) { - TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote)); temp.emote = EMOTE_ONESHOT_NONE; } } @@ -149,9 +149,11 @@ void CreatureTextMgr::LoadCreatureTexts() } } - // entry not yet added, add empty TextHolder (list of groups) - if (mTextMap.find(temp.entry) == mTextMap.end()) - ++creatureCount; + if (temp.TextRange > TEXT_RANGE_WORLD) + { + TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has incorrect TextRange %u.", temp.entry, temp.group, temp.id, temp.TextRange); + temp.TextRange = TEXT_RANGE_NORMAL; + } // add the text into our entry's group mTextMap[temp.entry][temp.group].push_back(temp); @@ -160,7 +162,7 @@ void CreatureTextMgr::LoadCreatureTexts() } while (result->NextRow()); - TC_LOG_INFO("server.loading", ">> Loaded %u creature texts for %u creatures in %u ms", textCount, creatureCount, GetMSTimeDiffToNow(oldMSTime)); + TC_LOG_INFO("server.loading", ">> Loaded %u creature texts for " SZFMTD " creatures in %u ms", textCount, mTextMap.size(), GetMSTimeDiffToNow(oldMSTime)); } void CreatureTextMgr::LoadCreatureTextLocales() @@ -193,7 +195,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() } -uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget /*= NULL*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= NULL*/) +uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget /*= nullptr*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/, Player* srcPlr /*= nullptr*/) { if (!source) return 0; @@ -274,6 +276,9 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject Language finalLang = (language == LANG_ADDON) ? iter->lang : language; uint32 finalSound = sound ? sound : iter->sound; + if (range == TEXT_RANGE_NORMAL) + range = iter->TextRange; + if (finalSound) SendSound(source, finalSound, finalType, whisperTarget, range, team, gmOnly); @@ -334,6 +339,18 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, { switch (msgType) { + case CHAT_MSG_MONSTER_PARTY: + { + if (!whisperTarget) + return; + + if (Player const* whisperPlayer = whisperTarget->ToPlayer()) + { + if (Group const* group = whisperPlayer->GetGroup()) + group->BroadcastWorker([data](Player* player) { player->SendDirectMessage(data); }); + } + return; + } case CHAT_MSG_MONSTER_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: { @@ -347,18 +364,6 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket* data, } break; } - case CHAT_MSG_MONSTER_PARTY: - if (!whisperTarget) - return; - - if (Player const* player = whisperTarget->ToPlayer()) - { - if (Group* group = const_cast<Group*>(player->GetGroup())) - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - if (Player* member = itr->GetSource()) - member->GetSession()->SendPacket(data); - } - return; default: break; } diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 49d83b91353..d6fa2b2492c 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -24,6 +24,15 @@ #include "SharedDefines.h" #include "Opcodes.h" +enum CreatureTextRange +{ + TEXT_RANGE_NORMAL = 0, + TEXT_RANGE_AREA = 1, + TEXT_RANGE_ZONE = 2, + TEXT_RANGE_MAP = 3, + TEXT_RANGE_WORLD = 4 +}; + struct CreatureTextEntry { uint32 entry; @@ -37,15 +46,7 @@ struct CreatureTextEntry uint32 duration; uint32 sound; uint32 BroadcastTextId; -}; - -enum CreatureTextRange -{ - TEXT_RANGE_NORMAL = 0, - TEXT_RANGE_AREA = 1, - TEXT_RANGE_ZONE = 2, - TEXT_RANGE_MAP = 3, - TEXT_RANGE_WORLD = 4 + CreatureTextRange TextRange; }; struct CreatureTextLocale @@ -55,9 +56,7 @@ struct CreatureTextLocale struct CreatureTextId { - CreatureTextId(uint32 e, uint32 g, uint32 i) : entry(e), textGroup(g), textId(i) - { - } + CreatureTextId(uint32 e, uint32 g, uint32 i) : entry(e), textGroup(g), textId(i) { } bool operator<(CreatureTextId const& right) const { @@ -69,9 +68,9 @@ struct CreatureTextId uint32 textId; }; -typedef std::vector<CreatureTextEntry> CreatureTextGroup; //texts in a group -typedef std::unordered_map<uint8, CreatureTextGroup> CreatureTextHolder; //groups for a creature by groupid -typedef std::unordered_map<uint32, CreatureTextHolder> CreatureTextMap; //all creatures by entry +typedef std::vector<CreatureTextEntry> CreatureTextGroup; // texts in a group +typedef std::unordered_map<uint8, CreatureTextGroup> CreatureTextHolder; // groups for a creature by groupid +typedef std::unordered_map<uint32, CreatureTextHolder> CreatureTextMap; // all creatures by entry typedef std::map<CreatureTextId, CreatureTextLocale> LocaleCreatureTextMap; @@ -83,8 +82,8 @@ typedef std::unordered_map<ObjectGuid, CreatureTextRepeatGroup> CreatureTextRepe class CreatureTextMgr { private: - CreatureTextMgr() { }; - ~CreatureTextMgr() { }; + CreatureTextMgr() { } + ~CreatureTextMgr() { } public: static CreatureTextMgr* instance() @@ -101,11 +100,11 @@ class CreatureTextMgr void SendEmote(Unit* source, uint32 emote); //if sent, returns the 'duration' of the text else 0 if error - uint32 SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget = NULL, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = NULL); + uint32 SendChat(Creature* source, uint8 textGroup, WorldObject const* whisperTarget = nullptr, ChatMsg msgType = CHAT_MSG_ADDON, Language language = LANG_ADDON, CreatureTextRange range = TEXT_RANGE_NORMAL, uint32 sound = 0, Team team = TEAM_OTHER, bool gmOnly = false, Player* srcPlr = nullptr); bool TextExist(uint32 sourceEntry, uint8 textGroup); std::string GetLocalizedChatString(uint32 entry, uint8 gender, uint8 textGroup, uint32 id, LocaleConstant locale) const; - template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = NULL, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; + template<class Builder> void SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget = nullptr, CreatureTextRange range = TEXT_RANGE_NORMAL, Team team = TEAM_OTHER, bool gmOnly = false) const; private: CreatureTextRepeatIds GetRepeatGroup(Creature* source, uint8 textGroup); @@ -181,7 +180,7 @@ class CreatureTextLocalizer }; template<class Builder> -void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget /*= NULL*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) const +void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder, ChatMsg msgType, WorldObject const* whisperTarget /*= nullptr*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, Team team /*= TEAM_OTHER*/, bool gmOnly /*= false*/) const { if (!source) return; @@ -190,6 +189,18 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder switch (msgType) { + case CHAT_MSG_MONSTER_PARTY: + { + if (!whisperTarget) + return; + + if (Player* whisperPlayer = const_cast<Player*>(whisperTarget->ToPlayer())) + { + if (Group* group = whisperPlayer->GetGroup()) + group->BroadcastWorker(localizer); + } + return; + } case CHAT_MSG_MONSTER_WHISPER: case CHAT_MSG_RAID_BOSS_WHISPER: { @@ -240,7 +251,7 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder SessionMap const& smap = sWorld->GetAllSessions(); for (SessionMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) if (Player* player = iter->second->GetPlayer()) - if (player->GetSession() && (!team || Team(player->GetTeam()) == team) && (!gmOnly || player->IsGameMaster())) + if ((!team || Team(player->GetTeam()) == team) && (!gmOnly || player->IsGameMaster())) localizer(player); return; } diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index e9039da892c..2fcdd276bdc 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -420,7 +420,7 @@ class npc_eye_of_acherus : public CreatureScript for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) me->SetSpeed(UnitMoveType(i), owner->GetSpeedRate(UnitMoveType(i)), true); - TalkToMap(TALK_CONTROL, owner); + Talk(TALK_CONTROL, owner); } me->SetDisableGravity(false); DoCast(me, SPELL_EYE_FLIGHT); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp index ae0fa2aa564..c25a061d622 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/instance_culling_of_stratholme.cpp @@ -163,7 +163,7 @@ class instance_culling_of_stratholme : public InstanceMapScript // Summon Chromie and global whisper if (Creature* chromie = instance->SummonCreature(NPC_CHROMIE_2, ChromieSummonPos[0])) if (!instance->GetPlayers().isEmpty()) - chromie->AI()->TalkToMap(SAY_CRATES_COMPLETED); + chromie->AI()->Talk(SAY_CRATES_COMPLETED); } DoUpdateWorldState(WORLDSTATE_CRATES_REVEALED, _crateCount); break; @@ -277,17 +277,17 @@ class instance_culling_of_stratholme : public InstanceMapScript case 25: if (instance->HavePlayers()) if (Creature* chromie = instance->GetCreature(_chromieGUID)) - chromie->AI()->TalkToMap(SAY_INFINITE_START); + chromie->AI()->Talk(SAY_INFINITE_START); break; case 5: if (instance->HavePlayers()) if (Creature* chromie = instance->GetCreature(_chromieGUID)) - chromie->AI()->TalkToMap(SAY_INFINITE); + chromie->AI()->Talk(SAY_INFINITE); break; case 0: if (instance->HavePlayers()) if (Creature* chromie = instance->GetCreature(_chromieGUID)) - chromie->AI()->TalkToMap(SAY_INFINITE_FAIL); + chromie->AI()->Talk(SAY_INFINITE_FAIL); if (Creature* infinite = instance->GetCreature(_infiniteGUID)) { diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 5862453731e..bd1a345e55b 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -672,7 +672,7 @@ public: Talk(SAY_BUFF_SPARK); } else if (spell->Id == SPELL_MALYGOS_BERSERK) - TalkToMap(EMOTE_HIT_BERSERKER_TIMER); + Talk(EMOTE_HIT_BERSERKER_TIMER); } void MoveInLineOfSight(Unit* who) override @@ -1121,7 +1121,7 @@ public: npc_power_sparkAI(Creature* creature) : ScriptedAI(creature) { _instance = creature->GetInstanceScript(); - TalkToMap(EMOTE_POWER_SPARK_SUMMONED); + Talk(EMOTE_POWER_SPARK_SUMMONED); MoveToMalygos(); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index f5d9913bc5b..e83901c8557 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -25,7 +25,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PrepareStatement(WORLD_SEL_QUEST_POOLS, "SELECT entry, pool_entry FROM pool_quest", CONNECTION_SYNCH); PrepareStatement(WORLD_DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC); - PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound, BroadcastTextID FROM creature_text", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT entry, groupid, id, text, type, language, probability, emote, duration, sound, BroadcastTextId, TextRange FROM creature_text", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH); PrepareStatement(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC); |