Package lineage2.gameserver.model.base

Examples of lineage2.gameserver.model.base.Element


        {
          int[] attributes = new int[6];
          for (Iterator<org.dom4j.Element> nextIterator = subElement.elementIterator(); nextIterator.hasNext();)
          {
            org.dom4j.Element nextElement = nextIterator.next();
            Element element;
            if (nextElement.getName().equalsIgnoreCase("attribute"))
            {
              element = Element.getElementByName(nextElement.attributeValue("element"));
              attributes[element.getId()] = Integer.parseInt(nextElement.attributeValue("value"));
            }
          }
          template.setBaseAtributeElements(attributes);
        }
        else if (subName.equalsIgnoreCase("enchant_options"))
View Full Code Here


    if (equipped)
    {
      activeChar.getInventory().isRefresh = true;
      activeChar.getInventory().unEquipItem(_item);
    }
    Element oldElement = _item.getAttackElement();
    int elementVal = _item.getAttributeElementValue(oldElement, false);
    _item.setAttributeElement(oldElement, 0);
    Element newElement = Element.VALUES[_newElementId];
    _item.setAttributeElement(newElement, _item.getAttributeElementValue(newElement, false) + elementVal);
    _item.setJdbcState(JdbcEntityState.UPDATED);
    _item.update();
    if (equipped)
    {
View Full Code Here

   */
  public static void load()
  {
    _log.info("AttributeStoneManager: Loading stone data...");
    int _id, _min_arm, _max_arm, _min_weap, _max_weap, _inc_arm, _inc_weap, _inc_weap_arm;
    Element _element;
    int _chance;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(false);
    factory.setIgnoringComments(true);
    File file = new File(Config.DATAPACK_ROOT, "data/xml/asc/model/etcitems/AttributeStone.xml");
View Full Code Here

   * Method getAttackElement.
   * @return Element
   */
  public Element getAttackElement()
  {
    Element element = isWeapon() ? getAttributeElement() : Element.NONE;
    if (element == Element.NONE)
    {
      for (Element e : Element.VALUES)
      {
        if (template.getBaseAttributeValue(e) > 0)
View Full Code Here

        resMod = Math.max(resMod, 0);
        env.value *= resMod;
      }
    }
    double elementMod = 0;
    final Element element = skill.getElement();
    if (element != Element.NONE)
    {
      elementMod = skill.getElementPower();
      Element attackElement = getAttackElement(caster, target);
      if (attackElement == element)
      {
        elementMod += caster.calcStat(element.getAttack(), 0);
      }
      elementMod -= target.calcStat(element.getDefence(), 0);
View Full Code Here

    int diff = defender.getLevel() - (pAttacker != null ? pAttacker.getLevel() : attacker.getLevel());
    if (attacker.isPlayable() && defender.isMonster() && (defender.getLevel() >= 78) && (diff > 2))
    {
      value *= .7 / Math.pow(diff - 2, .25);
    }
    Element element = Element.NONE;
    double power = 0.;
    if (skill != null)
    {
      element = skill.getElement();
      power = skill.getElementPower();
    }
    else
    {
      element = getAttackElement(attacker, defender);
    }
    if (element == Element.NONE)
    {
      return value;
    }
    Double attDiff = attacker.calcStat(element.getAttack(), power) - defender.calcStat(element.getDefence(), 0.);
    if ((pAttacker != null) && pAttacker.isDebug())
    {
      pAttacker.sendMessage("Element: " + element.name());
      pAttacker.sendMessage("Attack: " + attacker.calcStat(element.getAttack(), power));
      pAttacker.sendMessage("Defence: " + defender.calcStat(element.getDefence(), 0.));
      pAttacker.sendMessage("Modifier: " + (attDiff < 0 ? "On defense " : "On attack ") + AttributeDamageResistTable.getInstance().getAttributeBonus(attDiff));
    }
    if(attDiff < 0)
    {
      return value / AttributeDamageResistTable.getInstance().getAttributeBonus(attDiff);
View Full Code Here

   * @return Element
   */
  public static Element getAttackElement(Creature attacker, Creature target)
  {
    double val, max = Double.MIN_VALUE, maxElementDefenseVal = Double.MIN_VALUE;
    Element maxElementDefense = Element.NONE;   
    Element result = Element.NONE;
    for (Element e : Element.VALUES)
    {
      val = attacker.calcStat(e.getAttack(), 0., null, null);
      if (val <= 0.)
      {
View Full Code Here

          int[] attributeAttack = new int[6];
          int[] attributeDefence = new int[6];
          for (Iterator<org.dom4j.Element> eIterator = firstElement.elementIterator(); eIterator.hasNext();)
          {
            org.dom4j.Element eElement = eIterator.next();
            Element element;
            if (eElement.getName().equalsIgnoreCase("defence"))
            {
              element = Element.getElementByName(eElement.attributeValue("attribute"));
              attributeDefence[element.getId()] = Integer.parseInt(eElement.attributeValue("value"));
            }
            else if (eElement.getName().equalsIgnoreCase("attack"))
            {
              element = Element.getElementByName(eElement.attributeValue("attribute"));
              attributeAttack[element.getId()] = Integer.parseInt(eElement.attributeValue("value"));
            }
          }
          set.set("baseAttributeAttack", attributeAttack);
          set.set("baseAttributeDefence", attributeDefence);
        }
View Full Code Here

        {
          int[] attributes = new int[6];
          for (Iterator<org.dom4j.Element> nextIterator = subElement.elementIterator(); nextIterator.hasNext();)
          {
            org.dom4j.Element nextElement = nextIterator.next();
            Element element;
            if (nextElement.getName().equalsIgnoreCase("attribute"))
            {
              element = Element.getElementByName(nextElement.attributeValue("element"));
              attributes[element.getId()] = Integer.parseInt(nextElement.attributeValue("value"));
            }
          }
          template.setBaseAtributeElements(attributes);
        }
        else if  (subName.equalsIgnoreCase("enchant_options"))
View Full Code Here

        {
          int[] attributes = new int[6];
          for (Iterator<org.dom4j.Element> nextIterator = subElement.elementIterator(); nextIterator.hasNext();)
          {
            org.dom4j.Element nextElement = nextIterator.next();
            Element element;
            if (nextElement.getName().equalsIgnoreCase("attribute"))
            {
              element = Element.getElementByName(nextElement.attributeValue("element"));
              attributes[element.getId()] = Integer.parseInt(nextElement.attributeValue("value"));
            }
          }
          template.setBaseAtributeElements(attributes);
        }
        else if  (subName.equalsIgnoreCase("enchant_options"))
View Full Code Here

TOP

Related Classes of lineage2.gameserver.model.base.Element

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.