public virtual void RedoMR( Mobile from, BaseJewel item ) { if( from.MagicDamageAbsorb == 0 ) { if ( from.BeginAction( typeof( DefensiveSpell ) ) ) { Timer t = new MRTimer( from, TimeSpan.FromSeconds( 60 ), this ); int value = (int)(from.Skills[SkillName.Magery].Value + from.Skills[SkillName.Inscribe].Value); value = (int)(2 + (value/200)*7.0);//absorb from 8 to 15 "circles" from.MagicDamageAbsorb = value; from.FixedParticles( 0x375A, 10, 15, 5037, EffectLayer.Waist ); from.PlaySound( 0x1E9 ); --m_Uses; t.Start(); } else { Timer t = new MRTimer( from, TimeSpan.FromSeconds( 10 ), this ); t.Start(); } } else { --m_Uses; } }
public ProtectionTimer( Mobile from, BaseJewel item ) : base(TimeSpan.FromSeconds( 0 )) { double val = from.Skills[SkillName.Magery].Value * 2.0; if ( val < 15 ) val = 15; else if ( val > 240 ) val = 240; m_Mobile = from; m_Item = item; Delay = TimeSpan.FromSeconds( val ); Priority = TimerPriority.OneSecond; }
public UnBlessEntry(Mobile from, BaseJewel item) : base(6208, -1) { this.m_From = from; this.m_Item = item; }
private static void CheckItem( Mobile m, BaseJewel jewel, bool addingAttribute ) { if ( !((Item)jewel).IsChildOf( m ) ) throw new SpellCraftException( MsgNums.BackPack ); if ( !SpellCraftConfig.ArtifactCraftable && jewel.ArtifactRarity > 0 ) throw new SpellCraftException( MsgNums.Artifact ); if ( !( jewel is BaseBracelet || jewel is BaseRing ) && SpellCraftConfig.BraceletsRingsOnly ) throw new SpellCraftException( MsgNums.BraceletsAndRingsOnly ); if ( addingAttribute ) CheckMaxAttributes( jewel ); }
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; Weapon.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your weapon."); from.PlaySound(0x1F5); m_LorRune.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_LorRune.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.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your armor."); from.PlaySound(0x1F5); m_LorRune.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_LorRune.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.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your shield."); from.PlaySound(0x1F5); m_LorRune.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_LorRune.Delete(); } } } else if (targeted is BaseClothing) { BaseClothing Clothing = targeted as BaseClothing; 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; Clothing.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your clothing."); from.PlaySound(0x1F5); m_LorRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the clothing!"); from.SendMessage("The clothing is damaged beyond repair!"); from.PlaySound(88); Clothing.Delete(); m_LorRune.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; Jewel.Attributes.NightSight += 1; from.SendMessage("The Lor Rune enhances your jewelry."); from.PlaySound(0x1F5); m_LorRune.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_LorRune.Delete(); } } } else { from.SendMessage("You cannot enhance that."); } }
public static void ApplyAttributesTo( BaseJewel jewelry, bool isRunicTool, int luckChance, int attributeCount, int min, int max ) { m_IsRunicTool = isRunicTool; m_LuckChance = luckChance; AosAttributes primary = jewelry.Attributes; AosElementAttributes resists = jewelry.Resistances; AosSkillBonuses skills = jewelry.SkillBonuses; m_Props.SetAll( false ); for ( int i = 0; i < attributeCount; ++i ) { int random = GetUniqueRandom( 24 ); if ( random == -1 ) break; switch ( random ) { case 0: ApplyAttribute( resists, min, max, AosElementAttribute.Physical, 1, 15 ); break; case 1: ApplyAttribute( resists, min, max, AosElementAttribute.Fire, 1, 15 ); break; case 2: ApplyAttribute( resists, min, max, AosElementAttribute.Cold, 1, 15 ); break; case 3: ApplyAttribute( resists, min, max, AosElementAttribute.Poison, 1, 15 ); break; case 4: ApplyAttribute( resists, min, max, AosElementAttribute.Energy, 1, 15 ); break; case 5: ApplyAttribute( primary, min, max, AosAttribute.WeaponDamage, 1, 25 ); break; case 6: ApplyAttribute( primary, min, max, AosAttribute.DefendChance, 1, 15 ); break; case 7: ApplyAttribute( primary, min, max, AosAttribute.AttackChance, 1, 15 ); break; case 8: ApplyAttribute( primary, min, max, AosAttribute.BonusStr, 1, 8 ); break; case 9: ApplyAttribute( primary, min, max, AosAttribute.BonusDex, 1, 8 ); break; case 10: ApplyAttribute( primary, min, max, AosAttribute.BonusInt, 1, 8 ); break; case 11: ApplyAttribute( primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5 ); break; case 12: ApplyAttribute( primary, min, max, AosAttribute.CastSpeed, 1, 1 ); break; case 13: ApplyAttribute( primary, min, max, AosAttribute.CastRecovery, 1, 3 ); break; case 14: ApplyAttribute( primary, min, max, AosAttribute.LowerManaCost, 1, 8 ); break; case 15: ApplyAttribute( primary, min, max, AosAttribute.LowerRegCost, 1, 20 ); break; case 16: ApplyAttribute( primary, min, max, AosAttribute.Luck, 1, 100 ); break; case 17: ApplyAttribute( primary, min, max, AosAttribute.SpellDamage, 1, 12 ); break; case 18: ApplyAttribute( primary, min, max, AosAttribute.NightSight, 1, 1 ); break; case 19: ApplySkillBonus( skills, min, max, 0, 1, 15 ); break; case 20: ApplySkillBonus( skills, min, max, 1, 1, 15 ); break; case 21: ApplySkillBonus( skills, min, max, 2, 1, 15 ); break; case 22: ApplySkillBonus( skills, min, max, 3, 1, 15 ); break; case 23: ApplySkillBonus( skills, min, max, 4, 1, 15 ); break; } } }
public void FillChest(LevelType level) { switch (level) { case LevelType.First: { DropItem(new Gold(Utility.RandomMinMax(50, 70))); if (0.3 > Utility.RandomDouble()) { int chance = Utility.Random(3); switch (chance) { case 0: DropItem(new Bolt(10)); break; case 1: DropItem(new Arrow(10)); break; case 2: DropItem(Loot.RandomReagent()); break; } } break; } case LevelType.Hybrid: { DropItem(new Gold(Utility.RandomMinMax(10, 40))); if (0.3 > Utility.RandomDouble()) { int chance = Utility.Random(6); switch (chance) { case 0: DropItem(new Bolt(5)); break; case 1: DropItem(new Shoes()); break; case 2: DropItem(new Sandals()); break; case 3: DropItem(new Candle()); break; case 4: DropItem(new BeverageBottle(Utility.RandomBool() ? BeverageType.Ale : BeverageType.Liquor)); break; case 5: DropItem(new Jug(BeverageType.Cider)); break; } } break; } case LevelType.Second: { DropItem(new Gold(Utility.RandomMinMax(120, 160))); if (0.3 > Utility.RandomDouble()) { Item reagent = Loot.RandomReagent(); DropItem(reagent); } break; } case LevelType.Third: { DropItem(new Gold(Utility.RandomMinMax(300, 400))); if (0.3 > Utility.RandomDouble()) { int chance = Utility.Random(3); switch (chance) { case 0: DropItem(new Bolt(10)); break; case 1: DropItem(new Arrow(10)); break; case 2: DropItem(Loot.RandomGem()); break; } } int chance_new = Utility.Random(5); switch (chance_new) { case 0: { Map map = this.Map; BaseWeapon weapon = (map == Map.Tokuno) ? Loot.RandomSEWeapon() : Loot.RandomWeapon(); BaseRunicTool.ApplyAttributesTo(weapon, 3, 10, 40); DropItem(weapon); break; } case 1: { Map map = this.Map; BaseArmor armor = (map == Map.Tokuno) ? Loot.RandomSEArmor() : Loot.RandomArmor(); BaseRunicTool.ApplyAttributesTo(armor, 3, 10, 40); DropItem(armor); break; } case 2: { BaseJewel jewel = Loot.RandomJewelry(); BaseRunicTool.ApplyAttributesTo(jewel, 3, 10, 40); DropItem(jewel); break; } case 3: { Map map = this.Map; BaseHat hat = (map == Map.Tokuno) ? Loot.RandomSEHat() : Loot.RandomHat(); BaseRunicTool.ApplyAttributesTo(hat, 3, 10, 40); DropItem(hat); break; } case 4: { BaseWand wand = Loot.RandomWand(); DropItem(wand); break; } } break; } case LevelType.Fourth: { DropItem(new Gold(Utility.RandomMinMax(500, 600))); for (int i = 0; i < 2; i++) { int chance = Utility.Random(5); switch (chance) { case 0: { Map map = this.Map; BaseWeapon weapon = (map == Map.Tokuno) ? Loot.RandomSEWeapon() : Loot.RandomWeapon(); BaseRunicTool.ApplyAttributesTo(weapon, 4, 10, 50); DropItem(weapon); break; } case 1: { Map map = this.Map; BaseArmor armor = (map == Map.Tokuno) ? Loot.RandomSEArmor() : Loot.RandomSEArmor(); BaseRunicTool.ApplyAttributesTo(armor, 4, 10, 50); DropItem(armor); break; } case 2: { BaseJewel jewel = Loot.RandomJewelry(); BaseRunicTool.ApplyAttributesTo(jewel, 4, 10, 50); DropItem(jewel); break; } case 3: { Map map = this.Map; BaseHat hat = (map == Map.Tokuno) ? Loot.RandomSEHat() : Loot.RandomHat(); BaseRunicTool.ApplyAttributesTo(hat, 4, 10, 50); DropItem(hat); break; } case 4: { BaseWand wand = Loot.RandomWand(); DropItem(wand); break; } } } if (0.3 > Utility.RandomDouble()) { Item gem = Loot.RandomGem(); gem.Amount = Utility.RandomMinMax(1, 2); DropItem(gem); } break; } } }
public static void ApplyAttributesTo( BaseJewel jewelry, bool isRunicTool, int luckChance, int attributeCount, int min, int max ) { m_IsRunicTool = isRunicTool; m_LuckChance = luckChance; AosElementAttributes resists = jewelry.Resistances; AosSkillBonuses skills = jewelry.SkillBonuses; AosAttributes primary = jewelry.Attributes; m_Props.SetAll( false ); for( int i = 0; i < attributeCount; ++i ) { int random = GetUniqueRandom( 18 ); if( random == -1 ) break; switch( random ) { case 0: ApplyAttribute( resists, min, max, AosElementAttribute.Physical, 3, 15 ); break; case 1: ApplyAttribute( resists, min, max, AosElementAttribute.Fire, 3, 15 ); break; case 2: ApplyAttribute( resists, min, max, AosElementAttribute.Cold, 3, 15 ); break; case 3: ApplyAttribute( resists, min, max, AosElementAttribute.Poison, 3, 15 ); break; case 4: ApplyAttribute( resists, min, max, AosElementAttribute.Energy, 3, 15 ); break; //case 5: ApplySkillBonus( skills, min, max, 0, 1, 15 ); break; //case 6: ApplySkillBonus( skills, min, max, 1, 1, 15 ); break; //case 7: ApplySkillBonus( skills, min, max, 2, 1, 15 ); break; //case 8: ApplySkillBonus( skills, min, max, 3, 1, 15 ); break; //case 9: ApplySkillBonus( skills, min, max, 4, 1, 15 ); break; case 10: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 3, 10); break; case 12: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 3, 10); break; case 13: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 3, 10); break; case 15: ApplyAttribute(primary, min, max, AosAttribute.BonusHits, 3, 8); break; case 16: ApplyAttribute(primary, min, max, AosAttribute.BonusStam, 3, 8); break; case 17: ApplyAttribute(primary, min, max, AosAttribute.BonusMana, 3, 8); break; case 18: ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 4, 10); break; } } }
protected virtual void GenerateTreasure() { int MinGold = 1; int MaxGold = 2; switch (m_TreasureLevel) { case TreasureLevel.Level1: { MinGold = 25; MaxGold = 50; // Drop bolts/arrows if (Utility.RandomBool() == true) { switch (Utility.Random(2)) { case 0: DropItem(new Bolt(Utility.Random(2, 10))); break; case 1: DropItem(new Arrow(Utility.Random(2, 10))); break; } } // Gems if (Utility.RandomBool() == true) { Item GemLoot = Loot.RandomGem(); GemLoot.Amount = Utility.Random(1, 3); DropItem(GemLoot); } // Weapon if (Utility.RandomBool() == true) { DropItem(Loot.RandomWeapon()); } // Armour if (Utility.RandomBool() == true) { DropItem(Loot.RandomArmorOrShield()); } // Clothing if (Utility.RandomBool() == true) { DropItem(Loot.RandomClothing()); } // Jewelry if (Utility.RandomBool() == true) { DropItem(Loot.RandomJewelry()); } break; } case TreasureLevel.Level2: { MinGold = 80; MaxGold = 150; // Drop bolts/arrows if (Utility.RandomBool() == true) { switch (Utility.Random(2)) { case 0: DropItem(new Bolt(Utility.Random(6, 25))); break; case 1: DropItem(new Arrow(Utility.Random(6, 25))); break; } } // Reagents for (int i = Utility.Random(1, 2); i > 1; i--) { Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.Random(1, 2); DropItem(ReagentLoot); } // Scrolls for (int i = Utility.Random(1, 2); i > 1; i--) { Item ScrollLoot = Loot.RandomScroll(0, 39, SpellbookType.Regular); ScrollLoot.Amount = Utility.Random(1, 8); DropItem(ScrollLoot); } // Potions for (int i = Utility.Random(1, 2); i > 1; i--) { Item PotionLoot = Loot.RandomPotion(); DropItem(PotionLoot); } // Gems for (int i = Utility.Random(1, 2); i > 1; i--) { Item GemLoot = Loot.RandomGem(); GemLoot.Amount = Utility.Random(1, 6); DropItem(GemLoot); } break; } case TreasureLevel.Level3: { MinGold = 250; MaxGold = 350; // Reagents for (int i = Utility.Random(1, 3); i > 1; i--) { Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = Utility.Random(1, 9); DropItem(ReagentLoot); } // Scrolls for (int i = Utility.Random(1, 3); 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, 3); i > 1; i--) { Item PotionLoot = Loot.RandomPotion(); DropItem(PotionLoot); } // Gems for (int i = Utility.Random(1, 3); i > 1; i--) { Item GemLoot = Loot.RandomGem(); GemLoot.Amount = Utility.Random(1, 9); DropItem(GemLoot); } // Magic Wand for (int i = Utility.Random(1, 3); i > 1; i--) { DropItem(Loot.RandomWand()); } // Equipment for (int i = Utility.Random(1, 3); i > 1; i--) { Item item = Loot.RandomArmorOrShieldOrWeapon(); if (item is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)item; weapon.DamageLevel = (WeaponDamageLevel)Utility.Random(3); weapon.AccuracyLevel = (WeaponAccuracyLevel)Utility.Random(3); weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(3); weapon.Quality = WeaponQuality.Regular; } else if (item is BaseArmor) { BaseArmor armor = (BaseArmor)item; armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(3); armor.Durability = (ArmorDurabilityLevel)Utility.Random(3); 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--) { BaseJewel jewel = Loot.RandomJewelry(); jewel.Effect = (MagicEffect)Utility.Random(0, 11); jewel.Uses = Utility.Random(1, 10); DropItem(jewel); } break; } case TreasureLevel.Level4: { MinGold = 500; MaxGold = 900; if (10 > Utility.Random(100)) { DropItem(new MagicCrystalBall()); } // Reagents for (int i = Utility.Random(1, 4); i > 1; i--) { Item ReagentLoot = Loot.RandomReagent(); ReagentLoot.Amount = 12; DropItem(ReagentLoot); } // Scrolls for (int i = Utility.Random(1, 4); i > 1; i--) { Item ScrollLoot = Loot.RandomScroll(0, 47, SpellbookType.Regular); ScrollLoot.Amount = 16; DropItem(ScrollLoot); } // Drop blank scrolls DropItem(new BlankScroll(Utility.Random(1, 4))); // Potions for (int i = Utility.Random(1, 4); i > 1; i--) { Item PotionLoot = Loot.RandomPotion(); DropItem(PotionLoot); } // Gems for (int i = Utility.Random(1, 4); i > 1; i--) { Item GemLoot = Loot.RandomGem(); GemLoot.Amount = 12; DropItem(GemLoot); } // Magic Wand for (int i = Utility.Random(1, 4); i > 1; i--) { DropItem(Loot.RandomWand()); } // Equipment 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); } // 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--) { BaseJewel jewel = Loot.RandomJewelry(); jewel.Effect = (MagicEffect)Utility.Random(0, 11); jewel.Uses = Utility.Random(1, 10); DropItem(jewel); } break; } case TreasureLevel.Level5: { MinGold = 750; MaxGold = 1000; break; } case TreasureLevel.Level6: { MinGold = 1150; MaxGold = 1450; break; } } DropItem(new Gold(MinGold, MaxGold)); }
public MagicEffectTimer(PlayerMobile Wearer, BaseJewel Jewel, TimeSpan Duration) : base(Duration) { m_Wearer = Wearer; m_Jewel = Jewel; }
public static ItemValue CheckJewel( BaseJewel item ) { int value = 0; foreach( int i in Enum.GetValues(typeof( AosAttribute ) ) ) { if ( item != null && item.Attributes[ (AosAttribute)i ] > 0 ) value += 2; } //Start skill bonus if ( item.SkillBonuses.Skill_1_Value > 0 ) { value += (int)item.SkillBonuses.Skill_1_Value * 4; value += 2; } if ( item.SkillBonuses.Skill_2_Value > 0 ) { value += (int)item.SkillBonuses.Skill_2_Value * 4; value += 2; } if ( item.SkillBonuses.Skill_3_Value > 0 ) { value += (int)item.SkillBonuses.Skill_3_Value * 4; value += 2; } if ( item.SkillBonuses.Skill_4_Value > 0 ) { value += (int)item.SkillBonuses.Skill_4_Value * 4; value += 2; } if ( item.SkillBonuses.Skill_5_Value > 0 ) { value += (int)item.SkillBonuses.Skill_5_Value * 4; value += 2; } //Start standard attributes if ( item.Attributes.AttackChance > 0 ) value += item.Attributes.AttackChance * 2; if ( item.Attributes.BonusDex > 0 ) value += item.Attributes.BonusDex * 4; if ( item.Attributes.BonusHits > 0 ) value += item.Attributes.BonusHits * 2; if ( item.Attributes.BonusInt > 0 ) value += item.Attributes.BonusInt * 4; if ( item.Attributes.BonusMana > 0 ) value += item.Attributes.BonusMana * 2; if ( item.Attributes.BonusStam > 0 ) value += item.Attributes.BonusStam * 2; if ( item.Attributes.BonusStr > 0 ) value += item.Attributes.BonusStr * 4; if ( item.Attributes.CastRecovery > 0 ) value += item.Attributes.CastRecovery * 10; if ( item.Attributes.CastSpeed > 0 ) value += item.Attributes.CastSpeed * 10; if ( item.Attributes.DefendChance > 0 ) value += item.Attributes.DefendChance * 2; if ( item.Attributes.EnhancePotions > 0 ) value += item.Attributes.EnhancePotions; if ( item.Attributes.LowerManaCost > 0 ) value += item.Attributes.LowerManaCost * 2; if ( item.Attributes.LowerRegCost > 0 ) value += item.Attributes.LowerRegCost; if ( item.Attributes.Luck > 0 ) value += item.Attributes.Luck / 2; if ( item.Attributes.NightSight > 0 ) value += 10; if ( item.Attributes.ReflectPhysical > 0 ) value += item.Attributes.ReflectPhysical * 2; if ( item.Attributes.RegenHits > 0 ) value += item.Attributes.RegenHits * 10; if ( item.Attributes.RegenMana > 0 ) value += item.Attributes.RegenMana * 10; if ( item.Attributes.RegenStam > 0 ) value += item.Attributes.RegenStam * 10; if ( item.Attributes.SpellChanneling > 0 ) value += 10; if ( item.Attributes.SpellDamage > 0 ) value += item.Attributes.SpellDamage * 2; if ( item.Attributes.WeaponDamage > 0 ) value += item.Attributes.WeaponDamage * 2; if ( item.Attributes.WeaponSpeed > 0 ) value += item.Attributes.WeaponSpeed * 2; //Start Absorption Attributes if ( item.AbsorptionAttributes.CastingFocus > 0 ) value += item.AbsorptionAttributes.CastingFocus; if ( item.AbsorptionAttributes.EaterCold > 0 ) value += item.AbsorptionAttributes.EaterCold; if ( item.AbsorptionAttributes.EaterDamage > 0 ) value += item.AbsorptionAttributes.EaterDamage; if ( item.AbsorptionAttributes.EaterEnergy > 0 ) value += item.AbsorptionAttributes.EaterEnergy; if ( item.AbsorptionAttributes.EaterFire > 0 ) value += item.AbsorptionAttributes.EaterFire; if ( item.AbsorptionAttributes.EaterKinetic > 0 ) value += item.AbsorptionAttributes.EaterKinetic; if ( item.AbsorptionAttributes.EaterPoison > 0 ) value += item.AbsorptionAttributes.EaterPoison; if ( item.AbsorptionAttributes.ResonanceCold > 0 ) value += item.AbsorptionAttributes.ResonanceCold; if ( item.AbsorptionAttributes.ResonanceEnergy > 0 ) value += item.AbsorptionAttributes.ResonanceEnergy; if ( item.AbsorptionAttributes.ResonanceFire > 0 ) value += item.AbsorptionAttributes.ResonanceFire; if ( item.AbsorptionAttributes.ResonanceKinetic > 0 ) value += item.AbsorptionAttributes.ResonanceKinetic; if ( item.AbsorptionAttributes.ResonancePoison > 0 ) value += item.AbsorptionAttributes.ResonancePoison; if ( item.AbsorptionAttributes.SoulChargeCold > 0 ) value += item.AbsorptionAttributes.SoulChargeCold; if ( item.AbsorptionAttributes.SoulChargeEnergy > 0 ) value += item.AbsorptionAttributes.SoulChargeEnergy; if ( item.AbsorptionAttributes.SoulChargeFire > 0 ) value += item.AbsorptionAttributes.SoulChargeFire; if ( item.AbsorptionAttributes.SoulChargeKinetic > 0 ) value += item.AbsorptionAttributes.SoulChargeKinetic; if ( item.AbsorptionAttributes.SoulChargePoison > 0 ) value += item.AbsorptionAttributes.SoulChargePoison; //Start Element Resist if ( item.Resistances.Chaos > 0 ) value += item.Resistances.Chaos; if ( item.Resistances.Cold > 0 ) value += item.Resistances.Cold; if ( item.Resistances.Direct > 0 ) value += item.Resistances.Direct; if ( item.Resistances.Energy > 0 ) value += item.Resistances.Energy; if ( item.Resistances.Fire > 0 ) value += item.Resistances.Fire; if ( item.Resistances.Physical > 0 ) value += item.Resistances.Physical; if ( item.Resistances.Poison > 0 ) value += item.Resistances.Poison; //Start Calculate if ( value <= 50 ) return ItemValue.Common; if ( value <= 100 ) return ItemValue.Uncommon; if ( value <= 200 ) return ItemValue.Rare; if ( value <= 300 ) return ItemValue.Epic; return ItemValue.Legendary; }
// ==== Imbued Jewelery takes damage OnHit ==== public virtual int OnHit(BaseJewel jewel, int damageTaken) { if (25 > Utility.Random(100) && m_MaxHitPoints > 0) // 25% chance to lower durability { int wear; wear = Utility.Random(2); if (wear > 0 && m_MaxHitPoints > 0) { if (m_HitPoints >= wear) { HitPoints -= wear; wear = 0; } else { wear -= HitPoints; HitPoints = 0; } if (wear > 0) { if (m_MaxHitPoints > wear) { MaxHitPoints -= wear; if (Parent is Mobile) ((Mobile)Parent).LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061121); // Your equipment is severely damaged. } else { Delete(); } } } } return damageTaken; }
private static void CheckMaxAttributes( BaseJewel jewel ) { int props = 0; foreach( int i in Enum.GetValues(typeof( AosAttribute)) ) if ( jewel.Attributes[ (AosAttribute)i ] > 0 ) ++props; foreach( int i in Enum.GetValues(typeof( AosElementAttribute)) ) if ( jewel.Resistances[ (AosElementAttribute)i ] > 0 ) ++props; if ( props >= SpellCraftConfig.MaxPropsAllowed ) throw new SpellCraftException( MsgNums.MaxProperties ); }
public StatTimer( Mobile m, TimeSpan duration, BaseJewel item ) : base(duration) { Priority = TimerPriority.OneSecond; m_Mobile = m; m_Item = item; }
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!")); } }
protected override void OnTarget(Mobile from, object o) { if (o is Item) { if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100)) { #region BaseWeapon if (o is BaseWeapon && !((BaseWeapon)o).Identified) { BaseWeapon idarme = (BaseWeapon)o; int difficulty = idarme.WeaponDifficulty; if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5) { from.SendMessage("Cette arme dégage un pouvoir trop grand pour vos maigres moyens"); return; } else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10)) { from.SendMessage("Vous parvenez à décerner les capacités de l'arme"); idarme.Identified = true; } else { int consequence = Utility.Random(from.RawInt); if (consequence < difficulty) { from.SendMessage("Dans votre tentative d'identifier l'arme, vous l'avez brisée"); idarme.Delete(); } else if (consequence < difficulty * 10) { from.SendMessage("Vous n'avez rien décelé, mais avez abimé l'arme"); idarme.MaxHitPoints -= 1; } else { from.SendMessage("Vous n'avez rien décelé"); } } } #endregion #region BaseArmor else if (o is BaseArmor && !((BaseArmor)o).Identified) { BaseArmor idarmure = (BaseArmor)o; int difficulty = idarmure.ArmorDifficulty; if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5) { from.SendMessage("Cette armure dégage un pouvoir trop grand pour vos maigres moyens"); return; } else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10)) { from.SendMessage("Vous parvenez à décerner les capacités de l'armure"); idarmure.Identified = true; } else { int consequence = Utility.Random(from.RawInt); if (consequence < difficulty) { from.SendMessage("Dans votre tentative d'identifier l'armure, vous l'avez brisée"); idarmure.Delete(); } else if (consequence < difficulty * 10) { from.SendMessage("Vous n'avez rien décelé, mais avez abimé l'armure"); idarmure.MaxHitPoints -= 1; } else { from.SendMessage("Vous n'avez rien décelé"); } } } #endregion #region BaseClothing else if (o is BaseClothing && !((BaseClothing)o).Identified) { BaseClothing idclothing = (BaseClothing)o; int difficulty = idclothing.ClothingDifficulty; if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5) { from.SendMessage("Ce vêtement dégage un pouvoir trop grand pour vos maigres moyens"); return; } else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10)) { from.SendMessage("Vous parvenez à décerner les capacités du vêtement"); idclothing.Identified = true; } else { int consequence = Utility.Random(from.RawInt); if (consequence < difficulty) { from.SendMessage("Dans votre tentative d'identifier le vêtement, vous l'avez brisé"); idclothing.Delete(); } else if (consequence < difficulty * 10) { from.SendMessage("Vous n'avez rien décelé, mais avez abimé le vêtement"); idclothing.MaxHitPoints -= 1; } else { from.SendMessage("Vous n'avez rien décelé"); } } } #endregion #region BaseJewel else if (o is BaseJewel && !((BaseJewel)o).Identified) { BaseJewel idjewel = (BaseJewel)o; int difficulty = idjewel.JewelDifficulty; if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) <= 5) { from.SendMessage("Ce bijou dégage un pouvoir trop grand pour vos maigres moyens"); return; } else if ((from.Skills[SkillName.ItemID].Value - (difficulty * 10)) >= Utility.Random(difficulty * 10)) { from.SendMessage("Vous parvenez à décerner les capacités du bijou"); idjewel.Identified = true; } else { int consequence = Utility.Random(from.RawInt); if (consequence < difficulty * 2) { from.SendMessage("Dans votre tentative d'identifier le bijou, vous l'avez brisé"); idjewel.Delete(); } else { from.SendMessage("Vous n'avez rien décelé"); } } } else { from.SendMessage("Cet objet est déjà identifié"); } #endregion if (!Core.AOS) { ((Item)o).OnSingleClick(from); } } else { from.SendMessage("Vous ne parvenez pas à vous concentrer."); } } else if (o is Mobile) { ((Mobile)o).OnSingleClick(from); } else { from.SendMessage("Vous ne pouvez rien apprendre de cela"); } }
public ArenaTreasureChest() : base(0xE41) { Name = "Arena Champion"; Hue = 1161; DropItem(new ChampionStatue()); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); DropItem(new Gold(Utility.RandomMinMax(1000, 2000))); { int chance = Utility.Random(5); switch (chance) { case 0: { Map map = this.Map; BaseWeapon weapon = Loot.RandomWeapon(); BaseRunicTool.ApplyAttributesTo(weapon, 4, 10, 50); DropItem(weapon); break; } case 1: { Map map = this.Map; BaseArmor armor = Loot.RandomArmor(); BaseRunicTool.ApplyAttributesTo(armor, 4, 10, 50); DropItem(armor); break; } case 2: { BaseJewel jewel = Loot.RandomJewelry(); BaseRunicTool.ApplyAttributesTo(jewel, 4, 10, 50); DropItem(jewel); break; } case 3: { Map map = this.Map; BaseHat hat = Loot.RandomHat(); BaseRunicTool.ApplyAttributesTo(hat, 4, 10, 50); DropItem(hat); break; } case 4: { BaseWand wand = Loot.RandomWand(); DropItem(wand); break; } } switch (Utility.Random(32)) { default: case 0: DropItem(new VoiceOfTheFallenKing()); break; case 1: DropItem(new TunicOfFire()); break; case 2: DropItem(new SpiritOfTheTotem()); break; case 3: DropItem(new ShadowDancerLeggings()); break; case 4: DropItem(new OrnateCrownOfTheHarrower()); break; case 5: DropItem(new LeggingsOfBane()); break; case 6: DropItem(new JackalsCollar()); break; case 7: DropItem(new InquisitorsResolution()); break; case 8: DropItem(new HuntersHeaddress()); break; case 9: DropItem(new HelmOfInsight()); break; case 10: DropItem(new HatOfTheMagi()); break; case 11: DropItem(new GauntletsOfNobility()); break; case 12: DropItem(new DivineCountenance()); break; case 13: DropItem(new ArmorOfFortune()); break; case 14: DropItem(new ArcaneShield()); break; case 15: DropItem(new Aegis()); break; case 16: DropItem(new ZyronicClaw()); break; case 17: DropItem(new TitansHammer()); break; case 18: DropItem(new TheTaskmaster()); break; case 19: DropItem(new TheDragonSlayer()); break; case 20: DropItem(new StaffOfTheMagi()); break; case 21: DropItem(new SerpentsFang()); break; case 22: DropItem(new LegacyOfTheDreadLord()); break; case 23: DropItem(new BreathOfTheDead()); break; case 24: DropItem(new BoneCrusher()); break; case 25: DropItem(new BladeOfTheRighteous()); break; case 26: DropItem(new BladeOfInsanity()); break; case 27: DropItem(new AxeOfTheHeavens()); break; case 28: DropItem(new RingOfTheVile()); break; case 29: DropItem(new RingOfTheElements()); break; case 30: DropItem(new OrnamentOfTheMagician()); break; case 31: DropItem(new BraceletOfHealth()); break; } switch (Utility.Random(32)) { default: case 0: DropItem(new VoiceOfTheFallenKing()); break; case 1: DropItem(new TunicOfFire()); break; case 2: DropItem(new SpiritOfTheTotem()); break; case 3: DropItem(new ShadowDancerLeggings()); break; case 4: DropItem(new OrnateCrownOfTheHarrower()); break; case 5: DropItem(new LeggingsOfBane()); break; case 6: DropItem(new JackalsCollar()); break; case 7: DropItem(new InquisitorsResolution()); break; case 8: DropItem(new HuntersHeaddress()); break; case 9: DropItem(new HelmOfInsight()); break; case 10: DropItem(new HatOfTheMagi()); break; case 11: DropItem(new GauntletsOfNobility()); break; case 12: DropItem(new DivineCountenance()); break; case 13: DropItem(new ArmorOfFortune()); break; case 14: DropItem(new ArcaneShield()); break; case 15: DropItem(new Aegis()); break; case 16: DropItem(new ZyronicClaw()); break; case 17: DropItem(new TitansHammer()); break; case 18: DropItem(new TheTaskmaster()); break; case 19: DropItem(new TheDragonSlayer()); break; case 20: DropItem(new StaffOfTheMagi()); break; case 21: DropItem(new SerpentsFang()); break; case 22: DropItem(new LegacyOfTheDreadLord()); break; case 23: DropItem(new BreathOfTheDead()); break; case 24: DropItem(new BoneCrusher()); break; case 25: DropItem(new BladeOfTheRighteous()); break; case 26: DropItem(new BladeOfInsanity()); break; case 27: DropItem(new AxeOfTheHeavens()); break; case 28: DropItem(new RingOfTheVile()); break; case 29: DropItem(new RingOfTheElements()); break; case 30: DropItem(new OrnamentOfTheMagician()); break; case 31: DropItem(new BraceletOfHealth()); break; } switch (Utility.Random(32)) { default: case 0: DropItem(new VoiceOfTheFallenKing()); break; case 1: DropItem(new TunicOfFire()); break; case 2: DropItem(new SpiritOfTheTotem()); break; case 3: DropItem(new ShadowDancerLeggings()); break; case 4: DropItem(new OrnateCrownOfTheHarrower()); break; case 5: DropItem(new LeggingsOfBane()); break; case 6: DropItem(new JackalsCollar()); break; case 7: DropItem(new InquisitorsResolution()); break; case 8: DropItem(new HuntersHeaddress()); break; case 9: DropItem(new HelmOfInsight()); break; case 10: DropItem(new HatOfTheMagi()); break; case 11: DropItem(new GauntletsOfNobility()); break; case 12: DropItem(new DivineCountenance()); break; case 13: DropItem(new ArmorOfFortune()); break; case 14: DropItem(new ArcaneShield()); break; case 15: DropItem(new Aegis()); break; case 16: DropItem(new ZyronicClaw()); break; case 17: DropItem(new TitansHammer()); break; case 18: DropItem(new TheTaskmaster()); break; case 19: DropItem(new TheDragonSlayer()); break; case 20: DropItem(new StaffOfTheMagi()); break; case 21: DropItem(new SerpentsFang()); break; case 22: DropItem(new LegacyOfTheDreadLord()); break; case 23: DropItem(new BreathOfTheDead()); break; case 24: DropItem(new BoneCrusher()); break; case 25: DropItem(new BladeOfTheRighteous()); break; case 26: DropItem(new BladeOfInsanity()); break; case 27: DropItem(new AxeOfTheHeavens()); break; case 28: DropItem(new RingOfTheVile()); break; case 29: DropItem(new RingOfTheElements()); break; case 30: DropItem(new OrnamentOfTheMagician()); break; case 31: DropItem(new BraceletOfHealth()); break; } } }
protected override void OnTarget(Mobile from, object target) { if (target is Mobile) { from.SendLocalizedMessage(500507); // You can only bless an item! } else if (target is BaseArmor || target is BaseClothing || target is BaseWeapon || target is BaseJewel) { Item item = (Item)target; if (item.LootType == LootType.Blessed || item.BlessedFor != null || (Mobile.InsuranceEnabled && item.Insured)) // Check if its already newbied (blessed) { from.SendLocalizedMessage(1045113); // That item is already blessed } else if (item.LootType != LootType.Regular) { from.SendLocalizedMessage(500509); // You can't bless this object! } else if (item.RootParent != from) // Make sure its in their pack or they are wearing it { from.SendLocalizedMessage(500508); // You may only bless objects that you are carrying. } else if (m_Deed.RootParent != from) { from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it. } else { // Now we also know the deed is still in the players backpack, // as is the item the player wants to bless. Let's go and // bless it. if (item is BaseArmor) { BaseArmor mitem = (BaseArmor)item; mitem.BlessedBy = from; } else if (item is BaseClothing) { BaseClothing mitem = (BaseClothing)item; mitem.BlessedBy = from; } else if (item is BaseWeapon) { BaseWeapon mitem = (BaseWeapon)item; mitem.BlessedBy = from; } else if (item is BaseJewel) { BaseJewel mitem = (BaseJewel)item; mitem.BlessedBy = from; } item.BlessedFor = from; from.SendLocalizedMessage(1062204); // You personally bless the item for this character. from.PlaySound(0x202); m_Deed.Delete(); } } else { from.SendLocalizedMessage(500509); // You can't bless this object! } }
//daat99 OWLTR start - Jewlery resources public void ApplyAttributesTo(BaseJewel jewelry) { 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(jewelry, true, 0, attributeCount, min, max); }
protected override void OnTarget(Mobile from, object targeted) { int DestroyChance = Utility.Random(5); int augment = Utility.Random(2) + 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.Attributes.RegenHits += augment; from.SendMessage("The Rune enhances your weapon."); from.PlaySound(0x1F5); m_RegenHitsRune.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_RegenHitsRune.Delete(); } } } else if (targeted is BaseArmor) { BaseArmor Armor = targeted as BaseArmor; { if (DestroyChance > 0) // Success { Armor.Attributes.RegenHits += augment; from.SendMessage("The Rune enhances your armor."); from.PlaySound(0x1F5); m_RegenHitsRune.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_RegenHitsRune.Delete(); } } } else if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; { if (DestroyChance > 0) // Success { Shield.Attributes.RegenHits += augment; from.SendMessage("The Rune enhances your shield."); from.PlaySound(0x1F5); m_RegenHitsRune.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_RegenHitsRune.Delete(); } } } else if (targeted is BaseClothing) { BaseClothing Clothing = targeted as BaseClothing; { if (DestroyChance > 0) // Success { Clothing.Attributes.RegenHits += augment; from.SendMessage("The Rune enhances your clothing."); from.PlaySound(0x1F5); m_RegenHitsRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the clothing!"); from.SendMessage("The clothing is damaged beyond repair!"); from.PlaySound(88); Clothing.Delete(); m_RegenHitsRune.Delete(); } } } else if (targeted is BaseJewel) { BaseJewel Jewel = targeted as BaseJewel; { if (DestroyChance > 0) // Success { Jewel.Attributes.RegenHits += augment; from.SendMessage("The Rune enhances your jewelry."); from.PlaySound(0x1F5); m_RegenHitsRune.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_RegenHitsRune.Delete(); } } } } else { from.SendMessage("You cannot enhance that."); } }
public RenamePrompt(Mobile from, BaseJewel jewel, EtchingKit etchingkit) { m_from = from; m_jewel = jewel; m_etchingkit = etchingkit; }
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature { if (m_Deed.Deleted || m_Deed.RootParent != from) { return; } if (target is BaseJewel && m_Deed.AllowJewels && (!(target is BaseEarrings) || m_Deed.AllowEarrings)) { BaseJewel item = (BaseJewel)target; if (item.LootType == LootType.Cursed) { from.SendMessage("You cannot enhance that item further."); return; } if (IncreaseJewelAttribute(item)) { from.SendMessage(String.Format("You increase the items {0}... at a cost.", m_Deed.AosAttribute)); item.LootType = LootType.Cursed; m_Deed.Delete(); // Delete the deed } else { from.SendMessage(String.Format("{0} cannot be applied to that item with this deed.", m_Deed.AosAttribute)); return; } } else if (target is Spellbook && m_Deed.AllowBooks) { Spellbook item = (Spellbook)target; if (item.LootType == LootType.Cursed) { from.SendMessage("You cannot enhance that item further."); return; } if (IncreaseBookAttribute(item)) { from.SendMessage(String.Format("You increase the items {0}... at a cost.", m_Deed.AosAttribute)); item.LootType = LootType.Cursed; m_Deed.Delete(); // Delete the deed } else { from.SendMessage(String.Format("{0} cannot be applied to that item with this deed.", m_Deed.AosAttribute)); return; } } else if (target is BaseWeapon && m_Deed.AllowWeps) { BaseWeapon item = (BaseWeapon)target; if (item.LootType == LootType.Cursed) { from.SendMessage("You cannot enhance that item further."); return; } if (IncreaseWeaponAttribute(item)) { from.SendMessage(String.Format("You increase the items {0}... at a cost.", m_Deed.AosAttribute)); item.LootType = LootType.Cursed; m_Deed.Delete(); // Delete the deed } else { from.SendMessage(String.Format("{0} cannot be applied to that item with this deed.", m_Deed.AosAttribute)); return; } } else if (target is ElvenGlasses && m_Deed.AllowGlasses) { ElvenGlasses item = (ElvenGlasses)target; if (item.LootType == LootType.Cursed) { from.SendMessage("You cannot enhance that item further."); return; } if (IncreaseGlassesAttribute(item)) { from.SendMessage(String.Format("You increase the items {0}... at a cost.", m_Deed.AosAttribute)); item.LootType = LootType.Cursed; m_Deed.Delete(); // Delete the deed } else { from.SendMessage(String.Format("{0} cannot be applied to that item with this deed.", m_Deed.AosAttribute)); return; } } else if (target is BaseArmor && m_Deed.AllowArmor) { BaseArmor item = (BaseArmor)target; if (item.LootType == LootType.Cursed) { from.SendMessage("You cannot enhance that item further."); return; } if (IncreaseArmorAttribute(item)) { from.SendMessage(String.Format("You increase the items {0}... at a cost.", m_Deed.AosAttribute)); item.LootType = LootType.Cursed; m_Deed.Delete(); // Delete the deed } else { from.SendMessage(String.Format("{0} cannot be applied to that item with this deed.", m_Deed.AosAttribute)); return; } } else if (target is BaseClothing && m_Deed.AllowClothing) { BaseClothing item = (BaseClothing)target; if (item.LootType == LootType.Cursed) { from.SendMessage("You cannot enhance that item further."); return; } if (IncreaseClothingAttribute(item)) { from.SendMessage(String.Format("You increase the items {0}... at a cost.", m_Deed.AosAttribute)); item.LootType = LootType.Cursed; m_Deed.Delete(); // Delete the deed } else { from.SendMessage(String.Format("{0} cannot be applied to that item with this deed.", m_Deed.AosAttribute)); return; } } else { from.SendMessage(String.Format("You cannot add {0} to this item with this deed", m_Deed.AosAttribute)); } }
protected override void OnTick() { foreach (Item item in World.Items.Values) { if ((item is BaseRunicTool) || (item is BaseArmor) || (item is BaseWeapon) || (item is BaseJewel)) { bool parentmob = false; bool accesscheck = false; if (item.RootParent is Mobile) { parentmob = true; Mobile pm = (Mobile)item.RootParent; if (pm.AccessLevel < AccessLevel.Counselor) { accesscheck = true; } } if (!(parentmob) || accesscheck) { //if (item.Name == null) if (0 == 0) { if (item is BaseRunicTool) { BaseRunicTool r_tool = (BaseRunicTool)item; r_tool.UsesRemaining = 1; } else if (item is BaseArmor) { BaseArmor m_this = (BaseArmor)item; for (int i = 0; i < 5; ++i) //AosSkillBonuses { m_this.SkillBonuses.SetValues(i, SkillName.Alchemy, 0); } //AosArmorAttributes m_this.ArmorAttributes.LowerStatReq = 0; m_this.ArmorAttributes.SelfRepair = 0; m_this.ArmorAttributes.MageArmor = 0; m_this.ArmorAttributes.DurabilityBonus = 0; m_this.ColdBonus = 0; //Cold Bonus m_this.EnergyBonus = 0; //Energy Bonus m_this.FireBonus = 0; //Fire Bonus m_this.PhysicalBonus = 0; //Physical Bonus m_this.PoisonBonus = 0; //Poison Bonus m_this.StrBonus = 0; //Str Bonus m_this.IntBonus = 0; //Int Bonus m_this.DexBonus = 0; //Dex Bonus // AosAttributes m_this.Attributes.RegenHits = 0; m_this.Attributes.RegenStam = 0; m_this.Attributes.RegenMana = 0; m_this.Attributes.DefendChance = 0; m_this.Attributes.AttackChance = 0; m_this.Attributes.BonusStr = 0; m_this.Attributes.BonusDex = 0; m_this.Attributes.BonusInt = 0; m_this.Attributes.BonusHits = 0; m_this.Attributes.BonusStam = 0; m_this.Attributes.BonusMana = 0; m_this.Attributes.WeaponDamage = 0; m_this.Attributes.WeaponSpeed = 0; m_this.Attributes.SpellDamage = 0; m_this.Attributes.CastRecovery = 0; m_this.Attributes.CastSpeed = 0; m_this.Attributes.LowerManaCost = 0; m_this.Attributes.LowerRegCost = 0; m_this.Attributes.ReflectPhysical = 0; m_this.Attributes.EnhancePotions = 0; m_this.Attributes.Luck = 0; m_this.Attributes.SpellChanneling = 0; m_this.Attributes.NightSight = 0; } else if (item is BaseWeapon) { BaseWeapon m_this = (BaseWeapon)item; for (int i = 0; i < 5; ++i) //AosSkillBonuses { m_this.SkillBonuses.SetValues(i, SkillName.Alchemy, 0); } m_this.Slayer = SlayerName.None; //Slayer // AosAttributes m_this.Attributes.RegenHits = 0; m_this.Attributes.RegenStam = 0; m_this.Attributes.RegenMana = 0; m_this.Attributes.DefendChance = 0; m_this.Attributes.AttackChance = 0; m_this.Attributes.BonusStr = 0; m_this.Attributes.BonusDex = 0; m_this.Attributes.BonusInt = 0; m_this.Attributes.BonusHits = 0; m_this.Attributes.BonusStam = 0; m_this.Attributes.BonusMana = 0; m_this.Attributes.WeaponDamage = 0; m_this.Attributes.WeaponSpeed = 0; m_this.Attributes.SpellDamage = 0; m_this.Attributes.CastRecovery = 0; m_this.Attributes.CastSpeed = 0; m_this.Attributes.LowerManaCost = 0; m_this.Attributes.LowerRegCost = 0; m_this.Attributes.ReflectPhysical = 0; m_this.Attributes.EnhancePotions = 0; m_this.Attributes.Luck = 0; m_this.Attributes.SpellChanneling = 0; m_this.Attributes.NightSight = 0; //AosWeaponAttributes m_this.WeaponAttributes.LowerStatReq = 0; m_this.WeaponAttributes.SelfRepair = 0; m_this.WeaponAttributes.HitLeechHits = 0; m_this.WeaponAttributes.HitLeechStam = 0; m_this.WeaponAttributes.HitLeechMana = 0; m_this.WeaponAttributes.HitLowerAttack = 0; m_this.WeaponAttributes.HitLowerDefend = 0; m_this.WeaponAttributes.HitMagicArrow = 0; m_this.WeaponAttributes.HitHarm = 0; m_this.WeaponAttributes.HitFireball = 0; m_this.WeaponAttributes.HitLightning = 0; m_this.WeaponAttributes.HitDispel = 0; m_this.WeaponAttributes.HitColdArea = 0; m_this.WeaponAttributes.HitFireArea = 0; m_this.WeaponAttributes.HitPoisonArea = 0; m_this.WeaponAttributes.HitEnergyArea = 0; m_this.WeaponAttributes.HitPhysicalArea = 0; m_this.WeaponAttributes.ResistPhysicalBonus = 0; m_this.WeaponAttributes.ResistFireBonus = 0; m_this.WeaponAttributes.ResistColdBonus = 0; m_this.WeaponAttributes.ResistPoisonBonus = 0; m_this.WeaponAttributes.ResistEnergyBonus = 0; m_this.WeaponAttributes.UseBestSkill = 0; m_this.WeaponAttributes.MageWeapon = 0; m_this.WeaponAttributes.DurabilityBonus = 0; } else if (item is BaseJewel) { BaseJewel m_this = (BaseJewel)item; for (int i = 0; i < 5; ++i) //AosSkillBonuses { m_this.SkillBonuses.SetValues(i, SkillName.Alchemy, 0); } // AosAttributes m_this.Attributes.RegenHits = 0; m_this.Attributes.RegenStam = 0; m_this.Attributes.RegenMana = 0; m_this.Attributes.DefendChance = 0; m_this.Attributes.AttackChance = 0; m_this.Attributes.BonusStr = 0; m_this.Attributes.BonusDex = 0; m_this.Attributes.BonusInt = 0; m_this.Attributes.BonusHits = 0; m_this.Attributes.BonusStam = 0; m_this.Attributes.BonusMana = 0; m_this.Attributes.WeaponDamage = 0; m_this.Attributes.WeaponSpeed = 0; m_this.Attributes.SpellDamage = 0; m_this.Attributes.CastRecovery = 0; m_this.Attributes.CastSpeed = 0; m_this.Attributes.LowerManaCost = 0; m_this.Attributes.LowerRegCost = 0; m_this.Attributes.ReflectPhysical = 0; m_this.Attributes.EnhancePotions = 0; m_this.Attributes.Luck = 0; m_this.Attributes.SpellChanneling = 0; m_this.Attributes.NightSight = 0; for (int i = 0; i < 5; ++i) //AosElementAttributes { m_this.Resistances.SetValue(i, 0); } } } } } } Server.Scripts.Commands.CommandHandlers.BroadcastMessage(AccessLevel.Player, 0x482, String.Format("As the image fades away, you notice that item enchantments are now gone.")); }
public static void ApplyAttributesTo(BaseJewel jewelry, int attributeCount, int min, int max) { ApplyAttributesTo(jewelry, false, 0, attributeCount, min, max); }
public void ConsumeCharge( object parent, BaseJewel item ) { item.Charges--; }
public void OnTarget(Mobile from, object targeted) { if (targeted is Item) { if (targeted is BaseArmor) { BaseArmor armor = (BaseArmor)targeted; if (armor.Layer == Layer.Neck || armor.Layer == Layer.Helm || armor is BaseShield) { if (armor.GorgonLenseCharges > 0 && armor.GorgonLenseType != LenseType) { from.SendGump(new GorgonLenseWarningGump(this, armor)); } else { armor.GorgonLenseCharges = Amount; 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 = Amount; 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 = Amount; 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 EffectTimer( Mobile m, BaseJewel item ) : base(TimeSpan.FromSeconds( 60 )) { parent = m; m_Item = item; Priority = TimerPriority.OneMinute; }
public virtual void RedoProtection( Mobile from, BaseJewel item ) { if ( m_Registry.ContainsKey( from ) ) { new RedoProtectionTimer( from, this ).Start(); } else if ( from.BeginAction( typeof( DefensiveSpell ) ) ) { double value = (int)(from.Skills[SkillName.EvalInt].Value + from.Skills[SkillName.Meditation].Value + from.Skills[SkillName.Inscribe].Value); value /= 4; if ( value < 0 ) value = 0; else if ( value > 75 ) value = 75.0; Registry.Add( from, value ); new ProtectionTimer( from, this ).Start(); from.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist ); from.PlaySound( 0x1ED ); --m_Uses; } else { new RedoProtectionTimer( from, this ).Start(); } }
public MagicEffectTimer(PlayerMobile Wearer, BaseJewel Jewel, TimeSpan Duration) : base (Duration) { m_Wearer = Wearer; m_Jewel = Jewel; }
public RedoProtectionTimer( Mobile from, BaseJewel item ) : base(TimeSpan.FromSeconds( 10 )) { m_Mobile = from; m_Item = item; }
public StarterBagWarriorGargoyle() { Container cont; this.Name = "Starter Bag - Warrior"; cont = new Bag(); cont.Name = "PowerScroll Bag"; PlaceItemIn(cont, 30, 35, new PowerScroll(SkillName.Fencing, 105)); PlaceItemIn(cont, 60, 35, new PowerScroll(SkillName.Swords, 105)); PlaceItemIn(cont, 90, 35, new PowerScroll(SkillName.Macing, 105)); PlaceItemIn(cont, 30, 68, new PowerScroll(SkillName.Archery, 105)); PlaceItemIn(cont, 45, 68, new PowerScroll(SkillName.Parry, 105)); PlaceItemIn(cont, 75, 68, new PowerScroll(SkillName.Chivalry, 105)); PlaceItemIn(cont, 90, 68, new PowerScroll(SkillName.Tactics, 105)); PlaceItemIn(cont, 30, 118, new PowerScroll(SkillName.Anatomy, 105)); PlaceItemIn(cont, 60, 118, new PowerScroll(SkillName.Healing, 105)); PlaceItemIn(this, 0, 0, cont); for (int i = 0; i < cont.Items.Count; i++) { cont.Items[i].LootType = LootType.Blessed; } cont = new Bag(); cont.Name = "Gear Bag"; // Armor PlaceItemIn(cont, 30, 35, new GargishPlateChest()); PlaceItemIn(cont, 90, 35, new GargishPlateArms()); PlaceItemIn(cont, 30, 68, new GargishPlateKilt()); PlaceItemIn(cont, 45, 68, new GargishPlateWingArmor()); PlaceItemIn(cont, 45, 68, new GargishRobe()); // Jewelry PlaceItemIn(cont, 90, 68, new GargishNecklace()); PlaceItemIn(cont, 30, 118, new GargishEarrings()); PlaceItemIn(cont, 60, 118, new GargishRing()); PlaceItemIn(cont, 90, 100, new GargishBracelet()); PlaceItemIn(this, 50, 0, cont); for (int i = 0; i < cont.Items.Count; i++) { BaseArmor armor = cont.Items[i] as BaseArmor; BaseJewel jewel = cont.Items[i] as BaseJewel; BaseClothing clothes = cont.Items[i] as BaseClothing; if (jewel != null) { jewel.Attributes.LowerRegCost = 12; jewel.Attributes.AttackChance = 5; jewel.Attributes.DefendChance = 5; jewel.LootType = LootType.Blessed; jewel.Hue = 1161; jewel.Insured = false; jewel.TimesImbued = 50; } else if (armor != null) { armor.Attributes.LowerRegCost = 12; armor.ArmorAttributes.MageArmor = 1; armor.LootType = LootType.Blessed; armor.Hue = 1157; armor.Insured = false; armor.TimesImbued = 50; armor.StrRequirement = 0; armor.Weight = 0; } else if (clothes != null) { clothes.Attributes.LowerRegCost = 12; clothes.LootType = LootType.Blessed; clothes.TimesImbued = 50; } } cont = new Bag(); cont.Name = "Weapon Bag"; // Weapons PlaceItemIn(cont, 30, 35, new Cyclone()); PlaceItemIn(cont, 45, 68, new GargishKryss()); PlaceItemIn(cont, 75, 68, new GargishBattleAxe()); PlaceItemIn(cont, 90, 68, new GargishGnarledStaff()); PlaceItemIn(cont, 30, 118, new BookOfChivalry((UInt64)0x3FF)); PlaceItemIn(cont, 60, 118, new BookOfNinjitsu()); PlaceItemIn(this, 100, 0, cont); for (int i = 0; i < cont.Items.Count; i++) { BaseThrown thrown = cont.Items[i] as BaseThrown; BaseMeleeWeapon melee = cont.Items[i] as BaseMeleeWeapon; if (thrown != null) { thrown.Attributes.WeaponSpeed = 35; thrown.Attributes.RegenHits = 20; thrown.TimesImbued = 50; thrown.DurabilityLevel = WeaponDurabilityLevel.Regular; thrown.Hue = 1161; thrown.LootType = LootType.Blessed; thrown.TimesImbued = 50; } else if (melee != null) { melee.Attributes.WeaponSpeed = 35; melee.Attributes.RegenHits = 20; melee.TimesImbued = 50; melee.DurabilityLevel = WeaponDurabilityLevel.Regular; melee.Hue = 1161; melee.LootType = LootType.Blessed; melee.TimesImbued = 50; } } }
public virtual void GenerateiProps(object miref) { // Item type ItemType = miref.GetType(); // Approximate label ClassNameTranslator cnt = new ClassNameTranslator(); sApproxLabel = cnt.TranslateClass(ItemType); // Magical properties iProps = new int[4]; // Default to blacksmithing requirement for enhancement iMajorSkill = (int)SkillName.Blacksmith; if (miref is BaseArmor) { BaseArmor ba = (BaseArmor)miref; // Stored : Protection / Durability iProps[0] = ba.GetProtOffset() + 1; iProps[1] = (int)ba.Durability; iProps[2] = 0; // Figure out what kind of material was used if (ba.MaterialType == ArmorMaterialType.Leather || ba.MaterialType == ArmorMaterialType.Studded || ba.MaterialType == ArmorMaterialType.Bone) { iMajorSkill = (int)SkillName.Tailoring; } else if (miref is WoodenShield) { iMajorSkill = (int)SkillName.Carpentry; } } else if (miref is BaseWeapon) { BaseWeapon bw = (BaseWeapon)miref; // Stored : Damage / Durability / Accuracy / Silver iProps[0] = (int)bw.DamageLevel; iProps[1] = (int)bw.DurabilityLevel; iProps[2] = (int)bw.AccuracyLevel; iProps[3] = (int)bw.Slayer; // If it's a bow or a staff, a carpenter made it. // Blackstaffs are made by tinkers. if (miref is BaseRanged || (miref is BaseStaff && !(miref is BlackStaff)) || miref is Club) { iMajorSkill = (int)SkillName.Carpentry; } else if (miref is BlackStaff || miref is Pitchfork) { iMajorSkill = (int)SkillName.Tinkering; } } else if (miref is BaseClothing) { // Store : // [0] - int representing the type of charge // [1] - int representing the number of charges BaseClothing bc = (BaseClothing)miref; iProps[0] = (int)bc.MagicType; iProps[1] = (int)bc.MagicCharges; iMajorSkill = (int)SkillName.Tailoring; } else if (miref is BaseJewel) { // Store : // [0] - int representing the type of charge // [1] - int representing the number of charges BaseJewel bj = (BaseJewel)miref; iProps[0] = (int)bj.MagicType; iProps[1] = (int)bj.MagicCharges; iMajorSkill = (int)SkillName.Tinkering; } else { // We've been passed an object that cannot be handled... // don't drop this enchanted item! this.Delete(); return; } // Skill requirements SkillReq = new int[52]; // all enhancements require these SkillReq[(int)SkillName.Magery] = 80; if (ItemType.IsSubclassOf(typeof(BaseJewel)) || ItemType.IsSubclassOf(typeof(BaseClothing))) { SkillReq[(int)SkillName.ItemID] = 80; } else { SkillReq[(int)SkillName.ArmsLore] = 80; } // base final skill on what kind of object we're dealing with SkillReq[iMajorSkill] = 90; }
public StarterBagMage() { Container cont; this.Name = "Starter Bag - Mage"; cont = new Bag(); cont.Name = "PowerScrolls Bag"; // Power Scrolls PlaceItemIn(cont, 30, 35, new PowerScroll(SkillName.Meditation, 105)); PlaceItemIn(cont, 60, 35, new PowerScroll(SkillName.Magery, 105)); PlaceItemIn(cont, 90, 35, new PowerScroll(SkillName.EvalInt, 105)); PlaceItemIn(cont, 30, 68, new PowerScroll(SkillName.Necromancy, 105)); PlaceItemIn(cont, 45, 68, new PowerScroll(SkillName.SpiritSpeak, 105)); PlaceItemIn(this, 0, 0, cont); for (int i = 0; i < cont.Items.Count; i++) { cont.Items[i].LootType = LootType.Blessed; } cont = new Bag(); cont.Name = "Gear Bag"; // Armor PlaceItemIn(cont, 30, 35, new LeatherArms()); PlaceItemIn(cont, 60, 35, new LeatherGloves()); PlaceItemIn(cont, 90, 35, new LeatherCap()); PlaceItemIn(cont, 30, 68, new LeatherChest()); PlaceItemIn(cont, 45, 68, new LeatherLegs()); // Jewelry PlaceItemIn(cont, 75, 68, new GoldNecklace()); PlaceItemIn(cont, 90, 68, new GoldEarrings()); PlaceItemIn(cont, 30, 118, new GoldBracelet()); PlaceItemIn(cont, 60, 118, new GoldRing()); PlaceItemIn(this, 50, 0, cont); for (int i = 0; i < cont.Items.Count; i++) { BaseArmor armor = cont.Items[i] as BaseArmor; BaseJewel jewel = cont.Items[i] as BaseJewel; if (armor != null) { armor.Attributes.LowerRegCost = 12; armor.LootType = LootType.Newbied; armor.Hue = 1154; armor.Insured = false; armor.TimesImbued = 50; armor.LootType = LootType.Blessed; armor.Weight = 0; } else if (jewel != null) { jewel.Attributes.LowerRegCost = 12; jewel.Attributes.RegenMana = 1; jewel.LootType = LootType.Newbied; jewel.Hue = 1152; jewel.Insured = false; jewel.TimesImbued = 50; jewel.LootType = LootType.Blessed; } } cont = new Bag(); cont.Name = "Book Bag"; PlaceItemIn(cont, 30, 35, new Spellbook()); PlaceItemIn(cont, 60, 35, new NecromancerSpellbook()); Runebook runebook = new Runebook(5); runebook.CurCharges = runebook.MaxCharges; PlaceItemIn(cont, 90, 35, runebook); for (int i = 0; i < 3; ++i) { PlaceItemIn(cont, 45 + (i * 10), 75, new RecallRune()); } PlaceItemIn(this, 100, 0, cont); for (int i = 0; i < cont.Items.Count; i++) { Spellbook spellBook = cont.Items[i] as Spellbook; if (spellBook != null) { spellBook.SkillBonuses.SetValues(0, SkillName.Meditation, 100); spellBook.Attributes.CastSpeed = 1; spellBook.Hue = 1152; } } }
protected override void OnTarget(Mobile from, object target) { if (target is BaseWeapon) { BaseWeapon item = (BaseWeapon)target; if (item.RootParent != from) { from.SendMessage("The item must be in your pack."); } else { int luck = item.Attributes.Luck; if (luck >= 1000) { from.SendMessage("There is already enough luck on this item."); } else { item.Attributes.Luck = luck + 25; if (item.Attributes.Luck > 1000) { item.Attributes.Luck = 1000; } from.SendMessage("You add some extra luck to the item."); m_Deed.Delete(); } } } else if (target is BaseClothing) { BaseClothing item = (BaseClothing)target; if (item.RootParent != from) { from.SendMessage("The item must be in your pack."); } else { int luck = item.Attributes.Luck; if (luck >= 1000) { from.SendMessage("There is already enough luck on this item."); } else { item.Attributes.Luck = luck + 25; if (item.Attributes.Luck > 1000) { item.Attributes.Luck = 1000; } from.SendMessage("You add some extra luck to the item."); m_Deed.Delete(); } } } else if (target is BaseJewel) { BaseJewel item = (BaseJewel)target; if (item.RootParent != from) { from.SendMessage("The item must be in your pack."); } else { int luck = item.Attributes.Luck; if (luck >= 1000) { from.SendMessage("There is already enough luck on this item."); } else { item.Attributes.Luck = luck + 25; if (item.Attributes.Luck > 1000) { item.Attributes.Luck = 1000; } from.SendMessage("You add some extra luck to the item."); m_Deed.Delete(); } } } else if (target is BaseArmor) { BaseArmor item = (BaseArmor)target; if (item.RootParent != from) { from.SendMessage("The item must be in your pack."); } else { int luck = item.Attributes.Luck; if (luck >= 1000) { from.SendMessage("There is already enough luck on this item."); } else { item.Attributes.Luck = luck + 25; if (item.Attributes.Luck > 1000) { item.Attributes.Luck = 1000; } from.SendMessage("You add some extra luck to the item."); m_Deed.Delete(); } } } else if (target is Spellbook) { Spellbook item = (Spellbook)target; if (item.RootParent != from) { from.SendMessage("The item must be in your pack."); } else { int luck = item.Attributes.Luck; if (luck >= 1000) { from.SendMessage("There is already enough luck on this item."); } else { item.Attributes.Luck = luck + 25; if (item.Attributes.Luck > 1000) { item.Attributes.Luck = 1000; } from.SendMessage("You add some extra luck to the item."); m_Deed.Delete(); } } } else { from.SendMessage("You cannot enhance that item with luck."); } }
public bool IsUpgradable(Item itemToTest) { bool allowed = true; if (itemToTest is BaseShield) { BaseShield shield = (BaseShield)itemToTest; if (shield.ArtifactRarity > 0) { allowed = false; } if (Name == "AttackChance" && Core.ML) { allowed = false; } if (Name == "ReflectPhysical" && !Core.ML) { allowed = false; } if (Name == "LowerStatReq" && (!Core.AOS || (shield.Resource >= CraftResource.RegularLeather && shield.Resource <= CraftResource.BarbedLeather))) { allowed = false; } if (!AllowShield) { allowed = false; } } else if (itemToTest is BaseArmor) { BaseArmor armor = (BaseArmor)itemToTest; if (armor.ArtifactRarity > 0) { allowed = false; } if (Name == "LowerStatReq" && (!Core.AOS || (armor.Resource >= CraftResource.RegularLeather && armor.Resource <= CraftResource.BarbedLeather))) { allowed = false; } if (Name == "MageArmor" && armor.MeditationAllowance == ArmorMeditationAllowance.All) { allowed = false; } if (Name == "NightSight" && armor.RequiredRace == Race.Elf) { allowed = false; } if (!AllowArmor) { allowed = false; } } else if (itemToTest is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)itemToTest; if (weapon.ArtifactRarity > 0) { allowed = false; } if (Name == "UseBestSkill" && weapon.WeaponAttributes.MageWeapon > 0) { allowed = false; } if (Name == "MageWeapon" && weapon.WeaponAttributes.UseBestSkill > 0) { allowed = false; } if (Name == "HitPhysicalArea" && (weapon.WeaponAttributes.HitFireArea > 0 || weapon.WeaponAttributes.HitColdArea > 0 || weapon.WeaponAttributes.HitPoisonArea > 0 || weapon.WeaponAttributes.HitEnergyArea > 0)) { allowed = false; } if (Name == "HitFireArea" && (weapon.WeaponAttributes.HitPhysicalArea > 0 || weapon.WeaponAttributes.HitColdArea > 0 || weapon.WeaponAttributes.HitPoisonArea > 0 || weapon.WeaponAttributes.HitEnergyArea > 0)) { allowed = false; } if (Name == "HitColdArea" && (weapon.WeaponAttributes.HitFireArea > 0 || weapon.WeaponAttributes.HitPhysicalArea > 0 || weapon.WeaponAttributes.HitPoisonArea > 0 || weapon.WeaponAttributes.HitEnergyArea > 0)) { allowed = false; } if (Name == "HitPoisonArea" && (weapon.WeaponAttributes.HitFireArea > 0 || weapon.WeaponAttributes.HitColdArea > 0 || weapon.WeaponAttributes.HitPhysicalArea > 0 || weapon.WeaponAttributes.HitEnergyArea > 0)) { allowed = false; } if (Name == "HitEnergyArea" && (weapon.WeaponAttributes.HitFireArea > 0 || weapon.WeaponAttributes.HitColdArea > 0 || weapon.WeaponAttributes.HitPoisonArea > 0 || weapon.WeaponAttributes.HitPhysicalArea > 0)) { allowed = false; } if (Name == "HitMagicArrow " && (weapon.WeaponAttributes.HitHarm > 0 || weapon.WeaponAttributes.HitFireball > 0 || weapon.WeaponAttributes.HitLightning > 0)) { allowed = false; } if (Name == "HitHarm " && (weapon.WeaponAttributes.HitMagicArrow > 0 || weapon.WeaponAttributes.HitFireball > 0 || weapon.WeaponAttributes.HitLightning > 0)) { allowed = false; } if (Name == "HitFireball " && (weapon.WeaponAttributes.HitHarm > 0 || weapon.WeaponAttributes.HitMagicArrow > 0 || weapon.WeaponAttributes.HitLightning > 0)) { allowed = false; } if (Name == "HitLightning " && (weapon.WeaponAttributes.HitHarm > 0 || weapon.WeaponAttributes.HitFireball > 0 || weapon.WeaponAttributes.HitMagicArrow > 0)) { allowed = false; } if (!AllowWeapon) { allowed = false; } } else if (itemToTest is BaseJewel) { BaseJewel jewel = (BaseJewel)itemToTest; if (jewel.ArtifactRarity > 0) { allowed = false; } if (!AllowJewelry) { allowed = false; } } else if (itemToTest is BaseClothing) { BaseClothing cloth = (BaseClothing)itemToTest; if (cloth.ArtifactRarity > 0) { allowed = false; } if (!AllowClothing) { allowed = false; } } else if (itemToTest is Spellbook) { if (!AllowSpellbook) { allowed = false; } } else { allowed = false; } if (allowed) { int currentValue = Upgrade(itemToTest, true); if (currentValue == MaxValue) { allowed = false; } } return(allowed); }
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. } }
protected override void OnTarget(Mobile from, object targeted) { if (this.m_Powder.Deleted || this.m_Powder.UsesRemaining <= 0) { from.SendLocalizedMessage(1049086); // You have used up your powder of temperament. return; } if (targeted is IDurability && targeted is Item) { IDurability wearable = (IDurability)targeted; Item item = (Item)targeted; if (!wearable.CanFortify) { from.SendLocalizedMessage(1049083); // You cannot use the powder on that item. return; } #region SF Imbuing if (item is BaseArmor) { BaseArmor Ti = (BaseArmor)item as BaseArmor; if (Ti.Attributes.Brittle > 0) { from.SendLocalizedMessage(1149799); // That cannot be used on brittle items. return; } } else if (item is BaseJewel) { BaseJewel Ti = (BaseJewel)item as BaseJewel; if (Ti.Attributes.Brittle > 0) { from.SendLocalizedMessage(1149799); // That cannot be used on brittle items. return; } } else if (item is BaseHat) { BaseHat Ti = (BaseHat)item as BaseHat; if (Ti.Attributes.Brittle > 0) { from.SendLocalizedMessage(1149799); // That cannot be used on brittle items. return; } } else if (item is BaseWeapon) { BaseWeapon Ti = (BaseWeapon)item as BaseWeapon; if (Ti.Attributes.Brittle > 0) { from.SendLocalizedMessage(1149799); // That cannot be used on brittle items. return; } } #endregion if ((item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) && this.m_Powder.IsChildOf(from.Backpack)) { int origMaxHP = wearable.MaxHitPoints; int origCurHP = wearable.HitPoints; if (origMaxHP > 0) { int initMaxHP = Core.AOS ? 255 : wearable.InitMaxHits; wearable.UnscaleDurability(); if (wearable.MaxHitPoints < initMaxHP) { int bonus = initMaxHP - wearable.MaxHitPoints; if (bonus > 10) { bonus = 10; } wearable.MaxHitPoints += bonus; wearable.HitPoints += bonus; wearable.ScaleDurability(); if (wearable.MaxHitPoints > 255) { wearable.MaxHitPoints = 255; } if (wearable.HitPoints > 255) { wearable.HitPoints = 255; } if (wearable.MaxHitPoints > origMaxHP) { from.SendLocalizedMessage(1049084); // You successfully use the powder on the item. from.PlaySound(0x247); --this.m_Powder.UsesRemaining; if (this.m_Powder.UsesRemaining <= 0) { from.SendLocalizedMessage(1049086); // You have used up your powder of fortifying. this.m_Powder.Delete(); } } else { wearable.MaxHitPoints = origMaxHP; wearable.HitPoints = origCurHP; from.SendLocalizedMessage(1049085); // The item cannot be improved any further. } } else { from.SendLocalizedMessage(1049085); // The item cannot be improved any further. wearable.ScaleDurability(); } } else { from.SendLocalizedMessage(1049083); // You cannot use the powder on that item. } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } } else { from.SendLocalizedMessage(1049083); // You cannot use the powder on that item. } }
protected override void OnTarget(Mobile from, object o) { int oInt = 0; double oDo = 0; int oMods = 0; if (o is BaseWeapon || o is BaseArmor || o is BaseJewel || o is BaseHat) { if (from.Skills[SkillName.ItemID].Base >= 100.0) { if (o is BaseWeapon) { BaseWeapon w = o as BaseWeapon; if (o is BaseRanged) { BaseRanged r = o as BaseRanged; if (r.Velocity > 0) { oDo += (130 / 50) * r.Velocity; oMods += 1; } if (r.Balanced == true) { oDo += 150; oMods += 1; } if (w.Attributes.DefendChance > 0) { oDo += (130 / 25) * w.Attributes.DefendChance; oMods += 1; } if (w.Attributes.AttackChance > 0) { oDo += (130 / 25) * w.Attributes.AttackChance; oMods += 1; } if (w.Attributes.Luck > 0) { oDo += (100 / 120) * w.Attributes.Luck; oMods += 1; } if (w.WeaponAttributes.ResistPhysicalBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistPhysicalBonus; oMods += 1; } if (w.WeaponAttributes.ResistFireBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistFireBonus; oMods += 1; } if (w.WeaponAttributes.ResistColdBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistColdBonus; oMods += 1; } if (w.WeaponAttributes.ResistPoisonBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistPoisonBonus; oMods += 1; } if (w.WeaponAttributes.ResistEnergyBonus > 0) { oDo += (100 / 18) * w.WeaponAttributes.ResistEnergyBonus; oMods += 1; } } else if (o is BaseMeleeWeapon) { if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; } if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; } if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; } if (w.WeaponAttributes.ResistPhysicalBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistPhysicalBonus; oMods += 1; } if (w.WeaponAttributes.ResistFireBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistFireBonus; oMods += 1; } if (w.WeaponAttributes.ResistColdBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistColdBonus; oMods += 1; } if (w.WeaponAttributes.ResistPoisonBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistPoisonBonus; oMods += 1; } if (w.WeaponAttributes.ResistEnergyBonus > 0) { oDo += (100 / 15) * w.WeaponAttributes.ResistEnergyBonus; oMods += 1; } } if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; } if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; } if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; } if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; } if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; } if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; } if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; } if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; } if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; } if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; } if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; } if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; } if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; } if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; } if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; } if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; } if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; } if (w.Attributes.SpellChanneling > 0) { oDo += 100; oMods += 1; if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; } if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; } } else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; } if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; } if (w.WeaponAttributes.LowerStatReq > 0) { oDo += w.WeaponAttributes.LowerStatReq; oMods += 1; } if (w.WeaponAttributes.HitLeechHits > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitLeechHits; oMods += 1; } if (w.WeaponAttributes.HitLeechStam > 0) { oDo += 2 * w.WeaponAttributes.HitLeechStam; oMods += 1; } if (w.WeaponAttributes.HitLeechMana > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitLeechMana; oMods += 1; } if (w.WeaponAttributes.HitLowerAttack > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitLowerAttack; oMods += 1; } if (w.WeaponAttributes.HitLowerDefend > 0) { oDo += (130 / 50) * w.WeaponAttributes.HitLowerDefend; oMods += 1; } if (w.WeaponAttributes.HitColdArea > 0) { oDo += (2 * w.WeaponAttributes.HitColdArea); oMods += 1; } if (w.WeaponAttributes.HitFireArea > 0) { oDo += (2 * w.WeaponAttributes.HitFireArea); oMods += 1; } if (w.WeaponAttributes.HitPoisonArea > 0) { oDo += (2 * w.WeaponAttributes.HitPoisonArea); oMods += 1; } if (w.WeaponAttributes.HitEnergyArea > 0) { oDo += (2 * w.WeaponAttributes.HitEnergyArea); oMods += 1; } if (w.WeaponAttributes.HitPhysicalArea > 0) { oDo += (2 * w.WeaponAttributes.HitPhysicalArea); oMods += 1; } if (w.WeaponAttributes.HitMagicArrow > 0) { oDo += 2.4 * w.WeaponAttributes.HitMagicArrow; oMods += 1; } if (w.WeaponAttributes.HitHarm > 0) { oDo += (110 / 50) * w.WeaponAttributes.HitHarm; oMods += 1; } if (w.WeaponAttributes.HitFireball > 0) { oDo += 2.4 * w.WeaponAttributes.HitFireball; oMods += 1; } if (w.WeaponAttributes.HitLightning > 0) { oDo += 2.4 * w.WeaponAttributes.HitLightning; oMods += 1; } if (w.WeaponAttributes.HitDispel > 0) { oDo += (2 * w.WeaponAttributes.HitDispel); oMods += 1; } if (w.WeaponAttributes.UseBestSkill > 0) { oDo += 150; oMods += 1; } if (w.WeaponAttributes.MageWeapon > 0) { oDo += (20 * w.WeaponAttributes.MageWeapon); oMods += 1; } if (w.WeaponAttributes.DurabilityBonus > 0) { oDo += w.WeaponAttributes.DurabilityBonus; oMods += 1; } if (w.Slayer == SlayerName.Silver || w.Slayer == SlayerName.Repond || w.Slayer == SlayerName.ReptilianDeath || w.Slayer == SlayerName.Exorcism || w.Slayer == SlayerName.ArachnidDoom || w.Slayer == SlayerName.ElementalBan || w.Slayer == SlayerName.Fey) { oDo += 130; oMods += 1; } else if (w.Slayer != SlayerName.None) { oDo += 110; oMods += 1; } if (w.Slayer2 == SlayerName.Silver || w.Slayer2 == SlayerName.Repond || w.Slayer2 == SlayerName.ReptilianDeath || w.Slayer2 == SlayerName.Exorcism || w.Slayer2 == SlayerName.ArachnidDoom || w.Slayer2 == SlayerName.ElementalBan || w.Slayer2 == SlayerName.Fey) { oDo += 130; oMods += 1; } else if (w.Slayer2 != SlayerName.None) { oDo += 110; oMods += 1; } if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; } if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; } if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; } if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; } if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; } oDo = Math.Round(oDo, 1); oInt += Convert.ToInt32(oDo); } if (o is BaseArmor) { BaseArmor w = o as BaseArmor; if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; } if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; } if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; } if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; } if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; } if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; } if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; } if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; } if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; } if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; } if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; } if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; } if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; } if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; } if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; } if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; } if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; } if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; } if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; } if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; } if (w.Attributes.SpellChanneling > 0) { oDo += 100; oMods += 1; if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; } if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; } } else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; } if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; } if (w.ArmorAttributes.LowerStatReq > 0) { oDo += w.ArmorAttributes.LowerStatReq; oMods += 1; } if (w.ArmorAttributes.MageArmor > 0) { oDo += 140; oMods += 1; } if (w.ArmorAttributes.DurabilityBonus > 0) { oDo += w.ArmorAttributes.DurabilityBonus; oMods += 1; } if (w.Quality != ArmorQuality.Exceptional) { if (w.PhysicalBonus > 0) { oDo += (100 / 15) * w.PhysicalBonus; oMods += 1; } if (w.FireBonus > 0) { oDo += (100 / 15) * w.FireBonus; oMods += 1; } if (w.ColdBonus > 0) { oDo += (100 / 15) * w.ColdBonus; oMods += 1; } if (w.PoisonBonus > 0) { oDo += (100 / 15) * w.PoisonBonus; oMods += 1; } if (w.EnergyBonus > 0) { oDo += (100 / 15) * w.EnergyBonus; oMods += 1; } } if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; } if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; } if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; } if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; } if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; } oDo = Math.Round(oDo, 1); oInt += Convert.ToInt32(oDo); } if (o is BaseJewel) { BaseJewel w = o as BaseJewel; if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; } if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; } if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; } if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; } if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; } if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; } if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; } if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; } if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; } if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; } if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; } if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; } if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; } if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; } if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; } if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; } if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; } if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; } if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; } if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; } if (w.Attributes.SpellChanneling > 0) { oDo += 100; oMods += 1; if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; } if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; } } else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; } if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; } if (w.Resistances.Physical > 0) { oDo += (100 / 15) * w.Resistances.Physical; oMods += 1; } if (w.Resistances.Fire > 0) { oDo += (100 / 15) * w.Resistances.Fire; oMods += 1; } if (w.Resistances.Cold > 0) { oDo += (100 / 15) * w.Resistances.Cold; oMods += 1; } if (w.Resistances.Poison > 0) { oDo += (100 / 15) * w.Resistances.Poison; oMods += 1; } if (w.Resistances.Energy > 0) { oDo += (100 / 15) * w.Resistances.Energy; oMods += 1; } if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; } if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; } if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; } if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; } if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; } oDo = Math.Round(oDo, 1); oInt += Convert.ToInt32(oDo); } if (o is BaseClothing) { BaseClothing w = o as BaseClothing; if (w.Attributes.DefendChance > 0) { oDo += (130 / 15) * w.Attributes.DefendChance; oMods += 1; } if (w.Attributes.AttackChance > 0) { oDo += (130 / 15) * w.Attributes.AttackChance; oMods += 1; } if (w.Attributes.Luck > 0) { oDo += w.Attributes.Luck; oMods += 1; } if (w.Attributes.RegenHits > 0) { oDo += (50 * w.Attributes.RegenHits); oMods += 1; } if (w.Attributes.RegenStam > 0) { oDo += (33.33 * w.Attributes.RegenStam); oMods += 1; } if (w.Attributes.RegenMana > 0) { oDo += (50 * w.Attributes.RegenMana); oMods += 1; } if (w.Attributes.BonusStr > 0) { oDo += (110 / 8) * w.Attributes.BonusStr; oMods += 1; } if (w.Attributes.BonusDex > 0) { oDo += (110 / 8) * w.Attributes.BonusDex; oMods += 1; } if (w.Attributes.BonusInt > 0) { oDo += (110 / 8) * w.Attributes.BonusInt; oMods += 1; } if (w.Attributes.BonusHits > 0) { oDo += 22 * w.Attributes.BonusHits; oMods += 1; } if (w.Attributes.BonusStam > 0) { oDo += (100 / 8) * w.Attributes.BonusStam; oMods += 1; } if (w.Attributes.BonusMana > 0) { oDo += (110 / 8) * w.Attributes.BonusMana; oMods += 1; } if (w.Attributes.WeaponDamage > 0) { oDo += (2 * w.Attributes.WeaponDamage); oMods += 1; } if (w.Attributes.WeaponSpeed > 0) { oDo += (110 / 30) * w.Attributes.WeaponSpeed; oMods += 1; } if (w.Attributes.SpellDamage > 0) { oDo += (100 / 12) * w.Attributes.SpellDamage; oMods += 1; } if (w.Attributes.CastRecovery > 0) { oDo += (40 * w.Attributes.CastRecovery); oMods += 1; } if (w.Attributes.LowerManaCost > 0) { oDo += (110 / 8) * w.Attributes.LowerManaCost; oMods += 1; } if (w.Attributes.LowerRegCost > 0) { oDo += (5 * w.Attributes.LowerRegCost); oMods += 1; } if (w.Attributes.ReflectPhysical > 0) { oDo += (100 / 15) * w.Attributes.ReflectPhysical; oMods += 1; } if (w.Attributes.EnhancePotions > 0) { oDo += (4 * w.Attributes.EnhancePotions); oMods += 1; } if (w.Attributes.SpellChanneling > 0) { oDo += 100; oMods += 1; if (w.Attributes.CastSpeed == 0) { oDo += 140; oMods += 1; } if (w.Attributes.CastSpeed == 1) { oDo += 280; oMods += 1; } } else if (w.Attributes.CastSpeed > 0) { oDo += (140 * w.Attributes.CastSpeed); oMods += 1; } if (w.Attributes.NightSight > 0) { oDo += 50; oMods += 1; } if (w.Resistances.Physical > 0) { oDo += (100 / 15) * w.Resistances.Physical; oMods += 1; } if (w.Resistances.Fire > 0) { oDo += (100 / 15) * w.Resistances.Fire; oMods += 1; } if (w.Resistances.Cold > 0) { oDo += (100 / 15) * w.Resistances.Cold; oMods += 1; } if (w.Resistances.Poison > 0) { oDo += (100 / 15) * w.Resistances.Poison; oMods += 1; } if (w.Resistances.Energy > 0) { oDo += (100 / 15) * w.Resistances.Energy; oMods += 1; } if (w.SkillBonuses.GetBonus(0) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(0); oMods += 1; } if (w.SkillBonuses.GetBonus(1) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(1); oMods += 1; } if (w.SkillBonuses.GetBonus(2) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(2); oMods += 1; } if (w.SkillBonuses.GetBonus(3) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(3); oMods += 1; } if (w.SkillBonuses.GetBonus(4) > 0) { oDo += (140 / 15) * w.SkillBonuses.GetBonus(4); oMods += 1; } oDo = Math.Round(oDo, 1); oInt += Convert.ToInt32(oDo); } if (oInt > 0 && oInt <= 200) { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item will magically unravel into: Magical Residue"); if (from.Skills[SkillName.Imbuing].Base >= 100.0) { from.LocalOverheadMessage(MessageType.Regular, 2499, true, String.Format("Item Intensity: {0}", oInt)); } } else if (oInt > 200 && oInt < 480) { if (from.Skills[SkillName.Imbuing].Base >= 45.0) { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item will magically unravel into: Enchanted Essence"); if (from.Skills[SkillName.Imbuing].Base >= 100.0) { from.LocalOverheadMessage(MessageType.Regular, 2499, true, String.Format("Item Intensity: {0}", oInt)); } } else { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "Your Imbuing skill is not high enough to identify the imbuing ingredient."); } } else if (oInt >= 480) { if (from.Skills[SkillName.Imbuing].Base >= 95.0) { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item will magically unravel into: Relic Fragment"); if (from.Skills[SkillName.Imbuing].Base >= 100.0) { from.LocalOverheadMessage(MessageType.Regular, 2499, true, String.Format("Item Intensity: {0}", oInt)); } } else { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "Your Imbuing skill is not high enough to identify the imbuing ingredient."); } } else { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item cannot be magically unraveled. It appears to possess little to no magic."); } } else { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You are uncertain.. your Item Identification skill isn't high enougth"); } } else if (o is Mobile) { ((Mobile)o).OnSingleClick(from); } else { from.LocalOverheadMessage(MessageType.Regular, 2499, true, "You conclude that item cannot be magically unraveled."); } }
protected override void OnTarget(Mobile from, object targeted) { if (targeted == null) { return; } if (!(targeted is Item)) { from.SendMessage("This gem can only be used on armor, jewelry, and clothing."); return; } if (m_deed.Deleted) { return; } if (!(targeted as Item).IsChildOf(from.Backpack)) { from.SendMessage("You can use this gem only on items in your backpack"); return; } if (targeted is BaseArmor || targeted is BaseJewel || targeted is BaseClothing) { BaseArmor a = targeted as BaseArmor; BaseJewel j = targeted as BaseJewel; BaseClothing c = targeted as BaseClothing; if (a != null) { if (a.Attributes.RegenHits != 0) { a.Attributes.RegenHits = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { a.Attributes.RegenHits = 1; from.SendMessage("Glow from gem was transfered to item, gem wanished into thin air"); } } else if (j != null) { if (j.Attributes.RegenHits != 0) { j.Attributes.RegenHits = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { j.Attributes.RegenHits = 1; from.SendMessage("Glow from gem was transfered to item, gem wanished into thin air"); } } if (c != null) { if (c.Attributes.RegenHits != 0) { c.Attributes.RegenHits = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { c.Attributes.RegenHits = 1; from.SendMessage("Glow from gem was transfered to item, gem wanished into thin air"); } } Effects.PlaySound(from.Location, from.Map, 0x243); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); m_deed.Delete(); } else { from.SendMessage((string)"Gem did not react to targeted object"); } }
public void ConsumeCharge(object parent, BaseJewel item) { item.Charges--; }
public static void ApplyAttributesTo( BaseJewel jewelry, int attributeCount, int min, int max ) { ApplyAttributesTo( jewelry, false, 0, attributeCount, min, max ); }
public static int GetProps(Item sent) { int value = 0; if (sent is BaseArmor) { BaseArmor item = sent as BaseArmor; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } foreach (int i in Enum.GetValues(typeof(AosArmorAttribute))) { if (item.ArmorAttributes[(AosArmorAttribute)i] > 0) { value += 1; } } if (item.SkillBonuses.Skill_1_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_2_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_3_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_4_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_5_Value > 0) { value += 1; } if (item.ColdBonus > 0) { value += 1; } if (item.EnergyBonus > 0) { value += 1; } if (item.FireBonus > 0) { value += 1; } if (item.PhysicalBonus > 0) { value += 1; } if (item.PoisonBonus > 0) { value += 1; } } if (sent is BaseWeapon) { BaseWeapon item = sent as BaseWeapon; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } foreach (int i in Enum.GetValues(typeof(AosWeaponAttribute))) { if (item.WeaponAttributes[(AosWeaponAttribute)i] > 0) { value += 1; } } if (item.SkillBonuses.Skill_1_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_2_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_3_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_4_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_5_Value > 0) { value += 1; } if (item.Slayer != SlayerName.None) { value += 1; } if (item.Slayer2 != SlayerName.None) { value += 1; } } if (sent is BaseClothing) { BaseClothing item = sent as BaseClothing; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } foreach (int i in Enum.GetValues(typeof(AosArmorAttribute))) { if (item.ClothingAttributes[(AosArmorAttribute)i] > 0) { value += 1; } } if (item.SkillBonuses.Skill_1_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_2_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_3_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_4_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_5_Value > 0) { value += 1; } if (item.Resistances.Chaos > 0) { value += 1; } if (item.Resistances.Cold > 0) { value += 1; } if (item.Resistances.Direct > 0) { value += 1; } if (item.Resistances.Energy > 0) { value += 1; } if (item.Resistances.Fire > 0) { value += 1; } if (item.Resistances.Physical > 0) { value += 1; } if (item.Resistances.Poison > 0) { value += 1; } } if (sent is BaseJewel) { BaseJewel item = sent as BaseJewel; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } if (item.SkillBonuses.Skill_1_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_2_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_3_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_4_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_5_Value > 0) { value += 1; } if (item.Resistances.Chaos > 0) { value += 1; } if (item.Resistances.Cold > 0) { value += 1; } if (item.Resistances.Direct > 0) { value += 1; } if (item.Resistances.Energy > 0) { value += 1; } if (item.Resistances.Fire > 0) { value += 1; } if (item.Resistances.Physical > 0) { value += 1; } if (item.Resistances.Poison > 0) { value += 1; } } if (sent is BaseQuiver) { BaseQuiver item = sent as BaseQuiver; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } if (item.DamageIncrease > 0) { value += 1; } if (item.LowerAmmoCost > 0) { value += 1; } } if (sent is BaseTalisman) { BaseTalisman item = sent as BaseTalisman; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } if (item.SkillBonuses.Skill_1_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_2_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_3_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_4_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_5_Value > 0) { value += 1; } } if (sent is Spellbook) { Spellbook item = sent as Spellbook; foreach (int i in Enum.GetValues(typeof(AosAttribute))) { if (item != null && item.Attributes[(AosAttribute)i] > 0) { value += 1; } } if (item.SkillBonuses.Skill_1_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_2_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_3_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_4_Value > 0) { value += 1; } if (item.SkillBonuses.Skill_5_Value > 0) { value += 1; } if (item.Slayer != SlayerName.None) { value += 1; } if (item.Slayer2 != SlayerName.None) { value += 1; } } return(value); }
public bool IncreaseJewelAttribute(BaseJewel item) { switch (m_Deed.AosAttribute) { case "AttackChance": item.Attributes.AttackChance += m_Deed.Level; break; case "BonusDex": item.Attributes.BonusDex += m_Deed.Level; break; case "BonusHits": item.Attributes.BonusHits += m_Deed.Level; break; case "BonusInt": item.Attributes.BonusHits += m_Deed.Level; break; case "BonusMana": item.Attributes.BonusMana += m_Deed.Level; break; case "BonusStam": item.Attributes.BonusStam += m_Deed.Level; break; case "BonusStr": item.Attributes.BonusStr += m_Deed.Level; break; case "CastRecovery": item.Attributes.CastRecovery += m_Deed.Level; break; case "CastSpeed": item.Attributes.CastSpeed += m_Deed.Level; break; case "DefendChance": item.Attributes.DefendChance += m_Deed.Level; break; case "EnhancePotions": item.Attributes.EnhancePotions += m_Deed.Level; break; case "IncreasedKarmaLoss": item.Attributes.IncreasedKarmaLoss += m_Deed.Level; break; case "LowerManaCost": item.Attributes.LowerManaCost += m_Deed.Level; break; case "LowerRegCost": item.Attributes.LowerRegCost += m_Deed.Level; break; case "Luck": item.Attributes.Luck += m_Deed.Level; break; case "NightSight": item.Attributes.NightSight += m_Deed.Level; break; case "ReflectPhysical": item.Attributes.ReflectPhysical += m_Deed.Level; break; case "RegenHits": item.Attributes.RegenHits += m_Deed.Level; break; case "RegenMana": item.Attributes.RegenMana += m_Deed.Level; break; case "SpellChanneling": item.Attributes.SpellChanneling += m_Deed.Level; break; case "SpellDamage": item.Attributes.SpellDamage += m_Deed.Level; break; case "WeaponDamage": item.Attributes.WeaponDamage += m_Deed.Level; break; case "WeaponSpeed": item.Attributes.WeaponSpeed += m_Deed.Level; break; default: return(false); } return(true); }
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature { if (m_Deed.Deleted || m_Deed.RootParent != from) { return; } if (target is BaseClothing) { BaseClothing item = (BaseClothing)target; if (item is IArcaneEquip) { IArcaneEquip eq = (IArcaneEquip)item; if (eq.IsArcane) { from.SendLocalizedMessage(1005019); // This bless deed is for Clothes only. return; } } if (item.LootType == LootType.Blessed || item.BlessedFor == from || (Mobile.InsuranceEnabled && item.Insured)) // Check if its already newbied (blessed) { from.SendLocalizedMessage(1045113); // That item is already blessed } else if (item.LootType != LootType.Regular) { from.SendLocalizedMessage(1045114); // You can not bless that item } else if (!item.CanBeBlessed || item.RootParent != from) { from.SendLocalizedMessage(500509); // You cannot bless that object } else { item.LootType = LootType.Blessed; from.SendLocalizedMessage(1010026); // You bless the item.... m_Deed.Delete(); // Delete the bless deed } } else if ((target is MagicCloak) || (target is MagicRobe) || (target is MagicBoots)) // WIZARD ADDED { BaseJewel item = (BaseJewel)target; if (item.LootType == LootType.Blessed || item.BlessedFor == from || (Mobile.InsuranceEnabled && item.Insured)) // Check if its already newbied (blessed) { from.SendLocalizedMessage(1045113); // That item is already blessed } else if (item.LootType != LootType.Regular) { from.SendLocalizedMessage(1045114); // You can not bless that item } else if (item.RootParent != from) { from.SendLocalizedMessage(500509); // You cannot bless that object } else { item.LootType = LootType.Blessed; from.SendLocalizedMessage(1010026); // You bless the item.... m_Deed.Delete(); // Delete the bless deed } } else { from.SendLocalizedMessage(500509); // You cannot bless that object } }
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.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } if (item is BaseWeapon) { BaseWeapon i = item as BaseWeapon; if (i.Attributes.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } if (item is BaseHat) { BaseHat i = item as BaseHat; if (i.Attributes.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } if (item is BaseJewel) { BaseJewel i = item as BaseJewel; if (i.Attributes.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } if (item is BaseTalisman) { BaseTalisman i = item as BaseTalisman; if (i.Attributes.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } if (item is BaseQuiver) { BaseQuiver i = item as BaseQuiver; if (i.Attributes.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } if (item is Spellbook) { Spellbook i = item as Spellbook; if (i.Attributes.CastSpeed + value <= max) { i.Attributes.CastSpeed += value; } else { i.Attributes.CastSpeed = max; } } item.ChantSlots += 1; m_Rune.Delete(); } } else { from.SendMessage("You cannot use this enhancement on that."); } }
public EatChargesTimer(BaseJewel jewel) : base(TimeSpan.FromSeconds(120.0), TimeSpan.FromSeconds(120.0)) { m_Jewel = jewel; Start(); }
public UnBlessEntry(Mobile from, BaseJewel item) : base(6208, -1) { m_From = from; m_Item = item; }
public TeleportTarget(BaseJewel owner, Mobile mobile) : base(12, true, TargetFlags.None) { m_Owner = owner; m_Mobile = mobile; }
public static void ApplyAttributesTo(BaseJewel jewelry, bool isRunicTool, int luckChance, int attributeCount, int min, int max) { m_IsRunicTool = isRunicTool; m_LuckChance = luckChance; AosAttributes primary = jewelry.Attributes; AosElementAttributes resists = jewelry.Resistances; AosSkillBonuses skills = jewelry.SkillBonuses; m_Props.SetAll(false); for (int i = 0; i < attributeCount; ++i) { int random = GetUniqueRandom(24); if (random == -1) { break; } switch (random) { case 0: ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15); break; case 1: ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15); break; case 2: ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15); break; case 3: ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15); break; case 4: ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15); break; case 5: ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 25); break; case 6: ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15); break; case 7: ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15); break; case 8: ApplyAttribute(primary, min, max, AosAttribute.BonusStr, 1, 8); break; case 9: ApplyAttribute(primary, min, max, AosAttribute.BonusDex, 1, 8); break; case 10: ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8); break; case 11: ApplyAttribute(primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5); break; case 12: ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1); break; case 13: ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 3); break; case 14: ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8); break; case 15: ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20); break; case 16: ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100); break; case 17: ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12); break; case 18: ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1); break; case 19: ApplySkillBonus(skills, min, max, 0, 1, 15); break; case 20: ApplySkillBonus(skills, min, max, 1, 1, 15); break; case 21: ApplySkillBonus(skills, min, max, 2, 1, 15); break; case 22: ApplySkillBonus(skills, min, max, 3, 1, 15); break; case 23: ApplySkillBonus(skills, min, max, 4, 1, 15); break; } } }
public static void ApplyAttribute( Mobile from, BookOfSpellCrafts book, int craftId, BaseJewel jewel, AosElementAttribute attribute, int minimum, int maximum ) { CheckItem( from, jewel, ( jewel.Resistances[ attribute ] == 0 ) ); UseMagicJewels( from, book, jewel, SpellCraftConfig.MagicJewelRequirements[craftId] ); int scalar = ComputeSkillScalar( from ); ApplyAttribute( jewel.Resistances, SpellCraftConfig.MinimumIntensity * scalar, SpellCraftConfig.MaximumIntensity * scalar, attribute, minimum, maximum ); }