Package net.sf.l2j.gameserver.skills.conditions

Examples of net.sf.l2j.gameserver.skills.conditions.Condition


             armorPiece = (L2Armor) dummy.getItem();
             */
            //TODO add checks for shield here.
        }

        Condition preCondition = _preCondition;
        if(itemOrWeapon) preCondition = _itemPreCondition;
        if (preCondition == null) return true;

        Env env = new Env();
        env.player = activeChar;
        if (target instanceof L2Character) // TODO: object or char?
          env.target = (L2Character)target;
        env.skill = this;

        if (!preCondition.test(env))
        {
            String msg = preCondition.getMessage();
            if (msg != null)
            {
                SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2);
                sm.addString(msg);
                activeChar.sendPacket(sm);
View Full Code Here


        _tables.put(name, table);
    }

    protected void parseTemplate(Node n, Object template)
    {
        Condition condition = null;
        n = n.getFirstChild();
        if (n == null) return;
        if ("cond".equalsIgnoreCase(n.getNodeName()))
        {
            condition = parseCondition(n.getFirstChild(), template);
            Node msg = n.getAttributes().getNamedItem("msg");
            if (condition != null && msg != null) condition.setMessage(msg.getNodeValue());
            n = n.getNextSibling();
        }
        for (; n != null; n = n.getNextSibling())
        {
            if ("add".equalsIgnoreCase(n.getNodeName())) attachFunc(n, template, "Add", condition);
View Full Code Here

    {
        Stats stat = Stats.valueOfXml(n.getAttributes().getNamedItem("stat").getNodeValue());
        String order = n.getAttributes().getNamedItem("order").getNodeValue();
        Lambda lambda = getLambda(n, template);
        int ord = Integer.decode(getValue(order, template));
        Condition applayCond = parseCondition(n.getFirstChild(), template);
        FuncTemplate ft = new FuncTemplate(attachCond, applayCond, name, stat, ord, lambda);
        if (template instanceof L2Item) ((L2Item) template).attach(ft);
        else if (template instanceof L2Skill) ((L2Skill) template).attach(ft);
        else if (template instanceof EffectTemplate) ((EffectTemplate) template).attach(ft);
    }
View Full Code Here

        {
            if (Integer.decode(getValue(attrs.getNamedItem("self").getNodeValue(),template)) == 1)
                self = true;
        }
        Lambda lambda = getLambda(n, template);
        Condition applayCond = parseCondition(n.getFirstChild(), template);
        int abnormal = 0;
        if (attrs.getNamedItem("abnormal") != null)
        {
            String abn = attrs.getNamedItem("abnormal").getNodeValue();
            if (abn.equals("poison")) abnormal = L2Character.ABNORMAL_EFFECT_POISON;
View Full Code Here

        return null;
    }

    protected Condition parsePlayerCondition(Node n)
    {
        Condition cond = null;
        int[] ElementSeeds = new int[5];
        int[] forces = new int[2];
        NamedNodeMap attrs = n.getAttributes();
        for (int i = 0; i < attrs.getLength(); i++)
        {
View Full Code Here

        return cond;
    }

    protected Condition parseTargetCondition(Node n, Object template)
    {
        Condition cond = null;
        NamedNodeMap attrs = n.getAttributes();
        for (int i = 0; i < attrs.getLength(); i++)
        {
            Node a = attrs.item(i);
            if ("aggro".equalsIgnoreCase(a.getNodeName()))
View Full Code Here

        return new ConditionSkillStats(stat);
    }

    protected Condition parseUsingCondition(Node n)
    {
        Condition cond = null;
        NamedNodeMap attrs = n.getAttributes();
        for (int i = 0; i < attrs.getLength(); i++)
        {
            Node a = attrs.item(i);
            if ("kind".equalsIgnoreCase(a.getNodeName()))
View Full Code Here

        return cond;
    }

    protected Condition parseGameCondition(Node n)
    {
        Condition cond = null;
        NamedNodeMap attrs = n.getAttributes();
        for (int i = 0; i < attrs.getLength(); i++)
        {
            Node a = attrs.item(i);
            if ("skill".equalsIgnoreCase(a.getNodeName()))
View Full Code Here

            _currentSkill.currentLevel = i;
      for (n=first; n != null; n = n.getNextSibling())
      {
        if ("cond".equalsIgnoreCase(n.getNodeName()))
        {
          Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
          Node msg = n.getAttributes().getNamedItem("msg");
          if (condition != null && msg != null)
            condition.setMessage(msg.getNodeValue());
                    _currentSkill.currentSkills.get(i).attach(condition, false);
        }
        if ("for".equalsIgnoreCase(n.getNodeName()))
        {
          parseTemplate(n, _currentSkill.currentSkills.get(i));
        }
      }
    }
        for (int i=lastLvl; i < lastLvl+enchantLevels1; i++)
        {
            _currentSkill.currentLevel = i-lastLvl;
            boolean found = false;
            for (n=first; n != null; n = n.getNextSibling())
            {
                if ("enchant1cond".equalsIgnoreCase(n.getNodeName()))
                {
                    found = true;
                  Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
                    Node msg = n.getAttributes().getNamedItem("msg");
                    if (condition != null && msg != null)
                        condition.setMessage(msg.getNodeValue());
                    _currentSkill.currentSkills.get(i).attach(condition,false);
                }
                if ("enchant1for".equalsIgnoreCase(n.getNodeName()))
                {
                    found = true;
                  parseTemplate(n, _currentSkill.currentSkills.get(i));
                }
            }
             // If none found, the enchanted skill will take effects from maxLvL of norm skill
          if (!found)
          {
            _currentSkill.currentLevel = lastLvl-1;
            for (n=first; n != null; n = n.getNextSibling())
            {
              if ("cond".equalsIgnoreCase(n.getNodeName()))
              {
                Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
                Node msg = n.getAttributes().getNamedItem("msg");
                if (condition != null && msg != null)
                  condition.setMessage(msg.getNodeValue());
                _currentSkill.currentSkills.get(i).attach(condition,false);
              }
              if ("for".equalsIgnoreCase(n.getNodeName()))
              {
                parseTemplate(n, _currentSkill.currentSkills.get(i));
              }
            }
          }
        }
        for (int i=lastLvl+enchantLevels1; i < lastLvl+enchantLevels1+enchantLevels2; i++)
        {
          boolean found = false;
          _currentSkill.currentLevel = i-lastLvl-enchantLevels1;
            for (n=first; n != null; n = n.getNextSibling())
            {
                if ("enchant2cond".equalsIgnoreCase(n.getNodeName()))
                {
                    found = true;
                  Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
                    Node msg = n.getAttributes().getNamedItem("msg");
                    if (condition != null && msg != null)
                        condition.setMessage(msg.getNodeValue());
                    _currentSkill.currentSkills.get(i).attach(condition,false);
                }
                if ("enchant2for".equalsIgnoreCase(n.getNodeName()))
                {
                    found = true;
                  parseTemplate(n, _currentSkill.currentSkills.get(i));
                }
            }
            // If none found, the enchanted skill will take effects from maxLvL of norm skill
            if(!found)
            {
              _currentSkill.currentLevel = lastLvl-1;
              for (n=first; n != null; n = n.getNextSibling())
              {
                if ("cond".equalsIgnoreCase(n.getNodeName()))
                {
                  Condition condition = parseCondition(n.getFirstChild(), _currentSkill.currentSkills.get(i));
                  Node msg = n.getAttributes().getNamedItem("msg");
                  if (condition != null && msg != null)
                    condition.setMessage(msg.getNodeValue());
                  _currentSkill.currentSkills.get(i).attach(condition,false);
                }
                if ("for".equalsIgnoreCase(n.getNodeName()))
                {
                  parseTemplate(n, _currentSkill.currentSkills.get(i));
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.skills.conditions.Condition

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.