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

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


      {
        final int level = effect.get(0).getSkill().getLevel();
        if (level < 10)
        {
          effect.get(0).exit();
          final Skill skill = SkillTable.getInstance().getInfo(DeBuff, level + 1);
          skill.getEffects(actor, attacker, false, false);
        }
      }
      else
      {
        final Skill skill = SkillTable.getInstance().getInfo(DeBuff, 1);
        if (skill != null)
        {
          skill.getEffects(actor, attacker, false, false);
        }
        else
        {
          System.out.println("Skill " + DeBuff + " is null, fix it.");
        }
View Full Code Here


  protected void onEvtAttacked(Creature attacker, int damage)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && attacker.isPlayer())
    {
      final Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
    }
    if (attacker.isPet())
    {
      super.onEvtAttacked(attacker, damage);
View Full Code Here

  protected void onEvtAggression(Creature attacker, int aggro)
  {
    final NpcInstance actor = getActor();
    if ((attacker != null) && attacker.isPlayer())
    {
      final Skill skill = SkillTable.getInstance().getInfo(5423, 12);
      skill.getEffects(actor, attacker, false, false);
      return;
    }
  }
View Full Code Here

    _zoneListener = new ZoneListener();
    for (String element : ZONES)
    {
      int random = Rnd.get(60 * 1000 * 1, 60 * 1000 * 7);
      int message;
      Zone zone = ReflectionUtils.getZone(element);
      ThreadPoolManager.getInstance().schedule(new CampDestroyTask(zone), random);
      if (random > (5 * 60000))
      {
        message = random - (5 * 60000);
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(0, zone), message);
      }
      if (random > (3 * 60000))
      {
        message = random - (3 * 60000);
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(0, zone), message);
      }
      if (random > 60000)
      {
        message = random - 60000;
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(0, zone), message);
      }
      if (random > 15000)
      {
        message = random - 15000;
        ThreadPoolManager.getInstance().schedule(new BroadcastMessageTask(1, zone), message);
      }
      zone.addListener(_zoneListener);
    }
    _buffTask = ThreadPoolManager.getInstance().scheduleAtFixedRate(new BuffTask(), TICK_BUFF_DELAY, TICK_BUFF_DELAY);
  }
View Full Code Here

  @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

    if ((caster == null) || (skill.getId() != BALLISTA_BOMB_SKILL_ID))
    {
      return;
    }
    final Player player = caster.getPlayer();
    final FortressSiegeEvent siege = actor.getEvent(FortressSiegeEvent.class);
    final FortressSiegeEvent siege2 = player.getEvent(FortressSiegeEvent.class);
    if ((siege == null) || (!siege.equals(siege2)) || (siege.getSiegeClan(SiegeEvent.ATTACKERS, player.getClan()) == null))
    {
      return;
    }
    _bombsUseCounter++;
View Full Code Here

  @Override
  public void onEvtSpawn()
  {
    super.onEvtSpawn();
    final SiegeGuardInstance actor = getActor();
    final FortressSiegeEvent siegeEvent = actor.getEvent(FortressSiegeEvent.class);
    if (siegeEvent == null)
    {
      return;
    }
    if (siegeEvent.getResidence().getFacilityLevel(Fortress.GUARD_BUFF) > 0)
    {
      actor.doCast(SkillTable.getInstance().getInfo(5432, siegeEvent.getResidence().getFacilityLevel(Fortress.GUARD_BUFF)), actor, false);
    }
    siegeEvent.barrackAction(0, false);
  }
View Full Code Here

   */
  @Override
  public void onEvtDead(Creature killer)
  {
    final SiegeGuardInstance actor = getActor();
    final FortressSiegeEvent siegeEvent = actor.getEvent(FortressSiegeEvent.class);
    if (siegeEvent == null)
    {
      return;
    }
    siegeEvent.barrackAction(0, true);
    siegeEvent.broadcastTo(SystemMsg.THE_BARRACKS_HAVE_BEEN_SEIZED, SiegeEvent.ATTACKERS, SiegeEvent.DEFENDERS);
    Functions.npcShout(actor, NpcString.YOU_MAY_HAVE_BROKEN_OUR_ARROWS_BUT_YOU_WILL_NEVER_BREAK_OUR_WILL_ARCHERS_RETREAT);
    super.onEvtDead(killer);
    siegeEvent.checkBarracks();
  }
View Full Code Here

TOP

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

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.