Package com.l2jfrozen.gameserver.templates

Examples of com.l2jfrozen.gameserver.templates.StatsSet


          spawnDat.setHeading(rset.getInt("heading"));
          spawnDat.setRespawnMinDelay(rset.getInt("respawn_min_delay"));
          spawnDat.setRespawnMaxDelay(rset.getInt("respawn_max_delay"));
          respawnTime = rset.getLong("respawn_time");

          StatsSet info = new StatsSet();
          info.set("respawnTime", respawnTime);
          _storedInfo.put(rset.getInt("boss_id"), info);
         
          addNewSpawn(spawnDat, respawnTime, rset.getDouble("currentHP"), rset.getDouble("currentMP"), false);

          spawnDat = null;
View Full Code Here


  public void updateStatus(L2RaidBossInstance boss, boolean isBossDead)
  {
    if(!_storedInfo.containsKey(boss.getNpcId()))
      return;

    StatsSet info = _storedInfo.get(boss.getNpcId());

    if(isBossDead)
    {
      boss.setRaidStatus(StatusEnum.DEAD);

      long respawnTime;
      int RespawnMinDelay = boss.getSpawn().getRespawnMinDelay();
      int RespawnMaxDelay = boss.getSpawn().getRespawnMaxDelay();
      long respawn_delay = Rnd.get((int) (RespawnMinDelay * 1000 * Config.RAID_MIN_RESPAWN_MULTIPLIER), (int) (RespawnMaxDelay * 1000 * Config.RAID_MAX_RESPAWN_MULTIPLIER));
      respawnTime = Calendar.getInstance().getTimeInMillis() + respawn_delay;

      info.set("currentHP", boss.getMaxHp());
      info.set("currentMP", boss.getMaxMp());
      info.set("respawnTime", respawnTime);
     
      String text = "RaidBossSpawnManager: Updated " + boss.getName() + " respawn time to " + respawnTime;
      Log.add(text, "RaidBossSpawnManager");
     
      ScheduledFuture<?> futureSpawn;
      futureSpawn = ThreadPoolManager.getInstance().scheduleGeneral(new spawnSchedule(boss.getNpcId()), respawn_delay);

      _schedules.put(boss.getNpcId(), futureSpawn);
      futureSpawn = null;
      if(Config.SAVE_RAIDBOSS_STATUS_INTO_DB)
      {
        updateDb();
      }
    }
    else
    {
      boss.setRaidStatus(StatusEnum.ALIVE);

      info.set("currentHP", boss.getCurrentHp());
      info.set("currentMP", boss.getCurrentMp());
      info.set("respawnTime", 0L);
    }

    _storedInfo.remove(boss.getNpcId());
    _storedInfo.put(boss.getNpcId(), info);

View Full Code Here

    if (_period == 1)
      return;
   
    for (Integer nobleId : _nobles.keySet())
    {
      StatsSet nobleInfo = _nobles.get(nobleId);
      int currentPoints = nobleInfo.getInteger(POINTS);
      currentPoints += WEEKLY_POINTS;
      nobleInfo.set(POINTS, currentPoints);
     
      updateNobleStats(nobleId, nobleInfo);
    }
  }
View Full Code Here

        raidboss.setCurrentMp(currentMP);
        raidboss.setRaidStatus(StatusEnum.ALIVE);

        _bosses.put(bossId, raidboss);

        StatsSet info = new StatsSet();
        info.set("currentHP", currentHP);
        info.set("currentMP", currentMP);
        info.set("respawnTime", 0L);

        _storedInfo.put(bossId, info);

        raidboss = null;
      }
View Full Code Here

    {
      con = L2DatabaseFactory.getInstance().getConnection();
     
      for (Integer nobleId : _nobles.keySet())
      {
        StatsSet nobleInfo = _nobles.get(nobleId);
       
        if (nobleInfo == null)
          continue;
       
        int charId = nobleId;
        int classId = nobleInfo.getInteger(CLASS_ID);
        String charName = nobleInfo.getString(CHAR_NAME);
        int points = nobleInfo.getInteger(POINTS);
        int compDone = nobleInfo.getInteger(COMP_DONE);
        int compWon = nobleInfo.getInteger(COMP_WON);
        int compLost = nobleInfo.getInteger(COMP_LOST);
        int compDrawn = nobleInfo.getInteger(COMP_DRAWN);
        boolean toSave = nobleInfo.getBool("to_save");
       
        if (toSave)
        {
          statement = con.prepareStatement(OLYMPIAD_SAVE_NOBLES);
          statement.setInt(1, charId);
          statement.setInt(2, classId);
          statement.setString(3, charName);
          statement.setInt(4, points);
          statement.setInt(5, compDone);
          statement.setInt(6, compWon);
          statement.setInt(7, compLost);
          statement.setInt(8, compDrawn);
         
          nobleInfo.set("to_save", false);
         
          updateNobleStats(nobleId, nobleInfo);
        }
        else
        {
View Full Code Here

            updateStatus(boss, false);
          }

          boss = null;

          StatsSet info = _storedInfo.get(bossId);
          if(info != null)
          {
            PreparedStatement statement = con.prepareStatement("UPDATE raidboss_spawnlist set respawn_time = ?, currentHP = ?, currentMP = ? where boss_id = ?");
            statement.setLong(1, info.getLong("respawnTime"));
            statement.setDouble(2, info.getDouble("currentHP"));
            statement.setDouble(3, info.getDouble("currentMP"));
            statement.setInt(4, bossId);
            statement.execute();

            statement.close();
            statement = null;
View Full Code Here

    return template;
  }

  public void notifySpawnNightBoss(L2RaidBossInstance raidboss)
  {
    StatsSet info = new StatsSet();
    info.set("currentHP", raidboss.getCurrentHp());
    info.set("currentMP", raidboss.getCurrentMp());
    info.set("respawnTime", 0L);

    raidboss.setRaidStatus(StatusEnum.ALIVE);

    _storedInfo.put(raidboss.getNpcId(), info);
View Full Code Here

    PreparedStatement statement = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();

      StatsSet nobleInfo = _oldnobles.get(nobleId);

      if (nobleInfo == null)
        return;

      int charId = nobleId;
      int points = nobleInfo.getInteger(POINTS);
      int compDone = nobleInfo.getInteger(COMP_DONE);
      int compWon = nobleInfo.getInteger(COMP_WON);
      int compLost = nobleInfo.getInteger(COMP_LOST);
      int compDrawn = nobleInfo.getInteger(COMP_DRAWN);

      statement = con.prepareStatement(OLYMPIAD_UPDATE_OLD_NOBLES);
      statement.setInt(1, points);
      statement.setInt(2, compDone);
      statement.setInt(3, compWon);
View Full Code Here

   
    if (_nobles != null)
    {
      for (Integer nobleId : _nobles.keySet())
      {
        StatsSet nobleInfo = _nobles.get(nobleId);
       
        if (nobleInfo == null)
          continue;
       
        int charId = nobleId;
        int classId = nobleInfo.getInteger(CLASS_ID);
        String charName = nobleInfo.getString(CHAR_NAME);
        int points = nobleInfo.getInteger(POINTS);
        int compDone = nobleInfo.getInteger(COMP_DONE);
       
        logResult(charName, "", Double.valueOf(charId), Double.valueOf(classId), compDone, points, "noble-charId-classId-compdone-points", 0, "");
      }
    }
   
    _heroesToBe = new L2FastList<StatsSet>();
   
    Connection con = null;
    PreparedStatement statement = null;
    ResultSet rset = null;
    try
    {
      con = L2DatabaseFactory.getInstance().getConnection();
      StatsSet hero;
      for (int i = 0; i < HERO_IDS.length; i++)
      {
        statement = con.prepareStatement(OLYMPIAD_GET_HEROS);
        statement.setInt(1, HERO_IDS[i]);
        rset = statement.executeQuery();
       
        while (rset.next())
        {
          hero = new StatsSet();
          hero.set(CLASS_ID, HERO_IDS[i]);
          hero.set(CHAR_ID, rset.getInt(CHAR_ID));
          hero.set(CHAR_NAME, rset.getString(CHAR_NAME));
         
          logResult(hero.getString(CHAR_NAME), "", hero.getDouble(CHAR_ID), hero.getDouble(CLASS_ID), 0, 0, "awarded hero", 0, "");
          _heroesToBe.add(hero);
        }
        statement.close();
      }
    }
View Full Code Here

      if(raidboss != null)
      {
        raidboss.setRaidStatus(StatusEnum.ALIVE);

        StatsSet info = new StatsSet();
        info.set("currentHP", raidboss.getCurrentHp());
        info.set("currentMP", raidboss.getCurrentMp());
        info.set("respawnTime", 0L);

        _storedInfo.put(bossId, info);
        info = null;

        GmListTable.broadcastMessageToGMs("Spawning Raid Boss " + raidboss.getName());
View Full Code Here

TOP

Related Classes of com.l2jfrozen.gameserver.templates.StatsSet

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.