private static bool IsMeditable( BaseArmor ar ) { if ( ar == null || ar.ArmorAttributes.MageArmor != 0 || ar.Attributes.SpellChanneling != 0 ) return true; return ar.Meditable; }
private static double GetArmorStealthValue(BaseArmor ar) { if (ar == null) return 0.0; //return ar.ArmorRatingScaled; return ar.BaseArmorRating * ar.ArmorScalar; }
public static void ApplyBonusSingle( BaseArmor ba ) { //ba.Resistances.Physical -= 20; //ba.Resistances.Fire -= 20; //ba.Resistances.Cold -= 20; //ba.Resistances.Poison -= 20; //ba.Resistances.Energy -= 20; }
public static bool CanConvertArmor(BaseArmor armor) { if (armor.ArtifactRarity != 0) return false; if (armor.ArmorAttributes.MageArmor == 0 && Server.SkillHandlers.Imbuing.GetTotalMods(armor) > 4) return false; return true; }
public static BaseArmor MakeBloodArmor( BaseArmor armor ) { if ( 0.995 > Utility.RandomDouble() ) armor.SetSavedFlag( 0x01, true ); armor.Resource = CraftResource.BloodScales; armor.Identified = true; return armor; }
public static void ApplyBonus( BaseArmor ba ) { ba.ArmorAttributes.SelfRepair = 3; ba.Resistances.Physical = 2; ba.Resistances.Fire = 5; ba.Resistances.Cold = 5; ba.Resistances.Poison = 3; ba.Resistances.Energy = 5; ba.Hue = 1172; }
public static bool isArmaduraPesada(BaseArmor armadura) { //FIXME testar as armaduas por outra forma, e nao pelo material. if(armadura.MaterialType.Equals(ArmorMaterialType.Plate) || armadura.MaterialType.Equals(ArmorMaterialType.Dragon)) { return true; } return false; }
public static bool isArmaduraLeve(BaseArmor armadura) { //FIXME testar as armaduas por outra forma, e nao pelo material. if(armadura.MaterialType.Equals(ArmorMaterialType.Leather) || armadura.MaterialType.Equals(ArmorMaterialType.Studded)) { return true; } return false; }
public void PlayerWantsToUpgrade(Mobile from, BaseArmor armor) { if(!CanConvertArmor(armor)) { from.SendLocalizedMessage(1154119); // This action would exceed a stat cap return; } from.SendLocalizedMessage(1154117); // Ah yes, I will convert this piece of armor but it's gonna cost you 250,000 gold coin. Payment is due immediately. Just hand me the armor. m_PendingConverts.Add(new PendingConvert(from, armor)); }
public static void ApplyBonus( BaseArmor ba ) { ba.ArmorAttributes.SelfRepair = 5; ba.Hue = 0; ba.Resistances.Physical += 5; ba.Resistances.Fire += 5; ba.Resistances.Cold += 5; ba.Resistances.Poison += 5; ba.Resistances.Energy += 5; }
public static void ApplyBonus( BaseArmor ba ) { ba.Resistances.Physical = 3; ba.Resistances.Fire = 3; ba.Resistances.Cold = 3; ba.Resistances.Poison = 3; ba.Resistances.Energy = 3; ba.ArmorAttributes.SelfRepair = 3; ba.Hue = 203; ba.Attributes.NightSight = 1; }
public override void AlterFrom( BaseArmor orig ) { base.AlterFrom( orig ); var shield = orig as GargishSurgeShield; if ( shield != null ) { Charges = shield.Charges; SurgeEffect = shield.SurgeEffect; } }
public static bool isArmaduraMedia(BaseArmor armadura) { //FIXME testar as armaduas por outra forma, e nao pelo material. if(armadura.MaterialType.Equals(ArmorMaterialType.Ringmail) || armadura.MaterialType.Equals(ArmorMaterialType.Chainmail) || armadura.MaterialType.Equals(ArmorMaterialType.Bone)) { return true; } return false; }
private static double GetArmorMeditationValue( BaseArmor ar ) { if ( ar == null || ar.ArmorAttributes.MageArmor != 0 || ar.Attributes.SpellChanneling != 0 ) return 0.0; switch ( ar.MeditationAllowance ) { default: case ArmorMeditationAllowance.None: return ar.BaseArmorRatingScaled; case ArmorMeditationAllowance.Half: return ar.BaseArmorRatingScaled / 2.0; case ArmorMeditationAllowance.All: return 0.0; } }
public static BaseArmor[] DefaultArmorList(Mobile m) { BaseArmor[] armorList = new BaseArmor[] { new PlateHelm(), new PlateGorget(), new PlateArms(), new PlateGloves(), new PlateChest(), new PlateLegs(),new MetalKiteShield() }; for (int i = 0; i < armorList.Length; ++i) { BaseArmor armor = armorList[i]; if (armor.StrRequirement > m.Str) armor.Delete(); } return armorList; }
public void Mutate(BaseArmor weapon) { if (m_ProtectionContainer != null) { if (m_ProtectionContainer.AttributeSpawnChance >= (Utility.RandomDouble() * 100)) weapon.ProtectionLevel = (ArmorProtectionLevel)GetBonusLevel(m_ProtectionContainer.Attributes); } if (m_DurabilityContainer != null) { if (m_DurabilityContainer.AttributeSpawnChance >= (Utility.RandomDouble() * 100)) weapon.Durability = (ArmorDurabilityLevel)GetBonusLevel(m_DurabilityContainer.Attributes); } }
public static bool IsMeddableArmor(BaseArmor ba) { try { if( ba == null ) { return true; } if( ba.MeditationAllowance == ArmorMeditationAllowance.None ) { return false; } } catch (Exception ex) { EventSink.InvokeLogException(new LogExceptionEventArgs(ex)); } return true; }
private static double GetArmorMeditationValue( BaseArmor ar ) { if ( ar == null || ar.ArmorAttributes.MageArmor != 0 || ar.Attributes.SpellChanneling != 0 ) return 0.0; double d = 0.0; switch ( ar.MeditationAllowance ) { default: case ArmorMeditationAllowance.None: d = ar.BaseArmorRatingScaled; break; case ArmorMeditationAllowance.Half: d = ar.BaseArmorRatingScaled / 2.0; break; case ArmorMeditationAllowance.All: d = 0.0; break; } if ( ar is RangerArms || ar is RangerChest || ar is RangerGloves || ar is RangerGorget ) return d * 0.5; return d; }
public GraveTreasureChest3() : base(3712) { ItemID = Utility.RandomList(2472, 3712); Weight = 10.0; Movable = false; Locked = true; Name = "A Mysterious Chest"; LiftOverride = false; // force stealing int reward = Utility.RandomMinMax(2, 3);; RequiredSkill = 74; switch (Utility.Random(2)) { default: case 0: TrapType = TrapType.DartTrap; break; case 1: TrapType = TrapType.PoisonTrap; break; case 2: TrapType = TrapType.ExplosionTrap; break; } TrapPower = Utility.Random(30, 75); LockLevel = RequiredSkill - Utility.Random(1, 10); MaxLockLevel = RequiredSkill; DropItem(new Gold(Utility.RandomMinMax(RequiredSkill * 5, RequiredSkill * 10))); for (int i = Utility.Random(1, reward); i > 1; i--) { switch (Utility.Random(reward)) { default: case 0: DropItem(Loot.RandomClothing()); break; case 1: DropItem(Loot.RandomJewelry()); break; case 2: { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (!Core.AOS) { if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(reward * 2); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(reward * 2); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(reward * 2); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(reward * 2); armor.Durability = (ArmorDurabilityLevel)Utility.Random(reward * 2); } } DropItem(item); break; } } } }
public WhisperingHollowChest2() : base(0xE43) { Name = "a treasure chest -60-"; Movable = true; Weight = 1000.0; TrapPower = 0; Locked = true; RequiredSkill = 60; LockLevel = 60; MaxLockLevel = 80; /////////////////////////////////// Gold if (Utility.RandomDouble() < 0.25) { DropItem(new Gold(Utility.Random(20, 300))); } /////////////////////////////////////// Supplies switch (Utility.Random(18)) { case 0: DropItem(new Board(80)); break; case 1: DropItem(new BoltOfCloth(80)); break; case 2: DropItem(new Bottle(80)); break; case 3: DropItem(new CopperWire(80)); break; case 4: DropItem(new Cotton(80)); break; case 5: DropItem(new DarkYarn(80)); break; case 6: DropItem(new Feather(80)); break; case 7: DropItem(new Flax(80)); break; case 8: DropItem(new Gears(80)); break; case 9: DropItem(new GoldWire(80)); break; case 10: DropItem(new IronIngot(80)); break; case 11: DropItem(new IronWire(80)); break; case 12: DropItem(new Leather(80)); break; case 13: DropItem(new LightYarn(80)); break; case 14: DropItem(new Shaft(80)); break; case 15: DropItem(new SilverWire(80)); break; case 16: DropItem(new SpoolOfThread(80)); break; case 17: DropItem(new Springs(80)); break; case 18: DropItem(new Wool(80)); break; } switch (Utility.Random(5)) { case 0: DropItem(new ArcaneStone(25)); break; case 1: DropItem(new BeetleEgg(25)); break; case 2: DropItem(new DragonScale(25)); break; case 3: DropItem(new FishScale(25)); break; case 4: DropItem(new SerpentScale(25)); break; } Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.RandomMinMax(25, 50); DropItem(ReagentLoot); if (Utility.RandomDouble() < 0.05) { DropItem(new SackFlour()); } /////////////////////////////////////// Rare Items if (Utility.RandomDouble() < 0.01) { DropItem(new DyeTub()); } /////////////////////////////////////// LV 20-30 if (Utility.RandomDouble() < 0.10) { BaseWeapon weapon = Loot.RandomWeapon(true); switch (Utility.Random(31)) { case 0: weapon = new DoubleAxe(); break; // Lv20 case 1: weapon = new TwoHandedAxe(); break; // Lv25 case 2: weapon = new WarAxe(); break; // Lv30 case 3: weapon = new CompositeBow(); break; // Lv20 case 4: weapon = new EbonyCrossbow(); break; // Lv20 case 5: weapon = new FireBow(); break; // Lv25 case 6: weapon = new GrassBow(); break; // Lv25 case 7: weapon = new IceBow(); break; // Lv25 case 8: weapon = new LightningBow(); break; // Lv25 case 9: weapon = new EbonyWarBow(); break; // Lv30 case 10: weapon = new PistolCrossbow(); break; // Lv30 case 11: weapon = new EbonyDualDaggers(); break; // Lv20 case 12: weapon = new Tekagi(); break; // Lv25 case 13: weapon = new ElvenSpellblade(); break; // Lv30 case 14: weapon = new WarMace(); break; // Lv20 case 15: weapon = new Tessen(); break; // Lv25 case 16: weapon = new HammerPick(); break; // Lv30 case 17: weapon = new Spear(); break; // Lv20 case 18: weapon = new BoneSpear(); break; // Lv25 case 19: weapon = new BubbleStaff(); break; // Lv25 case 20: weapon = new CrystalStaff(); break; // Lv25 case 21: weapon = new EnergyStaff(); break; // Lv25 case 22: weapon = new FireStaff(); break; // Lv25 case 23: weapon = new VineStaff(); break; // Lv25 case 24: weapon = new BlackStaff(); break; // Lv30 case 25: weapon = new VikingSword(); break; // Lv20 case 26: weapon = new Wakizashi(); break; // Lv20 case 27: weapon = new Daisho(); break; // Lv30 case 28: weapon = new EbonyScimitar(); break; // Lv30 case 29: weapon = new RuneBlade(); break; // Lv30 default: weapon = new Longsword(); break; // Lv20 } BaseRunicTool.ApplyAttributesTo(weapon, 2, 5, 50); DropItem(weapon); } /////////////////////////////////////// LV 18-27 if (Utility.RandomDouble() < 0.10) { BaseArmor armor = Loot.RandomArmor(true); switch (Utility.Random(18)) { case 0: armor = new HideFemaleChest(); break; // Lv18 case 1: armor = new HideGloves(); break; // Lv18 case 2: armor = new HideGorget(); break; // Lv18 case 3: armor = new HidePants(); break; // Lv18 case 4: armor = new HidePauldrons(); break; // Lv18 case 5: armor = new StuddedDo(); break; // Lv21 case 6: armor = new StuddedHaidate(); break; // Lv21 case 7: armor = new StuddedHiroSode(); break; // Lv21 case 8: armor = new StuddedMempo(); break; // Lv21 case 9: armor = new StuddedSuneate(); break; // Lv21 case 10: armor = new VikingStuddedArms(); break; // Lv24 case 11: armor = new VikingStuddedCap(); break; // Lv24 case 12: armor = new VikingStuddedChest(); break; // Lv24 case 13: armor = new VikingStuddedLegs(); break; // Lv24 case 14: armor = new ChainChest(); break; // Lv27 case 15: armor = new ChainCoif(); break; // Lv27 case 16: armor = new ChainLegs(); break; // Lv27 default: armor = new HideChest(); break; // Lv18 } BaseRunicTool.ApplyAttributesTo(armor, 3, 5, 50); DropItem(armor); } if (Utility.RandomDouble() < 0.10) { BaseHat hat = Loot.RandomHat(true); BaseRunicTool.ApplyAttributesTo(hat, 3, 12, 15); DropItem(hat); } if (Utility.RandomDouble() < 0.10) { BaseClothing clothing = Loot.RandomClothing(true); BaseRunicTool.ApplyAttributesTo(clothing, 3, 12, 15); DropItem(clothing); } if (Utility.RandomDouble() < 0.10) { BaseShield shield1 = new ElvenShield(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(shield1, 3, 5, 50); } DropItem(shield1); } if (Utility.RandomDouble() < 0.10) { BaseShield shield2 = new InfantryShield(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(shield2, 3, 5, 50); } DropItem(shield2); } if (Utility.RandomDouble() < 0.10) { BaseShield shield3 = new SpiderShield(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(shield3, 3, 5, 50); } DropItem(shield3); } if (Utility.RandomDouble() < 0.10) { BaseShield shield4 = new GrassShield(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(shield4, 3, 5, 50); } DropItem(shield4); } if (Utility.RandomDouble() < 0.10) { BaseJewel bracelet = new SilverBracelet(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(bracelet, 3, 12, 15); } DropItem(bracelet); } if (Utility.RandomDouble() < 0.10) { BaseJewel earrings = new SilverEarrings(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(earrings, 3, 12, 15); } DropItem(earrings); } if (Utility.RandomDouble() < 0.10) { BaseJewel necklace = new SilverNecklace(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(necklace, 3, 12, 15); } DropItem(necklace); } if (Utility.RandomDouble() < 0.10) { BaseJewel ring = new SilverRing(); if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(ring, 3, 12, 15); } DropItem(ring); } }
protected override void OnTarget(Mobile from, object targ) { if (targ is BaseArmor) { BaseArmor item = (BaseArmor)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your armor has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else if (targ is BaseJewel) { BaseJewel item = (BaseJewel)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your jewelry has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else if (targ is BaseWeapon) { BaseWeapon item = (BaseWeapon)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your weapon has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else if (targ is BaseClothing) { BaseClothing item = (BaseClothing)targ; if (item.IsChildOf(from.Backpack)) { if (!item.Identified) { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("Your clothing has been identified")); item.Identified = true; ball.LastActiveCheck = DateTime.Now; if (ball.Charges > 0) { ball.Charges -= 1; } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That has already been identified.")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("That must be in your pack to identify")); } } else { ball.PublicOverheadMessage(MessageType.Regular, 0x0, false, ("I can't identify that!")); } }
public static void ApplyAttributesTo(BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount, int min, int max) { m_IsRunicTool = isRunicTool; m_LuckChance = luckChance; AosAttributes primary = armor.Attributes; AosArmorAttributes secondary = armor.ArmorAttributes; m_Props.SetAll(false); bool isShield = (armor is BaseShield); int baseCount = (isShield ? 7 : 20); int baseOffset = (isShield ? 0 : 4); if (!isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All) { m_Props.Set(3, true); // remove mage armor from possible properties } for (int i = 0; i < attributeCount; ++i) { int random = GetUniqueRandom(baseCount); if (random == -1) { break; } random += baseOffset; switch (random) { /* Begin Sheilds */ case 0: ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1); break; case 1: ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15); break; case 2: ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15); break; case 3: ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1); break; /* Begin Armor */ case 4: ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10); break; case 5: ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5); break; case 6: ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10); break; /* End Shields */ case 7: ApplyAttribute(secondary, min, max, AosArmorAttribute.MageArmor, 1, 1); break; case 8: ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2); break; case 9: ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3); break; case 10: ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2); break; case 11: ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1); break; case 12: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5); break; case 13: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8); break; case 14: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8); break; case 15: ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8); break; case 16: ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20); break; case 17: ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100); break; case 18: ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15); break; case 19: ApplyResistance(armor, min, max, ResistanceType.Physical, 1, 15); break; case 20: ApplyResistance(armor, min, max, ResistanceType.Fire, 1, 15); break; case 21: ApplyResistance(armor, min, max, ResistanceType.Cold, 1, 15); break; case 22: ApplyResistance(armor, min, max, ResistanceType.Poison, 1, 15); break; case 23: ApplyResistance(armor, min, max, ResistanceType.Energy, 1, 15); break; /* End Armor */ } } }
protected override void OnTarget(Mobile from, object targeted) { int scalar; double mageSkill = from.Skills[SkillName.Inscribe].Value; if (mageSkill >= 100.0) { scalar = 3; } else if (mageSkill >= 90.0) { scalar = 2; } else { scalar = 1; } if (targeted is BaseWeapon) { BaseWeapon Weapon = targeted as BaseWeapon; if (!from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage("You cannot enhance that in it's current location."); } else { int DestroyChance = Utility.Random(5); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; Weapon.WeaponAttributes.ResistEnergyBonus += augmentper; from.SendMessage("The Hur Rune enhances your weapon."); from.PlaySound(0x1F5); m_HurRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the weapon!"); from.SendMessage("The weapon is damaged beyond repair!"); from.PlaySound(42); Weapon.Delete(); m_HurRune.Delete(); } } } else if (targeted is BaseArmor) { BaseArmor Armor = targeted as BaseArmor; if (!from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage("You cannot enhance that in it's current location."); } else { int DestroyChance = Utility.Random(5); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; Armor.EnergyBonus += augment; from.SendMessage("The Hur Rune enhances your armor."); from.PlaySound(0x1F5); m_HurRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the armor!"); from.SendMessage("The armor is damaged beyond repair!"); from.PlaySound(42); Armor.Delete(); m_HurRune.Delete(); } } } else if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; if (!from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage("You cannot enhance that in it's current location."); } else { int DestroyChance = Utility.Random(5); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; Shield.EnergyBonus += augment; from.SendMessage("The Hur Rune enhances your shield."); from.PlaySound(0x1F5); m_HurRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the shield!"); from.SendMessage("The shield is damaged beyond repair!"); from.PlaySound(42); Shield.Delete(); m_HurRune.Delete(); } } } else if (targeted is BaseJewel) { BaseJewel Jewel = targeted as BaseJewel; if (!from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage("You cannot enhance that in it's current location."); } else { int DestroyChance = Utility.Random(5); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; Jewel.Resistances.Energy += augmentper; from.SendMessage("The Hur Rune ennhances your jewelry."); from.PlaySound(0x1F5); m_HurRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the jewelery!"); from.SendMessage("The jewelery is damaged beyond repair!"); from.PlaySound(62); Jewel.Delete(); m_HurRune.Delete(); } } } else { from.SendMessage("You cannot enhance that."); } }
protected override void OnTarget(Mobile from, object targeted) { Item iOil = targeted as Item; if (from.Backpack.FindItemByType(typeof(OilCloth)) == null) { from.SendMessage("You need an oil cloth to apply this."); } else if (iOil is BaseWeapon) { BaseWeapon xOil = (BaseWeapon)iOil; if (!iOil.IsChildOf(from.Backpack)) { from.SendMessage("You can only use this oil on items in your pack."); } else if (iOil.IsChildOf(from.Backpack) && MaterialInfo.IsWoodenItem(iOil)) { if (m_Oil.Name == "wood polish ( oak )") { xOil.Resource = CraftResource.OakTree; } else if (m_Oil.Name == "wood polish ( ash )") { xOil.Resource = CraftResource.AshTree; } else if (m_Oil.Name == "wood polish ( cherry )") { xOil.Resource = CraftResource.CherryTree; } else if (m_Oil.Name == "wood polish ( walnut )") { xOil.Resource = CraftResource.WalnutTree; } else if (m_Oil.Name == "wood polish ( golden oak )") { xOil.Resource = CraftResource.GoldenOakTree; } else if (m_Oil.Name == "wood polish ( ebony )") { xOil.Resource = CraftResource.EbonyTree; } else if (m_Oil.Name == "wood polish ( hickory )") { xOil.Resource = CraftResource.HickoryTree; } else if (m_Oil.Name == "wood polish ( pine )") { xOil.Resource = CraftResource.PineTree; } else if (m_Oil.Name == "wood polish ( rosewood )") { xOil.Resource = CraftResource.RosewoodTree; } else if (m_Oil.Name == "wood polish ( mahogany )") { xOil.Resource = CraftResource.MahoganyTree; } else if (m_Oil.Name == "wood polish ( driftwood )") { xOil.Resource = CraftResource.DriftwoodTree; } from.RevealingAction(); from.PlaySound(0x23E); from.AddToBackpack(new Bottle()); m_Oil.Consume(); from.Backpack.FindItemByType(typeof(OilCloth)).Delete(); } else { from.SendMessage("You cannot rub this oil on that."); } } else if (iOil is BaseArmor) { BaseArmor xOil = (BaseArmor)iOil; if (!iOil.IsChildOf(from.Backpack)) { from.SendMessage("You can only use this oil on items in your pack."); } else if (iOil.IsChildOf(from.Backpack) && MaterialInfo.IsWoodenItem(iOil)) { if (m_Oil.Name == "wood polish ( oak )") { xOil.Resource = CraftResource.OakTree; } else if (m_Oil.Name == "wood polish ( ash )") { xOil.Resource = CraftResource.AshTree; } else if (m_Oil.Name == "wood polish ( cherry )") { xOil.Resource = CraftResource.CherryTree; } else if (m_Oil.Name == "wood polish ( walnut )") { xOil.Resource = CraftResource.WalnutTree; } else if (m_Oil.Name == "wood polish ( golden oak )") { xOil.Resource = CraftResource.GoldenOakTree; } else if (m_Oil.Name == "wood polish ( ebony )") { xOil.Resource = CraftResource.EbonyTree; } else if (m_Oil.Name == "wood polish ( hickory )") { xOil.Resource = CraftResource.HickoryTree; } else if (m_Oil.Name == "wood polish ( pine )") { xOil.Resource = CraftResource.PineTree; } else if (m_Oil.Name == "wood polish ( rosewood )") { xOil.Resource = CraftResource.RosewoodTree; } else if (m_Oil.Name == "wood polish ( mahogany )") { xOil.Resource = CraftResource.MahoganyTree; } else if (m_Oil.Name == "wood polish ( driftwood )") { xOil.Resource = CraftResource.DriftwoodTree; } from.RevealingAction(); from.PlaySound(0x23E); from.AddToBackpack(new Bottle()); m_Oil.Consume(); from.Backpack.FindItemByType(typeof(OilCloth)).Delete(); } else { from.SendMessage("You cannot rub this oil on that."); } } else { from.SendMessage("You cannot rub this oil on that."); } }
public static void ApplyAttributesTo(BaseArmor armor, int attributeCount, int min, int max) { ApplyAttributesTo(armor, false, 0, attributeCount, min, max); }
public Item Resourced( BaseArmor armor, CraftResource resource ) { armor.Resource = resource; return armor; }
public TreasureLevel4() : base(Utility.RandomList(0xE42, 0x9AB, 0xE40)) { this.SetChestAppearance(); Movable = false; RequiredSkill = 92; LockLevel = this.RequiredSkill - Utility.Random(1, 10); MaxLockLevel = this.RequiredSkill; TrapType = TrapType.MagicTrap; TrapPower = 4 * Utility.Random(1, 25); DropItem(new Gold(200, 400)); DropItem(new BlankScroll(Utility.Random(1, 4))); for (int i = Utility.Random(1, 4); i > 1; i--) { Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.Random(6, 12); DropItem(ReagentLoot); } for (int i = Utility.Random(1, 4); i > 1; i--) { DropItem(Loot.RandomPotion()); } if (0.75 > Utility.RandomDouble()) //75% chance = 3/4 { for (int i = Utility.RandomMinMax(8, 16); i > 0; i--) { DropItem(Loot.RandomScroll(0, 47, SpellbookType.Regular)); } } if (0.75 > Utility.RandomDouble()) //75% chance = 3/4 { for (int i = Utility.RandomMinMax(6, 12) + 1; i > 0; i--) { DropItem(Loot.RandomGem()); } } for (int i = Utility.Random(1, 4); i > 1; i--) { DropItem(Loot.RandomWand()); } // Magical ArmorOrWeapon for (int i = Utility.Random(1, 4); i > 1; i--) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(4); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(4); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(4); weapon.Quality = WeaponQuality.Regular; } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(4); armor.Durability = (ArmorDurabilityLevel)Utility.Random(4); armor.Quality = ArmorQuality.Regular; } DropItem(item); } for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomClothing()); } for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomJewelry()); } DropItem(new MagicCrystalBall()); // Magic clothing (not implemented) // Magic jewelry (not implemented) }
protected override void OnTick() { Item gem = Loot.RandomGem(); Item reg = Loot.RandomPossibleReagent(); Item equip; equip = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); if (m_Item != null) { m_Item.IsDigging = false; } if (equip is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)equip; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else if (equip is BaseArmor) { BaseArmor armor = (BaseArmor)equip; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else if (equip is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)equip, attributeCount, min, max); } if (Utility.Random(100) < 85) { switch (Utility.Random(15)) { case 0: Skeleton skel = new Skeleton(); skel.Location = m_From.Location; skel.Map = m_From.Map; skel.Combatant = m_From; World.AddMobile(skel); break; case 1: Ghoul ghoul = new Ghoul(); ghoul.Location = m_From.Location; ghoul.Map = m_From.Map; ghoul.Combatant = m_From; World.AddMobile(ghoul); break; case 2: Wraith wraith = new Wraith(); wraith.Location = m_From.Location; wraith.Map = m_From.Map; wraith.Combatant = m_From; World.AddMobile(wraith); break; case 3: Lich lich = new Lich(); lich.Location = m_From.Location; lich.Map = m_From.Map; lich.Combatant = m_From; World.AddMobile(lich); break; case 4: LichLord lichl = new LichLord(); lichl.Location = m_From.Location; lichl.Map = m_From.Map; lichl.Combatant = m_From; World.AddMobile(lichl); break; case 5: AncientLich alich = new AncientLich(); alich.Location = m_From.Location; alich.Map = m_From.Map; alich.Combatant = m_From; World.AddMobile(alich); break; case 6: Mummy mum = new Mummy(); mum.Location = m_From.Location; mum.Map = m_From.Map; mum.Combatant = m_From; World.AddMobile(mum); break; case 7: Zombie zom = new Zombie(); zom.Location = m_From.Location; zom.Map = m_From.Map; zom.Combatant = m_From; World.AddMobile(zom); break; case 8: SkeletalKnight sk = new SkeletalKnight(); sk.Location = m_From.Location; sk.Map = m_From.Map; sk.Combatant = m_From; World.AddMobile(sk); break; case 9: SkeletalMage sm = new SkeletalMage(); sm.Location = m_From.Location; sm.Map = m_From.Map; sm.Combatant = m_From; World.AddMobile(sm); break; case 10: BoneKnight bk = new BoneKnight(); bk.Location = m_From.Location; bk.Map = m_From.Map; bk.Combatant = m_From; World.AddMobile(bk); break; case 11: BoneMagi bm = new BoneMagi(); bm.Location = m_From.Location; bm.Map = m_From.Map; bm.Combatant = m_From; World.AddMobile(bm); break; case 12: Spectre spec = new Spectre(); spec.Location = m_From.Location; spec.Map = m_From.Map; spec.Combatant = m_From; World.AddMobile(spec); break; case 13: Shade shade = new Shade(); shade.Location = m_From.Location; shade.Map = m_From.Map; shade.Combatant = m_From; World.AddMobile(shade); break; } m_From.SendMessage("The spirits have rose from the dead.."); } else if (m_From.Skills[SkillName.Mining].Base < 15.0) { if (Utility.Random(100) < 85) { m_From.SendMessage("You fail to dig anything up."); } else { switch (Utility.Random(3)) { case 0: m_From.AddToBackpack(gem); m_From.SendMessage("You dig up a gem."); break; case 1: m_From.AddToBackpack(reg); m_From.SendMessage("You dig up a reagent."); break; case 2: m_From.AddToBackpack(equip); m_From.SendMessage("You dig up some equipment."); break; } } } else if (m_From.Skills[SkillName.Mining].Base < 35.0) { if (Utility.Random(100) < 85) { m_From.SendMessage("You fail to dig anything up."); } else { gem.Amount = Utility.RandomMinMax(2, 4); reg.Amount = Utility.RandomMinMax(2, 4); switch (Utility.Random(5)) { case 0: m_From.AddToBackpack(gem); m_From.SendMessage("You dig up some gems."); break; case 1: m_From.AddToBackpack(reg); m_From.SendMessage("You dig up some reagents."); break; case 2: m_From.AddToBackpack(equip); m_From.SendMessage("You dig up some equipment."); break; case 3: m_From.AddToBackpack(Loot.RandomScroll(0, 20, SpellbookType.Regular)); m_From.SendMessage("You dig up a scroll."); break; case 4: m_From.AddToBackpack(Loot.RandomScroll(0, 5, SpellbookType.Necromancer)); m_From.SendMessage("You dig up a scroll."); break; } } } else if (m_From.Skills[SkillName.Mining].Base < 50.0) { if (Utility.Random(100) < 85) { m_From.SendMessage("You fail to dig anything up."); } else { gem.Amount = Utility.RandomMinMax(2, 10); reg.Amount = Utility.RandomMinMax(2, 10); switch (Utility.Random(6)) { case 0: m_From.AddToBackpack(gem); m_From.SendMessage("You dig up some gems."); break; case 1: m_From.AddToBackpack(reg); m_From.SendMessage("You dig up some reagents."); break; case 2: m_From.AddToBackpack(equip); m_From.SendMessage("You dig up some equipment."); break; case 3: m_From.AddToBackpack(Loot.RandomScroll(0, 40, SpellbookType.Regular)); m_From.SendMessage("You dig up a scroll."); break; case 4: m_From.AddToBackpack(Loot.RandomScroll(0, 10, SpellbookType.Regular)); m_From.SendMessage("You dig up a scroll."); break; case 5: m_From.AddToBackpack(new Bones()); m_From.SendMessage("You dig up a bones."); break; } } } else if (m_From.Skills[SkillName.Mining].Base < 75.0) { if (Utility.Random(100) < 85) { m_From.SendMessage("You fail to dig anything up."); } else { gem.Amount = Utility.RandomMinMax(2, 20); reg.Amount = Utility.RandomMinMax(2, 20); switch (Utility.Random(7)) { case 0: m_From.AddToBackpack(gem); m_From.SendMessage("You dig up some gems."); break; case 1: m_From.AddToBackpack(reg); m_From.SendMessage("You dig up some reagents."); break; case 2: m_From.AddToBackpack(equip); m_From.SendMessage("You dig up some equipment."); break; case 3: m_From.AddToBackpack(Loot.RandomScroll(0, 50, SpellbookType.Regular)); m_From.SendMessage("You dig up a scroll."); break; case 4: m_From.AddToBackpack(Loot.RandomScroll(0, 13, SpellbookType.Necromancer)); m_From.SendMessage("You dig up a scroll."); break; case 5: m_From.AddToBackpack(new Bones()); m_From.SendMessage("You dig up a bones."); break; } } } else if (m_From.Skills[SkillName.Mining].Base < 90.0) { if (Utility.Random(100) < 85) { m_From.SendMessage("You fail to dig anything up."); } else { gem.Amount = Utility.RandomMinMax(10, 30); reg.Amount = Utility.RandomMinMax(10, 30); switch (Utility.Random(8)) { case 0: m_From.AddToBackpack(gem); m_From.SendMessage("You dig up some gems."); break; case 1: m_From.AddToBackpack(reg); m_From.SendMessage("You dig up some reagents."); break; case 2: m_From.AddToBackpack(equip); m_From.SendMessage("You dig up some equipment."); break; case 3: m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular)); m_From.SendMessage("You dig up a scroll."); break; case 4: m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer)); m_From.SendMessage("You dig up a scroll."); break; case 5: m_From.AddToBackpack(new Bones()); m_From.SendMessage("You dig up a bones."); break; } } } else if (m_From.Skills[SkillName.Mining].Base < 150.0) { if (Utility.Random(500) < 5) { m_From.SendMessage("You dig up and item of great value."); switch (Utility.Random(5)) { case 0: m_From.AddToBackpack(new ArmoredRobe()); break; case 1: m_From.AddToBackpack(new ButchersResolve()); break; case 2: m_From.AddToBackpack(new FollowerOfTheOldLord()); break; case 3: m_From.AddToBackpack(new SkirtOfTheAmazon()); break; case 4: m_From.AddToBackpack(new HolyHammerOfExorcism()); break; } } else { gem.Amount = Utility.RandomMinMax(2, 40); reg.Amount = Utility.RandomMinMax(2, 40); switch (Utility.Random(8)) { case 0: m_From.AddToBackpack(gem); m_From.SendMessage("You dig up some gems."); break; case 1: m_From.AddToBackpack(reg); m_From.SendMessage("You dig up some reagents."); break; case 2: m_From.AddToBackpack(equip); m_From.SendMessage("You dig up some equipment."); break; case 3: m_From.AddToBackpack(Loot.RandomScroll(0, 63, SpellbookType.Regular)); m_From.SendMessage("You dig up a scroll."); break; case 4: m_From.AddToBackpack(Loot.RandomScroll(0, 15, SpellbookType.Necromancer)); m_From.SendMessage("You dig up a scroll."); break; case 5: m_From.AddToBackpack(new Bones()); m_From.SendMessage("You dig up a bones."); break; } } } else { m_From.SendMessage("You fail to dig anything up."); } Stop(); }
public static void Fill(LockableContainer cont, int luck, int level, bool isSos, Map map) { cont.Movable = false; cont.Locked = true; int numberItems; if (level == 0) { cont.LockLevel = 0; // Can't be unlocked cont.DropItem(new Gold(Utility.RandomMinMax(50, 100))); if (Utility.RandomDouble() < 0.75) { cont.DropItem(new TreasureMap(0, Map.Trammel)); } } else { cont.TrapType = TrapType.ExplosionTrap; cont.TrapPower = level * 25; cont.TrapLevel = level; switch (level) { case 1: cont.RequiredSkill = 5; break; case 2: cont.RequiredSkill = 45; break; case 3: cont.RequiredSkill = 65; break; case 4: cont.RequiredSkill = 75; break; case 5: cont.RequiredSkill = 75; break; case 6: cont.RequiredSkill = 80; break; case 7: cont.RequiredSkill = 80; break; } cont.LockLevel = cont.RequiredSkill - 10; cont.MaxLockLevel = cont.RequiredSkill + 40; cont.DropItem(new Gold(level * 5000)); for (int i = 0; i < level * 5; ++i) { cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular)); } double propsScale = 1.0; if (Core.SE) { switch (level) { case 1: numberItems = 32; propsScale = 0.5625; break; case 2: numberItems = 40; propsScale = 0.6875; break; case 3: numberItems = 48; propsScale = 0.875; break; case 4: numberItems = 56; break; case 5: numberItems = 64; break; case 6: numberItems = 72; break; case 7: numberItems = 80; break; default: numberItems = 0; break; } } else { numberItems = level * 6; } for (int i = 0; i < numberItems; ++i) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item != null && Core.HS && RandomItemGenerator.Enabled) { int min, max; GetRandomItemStat(out min, out max, propsScale); RunicReforging.GenerateRandomItem(item, luck, min, max, map); cont.DropItem(item); } else if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } cont.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } cont.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); } cont.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); cont.DropItem(item); } } } int reagents; if (level == 0) { reagents = 12; } else { reagents = level + 1; } for (int i = 0; i < reagents; i++) { Item item = Loot.RandomPossibleReagent(); item.Amount = Utility.RandomMinMax(40, 60); cont.DropItem(item); } int gems; if (level == 0) { gems = 2; } else { gems = (level * 3) + 1; } for (int i = 0; i < gems; i++) { Item item = Loot.RandomGem(); cont.DropItem(item); } if (level > 1) { Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]); item.Amount = level; cont.DropItem(item); } Item arty = null; Item special = null; if (isSos) { if (0.004 * level > Utility.RandomDouble()) { arty = Loot.Construct(m_SOSArtifacts); } if (0.006 * level > Utility.RandomDouble()) { special = Loot.Construct(m_SOSDecor); } else if (0.009 * level > Utility.RandomDouble()) { special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map); } } else { if (level >= 7) { if (0.025 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelSevenOnly); } else if (0.10 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelFiveToSeven); } else if (0.25 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } arty = Loot.Construct(m_Artifacts); } else if (level >= 6) { if (0.025 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelFiveToSeven); } else if (0.10 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } arty = Loot.Construct(m_Artifacts); } else if (level >= 5) { if (0.05 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelFiveToSeven); } else if (0.25 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } } else if (.10 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } } if (arty != null) { Container pack = new Backpack(); pack.Hue = 1278; pack.DropItem(arty); cont.DropItem(pack); } if (special != null) { cont.DropItem(special); } if (Core.SA) { int rolls = 2; if (level >= 5) { rolls += level - 2; } RefinementComponent.Roll(cont, rolls, 0.10); } }
public static void Fill(Mobile from, LockableContainer cont, int level, bool isSos) { Map map = from.Map; int luck = from is PlayerMobile ? ((PlayerMobile)from).RealLuck : from.Luck; cont.Movable = false; cont.Locked = true; int count; if (level == 0) { cont.LockLevel = 0; // Can't be unlocked cont.DropItem(new Gold(Utility.RandomMinMax(50, 100))); if (Utility.RandomDouble() < 0.75) { cont.DropItem(new TreasureMap(0, Map.Trammel)); } } else { cont.TrapType = TrapType.ExplosionTrap; cont.TrapPower = level * 25; cont.TrapLevel = level; switch (level) { case 1: cont.RequiredSkill = 5; break; case 2: cont.RequiredSkill = 45; break; case 3: cont.RequiredSkill = 65; break; case 4: cont.RequiredSkill = 75; break; case 5: cont.RequiredSkill = 75; break; case 6: cont.RequiredSkill = 80; break; case 7: cont.RequiredSkill = 80; break; } cont.LockLevel = cont.RequiredSkill - 10; cont.MaxLockLevel = cont.RequiredSkill + 40; #region Gold cont.DropItem(new Gold(isSos ? level * 10000 : level * 5000)); #endregion #region Scrolls if (isSos) { switch (level) { default: count = 20; break; case 0: case 1: count = Utility.RandomMinMax(2, 5); break; case 2: count = Utility.RandomMinMax(10, 15); break; } } else { count = level * 5; } for (int i = 0; i < count; ++i) { cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular)); } #endregion #region Magical Items double propsScale = 1.0; switch (level) { case 1: count = isSos ? Utility.RandomMinMax(2, 6) : 32; propsScale = 0.5625; break; case 2: count = isSos ? Utility.RandomMinMax(10, 15) : 40; propsScale = 0.6875; break; case 3: count = isSos ? Utility.RandomMinMax(15, 20) : 48; propsScale = 0.875; break; case 4: count = isSos ? Utility.RandomMinMax(15, 20) : 56; break; case 5: count = isSos ? Utility.RandomMinMax(15, 20) : 64; break; case 6: count = isSos ? Utility.RandomMinMax(15, 20) : 72; break; case 7: count = isSos ? Utility.RandomMinMax(15, 20) : 80; break; default: count = 0; break; } for (int i = 0; i < count; ++i) { Item item; item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); if (item != null && RandomItemGenerator.Enabled) { int min, max; GetRandomItemStat(out min, out max, propsScale); RunicReforging.GenerateRandomItem(item, luck, min, max, map); cont.DropItem(item); } else if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); cont.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); cont.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); cont.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); cont.DropItem(item); } } } #endregion #region Reagents if (isSos) { switch (level) { default: count = Utility.RandomMinMax(45, 60); break; case 0: case 1: count = Utility.RandomMinMax(15, 20); break; case 2: count = Utility.RandomMinMax(25, 40); break; } } else { count = level == 0 ? 12 : Utility.RandomMinMax(40, 60) * (level + 1); } for (int i = 0; i < count; i++) { cont.DropItemStacked(Loot.RandomPossibleReagent()); } #endregion #region Gems if (level == 0) { count = 2; } else { count = (level * 3) + 1; } for (int i = 0; i < count; i++) { cont.DropItem(Loot.RandomGem()); } #endregion #region Imbuing Ingreds if (level > 1) { Item item = Loot.Construct(m_ImbuingIngreds[Utility.Random(m_ImbuingIngreds.Length)]); item.Amount = level; cont.DropItem(item); } #endregion Item arty = null; Item special = null; Item newSpecial = null; if (isSos) { if (0.004 * level > Utility.RandomDouble()) { arty = Loot.Construct(m_SOSArtifacts); } if (0.006 * level > Utility.RandomDouble()) { special = Loot.Construct(m_SOSDecor); } else if (0.009 * level > Utility.RandomDouble()) { special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), cont.Map); } if (level >= 4) { switch (Utility.Random(4)) { case 0: newSpecial = new AncientAquariumFishNet(); break; case 1: newSpecial = new LiveRock(); break; case 2: newSpecial = new SaltedSerpentSteaks(); break; case 3: newSpecial = new OceanSapphire(); break; } } } else { if (level >= 7) { if (0.025 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelSevenOnly); } else if (0.10 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelFiveToSeven); } else if (0.25 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } arty = Loot.Construct(m_Artifacts); } else if (level >= 6) { if (0.025 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelFiveToSeven); } else if (0.20 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } arty = Loot.Construct(m_Artifacts); } else if (level >= 5) { if (0.005 > Utility.RandomDouble()) { special = Loot.Construct(m_LevelFiveToSeven); } else if (0.15 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } } else if (0.10 > Utility.RandomDouble()) { special = GetRandomSpecial(level, cont.Map); } } if (arty != null) { Container pack = new Backpack(); pack.Hue = 1278; pack.DropItem(arty); cont.DropItem(pack); } if (special != null) { cont.DropItem(special); } if (newSpecial != null) { cont.DropItem(newSpecial); } int rolls = 2; if (level >= 5) { rolls += level - 2; } RefinementComponent.Roll(cont, rolls, 0.10); }
private void Fill(int level) { this.TrapType = TrapType.ExplosionTrap; this.TrapPower = level * 25; this.TrapLevel = level; this.Locked = true; switch (level) { case 1: this.RequiredSkill = 36; break; case 2: this.RequiredSkill = 76; break; case 3: this.RequiredSkill = 84; break; case 4: this.RequiredSkill = 92; break; case 5: this.RequiredSkill = 100; break; case 6: this.RequiredSkill = 100; break; } this.LockLevel = this.RequiredSkill - 10; this.MaxLockLevel = this.RequiredSkill + 40; this.DropItem(new Gold(level * 200)); for (int i = 0; i < level; ++i) { this.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular)); } for (int i = 0; i < level * 2; ++i) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item != null && Core.HS && Server.Mobiles.RandomItemGenerator.Enabled) { int min, max; TreasureMapChest.GetRandomItemStat(out min, out max); RunicReforging.GenerateRandomItem(item, 0, min, max); DropItem(item); continue; } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } this.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } this.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); } this.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); this.DropItem(item); } } for (int i = 0; i < level; i++) { Item item = Loot.RandomPossibleReagent(); item.Amount = Utility.RandomMinMax(40, 60); this.DropItem(item); } for (int i = 0; i < level; i++) { Item item = Loot.RandomGem(); this.DropItem(item); } this.DropItem(new TreasureMap(level + 1, (Utility.RandomBool() ? Map.Felucca : Map.Trammel))); }
protected override void OnTarget(Mobile from, object targeted) { int DestroyChance = Utility.Random(5); int augmentper = Utility.Random(8) + 1; if (targeted is Item) // protects from crash if targeting a Mobile. { Item item = (Item)targeted; if (!from.InRange(((Item)targeted).GetWorldLocation(), 3)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage("You cannot enhance that in it's current location."); } else if (targeted is BaseWeapon) { BaseWeapon Weapon = targeted as BaseWeapon; { if (DestroyChance > 0) // Success { Weapon.WeaponAttributes.ResistEnergyBonus += augmentper; from.SendMessage("The Rune enhances your weapon."); from.PlaySound(0x1F5); m_ResistEnergyRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the weapon!"); from.SendMessage("The weapon is damaged beyond repair!"); from.PlaySound(42); Weapon.Delete(); m_ResistEnergyRune.Delete(); } } } else if (targeted is BaseArmor) { BaseArmor Armor = targeted as BaseArmor; { if (DestroyChance > 0) // Success { Armor.EnergyBonus += augmentper; from.SendMessage("The Rune enhances your armor."); from.PlaySound(0x1F5); m_ResistEnergyRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the armor!"); from.SendMessage("The armor is damaged beyond repair!"); from.PlaySound(42); Armor.Delete(); m_ResistEnergyRune.Delete(); } } } else if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; { if (DestroyChance > 0) // Success { Shield.EnergyBonus += augmentper; from.SendMessage("The Rune enhances your shield."); from.PlaySound(0x1F5); m_ResistEnergyRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the shield!"); from.SendMessage("The shield is damaged beyond repair!"); from.PlaySound(42); Shield.Delete(); m_ResistEnergyRune.Delete(); } } } else if (targeted is BaseJewel) { BaseJewel Jewel = targeted as BaseJewel; { if (DestroyChance > 0) // Success { Jewel.Resistances.Energy += augmentper; from.SendMessage("The Rune ennhances your jewelry."); from.PlaySound(0x1F5); m_ResistEnergyRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the jewelery!"); from.SendMessage("The jewelery is damaged beyond repair!"); from.PlaySound(62); Jewel.Delete(); m_ResistEnergyRune.Delete(); } } } } else { from.SendMessage("You cannot enhance that."); } }
private void Fill(int level) { switch (level) { case 1: RequiredSkill = 36; break; case 2: RequiredSkill = 76; break; case 3: RequiredSkill = 84; break; case 4: RequiredSkill = 92; break; case 5: RequiredSkill = 100; break; } DropItem(new Gold(level * 6)); for (int i = 0; i < level * 2; ++i) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); DropItem(item); } } for (int i = 0; i < level; i++) { Item item = Loot.RandomPossibleReagent(); item.Amount = Utility.RandomMinMax(1, 3); DropItem(item); } for (int i = 0; i < level; i++) { Item item = Loot.RandomGem(); DropItem(item); } }
public ArmorEntry(BaseArmor armor) : base(armor) { }
public static void ApplyAttributesTo(BaseArmor armor, bool isGemCraftTool, int luckChance, int attributeCount, int min, int max) { m_LuckChance = luckChance; AosAttributes primary = armor.Attributes; AosArmorAttributes secondary = armor.ArmorAttributes; m_Props.SetAll(false); bool isShield = (armor is BaseShield); int baseCount = (isShield ? 7 : 20); int baseOffset = (isShield ? 0 : 4); if (!isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All) { m_Props.Set(3, true); // remove mage armor from possible properties } if (armor.Resource >= CraftResource.RegularLeather && armor.Resource <= CraftResource.BarbedLeather) { m_Props.Set(0, true); // remove lower requirements from possible properties for leather armor m_Props.Set(2, true); // remove durability bonus from possible properties } if (armor.RequiredRace == Race.Elf) { m_Props.Set(7, true); // elves inherently have night sight and elf only armor doesn't get night sight as a mod } for (int i = 0; i < attributeCount; ++i) { int random = GetUniqueRandom(baseCount); if (random == -1) { break; } random += baseOffset; switch (random) { /* Begin Sheilds */ case 0: ApplyAttribute(primary, min, max, AosAttribute.SpellChanneling, 1, 1); break; case 1: ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15); break; case 2: if (Core.ML) { ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15); } else { ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15); } break; case 3: ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1); break; /* Begin Armor */ case 4: ApplyAttribute(secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10); break; case 5: ApplyAttribute(secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5); break; case 6: ApplyAttribute(secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10); break; /* End Shields */ case 7: ApplyAttribute(secondary, min, max, AosArmorAttribute.MageArmor, 1, 1); break; case 8: ApplyAttribute(primary, min, max, AosAttribute.RegenHits, 1, 2); break; case 9: ApplyAttribute(primary, min, max, AosAttribute.RegenStam, 1, 3); break; case 10: ApplyAttribute(primary, min, max, AosAttribute.RegenMana, 1, 2); break; case 11: ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1); break; case 12: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 1, 5); break; case 13: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 1, 8); break; case 14: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 1, 8); break; case 15: ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8); break; case 16: ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20); break; case 17: ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100); break; case 18: ApplyAttribute(primary, min, max, AosAttribute.ReflectPhysical, 1, 15); break; case 19: ApplyResistance(armor, min, max, ResistanceType.Physical, 1, 15); break; case 20: ApplyResistance(armor, min, max, ResistanceType.Fire, 1, 15); break; case 21: ApplyResistance(armor, min, max, ResistanceType.Cold, 1, 15); break; case 22: ApplyResistance(armor, min, max, ResistanceType.Poison, 1, 15); break; case 23: ApplyResistance(armor, min, max, ResistanceType.Energy, 1, 15); break; /* End Armor */ } } }
public void ApplyAttributesTo( BaseArmor armor ) { CraftResourceInfo resInfo = CraftResources.GetInfo( m_Resource ); if ( resInfo == null ) return; CraftAttributeInfo attrs = resInfo.AttributeInfo; if ( attrs == null ) return; int attributeCount = Utility.RandomMinMax( attrs.RunicMinAttributes, attrs.RunicMaxAttributes ); int min = attrs.RunicMinIntensity; int max = attrs.RunicMaxIntensity; ApplyAttributesTo( armor, true, 0, attributeCount, min, max ); }
protected override void GenerateTreasure() { DropItem(new Gold(600, 900)); ArrayList gems = new ArrayList(); for (int i = 0; i < 9; i++) { Item gem = Loot.RandomGem(); Type gemType = gem.GetType(); foreach (Item listGem in gems) { if (listGem.GetType() == gemType) { listGem.Amount++; gem.Delete(); break; } } if (!gem.Deleted) { gems.Add(gem); } } foreach (Item gem in gems) { DropItem(gem); } if (0.2 > Utility.RandomDouble()) { DropItem(new BagOfReagents(50)); } for (int i = 0; i < 2; i++) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); DropItem(item); } } Solution = new PuzzleChestSolution(); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (from != owner && Weight > 0) { this.Delete(); return(false); } else { bool openGump = false; if (dropped != null && (dropped is BaseArmor || dropped is BaseClothing || dropped is BaseJewel || dropped is BaseHat)) { if (dropped is BaseHat || dropped is MagicHat) { openGump = true; } else if (dropped is BaseArmor && dropped.Layer == Layer.Arms) { openGump = true; } else if (dropped.Layer == Layer.Gloves && dropped is BaseArmor) { BaseArmor gloves = (BaseArmor)dropped; if (gloves.ItemID != 0x564E) { ChangeItem(dropped, 0x564E, "guantlets", from); } else if (Server.Misc.MaterialInfo.IsAnyKindOfMetalItem(dropped)) { ChangeItem(dropped, 0x1414, "guantlets", from); } else if (Server.Misc.MaterialInfo.IsAnyKindOfWoodItem(dropped)) { ChangeItem(dropped, 0x1414, "guantlets", from); } else { ChangeItem(dropped, 0x13C6, "gloves", from); } } else if (dropped.ItemID == 0x2790 || dropped.ItemID == 0x2B68 || dropped.ItemID == 0x153B) { ChangeItem(dropped, 0x2B68, "loin cloth", from); } else if (dropped.ItemID == 0x2B68) { ChangeItem(dropped, 0x55DB, "royal loin cloth", from); } else if (dropped.Layer == Layer.Neck) { ChangeItem(dropped, 0x5650, "amulet", from); } else if (dropped.ItemID == 0x1541 || dropped.ItemID == 0x1542) { ChangeItem(dropped, 0x0409, "sash", from); } else if (dropped.ItemID == 0x0409) { ChangeItem(dropped, 0x1541, "sash", from); } else if (dropped.Layer == Layer.OuterTorso) { openGump = true; } else if (dropped.Layer == Layer.Cloak && ( dropped.ItemID == 0x1515 || dropped.ItemID == 0x1530 || dropped.ItemID == 0x2309 || dropped.ItemID == 0x230A || dropped.ItemID == 0x26AD || dropped.ItemID == 0x2B04 || dropped.ItemID == 0x2B05 || dropped.ItemID == 0x2B76 || dropped.ItemID == 0x316D || dropped.ItemID == 0x5679)) { if (dropped.ItemID != 0x5679) { ChangeItem(dropped, 0x5679, "fleece", from); } else { ChangeItem(dropped, 0x1515, "cloak", from); } } else if (dropped.Layer == Layer.Helm && dropped is BaseArmor) { openGump = true; } else if (dropped is BaseShield) { openGump = true; } else if ((dropped.Layer == Layer.Pants || dropped.Layer == Layer.InnerLegs) && dropped is BaseArmor) { openGump = true; } else if ((dropped.Layer == Layer.Shirt || dropped.Layer == Layer.InnerTorso) && dropped is BaseArmor) { openGump = true; } else if (dropped.Layer == Layer.Shoes) { bool metalShoes = false; if (dropped is BaseArmor) { BaseArmor boots = (BaseArmor)dropped; if (Server.Misc.MaterialInfo.IsAnyKindOfMetalItem(boots)) { metalShoes = true; } } if (dropped.ItemID == 0x0406) { ChangeItem(dropped, 0x170D, "sandals", from); } else if (dropped.ItemID == 0x170D) { if (metalShoes) { ChangeItem(dropped, 0x170B, "boots", from); } else if (dropped.ItemID != 0x2B67) { ChangeItem(dropped, 0x2B67, "boots", from); } } else { ChangeItem(dropped, 0x0406, "boots", from); } } } if (from is PlayerMobile && openGump) { from.CloseGump(typeof(BarbaricSatchelGump)); from.CloseGump(typeof(BarbaricAlterGump)); from.SendGump(new BarbaricAlterGump(from, dropped)); from.PlaySound(0x48); } } return(false); }
public TreasureChestLevel3() : base(0xE41) { this.SetChestAppearance(); Movable = false; TrapType = TrapType.PoisonTrap; TrapPower = m_Level * Utility.Random(1, 25); Locked = true; RequiredSkill = 84; LockLevel = this.RequiredSkill - Utility.Random(1, 10); MaxLockLevel = this.RequiredSkill; // According to OSI, loot in level 3 chest is: // Gold 250 - 350 // Arrows 10 // Reagents // Scrolls // Potions // Gems // Magic Wand // Magic weapon // Magic armour // Magic clothing (not implemented) // Magic jewelry (not implemented) // Gold DropItem(new Gold(Utility.Random(180, 240))); // Drop bolts //DropItem( new Arrow( 10 ) ); // Reagents for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.Random(1, 9); DropItem(ReagentLoot); } // Scrolls for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item ScrollLoot = Loot.RandomScroll(0, 47, SpellbookType.Regular); ScrollLoot.Amount = Utility.Random(1, 12); DropItem(ScrollLoot); } // Potions for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item PotionLoot = Loot.RandomPotion(); DropItem(PotionLoot); } // Gems for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item GemLoot = Loot.RandomGem(); GemLoot.Amount = Utility.Random(1, 9); DropItem(GemLoot); } // Magic Wand for (int i = Utility.Random(1, m_Level); i > 1; i--) { DropItem(Loot.RandomWand()); } // Equipment for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(m_Level); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(m_Level); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(m_Level); weapon.Quality = WeaponQuality.Regular; } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(m_Level); armor.Durability = (ArmorDurabilityLevel)Utility.Random(m_Level); armor.Quality = ArmorQuality.Regular; } DropItem(item); } // Clothing for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomClothing()); } // Jewelry for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomJewelry()); } }
public static void Fill(LockableContainer cont, int level) { cont.Movable = false; cont.Locked = true; int numberItems; cont.TrapType = TrapType.ExplosionTrap; cont.TrapPower = level * 25; cont.TrapLevel = level; switch (level) { case 1: cont.RequiredSkill = 36; break; case 2: cont.RequiredSkill = 76; break; case 3: cont.RequiredSkill = 84; break; case 4: cont.RequiredSkill = 92; break; case 5: cont.RequiredSkill = 100; break; case 6: cont.RequiredSkill = 100; break; } cont.LockLevel = cont.RequiredSkill - 10; cont.MaxLockLevel = cont.RequiredSkill + 40; cont.DropItem(new Gold(level * 1000)); for (int i = 0; i < level * 5; ++i) { cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular)); } numberItems = level * 6; for (int i = 0; i < numberItems; ++i) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); cont.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); cont.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; cont.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); cont.DropItem(item); } } int reagents; if (level == 0) { reagents = 12; } else { reagents = level * 3; } for (int i = 0; i < reagents; i++) { Item item = Loot.RandomPossibleReagent(); item.Amount = Utility.RandomMinMax(40, 60); cont.DropItem(item); } int gems; if (level == 0) { gems = 2; } else { gems = level * 3; } for (int i = 0; i < gems; i++) { Item item = Loot.RandomGem(); cont.DropItem(item); } }
public static void Fill(LockableContainer cont, int level) { cont.Movable = false; cont.Locked = true; int numberItems; if (level == 0) { cont.LockLevel = 0; // Can't be unlocked cont.DropItem(new Gold(Utility.RandomMinMax(50, 100))); if (Utility.RandomDouble() < 0.75) { cont.DropItem(new TreasureMap(0, Map.Trammel)); } } else { cont.TrapType = TrapType.ExplosionTrap; cont.TrapPower = level * 25; cont.TrapLevel = level; switch (level) { case 1: cont.RequiredSkill = 36; break; case 2: cont.RequiredSkill = 76; break; case 3: cont.RequiredSkill = 84; break; case 4: cont.RequiredSkill = 92; break; case 5: cont.RequiredSkill = 100; break; case 6: cont.RequiredSkill = 100; break; } cont.LockLevel = cont.RequiredSkill - 10; cont.MaxLockLevel = cont.RequiredSkill + 40; //Publish 67 gold change //if ( Core.SA ) // cont.DropItem( new Gold( level * 5000 ) ); //else cont.DropItem(new Gold(level * 1000)); for (int i = 0; i < level * 5; ++i) { cont.DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular)); } if (Core.SE) { switch (level) { case 1: numberItems = 5; break; case 2: numberItems = 10; break; case 3: numberItems = 15; break; case 4: numberItems = 38; break; case 5: numberItems = 50; break; case 6: numberItems = 60; break; default: numberItems = 0; break; } ; } else { numberItems = level * 6; } for (int i = 0; i < numberItems; ++i) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } cont.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); } cont.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); } cont.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); cont.DropItem(item); } } } int reagents; if (level == 0) { reagents = 12; } else { reagents = level * 3; } for (int i = 0; i < reagents; i++) { Item item = Loot.RandomPossibleReagent(); item.Amount = Utility.RandomMinMax(40, 60); cont.DropItem(item); } int gems; if (level == 0) { gems = 2; } else { gems = level * 3; } for (int i = 0; i < gems; i++) { Item item = Loot.RandomGem(); cont.DropItem(item); } if (level == 6 && Core.AOS) { cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)])); } }
private void ApplyArmorSpecificAttributesTo( BaseArmor armor ) { armor.PhysicalBonus += ArmorPhysicalResist; armor.FireBonus += ArmorFireResist; armor.ColdBonus += ArmorColdResist; armor.PoisonBonus += ArmorPoisonResist; armor.EnergyBonus += ArmorEnergyResist; }
public static void ApplyAttributesTo( BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount, int min, int max ) { m_IsRunicTool = isRunicTool; m_LuckChance = luckChance; AosAttributes primary = armor.Attributes; AosArmorAttributes secondary = armor.ArmorAttributes; m_Props.SetAll( false ); bool isShield = ( armor is BaseShield ); int baseCount = ( isShield ? 7 : 20 ); int baseOffset = ( isShield ? 0 : 4 ); if ( !isShield && armor.MeditationAllowance == ArmorMeditationAllowance.All ) m_Props.Set( 3, true ); // remove mage armor from possible properties for ( int i = 0; i < attributeCount; ++i ) { int random = GetUniqueRandom( baseCount ); if ( random == -1 ) break; random += baseOffset; switch ( random ) { /* Begin Sheilds */ case 0: ApplyAttribute( primary, min, max, AosAttribute.SpellChanneling, 1, 1 ); break; case 1: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break; case 2: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break; case 3: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break; /* Begin Armor */ case 4: ApplyAttribute( secondary, min, max, AosArmorAttribute.LowerStatReq, 10, 100, 10 ); break; case 5: ApplyAttribute( secondary, min, max, AosArmorAttribute.SelfRepair, 1, 5 ); break; case 6: ApplyAttribute( secondary, min, max, AosArmorAttribute.DurabilityBonus, 10, 100, 10 ); break; /* End Shields */ case 7: ApplyAttribute( secondary, min, max, AosArmorAttribute.MageArmor, 1, 1 ); break; case 8: ApplyAttribute( primary, min, max, AosAttribute.RegenHits, 1, 2 ); break; case 9: ApplyAttribute( primary, min, max, AosAttribute.RegenStam, 1, 3 ); break; case 10: ApplyAttribute( primary, min, max, AosAttribute.RegenMana, 1, 2 ); break; case 11: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break; case 12: ApplyAttribute( primary, min, max, AosAttribute.BonusHits, 1, 5 ); break; case 13: ApplyAttribute( primary, min, max, AosAttribute.BonusStam, 1, 8 ); break; case 14: ApplyAttribute( primary, min, max, AosAttribute.BonusMana, 1, 8 ); break; case 15: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break; case 16: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break; case 17: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break; case 18: ApplyAttribute( primary, min, max, AosAttribute.ReflectPhysical, 1, 15 ); break; case 19: ApplyResistance( armor, min, max, ResistanceType.Physical, 1, 15 ); break; case 20: ApplyResistance( armor, min, max, ResistanceType.Fire, 1, 15 ); break; case 21: ApplyResistance( armor, min, max, ResistanceType.Cold, 1, 15 ); break; case 22: ApplyResistance( armor, min, max, ResistanceType.Poison, 1, 15 ); break; case 23: ApplyResistance( armor, min, max, ResistanceType.Energy, 1, 15 ); break; /* End Armor */ } } }
public TreasureChestLevel3() : base(0xE41) { this.SetChestAppearance(); Movable = false; TrapType = TrapType.PoisonTrap; TrapPower = m_Level * Utility.Random(1, 25); Locked = true; LiftOverride = true; Breakable = false; RequiredSkill = 84; LockLevel = this.RequiredSkill - Utility.Random(1, 10); //MaxLockLevel = this.RequiredSkill; MaxLockLevel = 100; // According to OSI, loot in level 3 chest is: // Gold 250 - 350 // Arrows 10 // Reagents // Scrolls // Potions // Gems // Magic Wand // Magic weapon // Magic armour // Magic clothing (not implemented) // Magic jewelry (not implemented) // Gold DropItem(new Gold(Utility.Random(180, 240))); // Drop bolts //DropItem( new Arrow( 10 ) ); // Reagents for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.Random(1, 9); DropItem(ReagentLoot); } // Scrolls for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item ScrollLoot = Loot.RandomScroll(0, 47, SpellbookType.Regular); ScrollLoot.Amount = Utility.Random(1, 3); DropItem(ScrollLoot); } // Potions for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item PotionLoot = Loot.RandomPotion(); DropItem(PotionLoot); } // Gems for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item GemLoot = Loot.RandomGem(); GemLoot.Amount = Utility.Random(1, 4); DropItem(GemLoot); } // Magic Wand // Equipment for (int i = Utility.Random(1, m_Level); i > 1; i--) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; int damageLevel = PseudoSeerStone.GetDamageLevel(m_Level); if (PseudoSeerStone.HighestDamageLevelSpawn < damageLevel) { if (damageLevel == 5 && PseudoSeerStone.ReplaceVanqWithSkillScrolls) { DropItem(PuzzleChest.CreateRandomSkillScroll()); } int platAmount = PseudoSeerStone.PlatinumPerMissedDamageLevel * (damageLevel - PseudoSeerStone.Instance._HighestDamageLevelSpawn); if (platAmount > 0) { DropItem(new Platinum(platAmount)); } damageLevel = PseudoSeerStone.Instance._HighestDamageLevelSpawn; } weapon.DamageLevel = (WeaponDamageLevel)damageLevel; weapon.DurabilityLevel = (WeaponDurabilityLevel)PseudoSeerStone.GetDurabilityLevel(m_Level); weapon.AccuracyLevel = (WeaponAccuracyLevel)PseudoSeerStone.GetAccuracyLevel(m_Level); weapon.Quality = WeaponQuality.Regular; } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(m_Level); armor.Durability = (ArmorDurabilityLevel)Utility.Random(m_Level); armor.Quality = ArmorQuality.Regular; } DropItem(item); } // Clothing for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomClothing()); } // Jewelry for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomJewelry()); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseWeapon) { BaseWeapon Weapon = targeted as BaseWeapon; if (!from.InRange(m_Augmentation.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage(38, "You cannot enhance that in it's current location."); } else if (Weapon.Type == WeaponType.Ranged) { if (from.Skills[SkillName.Fletching].Base < 120.0) { from.SendMessage(38, "Only a Legendary Fletcher can enhance ranged weapons."); } else if (Weapon.UsedSockets >= Weapon.MaxSockets) { from.SendMessage(38, "That weapon is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Weapon.UsedSockets += 1; Weapon.Attributes.WeaponDamage += 25; Weapon.Hue = 16; Weapon.AugmentList = Weapon.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the weapon!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Weapon not destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the weapon in the process!"); Weapon.MaxHitPoints -= 3; Weapon.HitPoints -= 3; } else // Weapon is destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "You have damaged the weapon in the process,"); from.SendMessage(38, "the weapon is damaged beyond repair and crumbles in your hand!"); Weapon.Delete(); } m_Augmentation.Delete(); } } } else if (Weapon.Type == WeaponType.Polearm || Weapon.Type == WeaponType.Piercing || Weapon.Type == WeaponType.Staff || Weapon.Type == WeaponType.Slashing || Weapon.Type == WeaponType.Bashing || Weapon.Type == WeaponType.Axe) { if (from.Skills[SkillName.Blacksmith].Base < 120.0) { from.SendMessage(38, "Only a Legendary Blacksmith can enhance items."); } else if (Weapon.UsedSockets >= Weapon.MaxSockets) { from.SendMessage(38, "That weapon is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Weapon.UsedSockets += 1; Weapon.Attributes.WeaponDamage += 25; Weapon.Hue = 16; Weapon.AugmentList = Weapon.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the weapon!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Weapon not destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the weapon in the process!"); Weapon.MaxHitPoints -= 3; Weapon.HitPoints -= 3; } else // Weapon is destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "You have damaged the weapon in the process,"); from.SendMessage(38, "the weapon is damaged beyond repair and crumbles in your hand!"); Weapon.Delete(); } m_Augmentation.Delete(); } } } } if (targeted is BaseArmor) { BaseArmor Armor = targeted as BaseArmor; if (!from.InRange(m_Augmentation.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage(38, "You cannot enhance that in it's current location."); } else if (Armor.BodyPosition == ArmorBodyType.Gorget || Armor.BodyPosition == ArmorBodyType.Gloves || Armor.BodyPosition == ArmorBodyType.Helmet || Armor.BodyPosition == ArmorBodyType.Arms || Armor.BodyPosition == ArmorBodyType.Legs || Armor.BodyPosition == ArmorBodyType.Chest) { if (Armor.MaterialType == ArmorMaterialType.Plate || Armor.MaterialType == ArmorMaterialType.Chainmail || Armor.MaterialType == ArmorMaterialType.Ringmail) { if (from.Skills[SkillName.Blacksmith].Base < 120.0) { from.SendMessage(38, "Only a Legendary Blacksmith can enhance this type of armor."); } else if (Armor.UsedSockets >= Armor.MaxSockets) { from.SendMessage(38, "That armor is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Armor.UsedSockets += 1; Armor.Attributes.BonusStr += 4; Armor.Hue = 16; Armor.AugmentList = Armor.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the armor!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Armor not destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the armor in the process!"); Armor.MaxHitPoints -= 3; Armor.HitPoints -= 3; } else // Armor is destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "You have damaged the armor in the process,"); from.SendMessage(38, "the armor is damaged beyond repair and crumbles in your hand!"); Armor.Delete(); } m_Augmentation.Delete(); } } } else { if (from.Skills[SkillName.Tailoring].Base < 120.0) { from.SendMessage(38, "Only a Legendary Tailor can enhance this type of Armor."); } else if (Armor.UsedSockets >= Armor.MaxSockets) { from.SendMessage(38, "That armor is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Armor.UsedSockets += 1; Armor.Attributes.BonusStr += 4; Armor.Hue = 16; Armor.AugmentList = Armor.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the armor!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Armor not destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the armor in the process!"); Armor.MaxHitPoints -= 3; Armor.HitPoints -= 3; } else // Armor is destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "You have damaged the armor in the process,"); from.SendMessage(38, "the armor is damaged beyond repair and crumbles in your hand!"); Armor.Delete(); } m_Augmentation.Delete(); } } } } } if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; if (!from.InRange(m_Augmentation.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage(38, "You cannot enhance that in it's current location."); } else if (Shield.MaterialType == ArmorMaterialType.Plate) { if (from.Skills[SkillName.Blacksmith].Base < 120.0) { from.SendMessage(38, "Only a Legendary Blacksmith can enhance items."); } else if (Shield.UsedSockets >= Shield.MaxSockets) { from.SendMessage(38, "That shield is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Shield.UsedSockets += 1; Shield.Attributes.DefendChance += 25; Shield.Hue = 16; Shield.AugmentList = Shield.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the shield!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Shield not destroyed { from.SendMessage(38, "You have failed to enhance the shield!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the shield!"); Shield.MaxHitPoints -= 3; Shield.HitPoints -= 3; } else // Shield is destroyed { from.SendMessage(38, "You have failed to enhance the shield!"); from.SendMessage(38, "You have cracked the shield in the process,"); from.SendMessage(38, "the shield is damaged beyond repair and crumbles in your hand!"); Shield.Delete(); } m_Augmentation.Delete(); } } } } }
public static void ApplyAttributesTo(BaseArmor armor, bool isRunicTool, int luckChance, int attributeCount, int min, int max) { m_IsRunicTool = isRunicTool; m_LuckChance = luckChance; MagicalAttributes primary = armor.Attributes; ArmorAttributes secondary = armor.ArmorAttributes; ElementAttributes resistances = armor.Resistances; m_Props.SetAll(false); bool isShield = (armor is BaseShield); int baseCount = (isShield ? 8 : 20); int baseOffset = (isShield ? 0 : 4); if (!isShield && armor.Meditable) { m_Props.Set(4, true); // remove mage armor from possible properties } if (armor.PlayerConstructed) { m_Props.Set(2, true); // remove durability bonus from crafted armor } if (armor.MaterialType == ArmorMaterialType.Leather) { m_Props.Set(0, true); // remove lower stat requiments from leather armor } for (int i = 0; i < attributeCount; ++i) { int random = GetUniqueRandom(baseCount); if (random == -1) { break; } random += baseOffset; switch (random) { /* Begin Shields */ case 0: ApplyAttribute(primary, min, max, MagicalAttribute.SpellChanneling, 1, 1); break; case 1: ApplyAttribute(primary, min, max, MagicalAttribute.DefendChance, 1, 15); break; case 2: ApplyAttribute(primary, min, max, MagicalAttribute.AttackChance, 1, 15); break; case 3: ApplyAttribute(primary, min, max, MagicalAttribute.CastSpeed, 1, 1); break; /* Begin Armor */ case 4: ApplyAttribute(secondary, min, max, ArmorAttribute.LowerStatReq, 10, 100, 10); break; case 5: ApplyAttribute(secondary, min, max, ArmorAttribute.SelfRepair, 1, 5); break; case 6: ApplyAttribute(secondary, min, max, ArmorAttribute.DurabilityBonus, 10, 100, 10); break; case 7: ApplyAttribute(primary, min, max, MagicalAttribute.ReflectPhysical, 1, 15); break; /* End Shields */ case 8: ApplyAttribute(secondary, min, max, ArmorAttribute.MageArmor, 1, 1); break; case 9: ApplyAttribute(primary, min, max, MagicalAttribute.RegenHits, 1, 2); break; case 10: ApplyAttribute(primary, min, max, MagicalAttribute.RegenStam, 1, 3); break; case 11: ApplyAttribute(primary, min, max, MagicalAttribute.RegenMana, 1, 2); break; case 12: ApplyAttribute(primary, min, max, MagicalAttribute.NightSight, 1, 1); break; case 13: ApplyAttribute(primary, min, max, MagicalAttribute.BonusHits, 1, 5); break; case 14: ApplyAttribute(primary, min, max, MagicalAttribute.BonusStam, 1, 8); break; case 15: ApplyAttribute(primary, min, max, MagicalAttribute.BonusMana, 1, 8); break; case 16: ApplyAttribute(primary, min, max, MagicalAttribute.LowerManaCost, 1, 8); break; case 17: ApplyAttribute(primary, min, max, MagicalAttribute.LowerRegCost, 1, 20); break; case 18: ApplyAttribute(primary, min, max, MagicalAttribute.Luck, 1, 100); break; case 19: { ApplyAttribute(resistances, min, max, ElementAttribute.Physical, 1, 15, armor.PhysicalBonus); armor.PhysicalBonus = 0; break; } case 20: { ApplyAttribute(resistances, min, max, ElementAttribute.Fire, 1, 15, armor.FireBonus); armor.FireBonus = 0; break; } case 21: { ApplyAttribute(resistances, min, max, ElementAttribute.Cold, 1, 15, armor.ColdBonus); armor.ColdBonus = 0; break; } case 22: { ApplyAttribute(resistances, min, max, ElementAttribute.Poison, 1, 15, armor.PoisonBonus); armor.PoisonBonus = 0; break; } case 23: { ApplyAttribute(resistances, min, max, ElementAttribute.Energy, 1, 15, armor.EnergyBonus); armor.EnergyBonus = 0; break; } /* End Armor */ } } }
private static double GetArmorMeditationValue(BaseArmor ar) { if (ar == null) { return 0.0; } switch (ar.MeditationAllowance) { default: case ArmorMeditationAllowance.None: return ar.BaseArmorRatingScaled; case ArmorMeditationAllowance.Half: return ar.BaseArmorRatingScaled / 2.0; case ArmorMeditationAllowance.All: return 0.0; } }
protected override void GenerateTreasure() { DropItem(new Gold(600, 900)); List <Item> gems = new List <Item>(); for (int i = 0; i < 9; i++) { Item gem = Loot.RandomGem(); Type gemType = gem.GetType(); foreach (Item listGem in gems) { if (listGem.GetType() == gemType) { listGem.Amount++; gem.Delete(); break; } } if (!gem.Deleted) { gems.Add(gem); } } foreach (Item gem in gems) { DropItem(gem); } if (0.2 > Utility.RandomDouble()) { DropItem(new BagOfReagents(50)); } for (int i = 0; i < 2; i++) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; DropItem(item); } else if (item is BaseJewel) { DropItem(item); } } Solution = new PuzzleChestSolution(); }
private bool IsSpecialArmor(BaseArmor armor) { // Armor repairable but not craftable #region Temporary // TODO: Make these items craftable if (this.m_CraftSystem is DefTailoring) { return (armor is LeafTonlet) || (armor is LeafArms) || (armor is LeafChest) || (armor is LeafGloves) || (armor is LeafGorget) || (armor is LeafLegs) || (armor is HideChest) || (armor is HideGloves) || (armor is HideGorget) || (armor is HidePants) || (armor is HidePauldrons); } else if (this.m_CraftSystem is DefCarpentry) { return (armor is WingedHelm) || (armor is RavenHelm) || (armor is VultureHelm) || (armor is WoodlandArms) || (armor is WoodlandChest) || (armor is WoodlandGloves) || (armor is WoodlandGorget) || (armor is WoodlandLegs); } else if (this.m_CraftSystem is DefBlacksmithy) { return (armor is Circlet) || (armor is RoyalCirclet) || (armor is GemmedCirclet); } #endregion return false; }
public ChestOfHeirlooms() : base(0x2811) { this.Locked = true; this.LockLevel = 95; this.MaxLockLevel = 140; this.RequiredSkill = 95; this.TrapType = TrapType.ExplosionTrap; this.TrapLevel = 10; this.TrapPower = 100; this.GumpID = 0x10B; for (int i = 0; i < 10; ++i) { Item item = Loot.ChestOfHeirloomsContains(); int attributeCount = Utility.RandomMinMax(1, 5); int min = 20; int max = 80; if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } } else if (item is BaseHat && Core.AOS) { BaseRunicTool.ApplyAttributesTo((BaseHat)item, attributeCount, min, max); } else if (item is BaseJewel && Core.AOS) { BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); } this.DropItem(item); } }
private static void ApplyResistance( BaseArmor ar, int min, int max, ResistanceType res, int low, int high ) { switch ( res ) { case ResistanceType.Physical: ar.PhysicalBonus += Scale( min, max, low, high ); break; case ResistanceType.Fire: ar.FireBonus += Scale( min, max, low, high ); break; case ResistanceType.Cold: ar.ColdBonus += Scale( min, max, low, high ); break; case ResistanceType.Poison: ar.PoisonBonus += Scale( min, max, low, high ); break; case ResistanceType.Energy: ar.EnergyBonus += Scale( min, max, low, high ); break; } }
private void Fill(int level) { TrapType = TrapType.ExplosionTrap; TrapPower = level * 25; TrapLevel = level; Locked = true; switch (level) { case 1: RequiredSkill = 36; break; case 2: RequiredSkill = 76; break; case 3: RequiredSkill = 84; break; case 4: RequiredSkill = 92; break; case 5: RequiredSkill = 100; break; case 6: RequiredSkill = 100; break; } LockLevel = RequiredSkill - 10; MaxLockLevel = RequiredSkill + 40; DropItem(new Gold(level * 200)); for (int i = 0; i < level; ++i) { DropItem(Loot.RandomScroll(0, 63, SpellbookType.Regular)); } for (int i = 0; i < level * 2; ++i) { Item item; if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(); } else { item = Loot.RandomArmorOrShieldOrWeapon(); } if (item != null && Core.HS && RandomItemGenerator.Enabled) { int min, max; TreasureMapChest.GetRandomItemStat(out min, out max); RunicReforging.GenerateRandomItem(item, 0, min, max); DropItem(item); continue; } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); DropItem(item); } } for (int i = 0; i < level; i++) { Item item = Loot.RandomPossibleReagent(); item.Amount = Utility.RandomMinMax(40, 60); DropItem(item); } for (int i = 0; i < level; i++) { Item item = Loot.RandomGem(); DropItem(item); } DropItem(new TreasureMap(TreasureMapInfo.ConvertLevel(level + 1), (Siege.SiegeShard ? Map.Felucca : Utility.RandomBool() ? Map.Felucca : Map.Trammel))); }
public static void ApplyAttributesTo( BaseArmor armor, int attributeCount, int min, int max ) { ApplyAttributesTo( armor, false, 0, attributeCount, min, max ); }
public static void Fill(LockableContainer cont, int level) { bool isFelucca = (cont.Map == Map.Felucca); bool inTokuno = (cont.Map == Map.Tokuno); bool SoS = false; if (cont.IsShipwreckedItem == true) { SoS = true; } cont.Movable = false; cont.Locked = true; int numberItems; if (level == 0) { cont.LockLevel = 0; // Can't be unlocked cont.DropItem(new Gold(Utility.RandomMinMax(500, 1000))); if (Utility.RandomDouble() < 0.75) { cont.DropItem(new TreasureMap(0, Map.Trammel)); } } else { cont.TrapType = TrapType.ExplosionTrap; cont.TrapPower = level * 25; cont.TrapLevel = level; // = Chest Lock Levels (~40% to open at cont.RequiredSkill / 100% at cont.MaxLockLevel) switch (level) { case 1: cont.RequiredSkill = 5; cont.LockLevel = -25; cont.MaxLockLevel = 55; break; case 2: cont.RequiredSkill = 45; cont.LockLevel = 25; cont.MaxLockLevel = 75; break; case 3: cont.RequiredSkill = 65; cont.LockLevel = 45; cont.MaxLockLevel = 95; break; case 4: cont.RequiredSkill = 75; cont.LockLevel = 55; cont.MaxLockLevel = 105; break; case 5: cont.RequiredSkill = 75; cont.LockLevel = 55; cont.MaxLockLevel = 105; break; case 6: cont.RequiredSkill = 80; cont.LockLevel = 60; cont.MaxLockLevel = 110; break; case 7: cont.RequiredSkill = 80; cont.LockLevel = 60; cont.MaxLockLevel = 110; break; } // = GOLD PIECES cont.DropItem(new Gold(level * 5000)); // = TREASURE MAP or MiB if (!SoS) { if (Utility.RandomDouble() < 0.2) { cont.DropItem(new TreasureMap(level, MapItem.GetRandomFacet())); } else if ((level < 7) && (Utility.RandomDouble() < 0.025)) { cont.DropItem(new TreasureMap(level + 1, MapItem.GetRandomFacet())); } else if (Utility.RandomDouble() > 0.8) { if (Utility.RandomDouble() > 0.5) { cont.DropItem(new MessageInABottle(Map.Felucca)); } else { cont.DropItem(new MessageInABottle(Map.Trammel)); } } } else if (!SoS) { int soslvl = Utility.Random(level) + 1; if (Utility.RandomDouble() < 0.2) { cont.DropItem(new TreasureMap(soslvl, MapItem.GetRandomFacet())); } } // = LEVEL 8 ARCANE SCROLLS for (int i = 0; i < level; ++i) { cont.DropItem(Loot.RandomScroll(57, 64, SpellbookType.Regular)); } // = MAGIC ITEMS Item item; numberItems = 24 + (level * 8); for (int i = 0; i < numberItems; ++i) { if (Core.AOS) { item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(inTokuno); } else { item = Loot.RandomArmorOrShieldOrWeapon(inTokuno); } if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(level, out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max); } else { weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(6); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(6); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6); } cont.DropItem(item); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(level, out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max); } else { armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6); armor.Durability = (ArmorDurabilityLevel)Utility.Random(6); } cont.DropItem(item); } else if (item is BaseHat) { BaseHat hat = (BaseHat)item; if (Core.AOS) { int attributeCount; int min, max; GetRandomAOSStats(level, out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max); } cont.DropItem(item); } else if (item is BaseJewel) { int attributeCount; int min, max; GetRandomAOSStats(level, out attributeCount, out min, out max); BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max); cont.DropItem(item); } } } // = REAGENTS int reagents; if (level == 0) { reagents = 10; } else { reagents = 3 + level; } for (int i = 0; i < reagents; i++) { Item itr = Loot.RandomPossibleReagent(); itr.Amount = Utility.RandomMinMax(40, 60); cont.DropItem(itr); } // = STACK OF GEMS int gems; if (level == 0) { gems = 3; } else { gems = 1 + level * 3; } Item itg = new Citrine(); int rndG = Utility.Random(9) + 1; if (rndG == 1) { itg = new Amber(gems); } if (rndG == 2) { itg = new Amethyst(gems); } if (rndG == 3) { itg = new Citrine(gems); } if (rndG == 4) { itg = new Diamond(gems); } if (rndG == 5) { itg = new Emerald(gems); } if (rndG == 6) { itg = new Ruby(gems); } if (rndG == 7) { itg = new Sapphire(gems); } if (rndG == 8) { itg = new StarSapphire(gems); } if (rndG == 9) { itg = new Tourmaline(gems); } cont.DropItem(itg); // = SCROLL OF ALACRITY or POWERSCROLL if (level > 1) { if (Utility.RandomDouble() < (0.02 + (level / 200))) { SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length); cont.DropItem(PowerScroll.CreateRandomNoCraft(5, 5)); } else if (Utility.RandomDouble() < 0.075) { SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length); cont.DropItem(new ScrollofAlacrity(WhatS)); } } // = SCROLL OF TRANCENDENCE if (level >= 4 && isFelucca && Utility.RandomDouble() > 0.9) { cont.DropItem(ScrollofTranscendence.CreateRandom(level, level * 5)); } // = CREEPING VINES if (!SoS && Utility.RandomDouble() < 0.075) { cont.DropItem(new CreepingVines()); } // = ILSHENAR LESSER ARTIFACT if (level >= 6 && Core.AOS) { cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)])); } // = SKELETON KEY if (level < 7) { if (!SoS && Utility.RandomDouble() > (0.92 - (level / 100))) { cont.DropItem(new SFSkeletonKey()); } } // = [LVL 7] = MASTER SKELETON KEY if (level == 7) { if (Utility.RandomDouble() < 0.10) { cont.DropItem(new SFMasterSkeletonKey()); } } }
public override void AlterFrom( BaseArmor orig ) { base.AlterFrom( orig ); if ( orig is IFactionArtifact ) m_Owner = ( (IFactionArtifact) orig ).Owner; }
public void OnTarget(Mobile from, object targeted) { if (targeted is Item) { if (!IsChildOf(from.Backpack) || !((Item)targeted).IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1054107); // This item must be in your backpack. } else if (targeted is BaseArmor) { BaseArmor armor = (BaseArmor)targeted; if (armor.Layer == Layer.Neck || armor.Layer == Layer.Helm || armor is BaseShield || (armor.RequiredRace == Race.Gargoyle && armor.Layer == Layer.Earrings)) { if (armor.GorgonLenseCharges > 0 && armor.GorgonLenseType != LenseType) { from.SendGump(new GorgonLenseWarningGump(this, armor)); } else { armor.GorgonLenseCharges += Utility.RandomMinMax(28, 40); armor.GorgonLenseType = LenseType; from.SendLocalizedMessage(1112595); //You enhance the item with Gorgon Lenses! Delete(); } } else { from.SendLocalizedMessage(1112594); //You cannot place gorgon lenses on this. } } else if (targeted is BaseJewel) { BaseJewel j = (BaseJewel)targeted; if (j.Layer == Layer.Neck || j.Layer == Layer.Earrings) { if (j.GorgonLenseCharges > 0 && j.GorgonLenseType != LenseType) { from.SendGump(new GorgonLenseWarningGump(this, j)); } else { j.GorgonLenseCharges += Utility.RandomMinMax(28, 40); j.GorgonLenseType = LenseType; from.SendLocalizedMessage(1112595); //You enhance the item with Gorgon Lenses! Delete(); } } else { from.SendLocalizedMessage(1112594); //You cannot place gorgon lenses on this. } } else if (targeted is BaseClothing) { BaseClothing c = (BaseClothing)targeted; if (c.Layer == Layer.Neck || c.Layer == Layer.Helm) { if (c.GorgonLenseCharges > 0 && c.GorgonLenseType != LenseType) { from.SendGump(new GorgonLenseWarningGump(this, c)); } else { c.GorgonLenseCharges += Utility.RandomMinMax(28, 40); c.GorgonLenseType = LenseType; from.SendLocalizedMessage(1112595); //You enhance the item with Gorgon Lenses! Delete(); } } else { from.SendLocalizedMessage(1112594); //You cannot place gorgon lenses on this. } } else { from.SendLocalizedMessage(1112594); //You cannot place gorgon lenses on this. } } else { from.SendLocalizedMessage(1112594); //You cannot place gorgon lenses on this. } }
public void ApplyAttributesTo( BaseArmor armor ) { armor.Attributes.Luck += ArmorLuck; armor.Attributes.RegenHits += ArmorRegenHits; armor.ArmorAttributes.DurabilityBonus += ArmorDurability; if ( armor is BaseShield ) ApplyShieldSpecificAttributesTo( (BaseShield) armor ); else ApplyArmorSpecificAttributesTo( (BaseArmor) armor ); }
protected virtual void GenerateTreasure() { int MinGold = 1; int MaxGold = 2; int minRegs = 1; int maxRegs = 2; double craftingComponentChance = .02; double prestigeScrollChance = .01; double researchMaterialsChance = .005; switch (m_TreasureLevel) { case TreasureLevel.Level1: minRegs = 1; maxRegs = 2; MinGold = 33; MaxGold = 100; craftingComponentChance = .02; prestigeScrollChance = .01; researchMaterialsChance = .005; break; case TreasureLevel.Level2: minRegs = 1; maxRegs = 3; MinGold = 75; MaxGold = 225; craftingComponentChance = .04; prestigeScrollChance = .02; researchMaterialsChance = .01; break; case TreasureLevel.Level3: minRegs = 2; maxRegs = 6; MinGold = 225; MaxGold = 335; craftingComponentChance = .08; prestigeScrollChance = .04; researchMaterialsChance = .02; break; case TreasureLevel.Level4: minRegs = 4; maxRegs = 12; MinGold = 600; MaxGold = 900; craftingComponentChance = .10; prestigeScrollChance = .05; researchMaterialsChance = .025; break; case TreasureLevel.Level5: minRegs = 4; maxRegs = 18; MinGold = 1000; MaxGold = 1500; craftingComponentChance = .15; prestigeScrollChance = .075; researchMaterialsChance = .0375; break; case TreasureLevel.Level6: minRegs = 8; maxRegs = 20; MinGold = 1600; MaxGold = 2200; craftingComponentChance = .20; prestigeScrollChance = .10; researchMaterialsChance = .05; break; } //potion AddRare((int)m_TreasureLevel + 1, 0.75, Loot.PotionTypes); //0.75% chance per level for a potion // gold DropItem(new Gold(MinGold, MaxGold)); // gems AddGems((int)m_TreasureLevel * 2); AddGems((int)m_TreasureLevel * 2); // reagents Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.Random(minRegs, maxRegs - minRegs); DropItem(ReagentLoot); // clothing for (int i = Utility.Random(1, 2); i > 1; i--) { DropItem(Loot.RandomClothing()); } //Crafting Component Scroll if (Utility.RandomDouble() <= craftingComponentChance) { DropItem(CraftingComponent.GetRandomCraftingComponent(1)); } //Prestige Scroll if (Utility.RandomDouble() <= prestigeScrollChance) { DropItem(new PrestigeScroll()); } //Research Materials if (Utility.RandomDouble() <= researchMaterialsChance) { DropItem(new ResearchMaterials()); } // special cloth hues if (Level >= TreasureLevel.Level5 && Utility.Random(25) == 0) { DropItem(new RareCloth()); } // lvl3+ has chance for weapon & armor if ((int)m_TreasureLevel >= (int)TreasureLevel.Level3) { int level = (int)m_TreasureLevel; // Equipment for (int i = Utility.Random(1, level - 1); i > 1; i--) { Item item = Utility.RandomBool() ? Loot.RandomWeapon() as Item : Loot.RandomArmorOrShield() as Item; if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(level); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(level); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(level); } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(level); armor.DurabilityLevel = (ArmorDurabilityLevel)Utility.Random(level); armor.Quality = Quality.Regular; } DropItem(item); } } }
public UnBlessEntry(Mobile from, BaseArmor item) : base(6208, -1) { m_From = from; m_Item = item; }
protected override void OnTarget(Mobile from, object target) { Item item = target as Item; Type type = item.GetType(); if (item is BaseArmor || item is BaseWeapon || item is BaseHat || item is BaseJewel || item is BaseTalisman || item is BaseQuiver || item is Spellbook) { if (Runescribing.GetProps(item) >= 7) { from.SendMessage("This item cannot be enhanced any further"); } else if (item.ChantSlots >= 3) { from.SendMessage("This item cannot handle any more enhancments."); } else if (Runescribing.CheckBlacklist(type) == true) { from.SendMessage("This item cannot be enhanced."); } else { int value = m_Rune.BaseAmount; int max = m_Rune.MaxAmount; if (item is BaseArmor) { BaseArmor i = item as BaseArmor; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } if (item is BaseWeapon) { BaseWeapon i = item as BaseWeapon; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } if (item is BaseHat) { BaseHat i = item as BaseHat; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } if (item is BaseJewel) { BaseJewel i = item as BaseJewel; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } if (item is BaseTalisman) { BaseTalisman i = item as BaseTalisman; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } if (item is BaseQuiver) { BaseQuiver i = item as BaseQuiver; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } if (item is Spellbook) { Spellbook i = item as Spellbook; if (i.Attributes.BonusDex + value <= max) { i.Attributes.BonusDex += value; } else { i.Attributes.BonusDex = max; } } item.ChantSlots += 1; m_Rune.Delete(); } } else { from.SendMessage("You cannot use this enhancement on that."); } }