public BOBSmallEntry( GenericReader reader ) { int version = reader.ReadEncodedInt(); switch ( version ) { case 0: { string type = reader.ReadString(); if ( type != null ) m_ItemType = ScriptCompiler.FindTypeByFullName( type ); m_RequireExceptional = reader.ReadBool(); m_DeedType = (BODType)reader.ReadEncodedInt(); m_Material = (BulkMaterialType)reader.ReadEncodedInt(); m_AmountCur = reader.ReadEncodedInt(); m_AmountMax = reader.ReadEncodedInt(); m_Number = reader.ReadEncodedInt(); m_Graphic = reader.ReadEncodedInt(); m_Price = reader.ReadEncodedInt(); break; } } }
public static BulkGenericType Classify( BODType deedType, Type itemType ) { if ( deedType == BODType.Tailor ) { if ( itemType == null || itemType.IsSubclassOf( typeof( BaseArmor ) ) || itemType.IsSubclassOf( typeof( BaseShoes ) ) ) return BulkGenericType.Leather; return BulkGenericType.Cloth; } //else if ( deedType == BODType.Fletcher ) ////////////////////////////////// // Cap & Fletch BOD Addon 2/2 // ////////////////////////////////// else if ( deedType == BODType.Fletcher ) { if ( itemType == null || itemType.IsSubclassOf( typeof( BaseRanged ) ) ) return BulkGenericType.Wood; return BulkGenericType.Wood; } else if ( deedType == BODType.Carpenter ) { if ( itemType == null || itemType.IsSubclassOf( typeof( BaseStaff ) ) || itemType.IsSubclassOf( typeof( BaseShield ) ) ) return BulkGenericType.Wood; return BulkGenericType.Wood; } ////////////////////////////////// // End of Edit 2/2 // ////////////////////////////////// //return BulkGenericType.Wood; return BulkGenericType.Iron; }
public BOBLargeEntry(GenericReader reader) { int version = reader.ReadEncodedInt(); switch ( version ) { case 0: { this.m_RequireExceptional = reader.ReadBool(); this.m_DeedType = (BODType)reader.ReadEncodedInt(); this.m_Material = (BulkMaterialType)reader.ReadEncodedInt(); this.m_AmountMax = reader.ReadEncodedInt(); this.m_Price = reader.ReadEncodedInt(); this.m_Entries = new BOBLargeSubEntry[reader.ReadEncodedInt()]; for (int i = 0; i < this.m_Entries.Length; ++i) this.m_Entries[i] = new BOBLargeSubEntry(reader); break; } } }
public bool CheckFilter( BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType ) { BOBFilter f = ( m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter ); if ( f.IsDefault ) return true; if ( f.Quality == 1 && reqExc ) return false; else if ( f.Quality == 2 && !reqExc ) return false; if ( f.Quantity == 1 && amountMax != 10 ) return false; else if ( f.Quantity == 2 && amountMax != 15 ) return false; else if ( f.Quantity == 3 && amountMax != 20 ) return false; if ( f.Type == 1 && isLarge ) return false; else if ( f.Type == 2 && !isLarge ) return false; switch ( f.Material ) { default: case 0: return true; case 1: return ( deedType == BODType.Smith ); case 2: return ( deedType == BODType.Tailor ); case 3: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Iron ); case 4: return ( mat == BulkMaterialType.DullCopper ); case 5: return ( mat == BulkMaterialType.ShadowIron ); case 6: return ( mat == BulkMaterialType.Copper ); case 7: return ( mat == BulkMaterialType.Bronze ); case 8: return ( mat == BulkMaterialType.Gold ); case 9: return ( mat == BulkMaterialType.Agapite ); case 10: return ( mat == BulkMaterialType.Verite ); case 11: return ( mat == BulkMaterialType.Valorite ); case 12: return ( mat == BulkMaterialType.Silver ); //case 13: return ( mat == BulkMaterialType.Platinum ); //case 14: return ( mat == BulkMaterialType.Mythril ); //case 15: return ( mat == BulkMaterialType.Obsidian ); case 13: return ( mat == BulkMaterialType.Jade ); case 14: return ( mat == BulkMaterialType.Moonstone ); case 15: return ( mat == BulkMaterialType.Sunstone ); //case 19: return ( mat == BulkMaterialType.Bloodstone ); case 16: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Cloth ); case 17: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Leather ); case 18: return ( mat == BulkMaterialType.Spined ); case 19: return ( mat == BulkMaterialType.Horned ); case 20: return ( mat == BulkMaterialType.Barbed ); case 21: return ( mat == BulkMaterialType.DragonL ); case 22: return ( mat == BulkMaterialType.Daemon ); } }
public static BulkGenericType Classify( BODType deedType, Type itemType ) { if ( deedType == BODType.Tailor ) { if ( itemType == null || itemType.IsSubclassOf( typeof( BaseArmor ) ) || itemType.IsSubclassOf( typeof( BaseShoes ) ) ) return BulkGenericType.Leather; return BulkGenericType.Cloth; } return BulkGenericType.Iron; }
public BOBSmallEntry( SmallBOD bod ) { m_ItemType = bod.Type; m_RequireExceptional = bod.RequireExceptional; if ( bod is SmallTailorBOD ) m_DeedType = BODType.Tailor; else if ( bod is SmallSmithBOD ) m_DeedType = BODType.Smith; m_Material = bod.Material; m_AmountCur = bod.AmountCur; m_AmountMax = bod.AmountMax; m_Number = bod.Number; m_Graphic = bod.Graphic; }
public BOBLargeEntry(LargeBOD bod) { this.m_RequireExceptional = bod.RequireExceptional; if (bod is LargeTailorBOD) this.m_DeedType = BODType.Tailor; else if (bod is LargeSmithBOD) this.m_DeedType = BODType.Smith; this.m_Material = bod.Material; this.m_AmountMax = bod.AmountMax; this.m_Entries = new BOBLargeSubEntry[bod.Entries.Length]; for (int i = 0; i < this.m_Entries.Length; ++i) this.m_Entries[i] = new BOBLargeSubEntry(bod.Entries[i]); }
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType) { switch (type) { case BODType.Smith: { switch (mat) { case BulkMaterialType.None: return(1062226); case BulkMaterialType.DullCopper: return(1018332); case BulkMaterialType.ShadowIron: return(1018333); case BulkMaterialType.Copper: return(1018334); case BulkMaterialType.Bronze: return(1018335); case BulkMaterialType.Gold: return(1018336); case BulkMaterialType.Agapite: return(1018337); case BulkMaterialType.Verite: return(1018338); case BulkMaterialType.Valorite: return(1018339); } break; } case BODType.Tailor: { switch (mat) { case BulkMaterialType.None: { if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes))) { return(1062235); } return(1044286); } case BulkMaterialType.Spined: return(1062236); case BulkMaterialType.Horned: return(1062237); case BulkMaterialType.Barbed: return(1062238); } break; } } return("Invalid"); }
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType) { switch (type) { case BODType.Tinkering: case BODType.Smith: { if (type == BODType.Tinkering && mat == BulkMaterialType.None && BGTClassifier.Classify(type, itemType) == BulkGenericType.Wood) { return(1079435); } else { switch (mat) { case BulkMaterialType.None: return(1062226); case BulkMaterialType.DullCopper: return(1018332); case BulkMaterialType.ShadowIron: return(1018333); case BulkMaterialType.Copper: return(1018334); case BulkMaterialType.Bronze: return(1018335); case BulkMaterialType.Gold: return(1018336); case BulkMaterialType.Agapite: return(1018337); case BulkMaterialType.Verite: return(1018338); case BulkMaterialType.Valorite: return(1018339); //daat9 OWLTR start - custom resources case BulkMaterialType.Blaze: return("Blaze"); case BulkMaterialType.Ice: return("Ice"); case BulkMaterialType.Toxic: return("Toxic"); case BulkMaterialType.Electrum: return("Electrum"); case BulkMaterialType.Platinum: return("Platinum"); //daat9 OWLTR end - custom resources } } break; } case BODType.Tailor: { switch (mat) { case BulkMaterialType.None: { if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes))) { return(1062235); } return(1044286); } case BulkMaterialType.Spined: return(1062236); case BulkMaterialType.Horned: return(1062237); case BulkMaterialType.Barbed: return(1062238); //daat9 OWLTR start - custom resources case BulkMaterialType.Polar: return("Polar"); case BulkMaterialType.Synthetic: return("Synthetic"); case BulkMaterialType.BlazeL: return("Blaze"); case BulkMaterialType.Daemonic: return("Daemonic"); case BulkMaterialType.Shadow: return("Shadow"); case BulkMaterialType.Frost: return("Frost"); case BulkMaterialType.Ethereal: return("Ethereal"); //daat9 OWLTR end - custom resources } break; } case BODType.Carpentry: case BODType.Fletching: { if (mat == BulkMaterialType.None) { return(1079435); } switch (mat) { default: case BulkMaterialType.OakWood: return(1071428); case BulkMaterialType.AshWood: return(1071429); case BulkMaterialType.YewWood: return(1071430); case BulkMaterialType.Heartwood: return(1071432); case BulkMaterialType.Bloodwood: return(1071431); case BulkMaterialType.Frostwood: return(1071433); } } } return(""); }
public object GetMaterialName( BulkMaterialType mat, BODType type, Type itemType ) { switch ( type ) { case BODType.Smith: { switch ( mat ) { case BulkMaterialType.None: return 1062226; case BulkMaterialType.DullCopper: return 1018332; case BulkMaterialType.ShadowIron: return 1018333; case BulkMaterialType.Copper: return 1018334; case BulkMaterialType.Bronze: return 1018335; case BulkMaterialType.Gold: return 1018336; case BulkMaterialType.Agapite: return 1018337; case BulkMaterialType.Verite: return 1018338; case BulkMaterialType.Valorite: return 1018339; } break; } case BODType.Tailor: { switch ( mat ) { case BulkMaterialType.None: { if ( itemType.IsSubclassOf( typeof( BaseArmor ) ) || itemType.IsSubclassOf( typeof( BaseShoes ) ) ) return 1062235; return 1044286; } case BulkMaterialType.Spined: return 1062236; case BulkMaterialType.Horned: return 1062237; case BulkMaterialType.Barbed: return 1062238; } break; } } return "Invalid"; }
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType) { switch (type) { case BODType.Smith: { switch (mat) { case BulkMaterialType.None: return(1062226); case BulkMaterialType.DullCopper: return(1018332); case BulkMaterialType.ShadowIron: return(1018333); case BulkMaterialType.Copper: return(1018334); case BulkMaterialType.Bronze: return(1018335); case BulkMaterialType.Gold: return(1018336); case BulkMaterialType.Agapite: return(1018337); case BulkMaterialType.Verite: return(1018338); case BulkMaterialType.Valorite: return(1018339); case BulkMaterialType.Silver: return("Silver"); //case BulkMaterialType.Platinum: return "Platinum"; //case BulkMaterialType.Mythril: return "Mythril"; //case BulkMaterialType.Obsidian: return "Obsidian"; case BulkMaterialType.Jade: return("Jade"); case BulkMaterialType.Moonstone: return("Moonstone"); case BulkMaterialType.Sunstone: return("Sunstone"); //case BulkMaterialType.Bloodstone: return "Bloodstone"; } break; } case BODType.Tailor: { switch (mat) { case BulkMaterialType.None: { if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes))) { return(1062235); } return(1044286); } case BulkMaterialType.Spined: return(1062236); case BulkMaterialType.Horned: return(1062237); case BulkMaterialType.Barbed: return(1062238); case BulkMaterialType.DragonL: return("Dragon"); case BulkMaterialType.Daemon: return("Daemon"); } break; } case BODType.Fletcher: case BODType.Carpenter: { switch (mat) { case BulkMaterialType.None: return("Wood"); case BulkMaterialType.Pine: return("Pine"); case BulkMaterialType.Ash: return("Ash"); case BulkMaterialType.Mahogany: return("Mahogany"); case BulkMaterialType.Yew: return("Yew"); case BulkMaterialType.Oak: return("Oak"); } break; } } return("Invalid"); }
public BODData(BODType type, BODEntry entry) { Type = type; Entry = entry; }
public object GetMaterialName( BulkMaterialType mat, BODType type, Type itemType ) { switch ( type ) { case BODType.Smith: { switch ( mat ) { case BulkMaterialType.None: return 1062226; case BulkMaterialType.DullCopper: return 1018332; case BulkMaterialType.ShadowIron: return 1018333; case BulkMaterialType.Copper: return 1018334; case BulkMaterialType.Bronze: return 1018335; case BulkMaterialType.Gold: return 1018336; case BulkMaterialType.Agapite: return 1018337; case BulkMaterialType.Verite: return 1018338; case BulkMaterialType.Valorite: return 1018339; case BulkMaterialType.Silver: return "Silver"; //case BulkMaterialType.Platinum: return "Platinum"; //case BulkMaterialType.Mythril: return "Mythril"; //case BulkMaterialType.Obsidian: return "Obsidian"; case BulkMaterialType.Jade: return "Jade"; case BulkMaterialType.Moonstone: return "Moonstone"; case BulkMaterialType.Sunstone: return "Sunstone"; //case BulkMaterialType.Bloodstone: return "Bloodstone"; } break; } case BODType.Tailor: { switch ( mat ) { case BulkMaterialType.None: { if ( itemType.IsSubclassOf( typeof( BaseArmor ) ) || itemType.IsSubclassOf( typeof( BaseShoes ) ) ) return 1062235; return 1044286; } case BulkMaterialType.Spined: return 1062236; case BulkMaterialType.Horned: return 1062237; case BulkMaterialType.Barbed: return 1062238; case BulkMaterialType.DragonL: return "Dragon"; case BulkMaterialType.Daemon: return "Daemon"; } break; } case BODType.Fletcher: case BODType.Carpenter: { switch (mat) { case BulkMaterialType.None: return "Wood"; case BulkMaterialType.Pine: return "Pine"; case BulkMaterialType.Ash: return "Ash"; case BulkMaterialType.Mahogany: return "Mahogany"; case BulkMaterialType.Yew: return "Yew"; case BulkMaterialType.Oak: return "Oak"; } break; } } return "Invalid"; }
public bool CheckFilter( BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType ) { BOBFilter f = ( m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter ); if ( f.IsDefault ) { return true; } if ( f.Quality == 1 && reqExc ) { return false; } else if ( f.Quality == 2 && !reqExc ) { return false; } if ( f.Quantity == 1 && amountMax != 10 ) { return false; } else if ( f.Quantity == 2 && amountMax != 15 ) { return false; } else if ( f.Quantity == 3 && amountMax != 20 ) { return false; } if ( f.Type == 1 && isLarge ) { return false; } else if ( f.Type == 2 && !isLarge ) { return false; } switch ( f.Material ) { default: case 0: return true; case 1: return ( deedType == BODType.Smith ); case 2: return ( deedType == BODType.Tailor ); case 3: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Iron ); case 4: return ( mat == BulkMaterialType.DullCopper ); case 5: return ( mat == BulkMaterialType.ShadowIron ); case 6: return ( mat == BulkMaterialType.Copper ); case 7: return ( mat == BulkMaterialType.Bronze ); case 8: return ( mat == BulkMaterialType.Gold ); case 9: return ( mat == BulkMaterialType.Agapite ); case 10: return ( mat == BulkMaterialType.Verite ); case 11: return ( mat == BulkMaterialType.Valorite ); case 12: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Cloth ); case 13: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Leather ); case 14: return ( mat == BulkMaterialType.Spined ); case 15: return ( mat == BulkMaterialType.Horned ); case 16: return ( mat == BulkMaterialType.Barbed ); } }
public object GetMaterialName( BulkMaterialType mat, BODType type, Type itemType ) { switch ( type ) { case BODType.Smith: { switch ( mat ) { case BulkMaterialType.None: return 1062226; case BulkMaterialType.Copper: return 1018334; case BulkMaterialType.Bronze: return 1018335; case BulkMaterialType.Gold: return 1018336; case BulkMaterialType.Silver: return 1018337; case BulkMaterialType.Obsidian: return 1018338; case BulkMaterialType.Tin: return 1018333; case BulkMaterialType.Steel: return 1018339; } break; } case BODType.Tailor: { switch ( mat ) { case BulkMaterialType.None: { if ( itemType.IsSubclassOf( typeof( BaseArmor ) ) || itemType.IsSubclassOf( typeof( BaseShoes ) ) ) return 1062235; return 1044286; } case BulkMaterialType.Thick: return 1062236; case BulkMaterialType.Beast: return 1062237; case BulkMaterialType.Scaled: return 1062238; } break; } } return "Invalid"; }
public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType) { BOBFilter f = (this.m_From.UseOwnFilter ? this.m_From.BOBFilter : this.m_Book.Filter); if (f.IsDefault) { return(true); } if (f.Quality == 1 && reqExc) { return(false); } else if (f.Quality == 2 && !reqExc) { return(false); } if (f.Quantity == 1 && amountMax != 10) { return(false); } else if (f.Quantity == 2 && amountMax != 15) { return(false); } else if (f.Quantity == 3 && amountMax != 20) { return(false); } if (f.Type == 1 && isLarge) { return(false); } else if (f.Type == 2 && !isLarge) { return(false); } switch (f.Material) { default: case 0: return(true); case 1: return(deedType == BODType.Smith); case 2: return(deedType == BODType.Tailor); case 3: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron); case 4: return(mat == BulkMaterialType.DullCopper); case 5: return(mat == BulkMaterialType.ShadowIron); case 6: return(mat == BulkMaterialType.Copper); case 7: return(mat == BulkMaterialType.Bronze); case 8: return(mat == BulkMaterialType.Gold); case 9: return(mat == BulkMaterialType.Agapite); case 10: return(mat == BulkMaterialType.Verite); case 11: return(mat == BulkMaterialType.Valorite); case 12: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth); case 13: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather); case 14: return(mat == BulkMaterialType.Spined); case 15: return(mat == BulkMaterialType.Horned); case 16: return(mat == BulkMaterialType.Barbed); } }
public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType) { BOBFilter f = m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter; if (f.IsDefault) { return(true); } if (f.Quality == 1 && reqExc) { return(false); } if (f.Quality == 2 && !reqExc) { return(false); } if (f.Quantity == 1 && amountMax != 10) { return(false); } if (f.Quantity == 2 && amountMax != 15) { return(false); } if (f.Quantity == 3 && amountMax != 20) { return(false); } if (f.Type == 1 && isLarge) { return(false); } if (f.Type == 2 && !isLarge) { return(false); } return(f.Material switch { 1 => (deedType == BODType.Smith), 2 => (deedType == BODType.Tailor), 3 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Iron), 4 => (mat == BulkMaterialType.DullCopper), 5 => (mat == BulkMaterialType.ShadowIron), 6 => (mat == BulkMaterialType.Copper), 7 => (mat == BulkMaterialType.Bronze), 8 => (mat == BulkMaterialType.Gold), 9 => (mat == BulkMaterialType.Agapite), 10 => (mat == BulkMaterialType.Verite), 11 => (mat == BulkMaterialType.Valorite), 12 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth), 13 => (mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather), 14 => (mat == BulkMaterialType.Spined), 15 => (mat == BulkMaterialType.Horned), 16 => (mat == BulkMaterialType.Barbed), _ => true });
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType) { switch (type) { case BODType.Tinkering: case BODType.Smith: { if (type == BODType.Tinkering && mat == BulkMaterialType.None && BGTClassifier.Classify(type, itemType) == BulkGenericType.Wood) { return(1079435); } else { switch (mat) { case BulkMaterialType.None: return(1062226); case BulkMaterialType.DullCopper: return(1018332); case BulkMaterialType.ShadowIron: return(1018333); case BulkMaterialType.Copper: return(1018334); case BulkMaterialType.Bronze: return(1018335); case BulkMaterialType.Gold: return(1018336); case BulkMaterialType.Agapite: return(1018337); case BulkMaterialType.Verite: return(1018338); case BulkMaterialType.Valorite: return(1018339); } } break; } case BODType.Tailor: { switch (mat) { case BulkMaterialType.None: { if (itemType.IsSubclassOf(typeof(BaseArmor)) || itemType.IsSubclassOf(typeof(BaseShoes))) { return(1062235); } return(1044286); } case BulkMaterialType.Spined: return(1062236); case BulkMaterialType.Horned: return(1062237); case BulkMaterialType.Barbed: return(1062238); } break; } case BODType.Carpentry: case BODType.Fletching: { if (mat == BulkMaterialType.None) { return(1079435); } switch (mat) { default: case BulkMaterialType.OakWood: return(1071428); case BulkMaterialType.AshWood: return(1071429); case BulkMaterialType.YewWood: return(1071430); case BulkMaterialType.Heartwood: return(1071432); case BulkMaterialType.Bloodwood: return(1071431); case BulkMaterialType.Frostwood: return(1071433); } } } return(""); }
public bool CheckFilter(BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType) { BOBFilter f = (m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter); if (f.IsDefault) { return(true); } if (f.Quality == 1 && reqExc) { return(false); } else if (f.Quality == 2 && !reqExc) { return(false); } if (f.Quantity == 1 && amountMax != 10) { return(false); } else if (f.Quantity == 2 && amountMax != 15) { return(false); } else if (f.Quantity == 3 && amountMax != 20) { return(false); } if (f.Type == 1 && isLarge) { return(false); } else if (f.Type == 2 && !isLarge) { return(false); } switch (f.Material) { default: case 0: return(true); case 1: return(deedType == BODType.Smith); case 2: return(deedType == BODType.Tailor); case 3: return(deedType == BODType.Tinkering); case 4: return(deedType == BODType.Carpentry); case 5: return(deedType == BODType.Fletching); case 6: return(deedType == BODType.Alchemy); case 7: return(deedType == BODType.Inscription); case 8: return(deedType == BODType.Cooking); case 9: return(mat == BulkMaterialType.None && deedType == BODType.Smith); case 10: return(mat == BulkMaterialType.DullCopper); case 11: return(mat == BulkMaterialType.ShadowIron); case 12: return(mat == BulkMaterialType.Copper); case 13: return(mat == BulkMaterialType.Bronze); case 14: return(mat == BulkMaterialType.Gold); case 15: return(mat == BulkMaterialType.Agapite); case 16: return(mat == BulkMaterialType.Verite); case 17: return(mat == BulkMaterialType.Valorite); case 18: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Cloth); case 19: return(mat == BulkMaterialType.None && BGTClassifier.Classify(deedType, itemType) == BulkGenericType.Leather); case 20: return(mat == BulkMaterialType.Spined); case 21: return(mat == BulkMaterialType.Horned); case 22: return(mat == BulkMaterialType.Barbed); case 23: // Tinkering return(mat == BulkMaterialType.None && deedType == BODType.Tinkering); case 24: return(mat == BulkMaterialType.DullCopper); case 25: return(mat == BulkMaterialType.ShadowIron); case 26: return(mat == BulkMaterialType.Copper); case 27: return(mat == BulkMaterialType.Bronze); case 28: return(mat == BulkMaterialType.Gold); case 29: return(mat == BulkMaterialType.Agapite); case 30: return(mat == BulkMaterialType.Verite); case 31: return(mat == BulkMaterialType.Valorite); case 32: // Carpentry return(mat == BulkMaterialType.None && deedType == BODType.Carpentry); case 33: return(mat == BulkMaterialType.OakWood); case 34: return(mat == BulkMaterialType.AshWood); case 35: return(mat == BulkMaterialType.YewWood); case 36: return(mat == BulkMaterialType.Bloodwood); case 37: return(mat == BulkMaterialType.Heartwood); case 38: return(mat == BulkMaterialType.Frostwood); case 39: // Fletching return(mat == BulkMaterialType.None && deedType == BODType.Fletching); case 40: return(mat == BulkMaterialType.OakWood); case 41: return(mat == BulkMaterialType.AshWood); case 42: return(mat == BulkMaterialType.YewWood); case 43: return(mat == BulkMaterialType.Bloodwood); case 44: return(mat == BulkMaterialType.Heartwood); case 45: return(mat == BulkMaterialType.Frostwood); } }
public static bool CanGetBulkOrder(Mobile m, BODType type) { BODContext context = GetContext(m); if (context != null && context.Entries.ContainsKey(type)) { DateTime last = context.Entries[type].LastBulkOrder; if (context.Entries[type].CachedDeeds == 0) { int tocache = 0; if (last + TimeSpan.FromHours(Delay) < DateTime.UtcNow) { int minutes = (int)(DateTime.UtcNow - last).TotalMinutes; tocache = (int)(minutes / ((double)Delay * 60)); } if (tocache > 0) { context.Entries[type].CachedDeeds = Math.Min(MaxCachedDeeds, context.Entries[type].CachedDeeds + tocache); } } if (context.Entries[type].CachedDeeds > 0) { if (context.Entries[type].CachedDeeds == MaxCachedDeeds) { context.Entries[type].LastBulkOrder = DateTime.UtcNow - TimeSpan.FromHours(Delay * (MaxCachedDeeds)); } context.Entries[type].LastBulkOrder += TimeSpan.FromHours(Delay); context.Entries[type].CachedDeeds--; return(true); } /*int cached = context.Entries[type].CachedDeeds; * * if (cached > 0) * { * if (cached == MaxCachedDeeds) * { * context.Entries[type].LastBulkOrder = DateTime.UtcNow; * } * else * { * //TimeSpan remainder = last - TimeSpan.FromHours(Delay); * TimeSpan remainder = (DateTime.UtcNow - last) + TimeSpan.FromHours(Delay); * * context.Entries[type].LastBulkOrder = DateTime.UtcNow - remainder; * } * * context.Entries[type].CachedDeeds--; * * return true; * }*/ } return(false); }
public static Item CreateBulkOrder(Mobile m, BODType type, bool fromContextMenu) { PlayerMobile pm = m as PlayerMobile; if (pm == null) { return(null); } if (pm.AccessLevel > AccessLevel.Player || fromContextMenu || 0.2 > Utility.RandomDouble()) { SkillName sk = GetSkillForBOD(type); double theirSkill = pm.Skills[sk].Base; bool doLarge = theirSkill >= 70.1 && ((theirSkill - 40.0) / 300.0) > Utility.RandomDouble(); switch (type) { case BODType.Smith: if (doLarge) { return(new LargeSmithBOD()); } else { return(SmallSmithBOD.CreateRandomFor(pm)); } case BODType.Tailor: if (doLarge) { return(new LargeTailorBOD()); } else { return(SmallTailorBOD.CreateRandomFor(pm)); } case BODType.Alchemy: if (doLarge) { return(new LargeAlchemyBOD()); } else { return(SmallAlchemyBOD.CreateRandomFor(pm)); } case BODType.Inscription: if (doLarge) { return(new LargeInscriptionBOD()); } else { return(SmallInscriptionBOD.CreateRandomFor(pm)); } case BODType.Tinkering: if (doLarge) { return(new LargeTinkerBOD()); } else { return(SmallTinkerBOD.CreateRandomFor(pm)); } case BODType.Cooking: if (doLarge) { return(new LargeCookingBOD()); } else { return(SmallCookingBOD.CreateRandomFor(pm)); } case BODType.Fletching: if (doLarge) { return(new LargeFletchingBOD()); } else { return(SmallFletchingBOD.CreateRandomFor(pm)); } case BODType.Carpentry: if (doLarge) { return(new LargeCarpentryBOD()); } else { return(SmallCarpentryBOD.CreateRandomFor(pm)); } } } return(null); }
public bool CheckFilter( BulkMaterialType mat, int amountMax, bool isLarge, bool reqExc, BODType deedType, Type itemType ) { BOBFilter f = ( m_From.UseOwnFilter ? m_From.BOBFilter : m_Book.Filter ); if ( f.IsDefault ) return true; if ( f.Quality == 1 && reqExc ) return false; else if ( f.Quality == 2 && !reqExc ) return false; if ( f.Quantity == 1 && amountMax != 10 ) return false; else if ( f.Quantity == 2 && amountMax != 15 ) return false; else if ( f.Quantity == 3 && amountMax != 20 ) return false; if ( f.Type == 1 && isLarge ) return false; else if ( f.Type == 2 && !isLarge ) return false; switch ( f.Material ) { default: case 0: return true; case 1: return ( deedType == BODType.Smith ); case 2: return ( deedType == BODType.Tailor ); case 3: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Iron ); case 6: return ( mat == BulkMaterialType.Copper ); case 7: return ( mat == BulkMaterialType.Bronze ); case 8: return ( mat == BulkMaterialType.Copper ); case 9: return ( mat == BulkMaterialType.Silver ); case 10: return ( mat == BulkMaterialType.Obsidian ); case 11: return ( mat == BulkMaterialType.Steel ); case 12: return ( mat == BulkMaterialType.Tin ); case 13: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Cloth ); case 14: return ( mat == BulkMaterialType.None && BGTClassifier.Classify( deedType, itemType ) == BulkGenericType.Leather ); case 15: return ( mat == BulkMaterialType.Thick ); case 16: return ( mat == BulkMaterialType.Beast ); case 17: return ( mat == BulkMaterialType.Scaled ); } }