Package com.l2jfrozen.gameserver.templates

Examples of com.l2jfrozen.gameserver.templates.StatsSet


            {
                System.out.println("Adding new hero");
                System.out.println("Name:" + player.getName());
                System.out.println("ClassId:" + player.getClassId().getId());
            }
            StatsSet newHero = new StatsSet();
            newHero.set(Olympiad.CHAR_NAME, player.getName());
            newHero.set(Olympiad.CLASS_ID, player.getClassId().getId());
            newHero.set(COUNT, 1);
            newHero.set(PLAYED, 1);
            _heroes.put(player.getObjectId(),newHero);
            if (isComplete)
                _completeHeroes.put(player.getObjectId(),newHero);
        }
        catch (Exception e)
View Full Code Here


    for (StatsSet hero : newHeroes)
    {
      int charId = hero.getInteger(Olympiad.CHAR_ID);
      if (_completeHeroes != null && _completeHeroes.containsKey(charId))
      {
        StatsSet oldHero = _completeHeroes.get(charId);
        int count = oldHero.getInteger(COUNT);
        oldHero.set(COUNT, count + 1);
        oldHero.set(PLAYED, 1);
        heroes.put(charId, oldHero);
      }
      else
      {
        StatsSet newHero = new StatsSet();
        newHero.set(Olympiad.CHAR_NAME, hero.getString(Olympiad.CHAR_NAME));
        newHero.set(Olympiad.CLASS_ID, hero.getInteger(Olympiad.CLASS_ID));
        newHero.set(COUNT, 1);
        newHero.set(PLAYED, 1);
        heroes.put(charId, newHero);
      }
    }
    deleteItemsInDb();
    _heroes.clear();
View Full Code Here

      }
      else
      {
        for (Integer heroId : _heroes.keySet())
        {
          StatsSet hero = _heroes.get(heroId);
          if (_completeHeroes == null || !_completeHeroes.containsKey(heroId))
          {
            statement = con.prepareStatement(INSERT_HERO);
            statement.setInt(1, heroId);
            statement.setString(2, hero.getString(Olympiad.CHAR_NAME));
            statement.setInt(3, hero.getInteger(Olympiad.CLASS_ID));
            statement.setInt(4, hero.getInteger(COUNT));
            statement.setInt(5, hero.getInteger(PLAYED));
            statement.execute();
            statement2 = con.prepareStatement(GET_CLAN_ALLY);
            statement2.setInt(1, heroId);
            rset2 = statement2.executeQuery();
            if (rset2.next())
            {
              int clanId = rset2.getInt("clanid");
              int allyId = rset2.getInt("allyId");
              String clanName = "";
              String allyName = "";
              int clanCrest = 0;
              int allyCrest = 0;
              if (clanId > 0)
              {
                clanName = ClanTable.getInstance().getClan(clanId).getName();
                clanCrest = ClanTable.getInstance().getClan(clanId).getCrestId();
                if (allyId > 0)
                {
                  allyName = ClanTable.getInstance().getClan(clanId).getAllyName();
                  allyCrest = ClanTable.getInstance().getClan(clanId).getAllyCrestId();
                }
              }
              hero.set(CLAN_CREST, clanCrest);
              hero.set(CLAN_NAME, clanName);
              hero.set(ALLY_CREST, allyCrest);
              hero.set(ALLY_NAME, allyName);
            }
            rset2.close();
            statement2.close();
            _heroes.remove(heroId);
            _heroes.put(heroId, hero);
            _completeHeroes.put(heroId, hero);
          }
          else
          {
            statement = con.prepareStatement(UPDATE_HERO);
            statement.setInt(1, hero.getInteger(COUNT));
            statement.setInt(2, hero.getInteger(PLAYED));
            statement.setInt(3, heroId);
            statement.execute();
          }
          statement.close();
        }
View Full Code Here

    i_ai3 = 0;
    i_ai4 = 0;
    i_quest0 = 0;
    lastAttackTime = System.currentTimeMillis();
    _Zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632);
    StatsSet info = GrandBossManager.getInstance().getStatsSet(VALAKAS);
   
    Integer status = GrandBossManager.getInstance().getBossStatus(VALAKAS);
   
    if (status == DEAD)
    {
      // load the unlock date and time for valakas from DB
      long temp = (info.getLong("respawn_time") - System.currentTimeMillis());
      // if valakas is locked until a certain time, mark it so and start the unlock timer
      // the unlock time has not yet expired.  Mark valakas as currently locked.  Setup a timer
      // to fire at the correct time (calculate the time between now and the unlock time,
      // setup a timer to fire after that many msec)
      if (temp > 0)
      {
        this.startQuestTimer("valakas_unlock", temp, null, null);
      }
      else
      {
        // the time has already expired while the server was offline.
        // the status needs to be changed to DORMANT
        GrandBossManager.getInstance().setBossStatus(VALAKAS, DORMANT);
       
      }
    }
    else if(status == FIGHTING)
    {
        //respawn to original location       
        int loc_x = 213004;
        int loc_y = -114890;
        int loc_z = -1595;
        int heading = 0;
       
        final int hp = info.getInteger("currentHP");
        final int mp = info.getInteger("currentMP");
        L2GrandBossInstance valakas = (L2GrandBossInstance) addSpawn(VALAKAS, loc_x, loc_y, loc_z, heading, false, 0);
        GrandBossManager.getInstance().addBoss(valakas);
        final L2NpcInstance _valakas = valakas;
       
        ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
View Full Code Here

    int xspawn = Integer.parseInt(st.nextToken());
    int yspawn = Integer.parseInt(st.nextToken());
    int zspawn = Integer.parseInt(st.nextToken());
    int heading = Integer.parseInt(st.nextToken());

    StatsSet npcDat = new StatsSet();
    npcDat.set("npcId", id);
    npcDat.set("level", 0);
    npcDat.set("jClass", "boat");

    npcDat.set("baseSTR", 0);
    npcDat.set("baseCON", 0);
    npcDat.set("baseDEX", 0);
    npcDat.set("baseINT", 0);
    npcDat.set("baseWIT", 0);
    npcDat.set("baseMEN", 0);

    npcDat.set("baseShldDef", 0);
    npcDat.set("baseShldRate", 0);
    npcDat.set("baseAccCombat", 38);
    npcDat.set("baseEvasRate", 38);
    npcDat.set("baseCritRate", 38);

    //npcDat.set("name", "");
    npcDat.set("collision_radius", 0);
    npcDat.set("collision_height", 0);
    npcDat.set("sex", "male");
    npcDat.set("type", "");
    npcDat.set("baseAtkRange", 0);
    npcDat.set("baseMpMax", 0);
    npcDat.set("baseCpMax", 0);
    npcDat.set("rewardExp", 0);
    npcDat.set("rewardSp", 0);
    npcDat.set("basePAtk", 0);
    npcDat.set("baseMAtk", 0);
    npcDat.set("basePAtkSpd", 0);
    npcDat.set("aggroRange", 0);
    npcDat.set("baseMAtkSpd", 0);
    npcDat.set("rhand", 0);
    npcDat.set("lhand", 0);
    npcDat.set("armor", 0);
    npcDat.set("baseWalkSpd", 0);
    npcDat.set("baseRunSpd", 0);
    npcDat.set("name", name);
    npcDat.set("baseHpMax", 50000);
    npcDat.set("baseHpReg", 3.e-3f);
    npcDat.set("baseMpReg", 3.e-3f);
    npcDat.set("basePDef", 100);
    npcDat.set("baseMDef", 100);
    L2CharTemplate template = new L2CharTemplate(npcDat);
    boat = new L2BoatInstance(IdFactory.getInstance().getNextId(), template, name);
    boat.getPosition().setHeading(heading);
    boat.setXYZ(xspawn, yspawn, zspawn);
    //boat.spawnMe();
View Full Code Here

    Integer status = GrandBossManager.getInstance().getBossStatus(29062);
   
    if(status != INTERVAL)
    {
      long interval = Rnd.get(Config.HPH_FIXINTERVALOFHALTER, Config.HPH_FIXINTERVALOFHALTER + Config.HPH_RANDOMINTERVALOFHALTER)/* * 3600000*/;
      StatsSet info = GrandBossManager.getInstance().getStatsSet(29062);
      info.set("respawn_time", (System.currentTimeMillis() + interval));
      GrandBossManager.getInstance().setStatsSet(29062, info);
      GrandBossManager.getInstance().setBossStatus(29062, INTERVAL);
    }

    StatsSet info = GrandBossManager.getInstance().getStatsSet(29062);
    long temp = info.getLong("respawn_time") - System.currentTimeMillis();
    _intervalTask = ThreadPoolManager.getInstance().scheduleGeneral(new Interval(), temp);
  }
View Full Code Here

   */
  public Orfen(int questId, String name, String descr)
  {
    super(questId, name, descr);
   
    StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);   
    Integer status = GrandBossManager.getInstance().getBossStatus(ORFEN);
   
    addEventId(ORFEN, Quest.QuestEventType.ON_KILL);
    addEventId(ORFEN, Quest.QuestEventType.ON_ATTACK);
   
    switch (status)
    {
      case DEAD:
      {     
        long temp = info.getLong("respawn_time") - System.currentTimeMillis();
        if (temp > 0)
        {
          startQuestTimer("ORFEN_SPAWN", temp, null, null);
        }
        else
        {
          int loc_x = 55024;
          int loc_y = 17368;
          int loc_z = -5412;
          int heading = 0;
         
          orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
          if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
          {
            Announcements.getInstance().announceToAll("Raid boss " + orfen.getName() + " spawned in world.");
          }
          GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
          GrandBossManager.getInstance().addBoss(orfen);
        }
      }
        break;
      case LIVE:
      {       
        /*
         * int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading");
         */
       
        int loc_x = 55024;
        int loc_y = 17368;
        int loc_z = -5412;
        int heading = 0;
       
        int hp = info.getInteger("currentHP");
        int mp = info.getInteger("currentMP");
        orfen = (L2GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
        if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
        {
          Announcements.getInstance().announceToAll("Raid boss " + orfen.getName() + " spawned in world.");
        }
View Full Code Here

        // time is 48hour +/- 20hour
        long respawnTime = (long) (Config.ORFEN_RESP_FIRST + Rnd.get(Config.ORFEN_RESP_SECOND)) * 3600000;
        cancelQuestTimer("ORFEN_REFRESH", npc, null);
        startQuestTimer("ORFEN_SPAWN", respawnTime, null, null);
        // also save the respawn time so that the info is maintained past reboots
        StatsSet info = GrandBossManager.getInstance().getStatsSet(ORFEN);
        info.set("respawn_time", System.currentTimeMillis() + respawnTime);
        GrandBossManager.getInstance().setStatsSet(ORFEN, info);       
      }     
    }
   
    return super.onKill(npc, killer, isPet);
View Full Code Here

            addEventId(mob, Quest.QuestEventType.ON_ATTACK);
        }

        _Zone = GrandBossManager.getInstance().getZone(-21610, 181594, -5734);

        StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);

        Integer status = GrandBossManager.getInstance().getBossStatus(QUEEN);

        switch (status) {
            case DEAD: {
                long temp = info.getLong("respawn_time") - System.currentTimeMillis();
                if (temp > 0) {
                    startQuestTimer("QUEEN_SPAWN", temp, null, null);
                } else {
                    L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
                    if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) {
                        Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
                    }
                    GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
                    GrandBossManager.getInstance().addBoss(queen);
                    spawnBoss(queen);
                }
            }
            break;
            case LIVE: {                /*
         * int loc_x = info.getInteger("loc_x"); int loc_y = info.getInteger("loc_y"); int loc_z = info.getInteger("loc_z"); int heading = info.getInteger("heading");
         */
                int hp = info.getInteger("currentHP");
                int mp = info.getInteger("currentMP");
                L2GrandBossInstance queen = (L2GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
                if (Config.ANNOUNCE_TO_ALL_SPAWN_RB) {
                    Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
                }
                GrandBossManager.getInstance().addBoss(queen);
View Full Code Here

                cancelQuestTimer("CHECK_MINIONS_ZONE", npc, null);
                cancelQuestTimer("CHECK_NURSE_ALIVE", npc, null);
                cancelQuestTimer("HEAL", null, null);
                // cancelQuestTimer("CHECK_QA_ZONE", npc, null);
                // also save the respawn time so that the info is maintained past reboots
                StatsSet info = GrandBossManager.getInstance().getStatsSet(QUEEN);
                info.set("respawn_time", System.currentTimeMillis() + respawnTime);
                GrandBossManager.getInstance().setStatsSet(QUEEN, info);
            }

            startQuestTimer("DESPAWN_MINIONS", 10000, null, null);
        } else if (status == LIVE) {
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.