Package lineage2.gameserver.model.entity.events.objects

Examples of lineage2.gameserver.model.entity.events.objects.CMGSiegeClanObject


    {
      showChatWindow(player, "residence2/clanhall/game_manager003.htm");
      return;
    }
    List<CMGSiegeClanObject> siegeClans = miniGameEvent.getObjects(SiegeEvent.ATTACKERS);
    CMGSiegeClanObject siegeClan = miniGameEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
    if (siegeClan == null)
    {
      showChatWindow(player, "residence2/clanhall/game_manager014.htm");
      return;
    }
    if (siegeClan.getPlayers().isEmpty())
    {
      Party party = player.getParty();
      if (party == null)
      {
        showChatWindow(player, player.isClanLeader() ? "residence2/clanhall/game_manager005.htm" : "residence2/clanhall/game_manager002.htm");
        return;
      }
      if (!player.isClanLeader())
      {
        showChatWindow(player, "residence2/clanhall/game_manager004.htm");
        return;
      }
      if (party.getMemberCount() < 5)
      {
        showChatWindow(player, "residence2/clanhall/game_manager003.htm");
        return;
      }
      if (party.getPartyLeader() != player)
      {
        showChatWindow(player, "residence2/clanhall/game_manager006.htm");
        return;
      }
      for (Player member : party.getPartyMembers())
      {
        if (member.getClan() != player.getClan())
        {
          showChatWindow(player, "residence2/clanhall/game_manager007.htm");
          return;
        }
      }
      int index = siegeClans.indexOf(siegeClan);
      SpawnExObject spawnEx = miniGameEvent.getFirstObject("arena_" + index);
      Location loc = (Location) spawnEx.getSpawns().get(0).getCurrentSpawnRange();
      for (Player member : party.getPartyMembers())
      {
        siegeClan.addPlayer(member.getObjectId());
        member.teleToLocation(Location.coordsRandomize(loc, 100, 200));
      }
    }
    else
    {
View Full Code Here


      return;
    }
   
    final Player player = character.getPlayer();
   
    CMGSiegeClanObject siegeClan = null;
    final List<CMGSiegeClanObject> attackers = miniGameEvent.getObjects(SiegeEvent.ATTACKERS);
    for (CMGSiegeClanObject $ : attackers)
    {
      if ($.isParticle(player))
      {
View Full Code Here

    if (miniGameEvent == null)
    {
      return;
    }
    Player player = killer.getPlayer();
    CMGSiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
    if (siegeClanObject == null)
    {
      return;
    }
    _winner = siegeClanObject;
View Full Code Here

      {
        if (!player.consumeItem(ITEM_ID, count))
        {
          return;
        }
        CMGSiegeClanObject siegeClanObject = new CMGSiegeClanObject(SiegeEvent.ATTACKERS, clan, count);
        miniGameEvent.addObject(SiegeEvent.ATTACKERS, siegeClanObject);
        SiegeClanDAO.getInstance().insert(clanHall, siegeClanObject);
        showChatWindow(player, "residence2/clanhall/messenger_yetti009.htm");
      }
    }
    else if (command.equalsIgnoreCase("cancel"))
    {
      if (miniGameEvent.isRegistrationOver())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti017.htm");
        return;
      }
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 3))
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti011.htm");
        return;
      }
      if (clan.getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      SiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClanObject == null)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti016.htm");
      }
      else
      {
        miniGameEvent.removeObject(SiegeEvent.ATTACKERS, siegeClanObject);
        SiegeClanDAO.getInstance().delete(clanHall, siegeClanObject);
        ItemFunctions.addItem(player, ITEM_ID, siegeClanObject.getParam() / 2L, true);
        showChatWindow(player, "residence2/clanhall/messenger_yetti005.htm");
      }
    }
    else if (command.equalsIgnoreCase("refund"))
    {
      if (miniGameEvent.isRegistrationOver())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      Clan clan = player.getClan();
      if ((clan == null) || (clan.getLevel() < 3))
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti011.htm");
        return;
      }
      if (clan.getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti010.htm");
        return;
      }
      SiegeClanObject siegeClanObject = miniGameEvent.getSiegeClan(ClanHallMiniGameEvent.REFUND, clan);
      if (siegeClanObject == null)
      {
        showChatWindow(player, "residence2/clanhall/messenger_yetti020.htm");
      }
      else
      {
        miniGameEvent.removeObject(ClanHallMiniGameEvent.REFUND, siegeClanObject);
        SiegeClanDAO.getInstance().delete(clanHall, siegeClanObject);
        ItemFunctions.addItem(player, ITEM_ID, siegeClanObject.getParam(), true);
        showChatWindow(player, "residence2/clanhall/messenger_yetti019.htm");
      }
    }
    else
    {
View Full Code Here

    final int y = Integer.parseInt(param[1]);
    final int z = Integer.parseInt(param[2]);
    final int castleId = (param.length > 4) ? Integer.parseInt(param[3]) : 0;
    if (player.getReflection().isDefault())
    {
      final Castle castle = (castleId > 0) ? ResidenceHolder.getInstance().getResidence(Castle.class, castleId) : null;
      if ((castle != null) && castle.getSiegeEvent().isInProgress())
      {
        player.sendPacket(Msg.YOU_CANNOT_TELEPORT_TO_A_VILLAGE_THAT_IS_IN_A_SIEGE);
        return;
      }
    }
View Full Code Here

    public void onZoneEnter(Zone zone, Creature cha)
    {
      if (zone.getParams() == null || !cha.isPlayer())
        return;

      Castle castle = ResidenceHolder.getInstance().getResidence(zone.getTemplate().getIndex());

      if (castle != null)
      { 
        if(_side.ordinal()==1 || _side.ordinal()==0)
        {
View Full Code Here

   * Method enter_dc.
   */
  public void enter_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * Method exit_dc.
   */
  public void exit_dc()
  {
    final Player player = getSelf();
    final NpcInstance npc = getNpc();
    if ((player == null) || (npc == null))
    {
      return;
    }
    if (!NpcInstance.canBypassCheck(player, npc))
View Full Code Here

   * @return boolean
   */
  @Override
  protected boolean thinkActive()
  {
    final NpcInstance actor = getActor();
    if (actor == null)
    {
      return true;
    }
    for (Player player : World.getAroundPlayers(actor, 200, 200))
View Full Code Here

   * @param damage int
   */
  @Override
  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if (_firstTimeAttacked)
    {
      _firstTimeAttacked = false;
      if (Rnd.chance(25))
      {
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.events.objects.CMGSiegeClanObject

Copyright © 2018 www.massapicom. 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.