Package l2p.gameserver.model.instances

Source Code of l2p.gameserver.model.instances.L2ClanHallMessengerInstance

package l2p.gameserver.model.instances;

import l2p.gameserver.model.L2Player;
import l2p.gameserver.model.entity.residence.ClanHall;
import l2p.gameserver.model.entity.siege.clanhall.ClanHallSiege;
import l2p.gameserver.model.entity.siege.territory.TerritorySiege;
import l2p.gameserver.serverpackets.NpcHtmlMessage;
import l2p.gameserver.serverpackets.SiegeInfo;
import l2p.gameserver.templates.L2NpcTemplate;

public class L2ClanHallMessengerInstance extends L2NpcInstance
{
  public L2ClanHallMessengerInstance(int objectId, L2NpcTemplate template)
  {
    super(objectId, template);
  }

  @Override
  public void showChatWindow(L2Player player, int val)
  {
    ClanHall clanhall = getClanHall();
    if(clanhall == null)
    {
      return;
    }
    ClanHallSiege siege = clanhall.getSiege();
    if(siege == null)
    {
      return;
    }
    if(siege.isInProgress() || siege.isRegistrationOver() || TerritorySiege.isInProgress())
    {
      NpcHtmlMessage html = new NpcHtmlMessage(player, this);
      html.setHtml("<html><body><font color=\"LEVEL\">I can't do anything for you right now.</font></body></html>");
      player.sendPacket(html);
    }
    else
    {
      player.sendPacket(new SiegeInfo(getClanHall()));
    }
  }
}
TOP

Related Classes of l2p.gameserver.model.instances.L2ClanHallMessengerInstance

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.