public bool GiveReward(Mobile to) { Bag bag = new Bag(); bag.DropItem(new Gold(Utility.RandomMinMax(500, 1000))); if (Utility.RandomBool()) { BaseWeapon weapon = Loot.RandomWeapon(); int damageLevel = BaseCreature.RandomMinMaxScaled(2, 3); if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { bag.DropItem(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) { bag.DropItem(new Platinum(platAmount)); } damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 3); weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3); bag.DropItem(weapon); } else { Item item; // if Core.AOS //item = Loot.RandomArmorOrShieldOrJewelry(); BaseArmor armor = Loot.RandomArmorOrShield(); item = armor; armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled(2, 3); armor.Durability = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3); bag.DropItem(item); } bag.DropItem(new ObsidianStatue()); if (to.PlaceInBackpack(bag)) { return(true); } else { bag.Delete(); return(false); } }
public Item Mutate(Mobile from, Item item) { if (item != null && !(item is BaseWand)) { if (item is BaseWeapon && 1 > Utility.Random(100)) { item.Delete(); item = new FireHorn(); return(item); } if (item is BaseWeapon || item is BaseArmor || item is BaseJewel || item is BaseHat) { if (item is BaseWeapon) { var weapon = (BaseWeapon)item; if (55 > Utility.Random(100)) { weapon.AccuracyLevel = (WeaponAccuracyLevel)GetRandomOldBonus(); } if (45 > Utility.Random(100)) { int damageLevel = GetRandomOldBonus(); if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { return(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) { return(new Platinum(platAmount)); } damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; } if (25 > Utility.Random(100)) { weapon.DurabilityLevel = (WeaponDurabilityLevel)GetRandomOldBonus(); } if (5 > Utility.Random(100)) { weapon.Slayer = SlayerName.Silver; } if (1 > Utility.Random(1000) || (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None && 5 > Utility.Random(100))) { weapon.Slayer = from != null?SlayerGroup.GetLootSlayerType(from.GetType()) : BaseRunicTool.GetRandomSlayer(); } if (weapon.AccuracyLevel == 0 && weapon.DamageLevel == 0 && weapon.DurabilityLevel == 0 && weapon.Slayer == SlayerName.None) { weapon.Identified = true; } } else if (item is BaseArmor) { var armor = (BaseArmor)item; if (55 > Utility.Random(100)) { armor.ProtectionLevel = (ArmorProtectionLevel)GetRandomOldBonus(); } if (25 > Utility.Random(100)) { armor.Durability = (ArmorDurabilityLevel)GetRandomOldBonus(); } if (armor.ProtectionLevel == 0 && armor.Durability == 0) { armor.Identified = true; } } } else if (item is BaseInstrument) { SlayerName slayer = from == null || from.EraAOS ? BaseRunicTool.GetRandomSlayer() : SlayerGroup.GetLootSlayerType(from.GetType()); var instr = (BaseInstrument)item; instr.Quality = InstrumentQuality.Regular; instr.Slayer = slayer; } else if (item is Spellbook) //Randomize spellbook { var book = item as Spellbook; if (MaxIntensity == 100 && MinIntensity / 1000.0 > Utility.RandomDouble()) { book.LootType = LootType.Blessed; } if (MaxIntensity == 100 && MinIntensity >= 50 && (MinIntensity / 3000.0 > Utility.RandomDouble())) { book.Dyable = true; } int rnd = Utility.RandomMinMax(MinIntensity, MaxIntensity); var circle = (int)((rnd / 12.5) + 1.0); if (circle >= 8 && 0.33 > Utility.RandomDouble()) { book.Content = ulong.MaxValue; } else { circle = Math.Min(circle, 8); //do we fill this circle? for (int i = 0; i < circle; i++) { if (Utility.RandomBool()) { book.Content |= (ulong)Utility.Random(0x100) << (i * 8); } } } } if (item.Stackable) { // Note: do not check hits max here if you want to multiply against gold // the max hits have not been set when this function is called // The inital loot is added to the BaseCreature before the attributes are set // for the specific mob type if (item is Gold) { item.Amount = (int)Math.Ceiling(Quantity.Roll() * DynamicSettingsController.GoldMulti); } else { item.Amount = Quantity.Roll(); } } } return(item); }
public override void OnTalk(PlayerMobile player, bool contextMenu) { Direction = GetDirectionTo(player); QuestSystem qs = player.Quest; if (qs is WitchApprenticeQuest) { if (qs.IsObjectiveInProgress(typeof(FindApprenticeObjective))) { PlaySound(0x259); PlaySound(0x206); qs.AddConversation(new HagDuringCorpseSearchConversation()); } else { QuestObjective obj = qs.FindObjective(typeof(FindGrizeldaAboutMurderObjective)); if (obj != null && !obj.Completed) { PlaySound(0x420); PlaySound(0x20); obj.Complete(); } else if (qs.IsObjectiveInProgress(typeof(KillImpsObjective)) || qs.IsObjectiveInProgress(typeof(FindZeefzorpulObjective))) { PlaySound(0x259); PlaySound(0x206); qs.AddConversation(new HagDuringImpSearchConversation()); } else { obj = qs.FindObjective(typeof(ReturnRecipeObjective)); if (obj != null && !obj.Completed) { PlaySound(0x258); PlaySound(0x41B); obj.Complete(); } else if (qs.IsObjectiveInProgress(typeof(FindIngredientObjective))) { PlaySound(0x259); PlaySound(0x206); qs.AddConversation(new HagDuringIngredientsConversation()); } else { obj = qs.FindObjective(typeof(ReturnIngredientsObjective)); if (obj != null && !obj.Completed) { Container cont = GetNewContainer(); cont.DropItem(new BlackPearl(30)); cont.DropItem(new Bloodmoss(30)); cont.DropItem(new Garlic(30)); cont.DropItem(new Ginseng(30)); cont.DropItem(new MandrakeRoot(30)); cont.DropItem(new Nightshade(30)); cont.DropItem(new SulfurousAsh(30)); cont.DropItem(new SpidersSilk(30)); cont.DropItem(new Cauldron()); cont.DropItem(new MoonfireBrew()); cont.DropItem(new TreasureMap(Utility.RandomMinMax(1, 4), this.Map)); cont.DropItem(new Gold(2000, 2200)); if (Utility.RandomBool()) { BaseWeapon weapon = Loot.RandomWeapon(); int damageLevel = BaseCreature.RandomMinMaxScaled(2, 3); if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { cont.DropItem(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) { cont.DropItem(new Platinum(platAmount)); } damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 3); weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3); cont.DropItem(weapon); } else { Item item; BaseArmor armor = Loot.RandomArmorOrShield(); item = armor; armor.ProtectionLevel = (ArmorProtectionLevel)BaseCreature.RandomMinMaxScaled(2, 3); armor.Durability = (ArmorDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 3); cont.DropItem(item); } if (player.BAC > 0) { cont.DropItem(new HangoverCure()); } if (player.PlaceInBackpack(cont)) { PlaySound(0x253); PlaySound(0x20); obj.Complete(); } else { cont.Delete(); player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory. } } } } } } else { QuestSystem newQuest = new WitchApprenticeQuest(player); bool inRestartPeriod = false; if (qs != null) { newQuest.AddConversation(new DontOfferConversation()); } else if (QuestSystem.CanOfferQuest(player, typeof(WitchApprenticeQuest), out inRestartPeriod)) { PlaySound(0x20); PlaySound(0x206); newQuest.SendOffer(); } else if (inRestartPeriod) { PlaySound(0x259); PlaySound(0x206); newQuest.AddConversation(new RecentlyFinishedConversation()); } } }
public override void OnTalk(PlayerMobile player, bool contextMenu) { QuestSystem qs = player.Quest; if (qs is DarkTidesQuest) { if (DarkTidesQuest.HasLostCallingScroll(player)) { qs.AddConversation(new LostCallingScrollConversation(true)); } else { QuestObjective obj = qs.FindObjective(typeof(FindMardothAboutVaultObjective)); if (obj != null && !obj.Completed) { obj.Complete(); } else { obj = qs.FindObjective(typeof(FindMardothAboutKronusObjective)); if (obj != null && !obj.Completed) { obj.Complete(); } else { obj = qs.FindObjective(typeof(FindMardothEndObjective)); if (obj != null && !obj.Completed) { Container cont = GetNewContainer(); cont.DropItem(new PigIron(20)); cont.DropItem(new NoxCrystal(20)); cont.DropItem(new BatWing(25)); cont.DropItem(new DaemonBlood(20)); cont.DropItem(new GraveDust(20)); BaseWeapon weapon = new BoneHarvester(); weapon.Slayer = SlayerName.OrcSlaying; int damageLevel = BaseCreature.RandomMinMaxScaled(2, 4); if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { cont.DropItem(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) { cont.DropItem(new Platinum(platAmount)); } damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; weapon.AccuracyLevel = (WeaponAccuracyLevel)BaseCreature.RandomMinMaxScaled(2, 4); weapon.DurabilityLevel = (WeaponDurabilityLevel)BaseCreature.RandomMinMaxScaled(2, 4); cont.DropItem(weapon); cont.DropItem(new BankCheck(2000)); cont.DropItem(new EnchantedSextant()); if (!player.PlaceInBackpack(cont)) { cont.Delete(); player.SendLocalizedMessage(1046260); // You need to clear some space in your inventory to continue with the quest. Come back here when you have more space in your inventory. } else { obj.Complete(); } } else if (contextMenu) { FocusTo(player); player.SendLocalizedMessage(1061821); // Mardoth has nothing more for you at this time. } } } } } else if (qs == null && QuestSystem.CanOfferQuest(player, typeof(DarkTidesQuest))) { new DarkTidesQuest(player).SendOffer(); } }
public PuzzleGump(Mobile from, PuzzleChest chest, PuzzleChestSolution solution, int check) : base(50, 50) { m_From = from; m_Chest = chest; m_Solution = solution; Draggable = false; AddBackground(25, 0, 500, 410, 0x53); AddImage(62, 20, 0x67); AddHtmlLocalized(80, 36, 110, 70, 1018309, true); // A Puzzle Lock /* Correctly choose the sequence of cylinders needed to open the latch. Each cylinder * may potentially be used more than once. Beware! A false attempt could be deadly! */ AddHtmlLocalized(214, 26, 270, 90, 1018310, true, true); AddLeftCylinderButton(62, 130, PuzzleChestCylinder.LightBlue, 10); AddLeftCylinderButton(62, 180, PuzzleChestCylinder.Blue, 11); AddLeftCylinderButton(62, 230, PuzzleChestCylinder.Green, 12); AddLeftCylinderButton(62, 280, PuzzleChestCylinder.Orange, 13); AddRightCylinderButton(451, 130, PuzzleChestCylinder.Purple, 14); AddRightCylinderButton(451, 180, PuzzleChestCylinder.Red, 15); AddRightCylinderButton(451, 230, PuzzleChestCylinder.DarkBlue, 16); AddRightCylinderButton(451, 280, PuzzleChestCylinder.Yellow, 17); var lockpicking = from.Skills.Lockpicking.Base; if (lockpicking >= 60.0) { AddHtmlLocalized(160, 125, 230, 24, 1018308); // Lockpicking hint: AddBackground(159, 150, 230, 95, 0x13EC); if (lockpicking >= 80.0) { AddHtmlLocalized(165, 157, 200, 40, 1018312); // In the first slot: AddCylinder(350, 165, chest.Solution.First); AddHtmlLocalized(165, 197, 200, 40, 1018313); // Used in unknown slot: AddCylinder(350, 200, chest.FirstHint); if (lockpicking >= 90.0) { AddCylinder(350, 212, chest.SecondHint); } if (lockpicking >= 100.0) { AddCylinder(350, 224, chest.ThirdHint); } } else { AddHtmlLocalized(165, 157, 200, 40, 1018313); // Used in unknown slot: AddCylinder(350, 160, chest.FirstHint); if (lockpicking >= 70.0) { AddCylinder(350, 172, chest.SecondHint); } } } PuzzleChestSolution lastGuess = chest.GetLastGuess(from); if (lastGuess != null) { AddHtmlLocalized(127, 249, 170, 20, 1018311); // Thy previous guess: AddBackground(290, 247, 115, 25, 0x13EC); AddCylinder(281, 254, lastGuess.First); AddCylinder(303, 254, lastGuess.Second); AddCylinder(325, 254, lastGuess.Third); AddCylinder(347, 254, lastGuess.Fourth); AddCylinder(369, 254, lastGuess.Fifth); } AddPedestal(140, 270, solution.First, 0, check == 0); AddPedestal(195, 270, solution.Second, 1, check == 1); AddPedestal(250, 270, solution.Third, 2, check == 2); AddPedestal(305, 270, solution.Fourth, 3, check == 3); AddPedestal(360, 270, solution.Fifth, 4, check == 4); AddButton(258, 370, 0xFA5, 0xFA7, 1); }
public Executioner() : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4) { SpeechHue = Utility.RandomDyedHue(); Title = "the executioner"; Hue = Utility.RandomSkinHue(); if (this.Female = Utility.RandomBool()) { this.Body = 0x191; this.Name = NameList.RandomName("female"); AddItem(new Skirt(Utility.RandomRedHue())); } else { this.Body = 0x190; this.Name = NameList.RandomName("male"); AddItem(new ShortPants(Utility.RandomRedHue())); } SetStr(386, 400); SetDex(151, 165); SetInt(161, 175); SetDamage(8, 10); SetSkill(SkillName.Anatomy, 125.0); SetSkill(SkillName.Fencing, 46.0, 77.5); SetSkill(SkillName.Macing, 35.0, 57.5); SetSkill(SkillName.Poisoning, 60.0, 82.5); SetSkill(SkillName.MagicResist, 83.5, 92.5); SetSkill(SkillName.Swords, 125.0); SetSkill(SkillName.Tactics, 125.0); SetSkill(SkillName.Lumberjacking, 125.0); Fame = 5000; Karma = -5000; VirtualArmor = 40; AddItem(new ThighBoots(Utility.RandomRedHue())); AddItem(new Surcoat(Utility.RandomRedHue())); ExecutionersAxe weapon = new ExecutionersAxe(); int damageLevel = Utility.Random(0, 5); if (PseudoSeerStone.Instance != null && PseudoSeerStone.Instance._HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { PackItem(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) { PackItem(new Platinum(platAmount)); } damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(0, 5); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(0, 5); AddItem(weapon); Utility.AssignRandomHair(this); }