String name = saymode.getName();
int actor = saymode.getObjectId();
_type = 0;
Collection<L2Object> list = saymode.getKnownList().getKnownObjects().values();
CreatureSay cs = new CreatureSay(actor, _type, name, _text);
for(L2Object obj : list)
{
if(obj == null || !(obj instanceof L2Character))
{
continue;
}
L2Character chara = (L2Character) obj;
chara.sendPacket(cs);
}
return;
}
CreatureSay cs = new CreatureSay(activeChar.getObjectId(), _type, activeChar.getName(), _text);
switch(_type)
{
case TELL:
L2PcInstance receiver = L2World.getInstance().getPlayer(_target);
if(receiver == null){
SystemMessage sm = new SystemMessage(SystemMessageId.S1_IS_NOT_ONLINE);
sm.addString(_target);
activeChar.sendPacket(sm);
sm = null;
return;
}
if (!receiver.getBlockList().isInBlockList(activeChar.getName())
|| activeChar.isGM())
{
if(receiver.isAway())
{
activeChar.sendMessage("Player is Away try again later.");
}
if(Config.JAIL_DISABLE_CHAT && receiver.isInJail())
{
activeChar.sendMessage("Player is in jail.");
return;
}
if(receiver.isChatBanned() && !activeChar.isGM())
{
activeChar.sendMessage("Player is chat banned.");
return;
}
if (receiver.isOffline())
{
activeChar.sendMessage("Player is in offline mode.");
return;
}
if(!receiver.getMessageRefusal())
{
receiver.sendPacket(cs);
activeChar.sendPacket(new CreatureSay(activeChar.getObjectId(), _type, "->" + receiver.getName(), _text));
}
else
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.THE_PERSON_IS_IN_MESSAGE_REFUSAL_MODE));
}