Package net.sf.l2j.gameserver.skills

Examples of net.sf.l2j.gameserver.skills.Calculator


    if (_activeChar == null)
      return init;

    int id = stat.ordinal();

    Calculator c = _activeChar.getCalculators()[id];

    // If no Func object found, no modifier is applied
    if (c == null || c.size() == 0)
      return init;

    // Create and init an Env object to pass parameters to the Calculator
    Env env = new Env();
    env.player = _activeChar;
    env.target = target;
    env.skill = skill;
    env.value = init;

    // Launch the calculation
    c.calc(env);
    // avoid some troubles with negative stats (some stats should never be
    // negative)
    if (env.value <= 0
        && ((stat == Stats.MAX_HP) || (stat == Stats.MAX_MP) || (stat == Stats.MAX_CP) || (stat == Stats.MAGIC_DEFENCE)
            || (stat == Stats.POWER_DEFENCE) || (stat == Stats.POWER_ATTACK) || (stat == Stats.MAGIC_ATTACK) || (stat == Stats.POWER_ATTACK_SPEED)
View Full Code Here


     
      for (int i = 0; i < Stats.NUM_STATS; i++)
      {
        if (NPC_STD_CALCULATOR[i] != null)
        {
          _calculators[i] = new Calculator(NPC_STD_CALCULATOR[i]);
        }
      }
    }
   
    // Select the Calculator of the affected state in the Calculator set
    int stat = f.stat.ordinal();
   
    if (_calculators[stat] == null)
    {
      _calculators[stat] = new Calculator();
    }
   
    // Add the Func to the calculator corresponding to the state
    _calculators[stat].addFunc(f);
   
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.skills.Calculator

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.