public InternalTimer(Mobile from, ILockpickable item, Lockpick lockpick) : base(TimeSpan.FromSeconds(3.5)) { m_From = from; m_Item = item; m_Lockpick = lockpick; Priority = TimerPriority.TwoFiftyMS; if (from is PlayerMobile) { ((PlayerMobile)from).ResetPlayerAction(this); } }
public override void OnDoubleClick(Mobile m) { if (IsChildOf(m.Backpack) && _UsesRemaining > 0) { Lockpick lockpick = new Lockpick(Utility.RandomMinMax(5, 12)); if (m.Backpack == null || !m.Backpack.TryDropItem(m, lockpick, false)) { m.SendLocalizedMessage(1077971); // Make room in your backpack first! lockpick.Delete(); } else { m.SendLocalizedMessage(1071526); // You take some lockpicks from the tool box. UsesRemaining--; } } }
public static void crochetage_OnCommand(CommandEventArgs e) { NubiaPlayer p = e.Mobile as NubiaPlayer; Lockpick lockpick = null; if (p.Backpack != null) { foreach (Item i in p.Backpack.Items) { if (i is Lockpick) { lockpick = i as Lockpick; break; } } } p.SendLocalizedMessage(502068); // What do you want to pick? p.Target = new CrochetageTarget(lockpick); }
public InternalTimer( Mobile from, ILockpickable item, Lockpick lockpick ) : base(TimeSpan.Zero) { m_From = from; m_Item = item; m_Lockpick = lockpick; }
public InternalTarget( Lockpick item ) : base(1, false, TargetFlags.None) { m_Item = item; }
public InternalTimer( Mobile from, ILockpickable item, Lockpick lockpick ) : base(TimeSpan.FromSeconds( 3.0 )) { m_From = from; m_Item = item; m_Lockpick = lockpick; Priority = TimerPriority.TwoFiftyMS; }
public InternalTimer( Mobile from, ILockpickable item, Lockpick lockpick ) : base( TimeSpan.FromSeconds( 3.5 ) ) { m_From = from; m_Item = item; m_Lockpick = lockpick; Priority = TimerPriority.TwoFiftyMS; if (from is PlayerMobile) ((PlayerMobile)from).ResetPlayerAction(this); }
public InternalTimer( Mobile from, ILockpickable item, Lockpick lockpick ) : base(TimeSpan.FromSeconds( 30.0 - (from.RawInt / 10) )) { m_From = from; m_Item = item; m_Lockpick = lockpick; Priority = TimerPriority.TwoFiftyMS; if( from.AccessLevel < AccessLevel.GameMaster ) from.RevealingAction(); }
public override void InitOutfit() { Item item = null; if ( !Female ) { item = AddRandomHair(); item.Hue = Utility.RandomHairHue(); item = AddRandomFacialHair( item.Hue ); item = new FancyShirt(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); item = new LongPants(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); item = new Dagger(); AddItem( item ); PackGold( 15, 100 ); item = new Lockpick( Utility.RandomMinMax( 1, 5 ) ); PackItem( item ); } else { item = AddRandomHair(); item.Hue = Utility.RandomHairHue(); item = new FancyShirt(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); item = new Skirt(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); item = new Dagger(); AddItem( item ); PackGold( 15, 100 ); item = new Lockpick( Utility.RandomMinMax( 1, 5 ) ); PackItem( item ); } }
public override void OnResponse(NetState sender, RelayInfo info) { if (m_Player == null) { return; } bool closeGump = true; CaptchaPersistance.CheckAndCreateCaptchaAccountEntry(m_Player); CaptchaAccountData captchaData = m_Player.m_CaptchaAccountData; switch (info.ButtonID) { //Guide case 1: closeGump = false; break; //Confirm case 2: if (captchaData.m_ConfirmPrompt) { bool correct = false; if (captchaData.m_Row1CorrectIndex == captchaData.m_SelectedRow1Index && captchaData.m_Row2CorrectIndex == captchaData.m_SelectedRow2Index && captchaData.m_Row3CorrectIndex == captchaData.m_SelectedRow3Index) { correct = true; } if (correct) { captchaData.m_NextCaptchaTime = DateTime.UtcNow + TimeSpan.FromMinutes((double)Utility.RandomMinMax(CaptchaAccountData.MinimumCaptchaDelay, CaptchaAccountData.MaximumCaptchaDelay)); captchaData.m_CaptchaRequired = false; captchaData.m_CaptchaAttempt = 0; captchaData.m_ConfirmPrompt = false; m_Player.SendSound(0x5B6); m_Player.SendMessage("Captcha successful."); switch (captchaData.m_CaptchaSourceType) { case CaptchaSourceType.Fishing: FishingPole fishingPole = m_Player.FindItemOnLayer(Layer.TwoHanded) as FishingPole; if (fishingPole != null) { Fishing.System.StartHarvesting(m_Player, fishingPole, null, true); } break; case CaptchaSourceType.Lumberjacking: Hatchet hatchet = m_Player.FindItemOnLayer(Layer.TwoHanded) as Hatchet; if (hatchet != null) { Lumberjacking.System.StartHarvesting(m_Player, hatchet, null, true); } break; case CaptchaSourceType.Mining: Pickaxe pickaxe = m_Player.FindItemOnLayer(Layer.OneHanded) as Pickaxe; if (pickaxe != null) { Mining.System.StartHarvesting(m_Player, pickaxe, null, true); } break; case CaptchaSourceType.DungeonChest: Lockpick lockpick = (Lockpick)m_Player.Backpack.FindItemByType(typeof(Lockpick)); //TEST if (lockpick != null) { lockpick.OnDoubleClick(m_Player); } break; } return; } else { captchaData.m_CaptchaAttempt++; if (captchaData.m_CaptchaAttempt == 3) { string responseMessage = ""; if (captchaData.m_PreviousPenalty != CaptchaAccountData.PenaltyLevelType.None && captchaData.m_PenaltyProbationExpiration > DateTime.UtcNow) { switch (captchaData.m_PreviousPenalty) { case CaptchaAccountData.PenaltyLevelType.None: captchaData.m_CurrentPenalty = CaptchaAccountData.PenaltyLevelType.Minor; captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty); captchaData.m_PreviousPenalty = captchaData.m_CurrentPenalty; captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty); responseMessage = "You have failed a captcha response and your account will now be prevented from gathering resources for "; responseMessage += Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + "."; m_Player.SendMessage(2115, responseMessage); break; case CaptchaAccountData.PenaltyLevelType.Minor: captchaData.m_CurrentPenalty = CaptchaAccountData.PenaltyLevelType.Major; captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty); captchaData.m_PreviousPenalty = captchaData.m_CurrentPenalty; captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty); responseMessage = "You have failed a second captcha response within one day, and your account will now be prevented from gathering resources for "; responseMessage += Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + "."; m_Player.SendMessage(2115, responseMessage); break; case CaptchaAccountData.PenaltyLevelType.Major: captchaData.m_CurrentPenalty = CaptchaAccountData.PenaltyLevelType.Epic; captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty); captchaData.m_PreviousPenalty = captchaData.m_CurrentPenalty; captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty); responseMessage = "You have failed a third captcha response within one week, and your account will now be prevented from gathering resources for "; responseMessage += Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + "."; m_Player.SendMessage(2115, responseMessage); break; case CaptchaAccountData.PenaltyLevelType.Epic: captchaData.m_CurrentPenalty = CaptchaAccountData.PenaltyLevelType.Permanent; captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty); captchaData.m_PreviousPenalty = captchaData.m_CurrentPenalty; captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty); responseMessage = "You have failed a fourth captcha response within one month, and your account will now be permanently prevented from gathering resources."; m_Player.SendMessage(2115, responseMessage); break; case CaptchaAccountData.PenaltyLevelType.Permanent: captchaData.m_CurrentPenalty = CaptchaAccountData.PenaltyLevelType.Permanent; captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty); captchaData.m_PreviousPenalty = captchaData.m_CurrentPenalty; captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty); responseMessage = "You have failed a fourth captcha response within one month, and your account will now be permanently prevented from gathering resources."; m_Player.SendMessage(2115, responseMessage); break; } } else { captchaData.m_CurrentPenalty = CaptchaAccountData.PenaltyLevelType.Minor; captchaData.m_CurrentPenaltyExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyDuration(captchaData.m_CurrentPenalty); captchaData.m_PreviousPenalty = captchaData.m_CurrentPenalty; captchaData.m_PenaltyProbationExpiration = DateTime.UtcNow + CaptchaAccountData.GetPenaltyProbationDuration(captchaData.m_PreviousPenalty); responseMessage = "You have failed a captcha response and your account will now be blocked from gathering resources for " + Utility.CreateTimeRemainingString(DateTime.UtcNow, captchaData.m_CurrentPenaltyExpiration, false, true, true, true, false) + "."; m_Player.SendMessage(2115, responseMessage); } captchaData.m_NextCaptchaTime = DateTime.UtcNow + TimeSpan.FromMinutes((double)Utility.RandomMinMax(CaptchaAccountData.MinimumCaptchaDelay, CaptchaAccountData.MaximumCaptchaDelay)); captchaData.m_CaptchaRequired = false; captchaData.m_CaptchaAttempt = 0; captchaData.m_ConfirmPrompt = false; m_Player.SendSound(0x5B3); return; } else { switch (captchaData.m_CaptchaAttempt) { case 1: m_Player.SendMessage(55, "Captcha response incorrect. You have two more attempts."); break; case 2: m_Player.SendMessage(1256, "Captcha response incorrect. You have one more attempt."); break; } captchaData.m_NextCaptchaTime = DateTime.UtcNow + TimeSpan.FromMinutes((double)Utility.RandomMinMax(CaptchaAccountData.MinimumCaptchaDelay, CaptchaAccountData.MaximumCaptchaDelay)); captchaData.GenerateIDs(); captchaData.m_ConfirmPrompt = false; } } } else { captchaData.m_ConfirmPrompt = true; } closeGump = false; break; //Row 1 Previous case 3: captchaData.m_SelectedRow1Index--; if (captchaData.m_SelectedRow1Index < 0) { captchaData.m_SelectedRow1Index = CaptchaAccountData.ItemsPerRow - 1; } captchaData.m_ConfirmPrompt = false; m_Player.SendSound(SelectionSound); closeGump = false; break; //Row 1 Next case 4: captchaData.m_SelectedRow1Index++; if (captchaData.m_SelectedRow1Index >= CaptchaAccountData.ItemsPerRow) { captchaData.m_SelectedRow1Index = 0; } captchaData.m_ConfirmPrompt = false; m_Player.SendSound(SelectionSound); closeGump = false; break; //Row 2 Previous case 5: captchaData.m_SelectedRow2Index--; if (captchaData.m_SelectedRow2Index < 0) { captchaData.m_SelectedRow2Index = CaptchaAccountData.ItemsPerRow - 1; } captchaData.m_ConfirmPrompt = false; m_Player.SendSound(SelectionSound); closeGump = false; break; //Row 2 Next case 6: captchaData.m_SelectedRow2Index++; if (captchaData.m_SelectedRow2Index >= CaptchaAccountData.ItemsPerRow) { captchaData.m_SelectedRow2Index = 0; } captchaData.m_ConfirmPrompt = false; m_Player.SendSound(SelectionSound); closeGump = false; break; //Row 3 Previous case 7: captchaData.m_SelectedRow3Index--; if (captchaData.m_SelectedRow3Index < 0) { captchaData.m_SelectedRow3Index = CaptchaAccountData.ItemsPerRow - 1; } captchaData.m_ConfirmPrompt = false; m_Player.SendSound(SelectionSound); closeGump = false; break; //Row 3 Next case 8: captchaData.m_SelectedRow3Index++; if (captchaData.m_SelectedRow3Index >= CaptchaAccountData.ItemsPerRow) { captchaData.m_SelectedRow3Index = 0; } captchaData.m_ConfirmPrompt = false; m_Player.SendSound(SelectionSound); closeGump = false; break; } if (!closeGump) { m_Player.CloseGump(typeof(CaptchaGump)); m_Player.SendGump(new CaptchaGump(m_Player)); } else { m_Player.SendSound(CloseGumpSound); } }
public SquireLockpickTarget(Squire squire, Lockpick item) : base(20, false, TargetFlags.None) //Changed 1.8.8 from base( 1, false, to base( 20, false to make it so you don't need to be next to the target { m_Item = item; m_Squire = squire; }
public override void InitOutfit() { WipeLayers(); AddItem( new Shirt( Utility.RandomNeutralHue() ) ); AddItem( new ShortPants( Utility.RandomNeutralHue() ) ); AddItem( new Boots( Utility.RandomNeutralHue() ) ); switch ( Utility.Random( 4 ) ) { case 0: AddItem( new ShortHair( Utility.RandomHairHue() ) ); break; case 1: AddItem( new TwoPigTails( Utility.RandomHairHue() ) ); break; case 2: AddItem( new ReceedingHair( Utility.RandomHairHue() ) ); break; case 3: AddItem( new KrisnaHair( Utility.RandomHairHue() ) ); break; } AddItem( new Kryss() ); PackGold( 50, 60 ); Bandage aids = new Bandage(); aids.Amount = Utility.Random( 1, 3 ); AddItem( aids ); Lockpick picks = new Lockpick(); picks.Amount = Utility.Random( 1, 3 ); AddItem( picks ); }
public CrochetageTarget(Lockpick item) : base(1, false, TargetFlags.None) { m_Item = item; }
public InternalTimer(Mobile from, ILockpickable item, Lockpick lockpick) : base(TimeSpan.FromSeconds(3.0)) { m_From = from; m_Item = item; m_Lockpick = lockpick; }
public HireThief() { Female = Utility.RandomBool(); Body = Female ? 401 : 400; Title = "the thief"; Name = NameList.RandomName( Female ? "female" : "male" ); Hue = Utility.RandomSkinHue(); SetStr( 61, 75 ); SetDex( 86, 100 ); SetInt( 71, 85 ); Karma = Utility.RandomMinMax( 13, -45 ); SetSkill( SkillName.Tactics, 55, 77.5 ); SetSkill( SkillName.MagicResist, 55, 77.5 ); SetSkill( SkillName.Parry, 55, 77.5 ); SetSkill( SkillName.Swords, 35, 57.5 ); SetSkill( SkillName.Macing, 15, 37.5 ); SetSkill( SkillName.Fencing, 55, 77.5 ); SetSkill( SkillName.Wrestling, 25, 47.5 ); SetSkill( SkillName.Poisoning, 35, 57.5 ); SetSkill( SkillName.Lockpicking, 35, 57.5 ); SetSkill( SkillName.Hiding, 45, 67.5 ); SetSkill( SkillName.DetectHidden, 35, 57.5 ); SetSkill( SkillName.Snooping, 45, 67.5 ); SetSkill( SkillName.Stealing, 45, 67.5 ); Item item = null; if ( !Female ) { item = AddRandomHair(); item.Hue = Utility.RandomHairHue(); item = AddRandomFacialHair( item.Hue ); item = new Shirt(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); item = new ShortPants(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); switch ( Utility.Random( 4 ) ) { case 0: item = new Boots(); break; case 1: item = new ThighBoots(); break; case 2: item = new Shoes(); break; case 3: default: item = new Sandals(); break; } AddItem( item ); item = new Dagger(); AddItem( item ); PackGold( 15, 100 ); item = new Lockpick( Utility.RandomMinMax( 1, 5 ) ); PackItem( item ); } else { item = AddRandomHair(); item.Hue = Utility.RandomHairHue(); item = new Shirt(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); item = new Skirt(); item.Hue = Utility.RandomNondyedHue(); AddItem( item ); switch ( Utility.Random( 4 ) ) { case 0: item = new Boots(); break; case 1: item = new ThighBoots(); break; case 2: item = new Shoes(); break; case 3: default: item = new Sandals(); break; } AddItem( item ); item = new Dagger(); AddItem( item ); PackGold( 15, 100 ); item = new Lockpick( Utility.RandomMinMax( 1, 5 ) ); PackItem( item ); } }
public virtual void Fill() { Reset(); List <Item> contains = new List <Item>(Items); foreach (var i in contains) { i.Delete(); } ColUtility.Free(contains); for (int i = 0; i < Utility.RandomMinMax(6, 12); i++) { DropItem(Loot.RandomGem()); } DropItem(new Gold(Utility.RandomMinMax(800, 1100))); Item item = null; if (0.30 > Utility.RandomDouble()) { switch (Utility.Random(7)) { case 0: item = new Bandage(Utility.Random(10, 30)); break; case 1: item = new SmokeBomb(); item.Amount = Utility.Random(3, 6); break; case 2: item = new InvisibilityPotion(); item.Amount = Utility.Random(1, 3); break; case 3: item = new Lockpick(Utility.Random(1, 10)); break; case 4: item = new DreadHornMane(Utility.Random(1, 2)); break; case 5: item = new Corruption(Utility.Random(1, 2)); break; case 6: item = new Taint(Utility.Random(1, 2)); break; } DropItem(item); } if (0.25 > Utility.RandomDouble()) { DropItem(new CounterfeitPlatinum()); } if (0.2 > Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: item = new ZombiePainting(); break; case 1: item = new SkeletonPortrait(); break; case 2: item = new LichPainting(); break; case 3: item = new RelicOfHydros(); break; case 4: item = new RelicOfLithos(); break; case 5: item = new RelicOfPyros(); break; case 6: item = new RelicOfStratos(); break; } DropItem(item); } if (0.1 > Utility.RandomDouble()) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(LootPackEntry.IsInTokuno(this), LootPackEntry.IsMondain(this), LootPackEntry.IsStygian(this)); if (item != null) { TreasureMapChest.GetRandomItemStat(out int min, out int max, 1.0); RunicReforging.GenerateRandomItem(item, null, Utility.RandomMinMax(min, max), 0, ReforgedPrefix.None, ReforgedSuffix.Khaldun, Map); DropItem(item); } } }
public void LockpickHold(Mobile from, Lockpick lockpick) { if (from == null || lockpick == null || this.Deleted || this == null) { return; } //NPC Ship if (m_Ship.MobileControlType != MobileControlType.Player) { if (m_Ship.HasCrewAlive()) { from.SendMessage("You cannot access that ship's hold while it's crew members still live."); return; } else { from.SendMessage("With the ship's crew dead, you may access the hold freely."); return; } } Effects.PlaySound(Location, Map, 0x241); from.BeginAction((typeof(Lockpick))); Timer.DelayCall(TimeSpan.FromSeconds(3.0), delegate() { if (from != null) { from.EndAction(typeof(Lockpick)); } if (this == null) { return; } if (this.Deleted) { return; } if (from.GetDistanceToSqrt(this) > 2) { from.SendMessage("You are too far away from the hold to continue lockpicking."); return; } if (!from.Alive) { return; } double lockpickingSkill = from.Skills[SkillName.Lockpicking].Value; double successChance = (lockpickingSkill - 95) * .02; //10% At GM double chanceResult = Utility.RandomDouble(); //Succeed Lockpicking if (chanceResult < successChance) { Effects.PlaySound(Location, Map, 0x4A); from.SendMessage("You succeed in breaking into the ship's hold"); base.OnDoubleClick(from); return; } //Fail Lockpicking else { if (Utility.RandomDouble() > .5) { Effects.PlaySound(Location, Map, 0x3A4); from.SendMessage("You fail to break into the ship's hold and break your lockpick in the process."); lockpick.Consume(); return; } else { from.SendMessage("You fail to break into the ship's hold"); return; } } }); }
public InternalTarget(Lockpick item) : base(1, false, TargetFlags.None) { m_Item = item; }
public override void OnClick() { if (m_From.InRange(m_Fountain.GetWorldLocation(), 4)) { if (m_From.Backpack.ConsumeTotal(typeof(Gold), 1)) { m_Fountain.Jackpot++; switch (m_Fountain.MessageNum) { case MagicFountainAddon.FountainMessage.Cool: { if (0.001 > Utility.RandomDouble()) { Gold gold = new Gold(); gold.Amount = m_Fountain.Jackpot; // no need to test, it's always at least 1 if (!m_From.AddToBackpack(gold)) { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); gold.Delete(); } else { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!"); m_Fountain.Jackpot = 0; } } else if (0.001 > Utility.RandomDouble()) { Gold gold = new Gold(); gold.Amount = m_Fountain.Jackpot; // no need to test, it's always at least 1 if (!m_From.AddToBackpack(gold)) { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); gold.Delete(); } else { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!"); m_Fountain.Jackpot = 0; } } else { m_From.SendMessage("You toss a coin in ... but nothing happens."); } break; } case MagicFountainAddon.FountainMessage.Warm: { if (0.01 > Utility.RandomDouble()) { Item item = null; switch (Utility.RandomMinMax(1, 10)) { case 1: item = new TinkerTools(); break; case 2: item = new Lockpick(3); break; case 3: item = new Pitchfork(); break; case 4: item = new Dagger(); break; case 5: item = new Emerald(); break; case 6: item = new Ruby(); break; case 7: item = new Amber(); break; case 8: item = new Server.Engines.Mahjong.MahjongGame(); break; case 9: item = new SewingKit(); break; case 10: item = new SmithHammer(); break; } if (!m_From.AddToBackpack(item)) { m_From.SendMessage("You toss a coin in ... and an item appears! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); item.Delete(); } else { m_From.SendMessage("You toss a coin in ... and an item appears!"); if (m_Fountain.Jackpot > 10) { m_Fountain.Jackpot = m_Fountain.Jackpot - 5; } } } else if (0.001 > Utility.RandomDouble()) { Gold gold = new Gold(); gold.Amount = m_Fountain.Jackpot; // no need to test, it's always at least 1 if (!m_From.AddToBackpack(gold)) { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); gold.Delete(); } else { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!"); m_Fountain.Jackpot = 0; } } else { m_From.SendMessage("You toss a coin in ... but nothing happens."); } break; } case MagicFountainAddon.FountainMessage.Clean: { if (0.05 > Utility.RandomDouble()) { Item food = null; switch (Utility.RandomMinMax(1, 10)) { case 1: food = new Bacon(); break; case 2: food = new CookedBird(); break; case 3: food = new Ham(); break; case 4: food = new Ribs(); break; case 5: food = new Sausage(); break; case 6: food = new Cookies(); break; case 7: food = new Muffins(3); break; case 8: food = new ApplePie(); break; case 9: food = new PeachCobbler(); break; case 10: food = new Lime(); break; } if (!m_From.AddToBackpack(food)) { m_From.SendMessage("You toss a coin in ... and food appears! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); food.Delete(); } else { m_From.SendMessage("You toss a coin in ... and food appears!"); if (m_Fountain.Jackpot > 10) { m_Fountain.Jackpot = m_Fountain.Jackpot - 5; } } } else if (0.001 > Utility.RandomDouble()) { Gold gold = new Gold(); gold.Amount = m_Fountain.Jackpot; // no need to test, it's always at least 1 if (!m_From.AddToBackpack(gold)) { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); gold.Delete(); } else { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!"); m_Fountain.Jackpot = 0; } } else { m_From.SendMessage("You toss a coin in ... but nothing happens."); } break; } case MagicFountainAddon.FountainMessage.Calm: { if (0.005 > Utility.RandomDouble()) { Horse horse = new Horse(); horse.Map = m_From.Map; horse.Location = m_From.Location; if ((m_From.Followers + horse.ControlSlots) <= m_From.FollowersMax) { // set up the horse... =P horse.Controlled = true; horse.ControlMaster = m_From; horse.OwnerAbandonTime = DateTime.MinValue; horse.BondingBegin = DateTime.MinValue; horse.ControlOrder = OrderType.Follow; horse.ControlTarget = m_From; horse.Owners.Add(m_From); // seems to be new in 2.0 // horse.Loyalty = PetLoyalty.WonderfullyHappy; // doesn't work in 2.0 but seems unnecessary m_From.SendMessage("You toss a coin in ... and a horse appears!"); } else { m_From.SendMessage("You toss a coin in ... and a horse appears! But you have too many pets to control this one too. The horse runs off!"); horse.Delete(); } if (m_Fountain.Jackpot > 20) { m_Fountain.Jackpot = m_Fountain.Jackpot - 10; } } else if (0.001 > Utility.RandomDouble()) { Gold gold = new Gold(); gold.Amount = m_Fountain.Jackpot; // no need to test, it's always at least 1 if (!m_From.AddToBackpack(gold)) { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); gold.Delete(); } else { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!"); m_Fountain.Jackpot = 0; } } else { m_From.SendMessage("You toss a coin in ... but nothing happens."); } break; } case MagicFountainAddon.FountainMessage.Fruit: { if (0.05 > Utility.RandomDouble()) { Item fruit = null; switch (Utility.RandomMinMax(1, 10)) { case 1: fruit = new Watermelon(); break; case 2: fruit = new Apple(); break; case 3: fruit = new Pear(); break; case 4: fruit = new Peach(); break; case 5: fruit = new Lime(); break; case 6: fruit = new Lemon(); break; case 7: fruit = new Coconut(); break; case 8: fruit = new Grapes(); break; case 9: fruit = new Bananas(); break; case 10: fruit = new Cantaloupe(); break; } if (!m_From.AddToBackpack(fruit)) { m_From.SendMessage("You toss a coin in ... and fruit appears! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); fruit.Delete(); } else { m_From.SendMessage("You toss a coin in ... and fruit appears!"); if (m_Fountain.Jackpot > 10) { m_Fountain.Jackpot = m_Fountain.Jackpot - 5; } else { m_Fountain.Jackpot = 0; } } } else if (0.001 > Utility.RandomDouble()) { Gold gold = new Gold(); gold.Amount = m_Fountain.Jackpot; // no need to test, it's always at least 1 if (!m_From.AddToBackpack(gold)) { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain! But you can't hold it! You accidentally drop it back in the fountain, where it vanishes."); gold.Delete(); } else { m_From.SendMessage("You toss a coin in ... and a shower of gold leaps back out of the fountain!"); m_Fountain.Jackpot = 0; } } else { m_From.SendMessage("You toss a coin in ... but nothing happens."); } break; } } } else { m_From.SendMessage("You don't have a coin to toss in."); } } else { m_From.SendMessage("Get closer."); } }