Package lineage2.gameserver.model.entity.events.impl

Examples of lineage2.gameserver.model.entity.events.impl.ClanHallTeamBattleEvent


    @Override
    public void runImpl()
    {
      for (String element : ZONES)
      {
        Zone zone = ReflectionUtils.getZone(element);
        NpcInstance npc = getKasha(zone);
        if ((npc != null) && (zone != null))
        {
          int curseLvl = 0;
          int yearningLvl = 0;
          int despairLvl = 0;
          for (Creature c : zone.getObjects())
          {
            if (c.isMonster() && !c.isDead())
            {
              if (getRealNpcId((NpcInstance) c) == mobs[0])
              {
                curseLvl++;
              }
              else if (getRealNpcId((NpcInstance) c) == mobs[1])
              {
                yearningLvl++;
              }
              else if (getRealNpcId((NpcInstance) c) == mobs[2])
              {
                despairLvl++;
              }
            }
          }
          if ((yearningLvl > 0) || (curseLvl > 0) || (despairLvl > 0))
          {
            for (Creature cha : zone.getInsidePlayables())
            {
              boolean casted = false;
              if (curseLvl > 0)
              {
                addEffect(npc, cha.getPlayer(), SkillTable.getInstance().getInfo(_buffs[0], curseLvl), true);
View Full Code Here


  private void init()
  {
    _zoneListener = new ZoneListener();
    for (String s : zones)
    {
      Zone zone = ReflectionUtils.getZone(s);
      zone.addListener(_zoneListener);
    }
  }
View Full Code Here

   * Method init.
   */
  private void init()
  {
    _zoneListener = new ZoneListener();
    Zone zone = ReflectionUtils.getZone(ZONE_NAME);
    if (zone != null)
    {
      zone.addListener(_zoneListener);
    }
  }
View Full Code Here

    {
      return;
    }
    if (command.equalsIgnoreCase("request_nightzaken"))
    {
      Reflection r = player.getActiveReflection();
      if (r != null)
      {
        if (player.canReenterInstance(nightZakenIzId))
        {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      }
      else if (player.canEnterInstance(nightZakenIzId))
      {
        ReflectionUtils.enterReflection(player, new ZakenNight(), nightZakenIzId);
      }
    }
    else if (command.equalsIgnoreCase("request_dayzaken"))
    {
      Reflection r = player.getActiveReflection();
      if (r != null)
      {
        if (player.canReenterInstance(dayZakenIzId))
        {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      }
      else if (player.canEnterInstance(dayZakenIzId))
      {
        ReflectionUtils.enterReflection(player, new ZakenDay(), dayZakenIzId);
      }
    }
    else if (command.equalsIgnoreCase("request_ultrazaken"))
    {
      Reflection r = player.getActiveReflection();
      if (r != null)
      {
        if (player.canReenterInstance(ultraZakenIzId))
        {
          player.teleToLocation(r.getTeleportLoc(), r);
        }
      }
      else if (player.canEnterInstance(ultraZakenIzId))
      {
        ReflectionUtils.enterReflection(player, new ZakenDay83(), ultraZakenIzId);
View Full Code Here

      else if (Rnd.chance(50))
      {
        nextId = getNextVoid(npcId);
      }
    }
    final Reflection r = actor.getReflection();
    boolean spawnPossible = true;
    if (r instanceof KamalokaNightmare)
    {
      final KamalokaNightmare kama = (KamalokaNightmare) r;
      kama.addKilledKanabion(type);
View Full Code Here

   */
  @Override
  public void onBypassFeedback(final Player player, final String command)
  {
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    Clan clan = player.getClan();
    if (command.equalsIgnoreCase("registrationMenu"))
    {
      if (!checkCond(player, true))
      {
        return;
      }
      showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_1.htm");
    }
    else if (command.equalsIgnoreCase("registerAsClan"))
    {
      if (!checkCond(player, false))
      {
        return;
      }
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        showFlagInfo(player, siegeClans.indexOf(siegeClan));
        return;
      }
      QuestState questState = player.getQuestState(_655_AGrandPlanForTamingWildBeasts.class);
      if ((questState == null) || (questState.getQuestItemsCount(8293) != 1))
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_27.htm");
        return;
      }
      questState.exitCurrentQuest(true);
      register(player);
    }
    else if (command.equalsIgnoreCase("registerAsMember"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() == player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_5.htm");
        return;
      }
      if (siegeClan.getPlayers().contains(player.getObjectId()))
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_9.htm");
      }
      else
      {
        if (siegeClan.getPlayers().size() >= 18)
        {
          showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_8.htm");
          return;
        }
        siegeClan.getPlayers().add(player.getObjectId());
        SiegePlayerDAO.getInstance().insert(clanHall, clan.getClanId(), player.getObjectId());
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_9.htm");
      }
    }
    else if (command.startsWith("formAlliance"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_10.htm");
        return;
      }
      if (siegeClan.getParam() > 0)
      {
        return;
      }
      StringTokenizer t = new StringTokenizer(command);
      t.nextToken();
      int npcId = Integer.parseInt(t.nextToken());
      siegeClan.setParam(npcId);
      SiegeClanDAO.getInstance().update(clanHall, siegeClan);
      showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
    }
    else if (command.equalsIgnoreCase("setNpc"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_10.htm");
        return;
      }
      showChatWindow(player, npcDialog(siegeClan));
    }
    else if (command.equalsIgnoreCase("viewNpc"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/farm_kel_mahum_messenger_7.htm");
        return;
      }
      String file;
      if (siegeClan.getParam() == 0)
      {
        file = "residence2/clanhall/agit_oel_mahum_messeger_10.htm";
      }
      else
      {
        file = npcDialog(siegeClan);
      }
      showChatWindow(player, file);
    }
    else if (command.equalsIgnoreCase("listClans"))
    {
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/farm_messenger003.htm");
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      for (int i = 0; i < 5; i++)
      {
        CTBSiegeClanObject siegeClan = CollectionUtils.safeGet(siegeClans, i);
        if (siegeClan != null)
        {
View Full Code Here

   */
  private void register(Player player)
  {
    Clan clan = player.getClan();
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    CTBSiegeClanObject siegeClan = new CTBSiegeClanObject(SiegeEvent.ATTACKERS, clan, 0);
    siegeClan.getPlayers().add(player.getObjectId());
    siegeEvent.addObject(SiegeEvent.ATTACKERS, siegeClan);
    SiegeClanDAO.getInstance().insert(clanHall, siegeClan);
    SiegePlayerDAO.getInstance().insert(clanHall, clan.getClanId(), player.getObjectId());
    List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
    showFlagInfo(player, siegeClans.indexOf(siegeClan));
  }
View Full Code Here

   */
  private boolean checkCond(Player player, boolean regMenu)
  {
    Clan clan = player.getClan();
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
    SiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
    if (siegeEvent.isRegistrationOver())
    {
      showChatWindow(player, "quests/_655_AGrandPlanForTamingWildBeasts/farm_messenger_q0655_11.htm", "%siege_time%", TimeUtils.toSimpleFormat(clanHall.getSiegeDate()));
      return false;
    }
    if (regMenu && (siegeClan != null))
View Full Code Here

   */
  @Override
  public void showChatWindow(Player player, int val, Object... arg)
  {
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
   
    if (_timeout > System.currentTimeMillis())
    {
      showChatWindow(player, "residence2/clanhall/agit_mass_teleporter001.htm");
      return;
    }
   
    if (isInRange(player, INTERACTION_DISTANCE))
    {
      _timeout = System.currentTimeMillis() + 60000L;
     
      List<CTBTeamObject> locs = siegeEvent.getObjects(ClanHallTeamBattleEvent.TRYOUT_PART);
     
      CTBTeamObject object = locs.get(_flagId);
      if (object.getFlag() != null)
      {
        for (Player $player : World.getAroundPlayers(this, 400, 100))
View Full Code Here

   */
  @Override
  public void onBypassFeedback(final Player player, final String command)
  {
    ClanHall clanHall = getClanHall();
    ClanHallTeamBattleEvent siegeEvent = clanHall.getSiegeEvent();
    Clan clan = player.getClan();
    if (command.equalsIgnoreCase("registrationMenu"))
    {
      if (!checkCond(player, true))
      {
        return;
      }
      showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_1.htm");
    }
    else if (command.equalsIgnoreCase("registerAsClan"))
    {
      if (!checkCond(player, false))
      {
        return;
      }
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        showFlagInfo(player, siegeClans.indexOf(siegeClan));
        return;
      }
      QuestState questState = player.getQuestState(_504_CompetitionForTheBanditStronghold.class);
      if ((questState == null) || (questState.getQuestItemsCount(5009) != 1))
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_24.htm");
        return;
      }
      questState.exitCurrentQuest(true);
      register(player);
    }
    else if (command.equalsIgnoreCase("registerByOffer"))
    {
      if (!checkCond(player, false))
      {
        return;
      }
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, clan);
      if (siegeClan != null)
      {
        showFlagInfo(player, siegeClans.indexOf(siegeClan));
        return;
      }
      if (!player.consumeItem(ItemTemplate.ITEM_ID_ADENA, 200000))
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_26.htm");
        return;
      }
      register(player);
    }
    else if (command.equalsIgnoreCase("viewNpc"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_7.htm");
        return;
      }
      String file;
      switch ((int) siegeClan.getParam())
      {
        case 0:
          file = "residence2/clanhall/agit_oel_mahum_messeger_10.htm";
          break;
        case 35428:
          file = "residence2/clanhall/agit_oel_mahum_messeger_11.htm";
          break;
        case 35429:
          file = "residence2/clanhall/agit_oel_mahum_messeger_12.htm";
          break;
        case 35430:
          file = "residence2/clanhall/agit_oel_mahum_messeger_13.htm";
          break;
        case 35431:
          file = "residence2/clanhall/agit_oel_mahum_messeger_14.htm";
          break;
        case 35432:
          file = "residence2/clanhall/agit_oel_mahum_messeger_15.htm";
          break;
        default:
          return;
      }
      showChatWindow(player, file);
    }
    else if (command.startsWith("formAlliance"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() != player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_10.htm");
        return;
      }
      StringTokenizer t = new StringTokenizer(command);
      t.nextToken();
      int npcId = Integer.parseInt(t.nextToken());
      siegeClan.setParam(npcId);
      SiegeClanDAO.getInstance().update(clanHall, siegeClan);
      showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
    }
    else if (command.equalsIgnoreCase("registerAsMember"))
    {
      CTBSiegeClanObject siegeClan = siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if (siegeClan == null)
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_7.htm");
        return;
      }
      if (siegeClan.getClan().getLeaderId() == player.getObjectId())
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_5.htm");
        return;
      }
      if (siegeClan.getPlayers().contains(player.getObjectId()))
      {
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
      }
      else
      {
        if (siegeClan.getPlayers().size() >= 18)
        {
          showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_8.htm");
          return;
        }
        siegeClan.getPlayers().add(player.getObjectId());
        SiegePlayerDAO.getInstance().insert(clanHall, clan.getClanId(), player.getObjectId());
        showChatWindow(player, "residence2/clanhall/agit_oel_mahum_messeger_9.htm");
      }
    }
    else if (command.equalsIgnoreCase("listClans"))
    {
      NpcHtmlMessage msg = new NpcHtmlMessage(player, this);
      msg.setFile("residence2/clanhall/azit_messenger003.htm");
      List<CTBSiegeClanObject> siegeClans = siegeEvent.getObjects(SiegeEvent.ATTACKERS);
      for (int i = 0; i < 5; i++)
      {
        CTBSiegeClanObject siegeClan = CollectionUtils.safeGet(siegeClans, i);
        if (siegeClan != null)
        {
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.events.impl.ClanHallTeamBattleEvent

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.