Package lineage2.gameserver.model.entity

Examples of lineage2.gameserver.model.entity.Reflection


    return htmltext;
  }
 
  private void enterInstance(Player player)
  {
    Reflection r = player.getActiveReflection();
    if (r != null)
    {
      if (player.canReenterInstance(izId))
      {
        player.teleToLocation(r.getTeleportLoc(), r);
      }
    }
    else if (player.canEnterInstance(izId))
    {
      Reflection newInstance = ReflectionUtils.enterReflection(player, izId);
      synchronized (guardsOfDawn1)
      {
        for (Location spawn[] : guardsOfDawn1)
        {
          NpcInstance guard = newInstance.addSpawnWithoutRespawn(18835, spawn[0], 0);
          guard.setAI(new GuardofDawn(guard, spawn[1], spawn[2]));
        }
        for (Location spawn[] : guardsOfDawn1stationary)
        {
          NpcInstance guard = newInstance.addSpawnWithoutRespawn(18835, spawn[0], 0);
          guard.setAI(new GuardofDawnStat(guard, spawn[1]));
        }
        for (Location spawn[] : guardsOfDawnFemale)
        {
          NpcInstance guard = newInstance.addSpawnWithoutRespawn(27352, spawn[0], 0);
          guard.setAI(new GuardofDawnFemale(guard, spawn[1]));
        }
        for (Location spawn[] : guardsOfDawn2)
        {
          NpcInstance guard = newInstance.addSpawnWithoutRespawn(18834, spawn[0], 0);
          guard.setAI(new GuardofDawn(guard, spawn[1], spawn[2]));
        }
        for (Location spawn[] : guardsOfDawn2stationary)
        {
          NpcInstance guard = newInstance.addSpawnWithoutRespawn(18834, spawn[0], 0);
          guard.setAI(new GuardofDawnStat(guard, spawn[1]));
        }
      }
    }
  }
View Full Code Here


    final Creature randomHated = actor.getAggroList().getRandomHated();
    final Creature mostHated = actor.getAggroList().getMostHated();
    if (!actor.isCastingNow() && (_eternalblizzardReuseTimer < System.currentTimeMillis()))
    {
      actor.doCast(SkillTable.getInstance().getInfo(Skill_EternalBlizzard, 1), actor, true);
      final Reflection r = getActor().getReflection();
      for (Player p : r.getPlayers())
      {
        p.sendPacket(new ExShowScreenMessage(NpcString.I_FEEL_STRONG_MAGIC_FLOW, 3000, ScreenMessageAlign.MIDDLE_CENTER, true));
      }
      _eternalblizzardReuseTimer = System.currentTimeMillis() + (_eternalblizzardReuseDelay * 1000L);
    }
 
View Full Code Here

    _iceballReuseTimer += generalReuse + (Rnd.get(1, 20) * 1000L);
    _summonReuseTimer += generalReuse + (Rnd.get(1, 20) * 1000L);
    _selfnovaReuseTimer += generalReuse + (Rnd.get(1, 20) * 1000L);
    _deathsentenceReuseTimer += generalReuse + (Rnd.get(1, 20) * 1000L);
    _angerReuseTimer += generalReuse + (Rnd.get(1, 20) * 1000L);
    final Reflection r = getActor().getReflection();
    for (Player p : r.getPlayers())
    {
      this.notifyEvent(CtrlEvent.EVT_AGGRESSION, p, 2);
    }
  }
View Full Code Here

  {
    if ((_idleDelay == 0) && !getActor().isCurrentHpFull())
    {
      _idleDelay = System.currentTimeMillis();
    }
    final Reflection ref = getActor().getReflection();
    if (!getActor().isDead() && (_idleDelay > 0) && ((_idleDelay + 60000) < System.currentTimeMillis()))
    {
      if (!ref.isDefault())
      {
        for (Player p : ref.getPlayers())
        {
          p.sendMessage(new CustomMessage("scripts.ai.freya.FreyaFailure", p));
        }
        ref.collapse();
      }
    }
    super.thinkActive();
    return true;
  }
View Full Code Here

      return null;
    }
    else if(event.equalsIgnoreCase("start_stage_1"))
    {
      Player p = st.getPlayer();
      Reflection reflect = p.getReflection();
      NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
      if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
      {
        st.set("stage", 1);
        reflect.openDoor(16240002);
        officer.setRunning();
        officer.setFollowTarget(st.getPlayer());
        officer.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, st.getPlayer(), 150);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("start_stage_3"))
    {
      Player p = st.getPlayer();
      Reflection reflect = p.getReflection();
      NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
      if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
      {
        st.set("stage", 3);
        reflect.openDoor(16240004);
        officer.setRunning();
        officer.setFollowTarget(st.getPlayer());
        officer.getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, st.getPlayer(), 150);
        st.getPlayer().sendPacket(new ExShowScreenMessage(NpcString.MARK_OF_BELIS_CAN_BE_ACQUIRED_FROM_ENEMIES, 7000, ScreenMessageAlign.TOP_CENTER));
        st.startQuestTimer("belise_mark_msg_timer", 10000);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("drop_belise_mark"))
    {
      npc.dropItem(st.getPlayer(), BELIS_MARK, 1);
      return null;
    }
    else if(event.equalsIgnoreCase("belise_mark_msg_timer"))
    {
      Player player = st.getPlayer();
      Reflection reflection = player.getActiveReflection();
      if(reflection!= null && reflection.getInstancedZoneId() == INSTANCED_ZONE_ID && st.getInt("stage") == 3)
      {
        player.sendPacket(new ExShowScreenMessage(NpcString.MARK_OF_BELIS_CAN_BE_ACQUIRED_FROM_ENEMIES, 7000, ScreenMessageAlign.TOP_CENTER));
        st.startQuestTimer("belise_mark_msg_timer", 10000);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("use_belise_mark"))
    {
      if(st.getInt("stage") == 3)
      {
        if(st.takeItems(BELIS_MARK, 1) == 1)
        {
          int marksLeft = NEED_BELIS_MARKS_COUNT - st.getInt("belise_marks_left") - 1;
          if(marksLeft > 0)
          {
            htmltext = HtmCache.getInstance().getNotNull("quests/_10331_StartOfFate/belis_verification_system_q10331_2.htm", st.getPlayer());
            htmltext = htmltext.replace("<?BELISE_MARKS_LEFT?>", String.valueOf(marksLeft));
          }
          else
          {
            Player player = st.getPlayer();
            Reflection reflect = player.getActiveReflection();
            if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
            {
              st.set("stage", 4);
              reflect.openDoor(16240005);
              NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
              if(officer != null)
                officerMoveToLocation(officer, new Location(-117896, 214248, -8617, 49151));
            }
            htmltext = "belis_verification_system_q10331_3.htm";
          }
          st.set("belise_marks_left", NEED_BELIS_MARKS_COUNT - marksLeft);
        }
        else
          htmltext = "belis_verification_system_q10331_no.htm";
      }
      else
        htmltext = "belis_verification_system_q10331_4.htm";
    }
    else if(event.equalsIgnoreCase("start_stage_5"))
    {
      Player p = st.getPlayer();
      Reflection reflect = p.getReflection();
      NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
      if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
      {
        st.set("stage", 5);
        reflect.openDoor(16240006);
        officer.setRunning();
        NpcInstance generator = getNpcFromReflection(ELECTRICITY_GENERATOR, reflect);
        if(generator != null)
        {
          generator.setNpcState(1);
          officer.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, generator, 1000);
          Functions.npcSay(officer, NpcString.DONT_COME_BACK_HERE);
          st.startQuestTimer("stage_5_phrases_timer", 5000, officer);
          st.startQuestTimer("stage_5_spawn_timer", 5000, officer);
        }
      }
      return null;
    }
    else if(event.equalsIgnoreCase("stage_5_phrases_timer"))
    {
      if(st.getInt("stage") == 5)
      {
        Functions.npcSay(npc, NpcString.DONT_COME_BACK_HERE);
        Player player = st.getPlayer();
        Reflection reflection = player.getActiveReflection();
        if(reflection!= null && reflection.getInstancedZoneId() == INSTANCED_ZONE_ID)
        {
          NpcString screenMsg = NpcString.BEHIND_YOU_THE_ENEMY_IS_AMBUSING_YOU;
          if(Rnd.chance(50))
            screenMsg = NpcString.IF_TERAIN_DIES_MISSION_WILL_FAIL;
          player.sendPacket(new ExShowScreenMessage(screenMsg, 7000, ScreenMessageAlign.TOP_CENTER, true, true));
        }
        st.startQuestTimer("stage_5_phrases_timer", 10000, npc);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("stage_5_spawn_timer"))
    {
      if(st.getInt("stage") == 5)
      {
        int defendersCount = st.getInt("spawned_defenders");
        if(defendersCount < NEED_DEFENDERS_KILLS_COUNT)
        {
          int defenderNpcId = (defendersCount == 0 || defendersCount % 2 == 0) ? HANDYMAN : OPERATIVE;
          Reflection reflect = npc.getReflection();
          NpcInstance defender = addSpawnToInstance(defenderNpcId, new Location(-116600, 213080, -8615, 21220), 0, reflect.getId());

          /*
          NpcString defenderPhrase = NpcString.FOCUS_ON_ATTACKING_THE_GUY_IN_THE_ROOM;
          if(Rnd.chance(50))
            defenderPhrase = NpcString.KILL_THE_GUY_MESSING_WITH_THE_ELECTRIC_DEVICE;
          Functions.npcSay(defender, defenderPhrase);
          */
         
          NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
          if(officer != null)
          {
            defender.setSpawnedLoc(officer.getLoc());
            defender.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, officer, 10);
          }
          st.set("spawned_defenders", defendersCount + 1);
          String defendersIds = st.get("defenders_ids");
          if(defendersIds == null)
            defendersIds = "";
          st.set("defenders_ids", st.get("defenders_ids") + "-" + defender.getObjectId() + "-");
        }

        st.startQuestTimer("stage_5_spawn_timer", 20000, npc);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("process_stage_5"))
    {
      Player player = st.getPlayer();
      Reflection reflect = player.getActiveReflection();
      if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
      {
        int defenderKills = st.getInt("defender_kills");
        if(defenderKills >= NEED_DEFENDERS_KILLS_COUNT)
        {
          st.set("stage", 6);
          st.getPlayer().sendPacket(new ExShowScreenMessage(NpcString.ELECTRONIC_DEVICE_HAS_BEEN_DESTROYED, 5000, ScreenMessageAlign.TOP_CENTER));
          reflect.openDoor(16240007);
          reflect.getZone("[belise_labyrinth_03_1]").setActive(true);
          reflect.getZone("[belise_labyrinth_03_2]").setActive(false);

          NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
          if(officer != null)
            officerMoveToLocation(officer, new Location(-119112, 213672, -8617, 8191));

          NpcInstance generator = getNpcFromReflection(ELECTRICITY_GENERATOR, reflect);
          if(generator != null)
            generator.deleteMe();
        }
      }
      return null;
    }
    else if(event.equalsIgnoreCase("start_stage_7"))
    {
      Player player = st.getPlayer();
      Reflection reflect = player.getActiveReflection();
      if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
      {
        st.set("stage", 7);
        reflect.openDoor(16240008);
        SceneMovie scene = SceneMovie.sc_talking_island_boss_opening;
        st.getPlayer().showQuestMovie(scene);
        st.startQuestTimer("spawn_nemertess", scene.getDuration(), npc);
      }
      return null;
    }
    else if(event.equalsIgnoreCase("spawn_nemertess"))
    {
      if(st.getInt("stage") == 7)
      {
        Player player = st.getPlayer();
        Reflection reflect = player.getActiveReflection();
        if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
        {
          addSpawnToInstance(NEMERTESS, new Location(-118328, 212968, -8705, 24575), 0, reflect.getId());
        }
      }
      return null;
    }
    else if(event.equalsIgnoreCase("kill_nemertess"))
    {
      if(st.getInt("stage") == 7)
      {
        Player player = st.getPlayer();
        Reflection reflect = player.getActiveReflection();
        if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
        {
          clearInstanceVariables(st);
          st.setCond(4);
          st.giveItems(SARILS_NECKLACE, 1);
          NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
View Full Code Here

  {
    QuestState st = player.getQuestState(getClass());
    if(st == null)
      return "";

    Reflection reflect = npc.getReflection();
    if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
    {
      int npcId = npc.getNpcId();
      if(npcId == INFILTRATION_OFFICER)
      {
        int cond = st.getCond();
View Full Code Here

  }

  @Override
  public String onKill(NpcInstance npc, QuestState st)
  {
    Reflection reflect = npc.getReflection();
    if(reflect.getInstancedZoneId() == INSTANCED_ZONE_ID)
    {
      int npcId = npc.getNpcId();
      if(npcId == OPERATIVE)
      {
        if(st.getCond() == 3)
        {
          if(st.getInt("stage") == 1)
          {
            int killsCount = st.getInt("operative_kills") + 1;
            if(killsCount >= NEED_OPERATIVES_KILLS_COUNT)
            {
              st.set("stage", 2);
              reflect.openDoor(16240003);
              NpcInstance officer = getNpcFromReflection(INFILTRATION_OFFICER, reflect);
              if(officer != null)
                officerMoveToLocation(officer, new Location(-117037, 212504, -8592, 39479));
            }
            else
View Full Code Here

   */
  @Override
  protected void onEvtSpawn()
  {
    super.onEvtSpawn();
    final Reflection r = getActor().getReflection();
    for (Player p : r.getPlayers())
    {
      this.notifyEvent(CtrlEvent.EVT_ATTACKED, p, 300);
    }
    Functions.npcSayCustomMessage(getActor(), "scripts.ai.freya.FreyaQuest.onEvtSpawn");
  }
View Full Code Here

    Player player = st.getPlayer();
    if (player == null)
    {
      return;
    }
    Reflection reflection = player.getActiveReflection();
    if (reflection != null)
    {
      if (player.canReenterInstance(instancedZoneId))
      {
        player.teleToLocation(reflection.getTeleportLoc(), reflection);
        onReenterInstance(st, reflection);
      }
    }
    else if (player.canEnterInstance(instancedZoneId))
    {
      Reflection newReflection = ReflectionUtils.enterReflection(player, instancedZoneId);
      onEnterInstance(st, newReflection);
    }
  }
View Full Code Here

    super.onEvtSpawn();
    final NpcInstance actor = getActor();
    iced = true;
    actor.setNpcState(1);
    actor.block();
    final Reflection r = actor.getReflection();
    if ((r != null) && (r.getPlayers() != null))
    {
      for (Player p : r.getPlayers())
      {
        this.notifyEvent(CtrlEvent.EVT_AGGRESSION, p, 300);
      }
    }
    task = ThreadPoolManager.getInstance().schedule(new ReleaseFromIce(), 6000L);
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.entity.Reflection

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.