public bool HasMultipleTakeRates() { if (PackItems == null || !PackItems.Any()) { return(false); } var distinctTakeRates = DistinctTakeRates(); return(distinctTakeRates > 1); }
public void TakeEquipment() { if (Deleted) { return; } Owner.DropHolding(); foreach (Item i in Equipment) { if (i is Container) { var items = ((Container)i).FindItemsByType <Item>( true, item => item != null && !item.Deleted && !Equipment.Contains(item) && !PackItems.Contains(item)); foreach (var item in items) { Owner.Backpack.DropItem(item); } } i.Delete(); } foreach (Item i in PackItems) { if (i is Container) { var items = ((Container)i).FindItemsByType <Item>( true, item => item != null && !item.Deleted && !Equipment.Contains(item) && !PackItems.Contains(item)); foreach (var item in items) { Owner.Backpack.DropItem(item); } } i.Delete(); } var assoc51 = Owner.Backpack.FindItemsByType <Item>(true, i => i != null && !i.Deleted && i.Association == 51); foreach (var i in assoc51) { i.Delete(); } Equipment.Clear(); PackItems.Clear(); }
public void GiveEquipment() { if (Deleted || Owner == null) { return; } TakeEquipment(); if (Owner.Dex > 80) { Equipment.AddRange( new Item[] { new CloseHelm { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new ChainChest { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new ChainLegs { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new RingmailArms { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new RingmailGloves { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, } }); } else { Equipment.AddRange( new Item[] { new LeatherChest { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new LeatherLegs { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new LeatherGorget { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new LeatherArms { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, }, new LeatherGloves { Quality = ArmorQuality.Exceptional, Association = 51, Weight = 0, } }); } Equipment.AddRange( new Item[] { new Sandals(), new Cloak() }); PackItems.AddRange( new Item[] { new TemplateSpellBook(), new TemplateBagOfReagents(100), new TemplateBandages() }); PackItems.AddRange( new Item[] { new TemplateTotalRefreshPotion(), new TemplateGreaterExplosionPotion { Amount = 20 }, new TemplateGreaterCurePotion(), new TemplateGreaterHealPotion() }); if (Owner.Skills.Poisoning.Value > 50) { PackItems.Add( new TemplateDeadlyPoisonPotion { Association = 51, Weight = 0, Stackable = true, Amount = 20 }); } if (Owner.Skills.Fencing.Value > 50) { Equipment.AddRange( new Item[] { new WarFork { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }, new ShortSpear { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 } }); } if (Owner.Skills.Swords.Value > 50 && Owner.Skills.Lumberjacking.Value == 0 || Owner.Skills.Swords.Value > 50 && Owner.Int > 50) { Equipment.Add( new Halberd { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }); PackItems.Add( new Katana { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }); } if (Owner.Skills.Swords.Value > 50 && Owner.Skills.Lumberjacking.Value > 50) { Equipment.Add( new TwoHandedAxe { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }); PackItems.AddRange( new Item[] { new Halberd { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }, new DoubleAxe { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }, new Katana { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 } }); } if (Owner.Skills.Macing.Value > 50) { Equipment.Add( new WarAxe { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }); PackItems.Add( new WarHammer { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }); } if (Owner.Skills.Archery.Value > 50) { Equipment.Add( new Bow { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }); PackItems.AddRange( new Item[] { new HeavyCrossbow { Association = 51, Quality = WeaponQuality.Exceptional, Weight = 0 }, new TemplateArrows(), new TemplateBolts() }); } if (Owner.Skills.Parry.Value > 50) { Equipment.Add( new MetalKiteShield { Association = 51, Quality = ArmorQuality.Exceptional, MaxHitPoints = 10000, HitPoints = 10000, Weight = 0, }); } foreach (Item i in Equipment.Where(item => !Owner.EquipItem(item) && !Owner.AddToBackpack(item)).ToArray() ) { i.Delete(); Equipment.Remove(i); } foreach (Item i in PackItems.Where(item => !Owner.AddToBackpack(item)).ToArray()) { i.Delete(); PackItems.Remove(i); } }