Examples of CharStat


Examples of com.l2jfrozen.gameserver.model.actor.stat.CharStat

   */
  public CharStat getStat()
  {
    if(_stat == null)
    {
      _stat = new CharStat(this);
    }

    return _stat;
  }
View Full Code Here

Examples of com.l2jfrozen.gameserver.model.actor.stat.CharStat

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

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

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

        // Modify the current MP of the L2Character and broadcast Server->Client packet StatusUpdate
        if(getCurrentMp() < charstat.getMaxMp())
        {
          setCurrentMp(getCurrentMp() + Formulas.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
View Full Code Here

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

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

   */
  public CharStat getStat()
  {
    if (_stat == null)
    {
      _stat = new CharStat(this);
    }
    return _stat;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.