public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: case 0: { m_AmountMax = reader.ReadInt(); m_RequireExceptional = reader.ReadBool(); m_Material = (BulkMaterialType)reader.ReadInt(); m_Entries = new LargeBulkEntry[reader.ReadInt()]; for (int i = 0; i < m_Entries.Length; ++i) { m_Entries[i] = new LargeBulkEntry(this, reader, version); } break; } } if (Parent == null && Map == Map.Internal && Location == Point3D.Zero) { Delete(); } }
public BOBLargeSubEntry(LargeBulkEntry lbe) { m_ItemType = lbe.Details.Type; m_AmountCur = lbe.Amount; m_Number = lbe.Details.Number; m_Graphic = lbe.Details.Graphic; }
public BOBLargeSubEntry(LargeBulkEntry lbe) { this.m_ItemType = lbe.Details.Type; this.m_AmountCur = lbe.Amount; this.m_Number = lbe.Details.Number; this.m_Graphic = lbe.Details.Graphic; }
public BOBLargeSubEntry(LargeBulkEntry lbe) { ItemType = lbe.Details.Type; AmountCur = lbe.Amount; Number = lbe.Details.Number; Graphic = lbe.Details.Graphic; }
public LargeAlchemyBOD() { LargeBulkEntry[] entries; switch (Utility.Random(5)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeExplosive); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeGreater); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeLesser); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeRegular); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeToxic); break; } int amountMax = Utility.RandomList(10, 15, 20, 20); this.Hue = 2505; this.AmountMax = amountMax; this.Entries = entries; }
public LargeTailorBOD( int amountMax, bool reqExceptional, BulkMaterialType mat, LargeBulkEntry[] entries ) { Hue = 0x483; AmountMax = amountMax; Entries = entries; RequireExceptional = reqExceptional; Material = mat; }
public LargeHuntBOD(int amountMax, bool reqExceptional, int level, LargeBulkEntry[] entries) { this.Hue = HuntBodUtility.HuntBodDeedHue; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = (BulkMaterialType)level; }
public LargeSmithBOD( int amountMax, bool reqExceptional, BulkMaterialType mat, LargeBulkEntry[] entries ) { this.Hue = 0x44E; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = mat; }
public BOBLargeSubEntry(LargeBulkEntry lbe) { this.m_ItemType = lbe.Details.Type; this.m_AmountCur = lbe.Amount; this.m_Number = lbe.Details.Number; this.m_Graphic = lbe.Details.Graphic; this.m_Hue = lbe.Details.Hue; }
public LargeCarpentryBOD() { LargeBulkEntry[] entries; bool useMaterials = true; switch (Utility.Random(7)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeArmoire); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCabinets); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeChests); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeElvenWeapons); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeInstruments); break; case 5: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeWeapons); break; case 6: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeWoodFurniture); break; } int hue = 1512; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.OakWood, m_CarpentryingMaterialChances); } else { material = BulkMaterialType.None; } this.Hue = hue; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = material; }
public LargeTailorBOD() { LargeBulkEntry[] entries; bool useMaterials = false; switch (Utility.Random(14)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Farmer); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.FemaleLeatherSet); useMaterials = true; break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.FisherGirl); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Gypsy); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.HatSet); break; case 5: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Jester); break; case 6: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Lady); break; case 7: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.MaleLeatherSet); useMaterials = true; break; case 8: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Pirate); break; case 9: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.ShoeSet); break; case 10: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.StuddedSet); useMaterials = true; break; case 11: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.TownCrier); break; case 12: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Wizard); break; case 13: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.BoneSet); useMaterials = true; break; } int hue = 0x483; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.Spined, m_TailoringMaterialChances); } else { material = BulkMaterialType.None; } Hue = hue; AmountMax = amountMax; Entries = entries; RequireExceptional = reqExceptional; Material = material; }
public LargeSmithBOD(double theirSkill) { LargeBulkEntry[] entries; bool useMaterials = true; int rand = Utility.Random(8); switch (rand) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeRing); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePlate); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeChain); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeAxes); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeFencing); break; case 5: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeMaces); break; case 6: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePolearms); break; case 7: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeSwords); break; } if (rand > 2 && rand < 8) { useMaterials = false; } int hue = 0x44E; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); double bonus = (theirSkill - 100.0) * 0.02; Utility.FixMinMax(ref bonus, 0.0, 0.4); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances, bonus); } else { material = BulkMaterialType.None; } this.Hue = hue; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = material; }
public LargeTinkerBOD() { LargeBulkEntry[] entries; bool useMaterials = true; bool jewelry = false; int rand = Utility.Random(4); switch (rand) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeDining); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeJewelry); useMaterials = false; jewelry = true; break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeKeyGlobe); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeTools); useMaterials = false; break; } int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.DullCopper, m_BlackTinkerMaterialChances); } else { material = BulkMaterialType.None; } Hue = 1109; AmountMax = amountMax; Entries = entries; RequireExceptional = reqExceptional; Material = material; if (jewelry) { AssignGemType(); } }
public static LargeBulkEntry[] ConvertEntries(LargeBOD owner, SmallBulkEntry[] small) { LargeBulkEntry[] large = new LargeBulkEntry[small.Length]; for (int i = 0; i < small.Length; ++i) { large[i] = new LargeBulkEntry(owner, small[i]); } return(large); }
public LargeInscriptionBOD() { LargeBulkEntry[] entries; switch (Utility.Random(10)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeBooks); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCircle1); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCircle1and2); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCircle4); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCircle5); break; case 5: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCircle7); break; case 6: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeCircle8); break; case 7: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeNecromancy1); break; case 8: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeNecromancy2); break; case 9: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeNecromancy3); break; } int amountMax = Utility.RandomList(10, 15, 20, 20); Hue = 2598; AmountMax = amountMax; Entries = entries; }
public override int LabelNumber{ get{ return 1045151; } } // a bulk order deed public LargeBOD( int hue, int amountMax, bool requireExeptional, BulkMaterialType material, LargeBulkEntry[] entries ) : base( Core.AOS ? 0x2258 : 0x14EF ) { Weight = 1.0; Hue = hue; // Blacksmith: 0x44E; Tailoring: 0x483 LootType = LootType.Blessed; m_AmountMax = amountMax; m_RequireExceptional = requireExeptional; m_Material = material; m_Entries = entries; }
private LargeBulkEntry[] ReconstructEntries() { LargeBulkEntry[] entries = new LargeBulkEntry[m_Entries.Length]; for (int i = 0; i < m_Entries.Length; ++i) { entries[i] = new LargeBulkEntry(null, new SmallBulkEntry(m_Entries[i].ItemType, m_Entries[i].Number, m_Entries[i].Graphic)); entries[i].Amount = m_Entries[i].AmountCur; } return(entries); }
private LargeBulkEntry[] ReconstructEntries() { LargeBulkEntry[] entries = new LargeBulkEntry[m_Entries.Length]; for ( int i = 0; i < m_Entries.Length; ++i ) { entries[i] = new LargeBulkEntry( null, new SmallBulkEntry( m_Entries[i].ItemType, m_Entries[i].Number, m_Entries[i].Graphic ) ); entries[i].Amount = m_Entries[i].AmountCur; } return entries; }
public LargeFletchingBOD() { LargeBulkEntry[] entries; bool useMaterials = true; switch (Utility.Random(5)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeHumanBows1); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeHumanBows2); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeAmmunition); useMaterials = false; break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeElvenBows1); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeElvenBows2); break; } int hue = 1425; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = useMaterials && 0.825 > Utility.RandomDouble(); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.OakWood, m_FletchingingMaterialChances); } else { material = BulkMaterialType.None; } this.Hue = hue; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = material; }
public static bool CanExchangeBOD(Mobile from, BaseVendor vendor, IBOD bod, int cost) { if (bod.BODType != vendor.BODType) { vendor.SayTo(from, 1152298, 0x3B2); // I don't deal in those goods. return(false); } if (bod is SmallBOD sb && sb.AmountCur > 0) { vendor.SayTo(from, 1152299, 0x3B2); // I am sorry to say I cannot work with a deed that is even partially filled. return(false); } if (bod is LargeBOD lb && lb.Entries != null) { LargeBulkEntry first = null; for (var index = 0; index < lb.Entries.Length; index++) { var e = lb.Entries[index]; if (e.Amount > 0) { first = e; break; } } if (first != null) { vendor.SayTo(from, 1152299, 0x3B2); // I am sorry to say I cannot work with a deed that is even partially filled. return(false); } } if (bod.AmountMax == 20 && (!CanBeExceptional(bod) || bod.RequireExceptional) && (!CanUseMaterial(bod) || bod.Material == BulkMaterialType.Valorite || bod.Material == BulkMaterialType.Frostwood || bod.Material == BulkMaterialType.Barbed)) { vendor.SayTo(from, 1152291, 0x3B2); // I won't be able to replace that bulk order with a better one. return(false); } if (cost > -1 && !Banker.Withdraw(from, cost, true)) { vendor.SayTo(from, 1152302, 0x3B2); // I am afraid your bank box does not contain the funds needed to complete this transaction. return(false); } return(true); }
public LargeHuntBOD() { int curLevel = 0; int levelMax = 0; int amountMax = 0; HuntBodUtility.GetLargeBodProps(Utility.RandomMinMax(80, 120), out levelMax, out amountMax); LargeBulkEntry[] entries = LargeBulkEntry.ConvertEntries(this, HuntBodUtility.GetLargeEntry(out curLevel, levelMax)); this.Hue = HuntBodUtility.HuntBodDeedHue; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = false; this.Material = (BulkMaterialType)curLevel; }
public static LargeHuntBOD CreateRandomFor(Mobile m, double skill) { int curLevel = 0; int levelMax = 0; int amountMax = 0; HuntBodUtility.GetLargeBodProps(skill, out levelMax, out amountMax); LargeHuntBOD largeBod = new LargeHuntBOD(amountMax, false, 0, null); largeBod.Entries = LargeBulkEntry.ConvertEntries(largeBod, HuntBodUtility.GetLargeEntry(out curLevel, levelMax)); largeBod.Material = (BulkMaterialType)curLevel; return(largeBod); }
public LargeSmithBOD() { LargeBulkEntry[] entries; bool useMaterials = true; switch (Utility.Random(4)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeRing); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePlate); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeChain); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeSEPlate); break; } int hue = 0x44E; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances); } else { material = BulkMaterialType.None; } this.Hue = hue; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = material; }
public LargeCookingBOD() { LargeBulkEntry[] entries; bool nonexceptional = false; switch (Utility.Random(7)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeBarbeque); nonexceptional = true; break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeDough); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeFruits); nonexceptional = true; break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeMiso); break; case 4: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeSushi); break; case 5: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeSweets); break; case 6: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeUnbakedPies); break; } this.Hue = 1169; this.AmountMax = Utility.RandomList(10, 15, 20, 20); this.Entries = entries; this.RequireExceptional = !nonexceptional && 0.825 > Utility.RandomDouble(); }
public LargeSmithBOD() { bool useMaterials = true; int rand = Utility.Random(8); LargeBulkEntry[] entries = rand switch { 1 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePlate), 2 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeChain), 3 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeAxes), 4 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeFencing), 5 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeMaces), 6 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePolearms), 7 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeSwords), _ => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeRing), }; if (rand > 2 && rand < 8) { useMaterials = false; } int hue = 0x44E; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances); } else { material = BulkMaterialType.None; } Hue = hue; AmountMax = amountMax; Entries = entries; RequireExceptional = reqExceptional; Material = material; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: { m_Owner = reader.ReadMobile(); goto case 0; } case 0: { m_AmountMax = reader.ReadInt(); m_RequireExceptional = reader.ReadBool(); m_Material = (BulkMaterialType)reader.ReadInt(); m_Entries = new LargeBulkEntry[reader.ReadInt()]; for (int i = 0; i < m_Entries.Length; ++i) { m_Entries[i] = new LargeBulkEntry(this, reader); } break; } } // if ( Weight == 0.0 ) // Weight = 1.0; // if ( Core.AOS && ItemID == 0x14EF ) // ItemID = 0x2258; if (Parent == null && Map == Map.Internal && Location == Point3D.Zero) { Delete(); } }
public LargeCarpenterBOD() { LargeBulkEntry[] entries; bool useMaterials = true; switch (Utility.Random(4)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.AllInstrument); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Percussion); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Staff); break; case 3: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.String); break; } int hue = 0x30; string name = "Large Carpenter Bulk Order"; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.Pine, m_CarpenterMaterialChances); } else { material = BulkMaterialType.None; } this.Hue = hue; this.Name += name; this.AmountMax = amountMax; this.Entries = entries; this.RequireExceptional = reqExceptional; this.Material = material; }
public LargeSmithBOD() { LargeBulkEntry[] entries; var useMaterials = true; var rand = Utility.Random(8); entries = rand switch { 0 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeRing), 1 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePlate), 2 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeChain), 3 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeAxes), 4 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeFencing), 5 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeMaces), 6 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargePolearms), 7 => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeSwords), _ => LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.LargeRing) }; if (rand > 2 && rand < 8) { useMaterials = false; } var hue = 0x44E; var amountMax = Utility.RandomList(10, 15, 20, 20); var reqExceptional = Utility.RandomDouble() < 0.825; var material = useMaterials ? GetRandomMaterial(BulkMaterialType.DullCopper, m_BlacksmithMaterialChances) : BulkMaterialType.None; Hue = hue; AmountMax = amountMax; Entries = entries; RequireExceptional = reqExceptional; Material = material; }
public LargeFletcherBOD() { LargeBulkEntry[] entries; bool useMaterials = true; switch (Utility.Random(3)) { default: case 0: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.AllBow); break; case 1: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.Bow); break; case 2: entries = LargeBulkEntry.ConvertEntries(this, LargeBulkEntry.CrossBow); break; } int hue = 0x58; string name = "Large Fletcher Bulk Order"; int amountMax = Utility.RandomList(10, 15, 20, 20); bool reqExceptional = (0.825 > Utility.RandomDouble()); BulkMaterialType material; if (useMaterials) { material = GetRandomMaterial(BulkMaterialType.OakWood, m_FletcherMaterialChances); } else { material = BulkMaterialType.None; } Hue = hue; Name += name; AmountMax = amountMax; Entries = entries; RequireExceptional = reqExceptional; Material = material; }
//master constructor public LargeBODListEntry( Item item ) : base ( item ) { LargeBOD bod = (LargeBOD)item; _AmountMax = bod.AmountMax; _RequireExceptional = bod.RequireExceptional; _Material = bod.Material; //proper cloning is required _Entries = new LargeBulkEntry[ bod.Entries.Length ]; for( int i = 0; i < bod.Entries.Length; i++ ) { _Entries[i] = new LargeBulkEntry( null, bod.Entries[i].Details ); _Entries[i].Amount = bod.Entries[i].Amount; } //this produces the name for the bod based on the bod name definitions GenerateContentsName(); }
public void EndCombine(Mobile from, object o) { if (o is Item && ((Item)o).IsChildOf(from.Backpack)) { if (o is SmallBOD) { SmallBOD small = (SmallBOD)o; LargeBulkEntry entry = null; for (int i = 0; entry == null && i < m_Entries.Length; ++i) { if (CheckType(small, m_Entries[i].Details.Type)) { entry = m_Entries[i]; } } if (entry == null) { from.SendLocalizedMessage(1045160); // That is not a bulk order for this large request. } else if (m_RequireExceptional && !small.RequireExceptional) { from.SendLocalizedMessage(1045161); // Both orders must be of exceptional quality. } else if (small.Material != m_Material && m_Material != BulkMaterialType.None) { from.SendLocalizedMessage(1157311); // Both orders must use the same resource type. } else if (m_AmountMax != small.AmountMax) { from.SendLocalizedMessage(1045163); // The two orders have different requested amounts and cannot be combined. } else if (small.AmountCur < small.AmountMax) { from.SendLocalizedMessage(1045164); // The order to combine with is not completed. } else if (entry.Amount >= m_AmountMax) { from.SendLocalizedMessage(1045166); // The maximum amount of requested items have already been combined to this deed. } else { entry.Amount += small.AmountCur; small.Delete(); from.SendLocalizedMessage(1045165); // The orders have been combined. from.SendGump(new LargeBODGump(from, this)); if (!Complete) { BeginCombine(from); } } } else { from.SendLocalizedMessage(1045159); // That is not a bulk order. } } else { from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it. } }
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25) { m_From = from; m_Deed = deed; m_From.CloseGump(typeof(LargeBODGump)); m_From.CloseGump(typeof(SmallBODGump)); LargeBulkEntry[] entries = deed.Entries; AddPage(0); int height = 0; if (BulkOrderSystem.NewSystemEnabled) { if (deed.RequireExceptional || deed.Material != BulkMaterialType.None) { height += 24; } if (deed.RequireExceptional) { height += 24; } if (deed.Material != BulkMaterialType.None) { height += 24; } } AddBackground(50, 10, 455, 218 + height + (entries.Length * 24), 5054); AddImageTiled(58, 20, 438, 200 + height + (entries.Length * 24), 2624); AddAlphaRegion(58, 20, 438, 200 + height + (entries.Length * 24)); AddImage(45, 5, 10460); AddImage(480, 5, 10460); AddImage(45, 203 + height + (entries.Length * 24), 10460); AddImage(480, 203 + height + (entries.Length * 24), 10460); AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false); // Amount to make: AddLabel(275, 48, 1152, deed.AmountMax.ToString()); AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF, false, false); // Items requested: AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished: int y = 96; for (int i = 0; i < entries.Length; ++i) { LargeBulkEntry entry = entries[i]; SmallBulkEntry details = entry.Details; AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF, false, false); AddLabel(275, y, 0x480, entry.Amount.ToString()); y += 24; } if (deed.RequireExceptional || deed.Material != BulkMaterialType.None) { AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet: y += 24; } if (deed.RequireExceptional) { AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional. y += 24; } if (deed.Material != BulkMaterialType.None) { AddHtmlLocalized(75, y, 300, 20, SmallBODGump.GetMaterialNumberFor(deed.Material), 0x7FFF, false, false); // All items must be made with x material. y += 24; } if (BulkOrderSystem.NewSystemEnabled) { BODContext c = BulkOrderSystem.GetContext((PlayerMobile)from); int points = 0; double banked = 0.0; BulkOrderSystem.ComputePoints(deed, out points, out banked); AddHtmlLocalized(75, y, 300, 20, 1157301, string.Format("{0}\t{1}", points, banked.ToString("0.000000")), 0x7FFF, false, false); // Worth ~1_POINTS~ turn in points and ~2_POINTS~ bank points. y += 24; AddButton(125, y, 4005, 4007, 3, GumpButtonType.Reply, 0); AddHtmlLocalized(160, y, 300, 20, c.PointsMode == PointsMode.Enabled ? 1157302 : c.PointsMode == PointsMode.Disabled ? 1157303 : 1157309, 0x7FFF, false, false); // Banking Points Enabled/Disabled/Automatic y += 24; AddButton(125, y, 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(160, y, 300, 20, 1045154, 0x7FFF, false, false); // Combine this deed with the item requested. y += 24; AddButton(125, y, 4005, 4007, 4, GumpButtonType.Reply, 0); AddHtmlLocalized(160, y, 300, 20, 1157304, 0x7FFF, false, false); // Combine this deed with contained items. y += 24; AddButton(125, y, 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(160, y, 120, 20, 1011441, 0x7FFF, false, false); // EXIT } else { AddButton(125, 168 + (entries.Length * 24), 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(160, 168 + (entries.Length * 24), 300, 20, 1045155, 0x7FFF, false, false); // Combine this deed with another deed. AddButton(125, 192 + (entries.Length * 24), 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(160, 192 + (entries.Length * 24), 120, 20, 1011441, 0x7FFF, false, false); // EXIT } }
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25) { m_From = from; m_Deed = deed; m_From.CloseGump(typeof(LargeBODGump)); m_From.CloseGump(typeof(SmallBODGump)); LargeBulkEntry[] entries = deed.Entries; AddPage(0); AddBackground(50, 10, 455, 236 + (entries.Length * 24), 5054); AddImageTiled(58, 20, 438, 217 + (entries.Length * 24), 2624); AddAlphaRegion(58, 20, 438, 217 + (entries.Length * 24)); AddImage(45, 5, 10460); AddImage(480, 5, 10460); AddImage(45, 221 + (entries.Length * 24), 10460); AddImage(480, 221 + (entries.Length * 24), 10460); AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false); // Amount to make: AddLabel(275, 48, 1152, deed.AmountMax.ToString()); AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF, false, false); // Items requested: AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished: int y = 96; for (int i = 0; i < entries.Length; ++i) { LargeBulkEntry entry = entries[i]; SmallBulkEntry details = entry.Details; AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF, false, false); AddLabel(275, y, 0x480, entry.Amount.ToString()); y += 24; } if (deed.RequireExceptional || deed.Material != BulkMaterialType.None) { AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet: y += 24; } if (deed.RequireExceptional) { AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional. y += 24; } switch ((int)deed.Material) { case 1: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with dull copper ingots", false, false); break; case 2: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with shadow iron ingots", false, false); break; case 3: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with copper ingots", false, false); break; case 4: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with bronze ingots", false, false); break; case 5: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with gold ingots", false, false); break; case 6: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with agapite ingots", false, false); break; case 7: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with verite ingots", false, false); break; case 8: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with valorite ingots", false, false); break; case 9: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with silver ingots", false, false); break; //case 10: AddHtml( 75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with platinum ingots", false, false ); break; //case 11: AddHtml( 75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with mythril ingots", false, false ); break; //case 12: AddHtml( 75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with obsidian ingots", false, false ); break; case 10: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with jade ingots", false, false); break; case 11: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with moonstone ingots", false, false); break; case 12: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with sunstone ingots", false, false); break; //case 16: AddHtml( 75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with bloodstone ingots", false, false ); break; case 13: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with spined leather", false, false); break; case 14: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with horned leather", false, false); break; case 15: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with barbed leather", false, false); break; case 16: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with dragon leather", false, false); break; case 17: AddHtml(75, y, 400, 25, "<basefont color=#FFF000>All items must be crafted with daemon leather", false, false); break; case 18: AddHtml(75, y, 400, 25, "<basefont color=#FF0000>All items must be crafted with pine wood", false, false); break; case 19: AddHtml(75, y, 400, 25, "<basefont color=#FF0000>All items must be crafted with ash wood", false, false); break; case 20: AddHtml(75, y, 400, 25, "<basefont color=#FF0000>All items must be crafted with mohogany wood", false, false); break; case 21: AddHtml(75, y, 400, 25, "<basefont color=#FF0000>All items must be crafted with yew wood", false, false); break; case 22: AddHtml(75, y, 400, 25, "<basefont color=#FF0000>All items must be crafted with oak wood", false, false); break; } if ((int)deed.Material >= 1 && (int)deed.Material <= 35) { y += 24; } if (!deed.Complete) { AddButton(90, 168 + (entries.Length * 24), 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(125, 168 + (entries.Length * 24), 300, 20, 1045155, 0x7FFF, false, false); // Combine this deed with another deed. } else { if (deed is LargeSmithBOD) { AddButton(90, 168 + (entries.Length * 24), 4005, 4007, 3, GumpButtonType.Reply, 0); } else if (deed is LargeTailorBOD) { AddButton(90, 168 + (entries.Length * 24), 4005, 4007, 4, GumpButtonType.Reply, 0); } AddLabel(125, 168 + (entries.Length * 24), 0x480, "Claim your reward (must be near the apropriate vendor)"); //claim the bod reward near a vendor } AddButton(90, 192 + (entries.Length * 24), 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(125, 192 + (entries.Length * 24), 120, 20, 1011441, 0x7FFF, false, false); // EXIT }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); _AmountMax = reader.ReadInt(); _RequireExceptional = reader.ReadBool(); _Material = (BulkMaterialType)reader.ReadInt(); int count = reader.ReadInt(); _Entries = new LargeBulkEntry[ count ]; for( int i = 0; i < count; i++ ) { _Entries[i] = new LargeBulkEntry( null, reader ); } GenerateContentsName(); }
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25) { m_From = from; m_Deed = deed; m_From.CloseGump(typeof(LargeBODGump)); m_From.CloseGump(typeof(SmallBODGump)); LargeBulkEntry[] entries = deed.Entries; AddPage(0); AddBackground(50, 10, 455, 236 + (entries.Length * 24), 5054); AddImageTiled(58, 20, 438, 217 + (entries.Length * 24), 2624); AddAlphaRegion(58, 20, 438, 217 + (entries.Length * 24)); AddImage(45, 5, 10460); AddImage(480, 5, 10460); AddImage(45, 221 + (entries.Length * 24), 10460); AddImage(480, 221 + (entries.Length * 24), 10460); AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false); // Amount to make: AddLabel(275, 48, 1152, deed.AmountMax.ToString()); AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF, false, false); // Items requested: AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished: int y = 96; for (int i = 0; i < entries.Length; ++i) { LargeBulkEntry entry = entries[i]; SmallBulkEntry details = entry.Details; //STARMOD: Teiravon m_Item = (Item)Activator.CreateInstance(entries[i].Details.Type); if (m_Item.Name == null) { AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF, false, false); } else { AddHtml(75, y, 210, 20, "<basefont color=WHITE>" + m_Item.Name, false, false); } AddLabel(275, y, 0x480, entry.Amount.ToString()); m_Item.Delete(); //ENDMOD: Teiravon y += 24; } if (deed.RequireExceptional || deed.Material != BulkMaterialType.None) { AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet: y += 24; } if (deed.RequireExceptional) { AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional. y += 24; } if (deed.Material != BulkMaterialType.None && deed.Material >= BulkMaterialType.Spined) { AddHtmlLocalized(75, y, 300, 20, GetMaterialNumberFor(deed.Material), 0x7FFF, false, false); // All items must be made with x material. } else { switch ((int)deed.Material) { case 1: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with dull copper ingots", false, false); break; case 2: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with shadow iron ingots", false, false); break; case 3: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with copper ingots", false, false); break; case 4: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with bronze ingots", false, false); break; case 5: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with gold ingots", false, false); break; case 6: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with agapite ingots", false, false); break; case 7: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with verite ingots", false, false); break; case 8: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with valorite ingots", false, false); break; case 9: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with pine", false, false); break; case 10: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with redwood", false, false); break; case 11: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with white pine", false, false); break; case 12: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with ashwood", false, false); break; case 13: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with silver birch", false, false); break; case 14: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with yew", false, false); break; case 15: AddHtml(75, y, 300, 20, "<basefont color=WHITE>All items must be crafted with black oak", false, false); break; } } AddButton(125, 168 + (entries.Length * 24), 4005, 4007, 2, GumpButtonType.Reply, 0); AddHtmlLocalized(160, 168 + (entries.Length * 24), 300, 20, 1045155, 0x7FFF, false, false); // Combine this deed with another deed. AddButton(125, 192 + (entries.Length * 24), 4005, 4007, 1, GumpButtonType.Reply, 0); AddHtmlLocalized(160, 192 + (entries.Length * 24), 120, 20, 1011441, 0x7FFF, false, false); // EXIT }
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25) { this.m_From = from; this.m_Deed = deed; this.m_From.CloseGump(typeof(LargeBODGump)); this.m_From.CloseGump(typeof(SmallBODGump)); LargeBulkEntry[] entries = deed.Entries; this.AddPage(0); this.AddBackground(50, 10, 455, 236 + (entries.Length * 24), 5054); this.AddImageTiled(58, 20, 438, 217 + (entries.Length * 24), 2624); this.AddAlphaRegion(58, 20, 438, 217 + (entries.Length * 24)); this.AddImage(45, 5, 10460); this.AddImage(480, 5, 10460); this.AddImage(45, 221 + (entries.Length * 24), 10460); this.AddImage(480, 221 + (entries.Length * 24), 10460); this.AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order this.AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false); // Amount to make: this.AddLabel(275, 48, 1152, deed.AmountMax.ToString()); this.AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF, false, false); // Items requested: this.AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished: int y = 96; for (int i = 0; i < entries.Length; ++i) { LargeBulkEntry entry = entries[i]; SmallBulkEntry details = entry.Details; this.AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF, false, false); this.AddLabel(275, y, 0x480, entry.Amount.ToString()); y += 24; } if (deed.RequireExceptional || deed.Material != BulkMaterialType.None) { this.AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet: y += 24; } if (deed.RequireExceptional) { this.AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional. y += 24; } if (deed.Material != BulkMaterialType.None) { this.AddHtmlLocalized(75, y, 300, 20, GetMaterialNumberFor(deed.Material), 0x7FFF, false, false); // All items must be made with x material. } this.AddButton(125, 168 + (entries.Length * 24), 4005, 4007, 2, GumpButtonType.Reply, 0); this.AddHtmlLocalized(160, 168 + (entries.Length * 24), 300, 20, 1045155, 0x7FFF, false, false); // Combine this deed with another deed. this.AddButton(125, 192 + (entries.Length * 24), 4005, 4007, 1, GumpButtonType.Reply, 0); this.AddHtmlLocalized(160, 192 + (entries.Length * 24), 120, 20, 1011441, 0x7FFF, false, false); // EXIT }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); switch ( version ) { case 0: { m_AmountMax = reader.ReadInt(); m_RequireExceptional = reader.ReadBool(); m_Material = (BulkMaterialType)reader.ReadInt(); m_Entries = new LargeBulkEntry[reader.ReadInt()]; for ( int i = 0; i < m_Entries.Length; ++i ) m_Entries[i] = new LargeBulkEntry( this, reader ); break; } } if ( Weight == 0.0 ) Weight = 1.0; if ( Core.AOS && ItemID == 0x14EF ) ItemID = 0x2258; if ( Parent == null && Map == Map.Internal && Location == Point3D.Zero ) Delete(); }
//clone constructor public LargeBODListEntry( LargeBODListEntry entry ) : base( entry ) { _AmountMax = entry.AmountMax; _RequireExceptional = entry.RequireExceptional; _Material = entry.Material; _Entries = new LargeBulkEntry[ entry.Entries.Length ]; //proper cloning is required for( int i = 0; i < entry.Entries.Length; i++ ) { _Entries[i] = new LargeBulkEntry( null, entry.Entries[i].Details ); _Entries[i].Amount = entry.Entries[i].Amount; } GenerateContentsName(); }
public void EndCombine(Mobile from, object o) { if (o is Item && ((Item)o).IsChildOf(from.Backpack)) { if (o is SmallBOD) { SmallBOD small = (SmallBOD)o; LargeBulkEntry entry = null; for (int i = 0; entry == null && i < this.m_Entries.Length; ++i) { if (this.m_Entries[i].Details.Type == small.Type) { entry = this.m_Entries[i]; } } if (entry == null) { from.SendLocalizedMessage(1045160); // That is not a bulk order for this large request. } else if (this.m_RequireExceptional && !small.RequireExceptional) { from.SendLocalizedMessage(1045161); // Both orders must be of exceptional quality. } else if (this.m_Material >= BulkMaterialType.DullCopper && this.m_Material <= BulkMaterialType.Valorite && small.Material != this.m_Material) { from.SendLocalizedMessage(1045162); // Both orders must use the same ore type. } //daat99 OWLTR start - custom wood else if (m_Material >= BulkMaterialType.Heartwood && m_Material <= BulkMaterialType.Petrified && small.Material != m_Material) { from.SendMessage("Both orders must use the same wood type."); // Both orders must use the same leather type. } //daat99 OWLTR end - custom wood else if (this.m_AmountMax != small.AmountMax) { from.SendLocalizedMessage(1045163); // The two orders have different requested amounts and cannot be combined. } else if (small.AmountCur < small.AmountMax) { from.SendLocalizedMessage(1045164); // The order to combine with is not completed. } else if (entry.Amount >= this.m_AmountMax) { from.SendLocalizedMessage(1045166); // The maximum amount of requested items have already been combined to this deed. } else { entry.Amount += small.AmountCur; small.Delete(); from.SendLocalizedMessage(1045165); // The orders have been combined. from.SendGump(new LargeBODGump(from, this)); if (!this.Complete) { this.BeginCombine(from); } } } else { from.SendLocalizedMessage(1045159); // That is not a bulk order. } } else { from.SendLocalizedMessage(1045158); // You must have the item in your backpack to target it. } }
public static LargeBulkEntry[] ConvertEntries( LargeBOD owner, SmallBulkEntry[] small ) { LargeBulkEntry[] large = new LargeBulkEntry[small.Length]; for ( int i = 0; i < small.Length; ++i ) large[i] = new LargeBulkEntry( owner, small[i] ); return large; }