public static void SetValue(Mobile m, ExtendedWeaponAttribute att, int value, string title) { if (!EnhancementList.ContainsKey(m)) { AddMobile(m); } EnhancementAttributes match = EnhancementList[m].FirstOrDefault(attrs => attrs.Title == title); if (match != null) { match.ExtendedWeaponAttributes[att] = value; } else { match = new EnhancementAttributes(title); match.ExtendedWeaponAttributes[att] = value; EnhancementList[m].Add(match); } m.CheckStatTimers(); m.UpdateResistances(); m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana); }
public static int[] GetPropRange(Item item, ExtendedWeaponAttribute attr) { switch (attr) { default: case ExtendedWeaponAttribute.Bane: case ExtendedWeaponAttribute.BoneBreaker: return(new int[] { 1, 1 }); case ExtendedWeaponAttribute.HitSparks: case ExtendedWeaponAttribute.HitSwarm: return(new int[] { 1, 20 }); } }
public static int GetValue(Mobile m, ExtendedWeaponAttribute att) { if (m == null) { return(0); } if (EnhancementList.ContainsKey(m)) { int value = 0; EnhancementList[m].ForEach(attrs => value += attrs.ExtendedWeaponAttributes[att]); return(value); } return(0); }
public static int GetValue(Mobile m, ExtendedWeaponAttribute att) { if (m == null) { return(0); } if (EnhancementList.ContainsKey(m)) { int value = 0; for (var index = 0; index < EnhancementList[m].Count; index++) { var attrs = EnhancementList[m][index]; value += attrs.ExtendedWeaponAttributes[att]; } return(value); } return(0); }
public static void SetValue(Mobile m, ExtendedWeaponAttribute att, int value, string title) { if (!EnhancementList.ContainsKey(m)) { AddMobile(m); } EnhancementAttributes match = null; for (var index = 0; index < EnhancementList[m].Count; index++) { var attrs = EnhancementList[m][index]; if (attrs.Title == title) { match = attrs; break; } } if (match != null) { match.ExtendedWeaponAttributes[att] = value; } else { match = new EnhancementAttributes(title); match.ExtendedWeaponAttributes[att] = value; EnhancementList[m].Add(match); } m.CheckStatTimers(); m.UpdateResistances(); m.Delta(MobileDelta.Stat | MobileDelta.WeaponDamage | MobileDelta.Hits | MobileDelta.Stam | MobileDelta.Mana); }