Package lineage2.gameserver.templates

Examples of lineage2.gameserver.templates.StatsSet


      org.dom4j.Element npcElement = npcIterator.next();
      int npcId = Integer.parseInt(npcElement.attributeValue("id"));
      int templateId = npcElement.attributeValue("template_id") == null ? 0 : Integer.parseInt(npcElement.attributeValue("template_id"));
      String name = npcElement.attributeValue("name");
      String title = npcElement.attributeValue("title");
      StatsSet set = new StatsSet();
      set.set("npcId", npcId);
      set.set("displayId", templateId);
      set.set("name", name);
      set.set("title", title);
      set.set("baseCpReg", 0);
      set.set("baseCpMax", 0);
      for (Iterator<org.dom4j.Element> firstIterator = npcElement.elementIterator(); firstIterator.hasNext();)
      {
        org.dom4j.Element firstElement = firstIterator.next();
        if (firstElement.getName().equalsIgnoreCase("set"))
        {
          set.set(firstElement.attributeValue("name"), firstElement.attributeValue("value"));
        }
        else if (firstElement.getName().equalsIgnoreCase("equip"))
        {
          for (Iterator<org.dom4j.Element> eIterator = firstElement.elementIterator(); eIterator.hasNext();)
          {
            org.dom4j.Element eElement = eIterator.next();
            set.set(eElement.getName(), eElement.attributeValue("item_id"));
          }
        }
        else if (firstElement.getName().equalsIgnoreCase("ai_params"))
        {
          StatsSet ai = new StatsSet();
          for (Iterator<org.dom4j.Element> eIterator = firstElement.elementIterator(); eIterator.hasNext();)
          {
            org.dom4j.Element eElement = eIterator.next();
            ai.set(eElement.attributeValue("name"), eElement.attributeValue("value"));
          }
          set.set("aiParams", ai);
        }
        else if (firstElement.getName().equalsIgnoreCase("attributes"))
        {
View Full Code Here


          museum = getTopMuseum(category);
          if (!getLocation(category).isEmpty())
          {
            for (int[] location : getLocation(category))
            {
              StatsSet ss = new StatsSet();
              ss.set("npcId", 0);
              ss.set("type", "Npc");
              ss.set("name", "");
              NpcTemplate template = new NpcTemplate(ss);
              new L2StatueInstance(IdFactory.getInstance().getNextId(), template, museum.getObjectId(), location, getTopPlayerItems(museum.getObjectId()), getTopPlayerAppearance(museum.getObjectId()));
            }
          }
        }
View Full Code Here

  @Override
  protected void readData(Element rootElement) throws Exception
  {
    String impl = rootElement.attributeValue("impl");
    Class<?> clazz = null;
    StatsSet set = new StatsSet();
    for (Iterator<Attribute> iterator = rootElement.attributeIterator(); iterator.hasNext();)
    {
      Attribute element = iterator.next();
      set.set(element.getName(), element.getValue());
    }
    Residence residence = null;
    try
    {
      clazz = Class.forName("lineage2.gameserver.model.entity.residence." + impl);
View Full Code Here

  protected void readData(Element rootElement)
  {
    for (Iterator<Element> iterator = rootElement.elementIterator("pet"); iterator.hasNext();)
    {
      Element pet = iterator.next();
      StatsSet set = new StatsSet();
      set.set("id", pet.attributeValue("id"));
      set.set("index", pet.attributeValue("index"));
      for (Iterator<Element> i1 = pet.elementIterator(); i1.hasNext();)
      {
        Element element = i1.next();
        if (element.getName().equals("set"))
        {
          set.set(element.attributeValue("name"), element.attributeValue("val"));
        }
        else if (element.getName().equals("stats"))
        {
          for (Iterator<Element> itr = element.elementIterator("stat"); itr.hasNext();)
          {
            Element stat = itr.next();
            set.set("level", stat.attributeValue("level"));
            for (Iterator<Element> it = stat.elementIterator("set"); it.hasNext();)
            {
              Element e = it.next();
              set.set(e.attributeValue("name"), e.attributeValue("val"));
            }
          }
        }
      }
      getHolder().addPetData(set);
View Full Code Here

        Element doorsElement = (Element) doorsIterator.next();
        for (Iterator<?> doorIterator = doorsElement.elementIterator("door"); doorIterator.hasNext();)
        {
          Element doorElement = (Element) doorIterator.next();
          int doorId = Integer.parseInt(doorElement.attributeValue("id"));
          StatsSet set = new StatsSet();
          for (Iterator<?> setIterator = doorElement.elementIterator("set"); setIterator.hasNext();)
          {
            Element setElement = (Element) setIterator.next();
            set.set(setElement.attributeValue("name"), setElement.attributeValue("value"));
          }
          template.addDoor(new ShuttleDoor(doorId, set));
        }
      }
      getHolder().addTemplate(template);
View Full Code Here

            int enchantRoute = (tmplvl - (tmplvl % eLevels)) / eLevels;
            int enchantLevel = tmplvl - (enchantRoute * eLevels);
            skilllevel = (100 * (realEnchantRoute[enchantRoute + 1])) + enchantLevel + 1;
          }
        }
        currentSkill.sets[i] = new StatsSet();
        currentSkill.sets[i].set("skill_id", currentSkill.id);
        currentSkill.sets[i].set("level", skilllevel);
        currentSkill.sets[i].set("name", currentSkill.name);
        currentSkill.sets[i].set("base_level", levels);
      }
View Full Code Here

   * Method initBaseStats.
   * @return StatsSet
   */
  private StatsSet initBaseStats()
  {
    StatsSet baseDat = new StatsSet();
    baseDat.set("level", 0);
    baseDat.set("baseSTR", 0);
    baseDat.set("baseCON", 0);
    baseDat.set("baseDEX", 0);
    baseDat.set("baseINT", 0);
    baseDat.set("baseWIT", 0);
    baseDat.set("baseMEN", 0);
    baseDat.set("baseShldDef", 0);
    baseDat.set("baseShldRate", 0);
    baseDat.set("baseAccCombat", 38);
    baseDat.set("baseEvasRate", 38);
    baseDat.set("baseCritRate", 38);
    baseDat.set("baseAtkRange", 0);
    baseDat.set("baseMpMax", 0);
    baseDat.set("baseCpMax", 0);
    baseDat.set("basePAtk", 0);
    baseDat.set("baseMAtk", 0);
    baseDat.set("basePAtkSpd", 0);
    baseDat.set("baseMAtkSpd", 0);
    baseDat.set("baseWalkSpd", 0);
    baseDat.set("baseRunSpd", 0);
    baseDat.set("baseHpReg", 0);
    baseDat.set("baseCpReg", 0);
    baseDat.set("baseMpReg", 0);
    return baseDat;
  }
View Full Code Here

      con = DatabaseFactory.getInstance().getConnection();
      rset = con.createStatement().executeQuery("SELECT * FROM `raidboss_status`");
      while (rset.next())
      {
        int id = rset.getInt("id");
        StatsSet info = new StatsSet();
        info.set("current_hp", rset.getDouble("current_hp"));
        info.set("current_mp", rset.getDouble("current_mp"));
        info.set("respawn_delay", rset.getInt("respawn_delay"));
        _storedInfo.put(id, info);
      }
    }
    catch (Exception e)
    {
View Full Code Here

    Spawner spawner = _spawntable.get(id);
    if (spawner == null)
    {
      return;
    }
    StatsSet info = _storedInfo.get(id);
    if (info == null)
    {
      _storedInfo.put(id, info = new StatsSet());
    }
    NpcInstance raidboss = spawner.getFirstSpawned();
    if (raidboss instanceof ReflectionBossInstance)
    {
      return;
    }
    if (raidboss != null)
    {
      info.set("current_hp", raidboss.getCurrentHp());
      info.set("current_mp", raidboss.getCurrentMp());
      info.set("respawn_delay", 0);
    }
    else
    {
      info.set("current_hp", 0);
      info.set("current_mp", 0);
      info.set("respawn_delay", spawner.getRespawnTime());
    }
    Connection con = null;
    PreparedStatement statement = null;
    try
    {
      con = DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement("REPLACE INTO `raidboss_status` (id, current_hp, current_mp, respawn_delay) VALUES (?,?,?,?)");
      statement.setInt(1, id);
      statement.setDouble(2, info.getDouble("current_hp"));
      statement.setDouble(3, info.getDouble("current_mp"));
      statement.setInt(4, info.getInteger("respawn_delay", 0));
      statement.execute();
    }
    catch (SQLException e)
    {
      _log.warn("RaidBossSpawnManager: Couldnt update raidboss_status table");
View Full Code Here

    if (_spawntable.containsKey(npcId))
    {
      return;
    }
    _spawntable.put(npcId, spawnDat);
    StatsSet info = _storedInfo.get(npcId);
    if (info != null)
    {
      spawnDat.setRespawnTime(info.getInteger("respawn_delay", 0));
    }
  }
View Full Code Here

TOP

Related Classes of lineage2.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.