Created
June 2, 2019 23:19
-
-
Save DarkLotus/abf2bbede5ff221daf594bf3ed809db4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Item CreateBulkOrder( Mobile from, bool fromContextMenu ) | |
| { | |
| PlayerMobile pm = from as PlayerMobile; | |
| if (pm == null) | |
| return null; | |
| if (pm.AccessLevel > AccessLevel.Player || fromContextMenu || 0.2 > Utility.RandomDouble()) | |
| { | |
| SkillName sk = BODHelper.GetSkillForBOD(BODType); | |
| double theirSkill = pm.Skills[sk].Value; | |
| bool doLarge = theirSkill >= 70.1 && ((theirSkill - 40.0) / 300.0) > Utility.RandomDouble(); | |
| TimeSpan delay; | |
| if (theirSkill >= 70.1) | |
| delay = TimeSpan.FromHours(6.0); | |
| else if (theirSkill >= 50.1) | |
| delay = TimeSpan.FromHours(2.0); | |
| else | |
| delay = TimeSpan.FromHours(1.0); | |
| pm.SetNextBulkOrder(BODType,delay); | |
| switch (BODType) | |
| { | |
| 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; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment