/// <summary> /// The timer that reduce the endurance every interval /// </summary> //RegionTimer m_tickTimer; /// <summary> /// The amount of timer ticks player was not moving /// </summary> //int m_idleTicks = 0; /// <summary> /// Start the sprinting on player /// </summary> public override void Start(GameLiving target) { base.Start(target); /*if (m_tickTimer != null) { m_tickTimer.Stop(); m_tickTimer = null; } m_tickTimer = new RegionTimer(target); m_tickTimer.Callback = new RegionTimerCallback(PulseCallback); m_tickTimer.Start(1);*/ target.StartEnduranceRegeneration(); }
/// <summary> /// The timer that reduce the endurance every interval /// </summary> //RegionTimer m_tickTimer; /// <summary> /// The amount of timer ticks player was not moving /// </summary> //int m_idleTicks = 0; /// <summary> /// Start the sprinting on player /// </summary> public override void Start(GameLiving target) { base.Start(target); /*if (m_tickTimer != null) * { * m_tickTimer.Stop(); * m_tickTimer = null; * } * m_tickTimer = new RegionTimer(target); * m_tickTimer.Callback = new RegionTimerCallback(PulseCallback); * m_tickTimer.Start(1);*/ target.StartEnduranceRegeneration(); }
/// <summary> /// send updates about the changes /// </summary> /// <param name="target"></param> public override void SendUpdates(GameLiving target) { GamePlayer player = target as GamePlayer; // need new prop system to not worry about updates if (player != null) { player.Out.SendCharStatsUpdate(); player.Out.SendCharResistsUpdate(); player.Out.SendUpdateWeaponAndArmorStats(); player.UpdateEncumberance(); player.UpdatePlayerStatus(); } if (target.IsAlive) { if (target.Health < target.MaxHealth) { target.StartHealthRegeneration(); } else if (target.Health > target.MaxHealth) { target.Health = target.MaxHealth; } if (target.Mana < target.MaxMana) { target.StartPowerRegeneration(); } else if (target.Mana > target.MaxMana) { target.Mana = target.MaxMana; } if (target.Endurance < target.MaxEndurance) { target.StartEnduranceRegeneration(); } else if (target.Endurance > target.MaxEndurance) { target.Endurance = target.MaxEndurance; } } }
/// <summary> /// send updates about the changes /// </summary> /// <param name="target"></param> public override void SendUpdates(GameLiving target) { if (target is GamePlayer player) { player.Out.SendCharStatsUpdate(); player.Out.SendCharResistsUpdate(); player.Out.SendUpdateWeaponAndArmorStats(); player.UpdateEncumberance(); player.UpdatePlayerStatus(); } if (!target.IsAlive) { return; } if (target.Health < target.MaxHealth) { target.StartHealthRegeneration(); } else if (target.Health > target.MaxHealth) { target.Health = target.MaxHealth; } if (target.Mana < target.MaxMana) { target.StartPowerRegeneration(); } else if (target.Mana > target.MaxMana) { target.Mana = target.MaxMana; } if (target.Endurance < target.MaxEndurance) { target.StartEnduranceRegeneration(); } else if (target.Endurance > target.MaxEndurance) { target.Endurance = target.MaxEndurance; } }
/// <summary> /// send updates about the changes /// </summary> /// <param name="target"></param> protected override void SendUpdates(GameLiving target) { GamePlayer player = target as GamePlayer; // need new prop system to not worry about updates if (player != null) { player.Out.SendCharStatsUpdate(); player.Out.SendUpdateWeaponAndArmorStats(); player.UpdateEncumberance(); player.UpdatePlayerStatus(); } if (target.IsAlive) { if (target.Health < target.MaxHealth) target.StartHealthRegeneration(); else if (target.Health > target.MaxHealth) target.Health = target.MaxHealth; if (target.Mana < target.MaxMana) target.StartPowerRegeneration(); else if (target.Mana > target.MaxMana) target.Mana = target.MaxMana; if (target.Endurance < target.MaxEndurance) target.StartEnduranceRegeneration(); else if (target.Endurance > target.MaxEndurance) target.Endurance = target.MaxEndurance; } }