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

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


  @Override
  public void onReload()
  {
    for (String element : ZONES)
    {
      Zone zone = ReflectionUtils.getZone(element);
      zone.removeListener(_zoneListener);
    }
    if (_buffTask != null)
    {
      _buffTask.cancel(false);
      _buffTask = null;
View Full Code Here


    @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

   * Method getMostDamagedClan.
   * @return Clan
   */
  public Clan getMostDamagedClan()
  {
    ClanHallSiegeEvent siegeEvent = getEvent(ClanHallSiegeEvent.class);
    Player temp = null;
    Map<Player, Integer> damageMap = new HashMap<>();
    for (AggroList.HateInfo info : getAggroList().getPlayableMap().values())
    {
      Playable killer = (Playable) info.attacker;
      int damage = info.damage;
      if (killer.isPet() || killer.isServitor())
      {
        temp = killer.getPlayer();
      }
      else if (killer.isPlayer())
      {
        temp = (Player) killer;
      }
      if ((temp == null) || (siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, temp.getClan()) == null))
      {
        continue;
      }
      if (!damageMap.containsKey(temp))
      {
View Full Code Here

    final NpcInstance actor = getActor();
    super.onEvtDead(killer);
    ZONE_1.setActive(false);
    ZONE_2.setActive(false);
    Functions.npcShout(actor, NpcString.AARGH_IF_I_DIE_THEN_THE_MAGIC_FORCE_FIELD_OF_BLOOD_WILL);
    final ClanHallSiegeEvent siegeEvent = actor.getEvent(ClanHallSiegeEvent.class);
    if (siegeEvent == null)
    {
      return;
    }
    final SpawnExObject spawnExObject = siegeEvent.getFirstObject(ClanHallSiegeEvent.BOSS);
    final NpcInstance lidiaNpc = spawnExObject.getFirstSpawned();
    if (lidiaNpc.getCurrentHpRatio() == 1.)
    {
      lidiaNpc.setCurrentHp(lidiaNpc.getMaxHp() >> 1, true);
    }
View Full Code Here

      setCurrentHp(1, true);
      for (Creature cha : World.getAroundCharacters(this))
      {
        ThreadPoolManager.getInstance().execute(new GameObjectTasks.NotifyAITask(cha, CtrlEvent.EVT_FORGET_OBJECT, this, null));
      }
      ClanHallSiegeEvent siegeEvent = getEvent(ClanHallSiegeEvent.class);
      if (siegeEvent == null)
      {
        return;
      }
      SpawnExObject obj = siegeEvent.getFirstObject(ClanHallSiegeEvent.BOSS);
      for (int i = 0; i < 3; i++)
      {
        final NpcInstance npc = obj.getSpawns().get(i).getFirstSpawned();
        Functions.npcSay(npc, ((_34SiegeGuard) npc).teleChatSay());
        npc.broadcastPacket(new MagicSkillUse(npc, npc, 4235, 1, 10000, 0));
        _teleportTask = ThreadPoolManager.getInstance().schedule(new RunnableImpl()
        {
          @Override
          public void runImpl()
          {
            Location loc = Location.findAroundPosition(177134, -18807, -2256, 50, 100, npc.getGeoIndex());
            npc.teleToLocation(loc);
            if (npc == GustavInstance.this)
            {
              npc.reduceCurrentHp(npc.getCurrentHp(), 0, npc, null, false, false, false, false, false, false, false);
            }
          }
        }, 10000L);
      }
    }
    else
    {
      if (_teleportTask != null)
      {
        _teleportTask.cancel(false);
        _teleportTask = null;
      }
      SiegeEvent<?, ?> siegeEvent = getEvent(SiegeEvent.class);
      if (siegeEvent == null)
      {
        return;
      }
      siegeEvent.processStep(getMostDamagedClan());
      super.onDeath(killer);
    }
  }
View Full Code Here

   * Method getMostDamagedClan.
   * @return Clan
   */
  public Clan getMostDamagedClan()
  {
    ClanHallSiegeEvent siegeEvent = getEvent(ClanHallSiegeEvent.class);
    Player temp = null;
    Map<Player, Integer> damageMap = new HashMap<>();
    for (AggroList.HateInfo info : getAggroList().getPlayableMap().values())
    {
      Playable killer = (Playable) info.attacker;
      int damage = info.damage;
      if (killer.isPet() || killer.isServitor())
      {
        temp = killer.getPlayer();
      }
      else if (killer.isPlayer())
      {
        temp = (Player) killer;
      }
      if ((temp == null) || (siegeEvent.getSiegeClan(SiegeEvent.ATTACKERS, temp.getClan()) == null))
      {
        continue;
      }
      if (!damageMap.containsKey(temp))
      {
View Full Code Here

TOP

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

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.