Core/CreatureTextMgr: Fixed creature yell range
This commit is contained in:
@@ -299,7 +299,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C
|
|||||||
*data << uint8(0); // ChatTag
|
*data << uint8(0); // ChatTag
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const
|
void CreatureTextMgr::SendChatPacket(WorldPacket* data, WorldObject* source, ChatMsg msgType, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) const
|
||||||
{
|
{
|
||||||
if (!source)
|
if (!source)
|
||||||
return;
|
return;
|
||||||
@@ -308,7 +308,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
|||||||
|
|
||||||
switch (msgType)
|
switch (msgType)
|
||||||
{
|
{
|
||||||
case CHAT_MSG_YELL:
|
case CHAT_MSG_MONSTER_YELL:
|
||||||
dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL);
|
dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL);
|
||||||
break;
|
break;
|
||||||
case CHAT_MSG_MONSTER_EMOTE:
|
case CHAT_MSG_MONSTER_EMOTE:
|
||||||
@@ -339,6 +339,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
|||||||
uint32 areaId = source->GetAreaId();
|
uint32 areaId = source->GetAreaId();
|
||||||
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
||||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||||
|
{
|
||||||
if (itr->getSource()->GetAreaId() == areaId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster()))
|
if (itr->getSource()->GetAreaId() == areaId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster()))
|
||||||
{
|
{
|
||||||
if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid
|
if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid
|
||||||
@@ -347,11 +348,13 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
case TEXT_RANGE_ZONE:
|
case TEXT_RANGE_ZONE:
|
||||||
{
|
{
|
||||||
uint32 zoneId = source->GetZoneId();
|
uint32 zoneId = source->GetZoneId();
|
||||||
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
||||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||||
|
{
|
||||||
if (itr->getSource()->GetZoneId() == zoneId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster()))
|
if (itr->getSource()->GetZoneId() == zoneId && (!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster()))
|
||||||
{
|
{
|
||||||
if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid
|
if (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid
|
||||||
@@ -360,6 +363,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
case TEXT_RANGE_MAP:
|
case TEXT_RANGE_MAP:
|
||||||
{
|
{
|
||||||
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
||||||
@@ -370,8 +374,8 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
|||||||
if ((!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster()))
|
if ((!team || Team(itr->getSource()->GetTeam()) == team) && (!gmOnly || itr->getSource()->isGameMaster()))
|
||||||
(itr->getSource())->GetSession()->SendPacket(data);
|
(itr->getSource())->GetSession()->SendPacket(data);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
case TEXT_RANGE_WORLD:
|
case TEXT_RANGE_WORLD:
|
||||||
{
|
{
|
||||||
const SessionMap smap = sWorld->GetAllSessions();
|
const SessionMap smap = sWorld->GetAllSessions();
|
||||||
@@ -385,8 +389,8 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
|||||||
plr->GetSession()->SendPacket(data);
|
plr->GetSession()->SendPacket(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
case TEXT_RANGE_NORMAL:
|
case TEXT_RANGE_NORMAL:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user