public Buff(CharacterBuffs parent, Skill skill, int value) { Parent = parent; MapleID = skill.MapleID; SkillLevel = skill.CurrentLevel; Type = 1; Value = value; End = DateTime.Now.AddSeconds(skill.BuffTime); PrimaryStatups = new Dictionary <CharacterConstants.PrimaryBuffStat, short>(); SecondaryStatups = new Dictionary <CharacterConstants.SecondaryBuffStat, short>(); CalculateStatups(skill); Delay.Execute(() => { if (Parent.Contains(this)) { Parent.RemoveBuff(this); } }, (int)(End - DateTime.Now).TotalMilliseconds); }
public Buff(CharacterBuffs parent, Datum datum) { Parent = parent; MapleID = (int)datum["MapleID"]; SkillLevel = (byte)datum["SkillLevel"]; Type = (byte)datum["Type"]; Value = (int)datum["Value"]; End = (DateTime)datum["End"]; PrimaryStatups = new Dictionary <CharacterConstants.PrimaryBuffStat, short>(); SecondaryStatups = new Dictionary <CharacterConstants.SecondaryBuffStat, short>(); if (Type == 1) { CalculateStatups(DataProvider.Skills[MapleID][SkillLevel]); } Delay.Execute(() => { if (Parent.Contains(this)) { Parent.RemoveBuff(this); } }, (int)(End - DateTime.Now).TotalMilliseconds); }