public override bool OnAugment(Mobile from, object target) { if (target is BaseWeapon) { ((BaseWeapon)target).Attributes.WeaponDamage += 4; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.Attributes.BonusStr += 2; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.DefendChance += 4; } else if (target is BaseCreature) { ((BaseCreature)target).DamageMax += 1; } else { return(false); } return(true); }
public override bool OnRecover(Mobile from, object target, int version) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitPoisonArea -= 40; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.PoisonBonus -= 25; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusDex -= 25; } else if (target is BaseCreature) { ((BaseCreature)target).RawDex -= 32; } else { return(false); } return(true); }
public override bool OnAugment(Mobile from, object target) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitColdArea += 40; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.ColdBonus += 25; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusInt += 15; } else if (target is BaseCreature) { ((BaseCreature)target).RawInt += 32; } else { return(false); } return(true); }
public override bool OnAugment(Mobile from, object target) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitFireArea += 25; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.FireBonus += 15; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusHits += 20; } else if (target is BaseCreature) { ((BaseCreature)target).VirtualArmor += 20; } else { return(false); } return(true); }
public override bool OnRecover(Mobile from, object target, int version) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitColdArea -= 10; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.ColdBonus -= 6; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusInt -= 3; } else if (target is BaseCreature) { ((BaseCreature)target).RawInt -= 3; } else { return(false); } return(true); }
public override bool OnAugment(Mobile from, object target) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitPhysicalArea += 10; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.EnergyBonus += 1; s.FireBonus += 1; s.PoisonBonus += 1; s.PhysicalBonus += 1; s.ColdBonus += 1; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.AttackChance += 8; } else if (target is BaseCreature) { ((BaseCreature)target).RawStr += 8; } else { return(false); } return(true); }
public override bool OnAugment(Mobile from, object target) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitPoisonArea += 10; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.PoisonBonus += 6; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusDex += 6; } else if (target is BaseCreature) { ((BaseCreature)target).RawDex += 8; } else { return(false); } return(true); }
public override bool OnRecover(Mobile from, object target, int version) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitPhysicalArea -= 40; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.EnergyBonus -= 5; s.FireBonus -= 5; s.PoisonBonus -= 5; s.PhysicalBonus -= 5; s.ColdBonus -= 5; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.AttackChance -= 32; } else if (target is BaseCreature) { ((BaseCreature)target).RawStr -= 32; } else { return(false); } return(true); }
public override bool OnRecover(Mobile from, object target, int version) { if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitFireArea -= 10; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.FireBonus -= 6; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusHits -= 8; } else if (target is BaseCreature) { ((BaseCreature)target).VirtualArmor -= 8; } else { return(false); } return(true); }
public override bool OnRecover(Mobile from, object target, int version) { if (target is BaseWeapon) { ((BaseWeapon)target).Attributes.WeaponDamage -= 17; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.Attributes.BonusStr -= 9; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.DefendChance -= 16; } else if (target is BaseCreature) { ((BaseCreature)target).DamageMax -= 5; } else { return(false); } return(true); }
public override bool OnAugment(Mobile from, object target) { switch (this.Version) { case 0: // stronger version if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitFireArea += 40; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.FireBonus += 25; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusHits += 32; } else if (target is BaseCreature) { ((BaseCreature)target).VirtualArmor += 32; } else { return(false); } break; case 1: // weaker version if (target is BaseWeapon) { ((BaseWeapon)target).WeaponAttributes.HitFireArea += 30; } else if (target is BaseShield) { BaseShield s = target as BaseShield; s.FireBonus += 20; } else if (target is BaseArmor) { ((BaseArmor)target).Attributes.BonusHits += 25; } else if (target is BaseCreature) { ((BaseCreature)target).VirtualArmor += 28; } else { return(false); } break; } return(true); }
private void ApplyShieldSpecificAttributesTo(BaseShield shield) { shield.Attributes.ReflectPhysical += ShieldReflectDamage; shield.Attributes.SpellChanneling += ShieldSpellChanneling; shield.Attributes.CastSpeed += ShieldFasterCasting; shield.PhysicalBonus += ShieldPhysicalResist; shield.FireBonus += ShieldFireResist; shield.ColdBonus += ShieldColdResist; shield.PoisonBonus += ShieldPoisonResist; shield.EnergyBonus += ShieldEnergyResist; }
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 shields."); 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 BaseShield) { BaseShield s = targeted as BaseShield; if (s != null) { if (s.Attributes.DefendChance != 0) { s.Attributes.DefendChance = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { s.Attributes.DefendChance = 5; from.SendMessage("Glow from gem was transfered to item, gem vanished 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("Gem did not react to targeted object"); } }
public static void CheckHit(Mobile attacker, Mobile defender, int damage) { BaseShield shield = defender.FindItemOnLayer(Layer.TwoHanded) as BaseShield; if (shield != null && shield.ArmorAttributes.SoulCharge > 0 && shield.ArmorAttributes.SoulCharge > Utility.Random(100)) { SoulChargeContext sc = PropertyEffect.GetContext <SoulChargeContext>(defender, EffectsType.SoulCharge); if (sc == null) { sc = new SoulChargeContext(defender, shield); } sc.OnDamaged(damage); } }
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature { if (from == null) { return; } if (m_Deed.Deleted || m_Deed.RootParent != from) { return; } if (target is BaseShield) { BaseShield armor = (BaseShield)target; armor.Attributes.SpellChanneling = 1; } if (target is BaseWeapon) { BaseWeapon weapon = (BaseWeapon)target; weapon.Attributes.SpellChanneling = 1; } else { from.SendMessage("That is not a valid target!"); return; } //int maxSlots = 10; //if (from.FollowersMax >= maxSlots) //{ // from.SendMessage("You already have the max amount of follower slots!"); //return; //} //from.FollowersMax++; //from.SendMessage("You now possess "+from.FollowersMax+" follower slots."); m_Deed.Delete(); }
protected override void OnTarget(Mobile from, object target) // Override the protected OnTarget() for our feature { if (from == null) { return; } if (m_Deed.Deleted || m_Deed.RootParent != from) { return; } if (target is BaseWeapon) { BaseWeapon wep = (BaseWeapon)target; wep.WeaponAttributes.MageWeapon = 1; } if (target is BaseArmor) { BaseArmor armor = (BaseArmor)target; armor.ArmorAttributes.MageArmor = 1; } if (target is BaseShield) { BaseShield shield = (BaseShield)target; shield.ArmorAttributes.MageArmor = 1; } else { from.SendMessage("That is not a valid target!"); return; } m_Deed.Delete(); }
public static void CheckItems(Mobile killer, Mobile killed) { if (killer != null) { for (int i = 0; i < 25; ++i) { Item item = killer.FindItemOnLayer((Layer)i); if (item is BaseMagicStaff || item is WizardWand) // WIZARD WANDS DO NOT LOSE POINTS { BaseWeapon lvlBw = (BaseWeapon)item; lvlBw.HitPoints = lvlBw.MaxHitPoints; } else if (item is BaseArmor && item is ILevelable) // SO ITEMS NEVER WEAR OUT { BaseArmor lvlBa = (BaseArmor)item; lvlBa.HitPoints = lvlBa.MaxHitPoints; } else if (item is BaseWeapon && item is ILevelable) // SO ITEMS NEVER WEAR OUT { BaseWeapon lvlBw = (BaseWeapon)item; lvlBw.HitPoints = lvlBw.MaxHitPoints; } else if (item is BaseShield && item is ILevelable) // SO ITEMS NEVER WEAR OUT { BaseShield lvlBs = (BaseShield)item; lvlBs.HitPoints = lvlBs.MaxHitPoints; } if (item != null && item is ILevelable) { CheckLevelable((ILevelable)item, killer, killed); } } } }
/// <summary> /// Applies a 25% chance to bash the attacker at <code>PerkLevel.Fourth</code> /// </summary> public void TryBash( BaseShield shield, BaseWeapon attackerWeapon ) { if( Level < PerkLevel.Fourth || !ShieldEquipped || attackerWeapon is BaseRanged ) return; if( Utility.RandomDouble() < 0.25 ) return; Mobile aggressor = Player.Combatant as Mobile; if( aggressor == null || !Player.CanBeHarmful(aggressor, false) ) return; int damage = (int)((shield.ArmorRating / 2.0) + shield.Weight); damage += (int)(Player.Str * 0.05); aggressor.Damage(damage, Player); aggressor.FixedEffect(0x37B9, 10, 16); aggressor.PlaySound(0x141); Player.SendMessage("You strike your opponent with your shield!"); Player.Emote("*Sheild-strike*"); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadEncodedInt(); m_RangedWeapon = reader.ReadItem() as BaseWeapon; m_MeleeWeapon = reader.ReadItem() as BaseWeapon; m_MeleeShield = reader.ReadItem() as BaseShield; }
protected override void OnTarget(Mobile from, object targeted) { int DestroyChance = Utility.Random(4); // we dont use += on mage armor (can raise magery over caps) 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."); } if (targeted is BaseWeapon) { BaseWeapon Weapon = targeted as BaseWeapon; { if (DestroyChance > 0) // Success { Weapon.WeaponAttributes.MageWeapon = 1; from.SendMessage("The Rune enhances your weapon."); from.PlaySound(0x1F5); m_MageArmorRune.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_MageArmorRune.Delete(); } } } else if (targeted is BaseArmor) { BaseArmor Armor = targeted as BaseArmor; { if (DestroyChance > 0) // Success { Armor.ArmorAttributes.MageArmor = 1; from.SendMessage("The Rune enhances your armor."); from.PlaySound(0x1F5); m_MageArmorRune.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_MageArmorRune.Delete(); } } } else if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; { if (DestroyChance > 0) // Success { Shield.ArmorAttributes.MageArmor = 1; from.SendMessage("The Rune enhances your shield."); from.PlaySound(0x1F5); m_MageArmorRune.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_MageArmorRune.Delete(); } } } else if (targeted is BaseClothing) { BaseClothing Clothing = targeted as BaseClothing; { if (DestroyChance > 0) // Success { Clothing.ClothingAttributes.MageArmor = 1; from.SendMessage("The Rune enhances your clothing."); from.PlaySound(0x1F5); m_MageArmorRune.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_MageArmorRune.Delete(); } } } } else { from.SendMessage("You cannot enhance that."); } }
public DreadLord() : base( AIType.AI_RangedMelee, FightMode.Closest, 10, 1, 0.1, 0.1 ) { Body = 0x190; Name = NameList.RandomName( "male" ); SpeechHue = Utility.RandomDyedHue(); Title = "the dread lord"; Hue = Utility.RandomSkinHue(); Utility.AssignRandomHair( this, true ); if ( Utility.RandomBool() ) Utility.AssignRandomFacialHair( this, HairHue ); SetSkill( SkillName.Swords, 120.0 ); SetSkill( SkillName.Macing, 120.0 ); SetSkill( SkillName.Tactics, 120.0 ); SetSkill( SkillName.MagicResist, 100.0 ); SetSkill( SkillName.Parry, 120.0 ); SetSkill( SkillName.Wrestling, 120.0 ); SetSkill( SkillName.Archery, 120.0 ); SetSkill( SkillName.Anatomy, 120.0 ); Fame = 9000; Karma = -9000; SetStr( 650, 700 ); SetDex( 120, 135 ); SetInt( 48, 50 ); SetHits( 690, 750 ); SetDamage( 20, 25 ); VirtualArmor = 100; AddItem( NotCorpseCont( Immovable(new RoyalPlateChest()) ) ); AddItem( NotCorpseCont( Immovable(new RoyalPlateArms()) ) ); AddItem( NotCorpseCont( Immovable(new RoyalPlateHelm()) ) ); AddItem( NotCorpseCont( Immovable(new RoyalPlateGloves()) ) ); AddItem( NotCorpseCont( Immovable(new RoyalPlateLegs()) ) ); AddItem( NotCorpseCont( Immovable(new RoyalPlateGorget()) ) ); AddItem( NotCorpseCont( Immovable(new RoyalPlateBoots()) ) ); m_RangedWeapon = (BaseWeapon)Resourced( new HeavyCrossbow(), CraftResource.Bronze ); AddItem( Identify( NotCorpseCont( m_RangedWeapon ) ) ); if ( 0.75 > Utility.RandomDouble() ) m_MeleeWeapon = new OrnateWarAxe(); else { m_MeleeWeapon = new RadiantWarSword(); m_MeleeShield = new RoyalShield(); PackItem( NotCorpseCont( m_MeleeShield ) ); } PackItem( NotCorpseCont( m_MeleeWeapon ) ); AddItem( new BodySash( 1636 ) ); AddItem( NotCorpseCont( new RoyalCloak() ) ); //PackItem( new Gold( Utility.Random( 300, 500 ) ) ); PackItem( new Bolt( 50 ) ); }
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, clothing, jewelry and shields."); 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 BaseClothing || targeted is BaseJewel || targeted is BaseShield) { BaseArmor a = targeted as BaseArmor; BaseClothing c = targeted as BaseClothing; BaseJewel j = targeted as BaseJewel; BaseShield s = targeted as BaseShield; if (a != null) { if (a.PoisonBonus != 0) { a.PoisonBonus = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { a.PoisonBonus = 1; from.SendMessage("Glow from gem was transfered to item, gem vanished into thin air"); } } else if (c != null) { if (c.Resistances.Poison != 0) { c.Resistances.Poison = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { c.Resistances.Poison = 1; from.SendMessage("Glow from gem was transfered to item, gem vanished into thin air"); } } else if (j != null) { if (j.Resistances.Poison != 0) { j.Resistances.Poison = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { j.Resistances.Poison = 2; from.SendMessage("Glow from gem was transfered to item, gem vanished into thin air"); } } else if (s != null) { if (s.PoisonBonus != 0) { s.PoisonBonus = 0; from.SendMessage("Gem absorbed items glow, and disintegrated with bright flash"); } else { s.PoisonBonus = 5; from.SendMessage("Glow from gem was transfered to item, gem vanished 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"); } }
private void ApplyShieldSpecificAttributesTo( BaseShield shield ) { shield.Attributes.ReflectPhysical += ShieldReflectDamage; shield.Attributes.SpellChanneling += ShieldSpellChanneling; shield.Attributes.CastSpeed += ShieldFasterCasting; shield.PhysicalBonus += ShieldPhysicalResist; shield.FireBonus += ShieldFireResist; shield.ColdBonus += ShieldColdResist; shield.PoisonBonus += ShieldPoisonResist; shield.EnergyBonus += ShieldEnergyResist; }
protected override void OnTarget(Mobile from, object targeted) { int scalar; double mageSkill = from.Skills[SkillName.Inscribe].Value; if (mageSkill >= 100.0) { scalar = 3; } else if (mageSkill >= 90.0) { scalar = 2; } else { scalar = 1; } if (targeted is BaseWeapon) { BaseWeapon Weapon = targeted as BaseWeapon; if (!from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage("You cannot enhance that in it's current location."); } else { int DestroyChance = Utility.Random(5); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; Weapon.WeaponAttributes.DurabilityBonus += augmentper; from.SendMessage("The Aglo Rune enhances your weapon."); from.PlaySound(0x1F5); m_AgloRune.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_AgloRune.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.ArmorAttributes.DurabilityBonus += augmentper; from.SendMessage("The Aglo Rune enhances your armor."); from.PlaySound(0x1F5); m_AgloRune.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_AgloRune.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.ArmorAttributes.DurabilityBonus += augmentper; from.SendMessage("The shield supports when the warrior leans upon it."); from.PlaySound(0x1F5); m_AgloRune.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_AgloRune.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; int augmentper = ((Utility.Random(5)) * scalar) + 5; Clothing.ClothingAttributes.DurabilityBonus += augmentper; from.SendMessage("Meditation is easier when one is comfortable."); from.PlaySound(0x1F5); m_AgloRune.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_AgloRune.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.BonusInt += augment; from.SendMessage( "The Aglo Rune enhances your jewelry." ); //from.PlaySound( 0x1F5 ); //m_AgloRune.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_AgloRune.Delete(); //} //} //} //else //{ from.SendMessage("You cannot enhance that."); } }
public static bool isEscudoPequeno(BaseShield escudo) { if(escudo is Buckler || escudo is WoodenShield) { return true; } return false; }
public static bool temTalentoParaEquiparEscudo(Jogador jogador, BaseShield escudo) { SistemaTalento sistemaTalento = jogador.getSistemaTalento(); /* if(isEscudoPequeno(escudo) && sistemaTalento.possuiTalento(IdHabilidadeTalento.escudoPequeno)) { return true; } else if(isEscudoMedio(escudo) && sistemaTalento.possuiTalento(IDTalento.escudoMedio)) { return true; } else if(isEscudoGrande(escudo) && sistemaTalento.possuiTalento(IDTalento.escudoGrande)) { return true; } */ return false; }
public static bool isEscudoGrande(BaseShield escudo) { if(escudo is HeaterShield || escudo is MetalKiteShield || escudo is WoodenKiteShield) { return true; } return false; }
public static bool isEscudoMedio(BaseShield escudo) { if(escudo is BronzeShield || escudo is MetalShield || escudo is ChaosShield || escudo is OrderShield) { return true; } return false; }
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."); } }
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 ShieldBashTarget(int ar, object sh) : base(1, false, TargetFlags.Harmful) { CheckLOS = true; m_ar = ar; shield = (BaseShield)sh; }
protected override void OnTarget(Mobile from, object target) { if (m_HuePlating.Deleted || m_HuePlating.RootParent != from) { if (from == null) { return; } } CraftResourceInfo resourceInfo = CraftResources.GetInfo(m_HuePlating.ResourceType); if (target is Item) { Item item = target as Item; if (!item.IsChildOf(from.Backpack)) { from.SendMessage("You must target a metal-based weapon or armor in your backpack."); return; } if (item is BaseWeapon || item is BaseArmor) { if (item.Aspect != AspectEnum.None) { from.SendMessage("Aspect armor may not be hued with this item."); return; } if (item.LootType == LootType.Newbied || item.LootType == LootType.Blessed) { from.SendMessage("Newbied or blessed items may not be hued with this item."); return; } if (item is BaseWeapon) { BaseWeapon weapon = item as BaseWeapon; if (weapon is BaseStaff || weapon is BaseRanged || weapon is Club) { from.SendMessage("Only metal-based weapons may be hued with this item."); return; } } if (item is BaseArmor) { BaseArmor armor = item as BaseArmor; if (!(armor.MaterialType == ArmorMaterialType.Ringmail || armor.MaterialType == ArmorMaterialType.Chainmail || armor.MaterialType == ArmorMaterialType.Plate)) { from.SendMessage("Only metal-based armor may be hued with this item."); return; } } if (item is BaseShield) { BaseShield shield = item as BaseShield; if (shield is WoodenShield) { from.SendMessage("Only metal-based shields may be hued with this item."); return; } } if (item.Hue == resourceInfo.Hue) { from.SendMessage("That item is already that hue."); return; } else { item.Hue = resourceInfo.Hue; from.PlaySound(0x23E); from.SendMessage("You alter the hue of the item."); m_HuePlating.Delete(); } } else { from.SendMessage("You must target a metal-based weapon or piece or armor in your backpack."); return; } } else { from.SendMessage("You must target a metal-based weapon or piece or armor in your backpack."); return; } }
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); }
protected override void OnTarget(Mobile from, object targeted) { if (targeted is BaseWeapon) { BaseWeapon Weapon = targeted as BaseWeapon; if (!from.InRange(m_Augmentation.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage(38, "You cannot enhance that in it's current location."); } else if (Weapon.Type == WeaponType.Ranged) { if (from.Skills[SkillName.Fletching].Base < 120.0) { from.SendMessage(38, "Only a Legendary Fletcher can enhance ranged weapons."); } else if (Weapon.UsedSockets >= Weapon.MaxSockets) { from.SendMessage(38, "That weapon is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Weapon.UsedSockets += 1; Weapon.WeaponAttributes.HitColdArea += 20; Weapon.Hue = 5; Weapon.AugmentList = Weapon.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the weapon!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Weapon not destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the weapon in the process!"); Weapon.MaxHitPoints -= 3; Weapon.HitPoints -= 3; } else // Weapon is destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "You have damaged the weapon in the process,"); from.SendMessage(38, "the weapon is damaged beyond repair and crumbles in your hand!"); Weapon.Delete(); } m_Augmentation.Delete(); } } } else if (Weapon.Type == WeaponType.Polearm || Weapon.Type == WeaponType.Piercing || Weapon.Type == WeaponType.Staff || Weapon.Type == WeaponType.Slashing || Weapon.Type == WeaponType.Bashing || Weapon.Type == WeaponType.Axe) { if (from.Skills[SkillName.Blacksmith].Base < 120.0) { from.SendMessage(38, "Only a Legendary Blacksmith can enhance items."); } else if (Weapon.UsedSockets >= Weapon.MaxSockets) { from.SendMessage(38, "That weapon is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Weapon.UsedSockets += 1; Weapon.WeaponAttributes.HitColdArea += 20; Weapon.Hue = 5; Weapon.AugmentList = Weapon.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the weapon!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Weapon not destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the weapon in the process!"); Weapon.MaxHitPoints -= 3; Weapon.HitPoints -= 3; } else // Weapon is destroyed { from.SendMessage(38, "You have failed to enhance the weapon!"); from.SendMessage(38, "You have damaged the weapon in the process,"); from.SendMessage(38, "the weapon is damaged beyond repair and crumbles in your hand!"); Weapon.Delete(); } m_Augmentation.Delete(); } } } } if (targeted is BaseArmor) { BaseArmor Armor = targeted as BaseArmor; if (!from.InRange(m_Augmentation.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage(38, "You cannot enhance that in it's current location."); } else if (Armor.BodyPosition == ArmorBodyType.Gorget || Armor.BodyPosition == ArmorBodyType.Gloves || Armor.BodyPosition == ArmorBodyType.Helmet || Armor.BodyPosition == ArmorBodyType.Arms || Armor.BodyPosition == ArmorBodyType.Legs || Armor.BodyPosition == ArmorBodyType.Chest) { if (Armor.MaterialType == ArmorMaterialType.Plate || Armor.MaterialType == ArmorMaterialType.Chainmail || Armor.MaterialType == ArmorMaterialType.Ringmail) { if (from.Skills[SkillName.Blacksmith].Base < 120.0) { from.SendMessage(38, "Only a Legendary Blacksmith can enhance this type of armor."); } else if (Armor.UsedSockets >= Armor.MaxSockets) { from.SendMessage(38, "That armor is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Armor.UsedSockets += 1; Armor.Attributes.BonusMana += 3; Armor.Hue = 5; Armor.AugmentList = Armor.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the armor!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Armor not destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the armor in the process!"); Armor.MaxHitPoints -= 3; Armor.HitPoints -= 3; } else // Armor is destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "You have damaged the armor in the process,"); from.SendMessage(38, "the armor is damaged beyond repair and crumbles in your hand!"); Armor.Delete(); } m_Augmentation.Delete(); } } } else { if (from.Skills[SkillName.Tailoring].Base < 120.0) { from.SendMessage(38, "Only a Legendary Tailor can enhance this type of Armor."); } else if (Armor.UsedSockets >= Armor.MaxSockets) { from.SendMessage(38, "That armor is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Armor.UsedSockets += 1; Armor.Attributes.BonusMana += 3; Armor.Hue = 5; Armor.AugmentList = Armor.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the armor!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Armor not destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the armor in the process!"); Armor.MaxHitPoints -= 3; Armor.HitPoints -= 3; } else // Armor is destroyed { from.SendMessage(38, "You have failed to enhance the armor!"); from.SendMessage(38, "You have damaged the armor in the process,"); from.SendMessage(38, "the armor is damaged beyond repair and crumbles in your hand!"); Armor.Delete(); } m_Augmentation.Delete(); } } } } } if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; if (!from.InRange(m_Augmentation.GetWorldLocation(), 1) || !from.InRange(((Item)targeted).GetWorldLocation(), 1)) { from.SendLocalizedMessage(500446); // That is too far away. } else if ((((Item)targeted).Parent != null) && (((Item)targeted).Parent is Mobile)) { from.SendMessage(38, "You cannot enhance that in it's current location."); } else if (Shield.MaterialType == ArmorMaterialType.Plate) { if (from.Skills[SkillName.Blacksmith].Base < 120.0) { from.SendMessage(38, "Only a Legendary Blacksmith can enhance items."); } else if (Shield.UsedSockets >= Shield.MaxSockets) { from.SendMessage(38, "That shield is already enhanced to its limits!"); } else { int EnhanceChance = Utility.Random(20); if (EnhanceChance == 19) { EnhanceChance = 1; } else { EnhanceChance = 0; } int DestroyChance = Utility.Random(100); if (DestroyChance == 99) { DestroyChance = 1; } else { DestroyChance = 0; } if (EnhanceChance == 0) // Success { Shield.UsedSockets += 1; Shield.ColdBonus += 6; Shield.Hue = 5; Shield.AugmentList = Shield.AugmentList + "\n" + m_Augmentation.Name; from.PlaySound(0x2A); // Anvil from.SendMessage(55, "You have successfully enhanced the shield!"); m_Augmentation.Delete(); } else // Fail { if (DestroyChance == 0) // Shield not destroyed { from.SendMessage(38, "You have failed to enhance the shield!"); from.SendMessage(38, "The augmentation crumbles in your hand,"); from.SendMessage(38, "you have damaged the shield!"); Shield.MaxHitPoints -= 3; Shield.HitPoints -= 3; } else // Shield is destroyed { from.SendMessage(38, "You have failed to enhance the shield!"); from.SendMessage(38, "You have cracked the shield in the process,"); from.SendMessage(38, "the shield is damaged beyond repair and crumbles in your hand!"); Shield.Delete(); } m_Augmentation.Delete(); } } } } }
protected override void OnTarget(Mobile from, object targeted) { int DestroyChance = Utility.Random(3); // 3 chance 0 1 2 if rolls 0 then fail // most other runes will have a random 0 - x increase + 1 (no 0) here this is a true or false // rune so dont needa random stat bonus just set to 1 int NewNameHere = Utility.Random(4); // you could define a new interger here above the tree like this // then call it later, goto line 116 for example 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.SpellChanneling = 1; from.SendMessage("The Rune enhances your weapon."); from.PlaySound(0x1F5); m_SpellChannelRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the weapon!"); m_SpellChannelRune.Delete(); from.PlaySound(42); if (NewNameHere < 1) // this is the random interger we made, for a seperate success chance to determine { // if the item to break with the rune or not. see line 139 for example without. from.SendMessage("The weapon is damaged beyond repair!"); Weapon.Delete(); } else { from.SendMessage("The rune crumbles in the attempt, but the weapon survives."); } } } } else if (targeted is BaseShield) { BaseShield Shield = targeted as BaseShield; { if (DestroyChance > 0) // Success { Shield.Attributes.SpellChanneling = 1; from.SendMessage("The Rune enhances your shield."); from.PlaySound(0x1F5); m_SpellChannelRune.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the shield!"); from.SendMessage("The shield is damaged beyond repair!"); // see how this "fail" is structered it will always from.PlaySound(42); // break the item if you fail the rune to change Shield.Delete(); // do what i did above. for Each Layer Defined. m_SpellChannelRune.Delete(); } } } } else // if not a item or slot we approved (mobile crash) this says nope nope nope { from.SendMessage("You cannot enhance that."); } }
public static void ApplyAttribute( Mobile from, BookOfSpellCrafts book, int craftId, BaseShield shield, AosAttribute attribute, int minimum, int maximum, int scale ) { CheckItem( from, shield, ( shield.Attributes[ attribute ] == 0 ) ); UseMagicJewels( from, book, shield, SpellCraftConfig.MagicJewelRequirements[craftId] ); int scalar = ComputeSkillScalar( from ); ApplyAttribute( shield.Attributes, SpellCraftConfig.MinimumIntensity * scalar, SpellCraftConfig.MaximumIntensity * scalar, attribute, minimum, maximum, scale ); MarkArmor( from, shield ); }
public DreadGuard() : base( AIType.AI_RangedMelee, FightMode.Closest, 10, 1, 0.1, 0.1 ) { Body = 0x190; Name = NameList.RandomName( "male" ); SpeechHue = Utility.RandomDyedHue(); Title = "the dread guard"; Hue = Utility.RandomSkinHue(); Utility.AssignRandomHair( this, true ); if ( Utility.RandomBool() ) Utility.AssignRandomFacialHair( this, HairHue ); SetSkill( SkillName.Swords, 100.0 ); SetSkill( SkillName.Macing, 100.0 ); SetSkill( SkillName.Tactics, 100.0 ); SetSkill( SkillName.MagicResist, 85.0, 90.0 ); SetSkill( SkillName.Parry, 100.0, 120.0 ); SetSkill( SkillName.Wrestling, 120.0 ); SetSkill( SkillName.Archery, 120.0 ); SetSkill( SkillName.Anatomy, 120.0 ); Fame = 9000; Karma = -9000; SetStr( 425, 500 ); SetDex( 120, 135 ); SetInt( 48, 50 ); SetHits( 650, 700 ); SetDamage( 16, 19 ); VirtualArmor = 15; AddItem( Identify( Rehued( new PlateChest(), 2407 ) ) ); AddItem( Identify( Rehued( new PlateArms(), 2407 ) ) ); AddItem( Identify( Rehued( new PlateHelm(), 2407 ) ) ); AddItem( Identify( Rehued( new PlateGloves(), 2407 ) ) ); AddItem( Identify( Rehued( new PlateLegs(), 2407 ) ) ); AddItem( Identify( Rehued( new PlateGorget(), 2407 ) ) ); m_RangedWeapon = new Crossbow(); AddItem( Identify( NotCorpseCont( Resourced( m_RangedWeapon, CraftResource.Bronze ) ) ) ); if ( 0.75 > Utility.RandomDouble() ) m_MeleeWeapon = new ExecutionersAxe(); else { m_MeleeWeapon = new Longsword(); m_MeleeShield = new HeaterShield(); PackItem( Identify( Rehued( m_MeleeShield, 2407 ) ) ); } PackItem( Identify( Rehued( m_MeleeWeapon, 2407 ) ) ); AddItem( new BodySash( 1636 ) ); AddItem( new Cloak( 1636 ) ); //PackItem( new Gold( Utility.Random( 150, 200 ) ) ); PackItem( new Bolt( 50 ) ); }
protected override void OnTarget(Mobile from, object targeted) { int scalar; double mageSkill = from.Skills[SkillName.Magery].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(10); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; switch (Utility.Random(9)) { case 0: Weapon.Attributes.AttackChance += augmentper; from.SendMessage("A true weapon strikes true wounds."); break; case 1: Weapon.Attributes.BonusMana += augment; from.SendMessage("The spirit rises within."); break; case 2: Weapon.Attributes.WeaponDamage += augmentper; from.SendMessage("A warrior is only as good as his best weapon."); break; case 3: Weapon.Attributes.SpellChanneling = 1; from.SendMessage("The mage's best ally."); break; case 4: Weapon.WeaponAttributes.HitDispel += augmentper; from.SendMessage("The bane of demons, the unsummoner."); break; case 5: Weapon.WeaponAttributes.HitFireball += augmentper; from.SendMessage("What the blade leaves alive, the fire purifies."); break; case 6: Weapon.WeaponAttributes.HitHarm += augmentper; from.SendMessage("Sometimes the sting can be worse."); break; case 7: Weapon.WeaponAttributes.HitLightning += augmentper; from.SendMessage("The power of the storm is called to strike."); break; case 8: Weapon.Attributes.WeaponSpeed += augmentper; from.SendMessage("What can beat speed but more speed?"); break; } from.PlaySound(0x1F5); m_RuneStone.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the weapon!"); from.SendMessage("The weapon is damaged beyond repair!"); from.PlaySound(0x1F8); Weapon.Delete(); m_RuneStone.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(10); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; switch (Utility.Random(12)) { case 0: Armor.Attributes.BonusHits += augment; from.SendMessage("Even pierced, the armor protects."); break; case 1: Armor.Attributes.NightSight = 1; from.SendMessage("In the darkest night, your path can be seen."); break; case 2: Armor.Attributes.Luck += augment; from.SendMessage("The unluckiest always get the biggest breaks."); break; case 3: Armor.Attributes.LowerManaCost += augment; from.SendMessage("The power of the spirit can be harnessed by metal."); break; case 4: Armor.ArmorAttributes.DurabilityBonus += augmentper; from.SendMessage("Metal lasts longer than flesh."); break; case 5: Armor.ArmorAttributes.MageArmor = 1; from.SendMessage("Channels of magic aren't held back."); break; case 6: Armor.ArmorAttributes.SelfRepair += augment; from.SendMessage("The weapon that strikes mends the metal."); break; case 7: Armor.PhysicalBonus += augment; from.SendMessage("Armor focus renews."); break; case 8: Armor.FireBonus += augment; from.SendMessage("Armor focus renews."); break; case 9: Armor.ColdBonus += augment; from.SendMessage("Armor focus renews."); break; case 10: Armor.PoisonBonus += augment; from.SendMessage("Armor focus renews."); break; case 11: Armor.EnergyBonus += augment; from.SendMessage("Armor focus renews."); break; } from.PlaySound(0x1F5); m_RuneStone.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the armor!"); from.SendMessage("The armor is damaged beyond repair!"); from.PlaySound(0x1F8); Armor.Delete(); m_RuneStone.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(10); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; int augmentper = ((Utility.Random(5)) * scalar) + 5; switch (Utility.Random(12)) { case 0: Shield.Attributes.BonusStam += augment; from.SendMessage("Sometimes the warrior's best friend is his shield."); break; case 1: Shield.Attributes.DefendChance += augment; from.SendMessage("The shield's purpose is to defend."); break; case 2: Shield.Attributes.ReflectPhysical += augment; from.SendMessage("Turn the attack against the attacker."); break; case 3: Shield.Attributes.SpellChanneling = 1; from.SendMessage("Sometimes even mages carry shields."); break; case 4: Shield.Attributes.CastRecovery += augment; from.SendMessage("The shield supports when the warrior leans upon it."); break; case 5: Shield.ArmorAttributes.SelfRepair += augment; from.SendMessage("The sword mends, the mace fixes."); break; case 6: Shield.ArmorAttributes.DurabilityBonus += augmentper; from.SendMessage("Time cannot rust a trusted companion."); break; case 7: Shield.PhysicalBonus += augment; from.SendMessage("Armor focus renews."); break; case 8: Shield.FireBonus += augment; from.SendMessage("Armor focus renews."); break; case 9: Shield.ColdBonus += augment; from.SendMessage("Armor focus renews."); break; case 10: Shield.PoisonBonus += augment; from.SendMessage("Armor focus renews."); break; case 11: Shield.EnergyBonus += augment; from.SendMessage("Armor focus renews."); break; } from.PlaySound(0x1F5); m_RuneStone.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the shield!"); from.SendMessage("The shield is damaged beyond repair!"); from.PlaySound(0x1F8); Shield.Delete(); m_RuneStone.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(10); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; switch (Utility.Random(9)) { case 0: Clothing.Attributes.RegenHits += augment; from.SendMessage("Sturdy clothes help everyone."); break; case 1: Clothing.Attributes.RegenStam += augment; from.SendMessage("Light clothes mean less of a burden."); break; case 2: Clothing.Attributes.RegenMana += augment; from.SendMessage("Meditation is easier when one is comfortable."); break; case 3: Clothing.Attributes.Luck += augment; from.SendMessage("Everyone should have at least one lucky piece of clothing."); break; case 4: Clothing.Resistances.Physical += augment; from.SendMessage("Cotton or flax, it is now stronger."); break; case 5: Clothing.Resistances.Fire += augment; from.SendMessage("Cotton or flax, it is now stronger."); break; case 6: Clothing.Resistances.Cold += augment; from.SendMessage("Cotton or flax, it is now stronger."); break; case 7: Clothing.Resistances.Poison += augment; from.SendMessage("Cotton or flax, it is now stronger."); break; case 8: Clothing.Resistances.Energy += augment; from.SendMessage("Cotton or flax, it is now stronger."); break; } from.PlaySound(0x1F5); m_RuneStone.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the clothing!"); from.SendMessage("The clothing is damaged beyond repair!"); from.PlaySound(0x1F8); Clothing.Delete(); m_RuneStone.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(10); if (DestroyChance > 0) // Success { int augment = ((Utility.Random(3)) * scalar) + 1; switch (Utility.Random(16)) { case 0: Jewel.Attributes.BonusDex += augment; from.SendMessage("The light of the gem speeds the wearer's feet."); break; case 1: Jewel.Attributes.BonusInt += augment; from.SendMessage("The spirit of the gem helps concentration."); break; case 2: Jewel.Attributes.BonusStr += augment; from.SendMessage("The strength of the gem resonates in the muscles."); break; case 3: Jewel.Attributes.Luck += augment; from.SendMessage("Gifts will rain while the gem is worn."); break; case 4: Jewel.Attributes.SpellDamage += augment; from.SendMessage("Mana focuses into a stronger form."); break; case 5: Jewel.Attributes.NightSight = 1; from.SendMessage("The gem lights the way."); break; case 6: Jewel.Resistances.Physical += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break; case 7: Jewel.Resistances.Fire += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break; case 8: Jewel.Resistances.Cold += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break; case 9: Jewel.Resistances.Poison += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break; case 10: Jewel.Resistances.Energy += augment; from.SendMessage("The fortitude of the gem grows even stronger."); break; case 11: Jewel.Attributes.AttackChance += augment; from.SendMessage("The gem glows a deep red."); break; case 12: Jewel.Attributes.DefendChance += augment; from.SendMessage("The gem glows a faint yellow."); break; case 13: Jewel.Attributes.LowerManaCost += augment; from.SendMessage("The gem glows an undulating blue."); break; case 14: Jewel.Attributes.ReflectPhysical += augment; from.SendMessage("The gem glows a bright orange."); break; case 15: Jewel.Attributes.WeaponSpeed += augment; from.SendMessage("The gem glows an eery green."); break; } from.PlaySound(0x1F5); m_RuneStone.Delete(); } else // Fail { from.SendMessage("You have failed to enhance the jewelery!"); from.SendMessage("The jewelery is damaged beyond repair!"); from.PlaySound(0x1F8); Jewel.Delete(); m_RuneStone.Delete(); } } } else { from.SendMessage("You can not enhance that."); } }
public static void AdjustFastCast( BaseShield shield ) { AdjustFastCast( shield.Attributes ); }