public override void CalcTrickle() { if ((this.Parent is Character) || (this.Parent is NonPlayerCharacterClass)) { Character character = (Character)this.Parent; // calculating Nano and Heal Delta and interval int healinterval = 29 - Math.Min(character.Stats.Stamina.Value / 30, 27); character.Stats.HealInterval.StatBaseValue = (uint)healinterval; // Healinterval character.PurgeTimer(0); AOFunctions aof = new AOFunctions(); character.AddTimer(0, DateTime.Now + TimeSpan.FromSeconds(healinterval * 1000), aof, true); int sitBonusInterval = 0; int healDelta = character.Stats.HealDelta.Value; if (character.MoveMode == MoveModes.Sit) { sitBonusInterval = 1000; int healDelta2 = healDelta >> 1; healDelta = healDelta + healDelta2; } character.PurgeTimer(0); AOTimers at = new AOTimers(); at.Strain = 0; at.Timestamp = DateTime.Now + TimeSpan.FromMilliseconds(character.Stats.HealInterval.Value * 1000 - sitBonusInterval); at.Function.Target = this.Parent.Id; // changed from ItemHandler.itemtarget_self; at.Function.TickCount = -2; at.Function.TickInterval = (uint)(character.Stats.HealInterval.Value * 1000 - sitBonusInterval); at.Function.FunctionType = Constants.FunctiontypeHit; at.Function.Arguments.Values.Add(27); at.Function.Arguments.Values.Add(healDelta); at.Function.Arguments.Values.Add(healDelta); at.Function.Arguments.Values.Add(0); character.Timers.Add(at); if (!this.Parent.Starting) { this.AffectStats(); } } }
public override void CalcTrickle() { if ((this.Parent is Character) || (this.Parent is NonPlayerCharacterClass)) { Character character = (Character)this.Parent; // calculating Nano and Heal Delta and interval int nanoInterval = 28 - (Math.Min((int)Math.Floor(Convert.ToDouble(character.Stats.Psychic.Value) / 60), 13) * 2); character.Stats.NanoInterval.StatBaseValue = (uint)nanoInterval; // Healinterval character.PurgeTimer(1); AOTimers at = new AOTimers(); at.Strain = 1; int nanoDelta = character.Stats.NanoDelta.Value; if (character.MoveMode == MoveModes.Sit) { int nanoDelta2 = nanoDelta >> 1; nanoDelta = nanoDelta + nanoDelta2; } at.Timestamp = DateTime.Now + TimeSpan.FromSeconds(character.Stats.NanoInterval.Value); at.Function.Target = this.Parent.Id; // changed from ItemHandler.itemtarget_self; at.Function.TickCount = -2; at.Function.TickInterval = (uint)(character.Stats.NanoInterval.Value * 1000); at.Function.FunctionType = Constants.FunctiontypeHit; at.Function.Arguments.Add(214); at.Function.Arguments.Add(nanoDelta); at.Function.Arguments.Add(nanoDelta); at.Function.Arguments.Add(0); character.Timers.Add(at); if (!this.Parent.Starting) { this.AffectStats(); } } }