Package net.sf.l2j.gameserver.model.actor.stat

Examples of net.sf.l2j.gameserver.model.actor.stat.CharStat


        @Override
    public void run()
        {
            try
            {
                CharStat charstat = getActiveChar().getStat();

                // Modify the current CP of the L2Character and broadcast Server->Client packet StatusUpdate
                if (getCurrentCp() < charstat.getMaxCp()) setCurrentCp(getCurrentCp() + Formulas.getInstance().calcCpRegen(getActiveChar()),false);

                // Modify the current HP of the L2Character and broadcast Server->Client packet StatusUpdate
                if (getCurrentHp() < charstat.getMaxHp()) setCurrentHp(getCurrentHp() + Formulas.getInstance().calcHpRegen(getActiveChar()),false);

                // Modify the current MP of the L2Character and broadcast Server->Client packet StatusUpdate
                if (getCurrentMp() < charstat.getMaxMp()) setCurrentMp(getCurrentMp() + Formulas.getInstance().calcMpRegen(getActiveChar()),false);

                if(!getActiveChar().isInActiveRegion())
                {
                    // no broadcast necessary for characters that are in inactive regions.
                    // stop regeneration for characters who are filled up and in an inactive region.
                    if((getCurrentCp() == charstat.getMaxCp()) && (getCurrentHp()== charstat.getMaxHp()) && (getCurrentMp() == charstat.getMaxMp()))
                        stopHpMpRegeneration();
                }
                else
                    getActiveChar().broadcastStatusUpdate(); //send the StatusUpdate packet
            }
View Full Code Here


   */
  public CharStat getStat()
  {
    if (_stat == null)
    {
      _stat = new CharStat(this);
    }
    return _stat;
  }
View Full Code Here

TOP

Related Classes of net.sf.l2j.gameserver.model.actor.stat.CharStat

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.