Core/CreatureTextMgr: Fixed creature yell range
This commit is contained in:
@@ -308,7 +308,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
||||
|
||||
switch (msgType)
|
||||
{
|
||||
case CHAT_MSG_YELL:
|
||||
case CHAT_MSG_MONSTER_YELL:
|
||||
dist = sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL);
|
||||
break;
|
||||
case CHAT_MSG_MONSTER_EMOTE:
|
||||
@@ -339,6 +339,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
||||
uint32 areaId = source->GetAreaId();
|
||||
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
||||
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 (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid
|
||||
@@ -347,11 +348,13 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_ZONE:
|
||||
{
|
||||
uint32 zoneId = source->GetZoneId();
|
||||
Map::PlayerList const& pList = source->GetMap()->GetPlayers();
|
||||
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 (data->GetOpcode() == SMSG_MESSAGECHAT)//override whisperguid with actual player's guid
|
||||
@@ -360,6 +363,7 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_MAP:
|
||||
{
|
||||
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()))
|
||||
(itr->getSource())->GetSession()->SendPacket(data);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_WORLD:
|
||||
{
|
||||
const SessionMap smap = sWorld->GetAllSessions();
|
||||
@@ -385,8 +389,8 @@ void CreatureTextMgr::SendChatPacket(WorldPacket *data, WorldObject* source, Cha
|
||||
plr->GetSession()->SendPacket(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_NORMAL:
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user