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

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


    @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 onSpawn()
  {
    super.onSpawn();
    ClanHallMiniGameEvent event = getEvent(ClanHallMiniGameEvent.class);
    if (event == null)
    {
      return;
    }
    List<Player> around = World.getAroundPlayers(this, 750, 100);
    for (Player player : around)
    {
      CMGSiegeClanObject siegeClanObject = event.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan());
      if ((siegeClanObject == null) || !siegeClanObject.getPlayers().contains(player.getObjectId()))
      {
        player.teleToLocation(event.getResidence().getOtherRestartPoint());
      }
    }
    _task = ThreadPoolManager.getInstance().scheduleAtFixedRate(new GenerateTask(), 10000L, 300000L);
  }
View Full Code Here

  /**
   * Method teleportFromArena.
   */
  public void teleportFromArena()
  {
    ClanHallMiniGameEvent event = getEvent(ClanHallMiniGameEvent.class);
    if (event == null)
    {
      return;
    }
    List<Player> around = World.getAroundPlayers(this, 750, 100);
    for (Player player : around)
    {
      player.teleToLocation(event.getResidence().getOtherRestartPoint());
    }
  }
View Full Code Here

   * @param player Player
   * @param itemId int
   */
  private void addItem(Player player, int itemId)
  {
    ClanHallMiniGameEvent event = getEvent(ClanHallMiniGameEvent.class);
    if (event == null)
    {
      return;
    }
    ItemInstance item = ItemFunctions.createItem(itemId);
View Full Code Here

    if (!canBypassCheck(player, this))
    {
      return;
    }
    ClanHall clanHall = getClanHall();
    ClanHallMiniGameEvent miniGameEvent = clanHall.getSiegeEvent();
    if (miniGameEvent == null)
    {
      return;
    }
    if (miniGameEvent.isArenaClosed())
    {
      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));
View Full Code Here

   */
  @Override
  public void onEvtSeeSpell(Skill skill, Creature character)
  {
    final RainbowYetiInstance actor = (RainbowYetiInstance) getActor();
    final ClanHallMiniGameEvent miniGameEvent = actor.getEvent(ClanHallMiniGameEvent.class);
    if (miniGameEvent == null)
    {
      return;
    }
    if (!character.isPlayer())
    {
      return;
    }
   
    final Player player = character.getPlayer();
   
    CMGSiegeClanObject siegeClan = null;
    final List<CMGSiegeClanObject> attackers = miniGameEvent.getObjects(SiegeEvent.ATTACKERS);
    for (CMGSiegeClanObject $ : attackers)
    {
      if ($.isParticle(player))
      {
        siegeClan = $;
      }
    }
   
    if (siegeClan == null)
    {
      return;
    }
   
    final int index = attackers.indexOf(siegeClan);
    int warIndex = Integer.MIN_VALUE;
   
    RainbowGourdInstance gourdInstance = null;
    RainbowGourdInstance gourdInstance2 = null;
    switch (skill.getId())
    {
      case 2240: // nectar
        if (Rnd.chance(90))
        {
          gourdInstance = getGourd(index);
          if (gourdInstance == null)
          {
            return;
          }
         
          gourdInstance.doDecrease(player);
        }
        else
        {
          actor.addMob(NpcUtils.spawnSingle(35592, actor.getX() + 10, actor.getY() + 10, actor.getZ(), 0));
        }
        break;
      case 2241: // mineral water
        warIndex = rndEx(attackers.size(), index);
        if (warIndex == Integer.MIN_VALUE)
        {
          return;
        }
       
        gourdInstance2 = getGourd(warIndex);
        if (gourdInstance2 == null)
        {
          return;
        }
        gourdInstance2.doHeal();
        break;
      case 2242: // water
        warIndex = rndEx(attackers.size(), index);
        if (warIndex == Integer.MIN_VALUE)
        {
          return;
        }
       
        gourdInstance = getGourd(index);
        gourdInstance2 = getGourd(warIndex);
        if ((gourdInstance2 == null) || (gourdInstance == null))
        {
          return;
        }
       
        gourdInstance.doSwitch(gourdInstance2);
        break;
      case 2243: // sulfur
        warIndex = rndEx(attackers.size(), index);
        if (warIndex == Integer.MIN_VALUE)
        {
          return;
        }
       
        final ZoneObject zone = miniGameEvent.getFirstObject("zone_" + warIndex);
        if (zone == null)
        {
          return;
        }
        zone.setActive(true);
View Full Code Here

TOP

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

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.