@Override
  public String onEvent(String event, QuestState st, NpcInstance npc) {
    int _state = st.getState();
    int cond = st.getCond();
    if (event.equalsIgnoreCase("jeremy_q0625_0104.htm") && _state == CREATED) {
      if (st.getQuestItemsCount(Soy_Sauce_Jar) == 0) {
        st.exitCurrentQuest(true);
        return "jeremy_q0625_0102.htm";
      }
      st.setState(STARTED);
      st.setCond(1);
      st.takeItems(Soy_Sauce_Jar, 1);
      st.giveItems(Food_for_Bumbalump, 1);
      st.playSound(SOUND_ACCEPT);
    } else if (event.equalsIgnoreCase("jeremy_q0625_0301.htm") && _state == STARTED && cond == 3) {
      st.exitCurrentQuest(true);
      if (st.getQuestItemsCount(Special_Yeti_Meat) == 0) return "jeremy_q0625_0302.htm";
      st.takeItems(Special_Yeti_Meat, 1);
      st.giveItems(Rnd.get(Reward_First, Reward_Last), 5, true);
    } else if (event.equalsIgnoreCase("yetis_table_q0625_0201.htm")
        && _state == STARTED
        && cond == 1) {
      if (ServerVariables.getLong(_625_TheFinestIngredientsPart2.class.getSimpleName(), 0)
              + 3 * 60 * 60 * 1000
          > System.currentTimeMillis()) return "yetis_table_q0625_0204.htm";
      if (st.getQuestItemsCount(Food_for_Bumbalump) == 0) return "yetis_table_q0625_0203.htm";
      if (BumbalumpSpawned()) return "yetis_table_q0625_0202.htm";
      st.takeItems(Food_for_Bumbalump, 1);
      st.setCond(2);
      ThreadPoolManager.getInstance().schedule(new BumbalumpSpawner(), 1000);
    }

    return event;
  }
  @Override
  public String onTalk(NpcInstance npc, QuestState st) {
    String htmltext = "noquest";
    int npcId = npc.getNpcId();
    int cond = st.getCond();

    if (npcId == Droph)
      if (cond == 0) {
        if (st.getPlayer().getLevel() >= 79) htmltext = "droph_q307_1.htm";
        else {
          htmltext = "droph_q307_0.htm";
          st.exitCurrentQuest(true);
        }
      } else if (cond == 1) {
        if (st.getQuestItemsCount(CaveExplorationText1Sheet) >= 1
            && st.getQuestItemsCount(CaveExplorationText2Sheet) >= 1
            && st.getQuestItemsCount(CaveExplorationText3Sheet) >= 1)
          if (ServerVariables.getLong("HekatonPrimeRespawn", 0) < System.currentTimeMillis())
            htmltext = "droph_q307_3.htm";
          else htmltext = "droph_q307_4.htm";
        else htmltext = "droph_q307_2a.htm";
      } else if (cond == 2) {
        htmltext = "droph_q307_5.htm";
        st.giveItems(DrophsSupportItems, 1);
        st.playSound(SOUND_FINISH);
        st.exitCurrentQuest(true);
      }
    return htmltext;
  }
 @Override
 public String onEvent(String event, QuestState st, NpcInstance npc) {
   String htmltext = event;
   if (event.equalsIgnoreCase("droph_q307_2.htm")) {
     st.setCond(1);
     st.setState(STARTED);
   } else if (event.equalsIgnoreCase("loc1")) {
     htmltext = "droph_q307_2a_1.htm";
     RadarControlPacket rc = new RadarControlPacket(0, 1, GorgolosLoc);
     st.getPlayer().sendPacket(rc);
   } else if (event.equalsIgnoreCase("loc2")) {
     htmltext = "droph_q307_2a_2.htm";
     RadarControlPacket rc = new RadarControlPacket(0, 1, LastTitanUtenusLoc);
     st.getPlayer().sendPacket(rc);
   } else if (event.equalsIgnoreCase("loc3")) {
     htmltext = "droph_q307_2a_3.htm";
     RadarControlPacket rc = new RadarControlPacket(0, 1, GiantMarpanakLoc);
     st.getPlayer().sendPacket(rc);
   } else if (event.equalsIgnoreCase("summon_rb")) {
     if (ServerVariables.getLong("HekatonPrimeRespawn", 0) < System.currentTimeMillis()
         && st.getQuestItemsCount(CaveExplorationText1Sheet) >= 1
         && st.getQuestItemsCount(CaveExplorationText2Sheet) >= 1
         && st.getQuestItemsCount(CaveExplorationText3Sheet) >= 1) {
       st.takeItems(CaveExplorationText1Sheet, 1);
       st.takeItems(CaveExplorationText2Sheet, 1);
       st.takeItems(CaveExplorationText3Sheet, 1);
       ServerVariables.set(
           "HekatonPrimeRespawn", System.currentTimeMillis() + HekatonPrimeRespawn);
       NpcInstance boss =
           st.addSpawn(
               HekatonPrime,
               HekatonPrimeLoc.x,
               HekatonPrimeLoc.y,
               HekatonPrimeLoc.z,
               HekatonPrimeLoc.h,
               0,
               0);
       boss.getMinionList().spawnMinions();
       htmltext = "droph_q307_3a.htm";
     } else htmltext = "droph_q307_2b.htm";
   }
   return htmltext;
 }
예제 #4
0
    @Override
    public void runImpl() throws Exception {
      makeAnnouncement(
          SystemMessage
              .FIRST_PRIZE_GOES_TO_THE_PLAYER_IN_LANE_S1_SECOND_PRIZE_GOES_TO_THE_PLAYER_IN_LANE_S2);
      makeAnnouncement(SystemMessage.MONSTER_RACE_S1_IS_FINISHED);
      _raceNumber++;
      ServerVariables.set("monster_race", _raceNumber);

      for (int i = 0; i < 8; i++)
        broadcast(new DeleteObject(MonsterRace.getInstance().getMonsters()[i]));
    }
  @Override
  public String onTalk(NpcInstance npc, QuestState st) {
    int _state = st.getState();
    int npcId = npc.getNpcId();
    if (_state == CREATED) {
      if (npcId != Jeremy) return "noquest";
      if (st.getPlayer().getLevel() < 73) {
        st.exitCurrentQuest(true);
        return "jeremy_q0625_0103.htm";
      }
      if (st.getQuestItemsCount(Soy_Sauce_Jar) == 0) {
        st.exitCurrentQuest(true);
        return "jeremy_q0625_0102.htm";
      }
      st.setCond(0);
      return "jeremy_q0625_0101.htm";
    }

    if (_state != STARTED) return "noquest";
    int cond = st.getCond();

    if (npcId == Jeremy) {
      if (cond == 1) return "jeremy_q0625_0105.htm";
      if (cond == 2) return "jeremy_q0625_0202.htm";
      if (cond == 3) return "jeremy_q0625_0201.htm";
    }

    if (npcId == Yetis_Table) {
      if (ServerVariables.getLong(_625_TheFinestIngredientsPart2.class.getSimpleName(), 0)
              + 3 * 60 * 60 * 1000
          > System.currentTimeMillis()) return "yetis_table_q0625_0204.htm";
      if (cond == 1) return "yetis_table_q0625_0101.htm";
      if (cond == 2) {
        if (BumbalumpSpawned()) return "yetis_table_q0625_0202.htm";
        ThreadPoolManager.getInstance().schedule(new BumbalumpSpawner(), 1000);
        return "yetis_table_q0625_0201.htm";
      }
      if (cond == 3) return "yetis_table_q0625_0204.htm";
    }

    return "noquest";
  }
 @Override
 public void onDeath(Creature actor, Creature killer) {
   ServerVariables.set(
       _625_TheFinestIngredientsPart2.class.getSimpleName(),
       String.valueOf(System.currentTimeMillis()));
 }
예제 #7
0
  public RaceManagerInstance(int objectId, NpcTemplate template) {
    super(objectId, template);
    if (!Config.ALLOW_MONSTER_RACE) return;

    if (notInitialized) {
      notInitialized = false;

      _raceNumber = ServerVariables.getInt("monster_race", 1);
      history = new ArrayList<Race>();
      managers = new CopyOnWriteArraySet<RaceManagerInstance>();

      ThreadPoolManager s = ThreadPoolManager.getInstance();
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.TICKETS_ARE_NOW_AVAILABLE_FOR_THE_S1TH_MONSTER_RACE),
          0,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.WE_ARE_NOW_SELLING_TICKETS_FOR_THE_S1TH_MONSTER_RACE),
          30 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.TICKETS_ARE_NOW_AVAILABLE_FOR_THE_S1TH_MONSTER_RACE),
          MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.WE_ARE_NOW_SELLING_TICKETS_FOR_THE_S1TH_MONSTER_RACE),
          MINUTE + 30 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_CEASE_IN_S1_MINUTE_S),
          2 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_CEASE_IN_S1_MINUTE_S),
          3 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_CEASE_IN_S1_MINUTE_S),
          4 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.TICKET_SALES_FOR_THE_MONSTER_RACE_WILL_CEASE_IN_S1_MINUTE_S),
          5 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.TICKETS_SALES_ARE_CLOSED_FOR_THE_S1TH_MONSTER_RACE_ODDS_ARE_POSTED),
          6 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.TICKETS_SALES_ARE_CLOSED_FOR_THE_S1TH_MONSTER_RACE_ODDS_ARE_POSTED),
          7 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_S2TH_MONSTER_RACE_WILL_BEGIN_IN_S1_MINUTES),
          7 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_S2TH_MONSTER_RACE_WILL_BEGIN_IN_S1_MINUTES),
          8 * MINUTE,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_S1TH_MONSTER_RACE_WILL_BEGIN_IN_30_SECONDS),
          8 * MINUTE + 30 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(
              SystemMessage.THE_S1TH_MONSTER_RACE_IS_ABOUT_TO_BEGIN_COUNTDOWN_IN_FIVE_SECONDS),
          8 * MINUTE + 50 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_RACE_WILL_BEGIN_IN_S1_SECONDS),
          8 * MINUTE + 55 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_RACE_WILL_BEGIN_IN_S1_SECONDS),
          8 * MINUTE + 56 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_RACE_WILL_BEGIN_IN_S1_SECONDS),
          8 * MINUTE + 57 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_RACE_WILL_BEGIN_IN_S1_SECONDS),
          8 * MINUTE + 58 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(
          new Announcement(SystemMessage.THE_RACE_WILL_BEGIN_IN_S1_SECONDS),
          8 * MINUTE + 59 * SECOND,
          10 * MINUTE);
      s.scheduleAtFixedRate(new Announcement(SystemMessage.THEYRE_OFF), 9 * MINUTE, 10 * MINUTE);
    }
    managers.add(this);
  }