Chat ban command fixed and upgraded.

This commit is contained in:
MobiusDev
2018-05-06 01:38:45 +00:00
parent 2881989633
commit 217c85eedd
26 changed files with 826 additions and 644 deletions

View File

@ -2560,7 +2560,7 @@ public final class Config
// Load ChatModeration config file (if exists)
final PropertiesParser ChatModeration = new PropertiesParser(CUSTOM_CHAT_MODERATION_CONFIG_FILE);
CHAT_ADMIN = ChatModeration.getBoolean("ChatAdmin", false);
CHAT_ADMIN = ChatModeration.getBoolean("ChatAdmin", true);
// Load CommunityBoard config file (if exists)
final PropertiesParser CommunityBoard = new PropertiesParser(CUSTOM_COMMUNITY_BOARD_CONFIG_FILE);

View File

@ -30,6 +30,9 @@ import com.l2jmobius.commons.database.DatabaseFactory;
import com.l2jmobius.gameserver.handler.IPunishmentHandler;
import com.l2jmobius.gameserver.handler.PunishmentHandler;
import com.l2jmobius.gameserver.instancemanager.PunishmentManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.skills.AbnormalVisualEffect;
/**
* @author UnAfraid
@ -234,6 +237,15 @@ public class PunishmentTask implements Runnable
}
}
if (_type.equals(PunishmentType.CHAT_BAN) && _affect.equals(PunishmentAffect.CHARACTER))
{
final L2PcInstance player = L2World.getInstance().getPlayer(Integer.valueOf(_key));
if (player != null)
{
player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}
final IPunishmentHandler handler = PunishmentHandler.getInstance().getHandler(_type);
if (handler != null)
{

View File

@ -268,6 +268,12 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (activeChar.isChatBanned())
{
activeChar.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (activeChar.getCurrentHp() < 0.5)
{