using System; using Server.Network; using Server.Items; using Server.Targeting; using Server.Mobiles; namespace Server.Items { [FlipableAttribute( 0xE81, 0xE82 )] public class CrookOfAnimalMastery : BaseStaff { public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.CrushingBlow; } } public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.Disarm; } } public override int AosStrengthReq{ get{ return 20; } } public override int AosMinDamage{ get{ return 5; } } public override int AosMaxDamage{ get{ return 10; } } public override int AosSpeed{ get{ return 10; } } public override int OldStrengthReq{ get{ return 10; } } public override int OldMinDamage{ get{ return 3; } } public override int OldMaxDamage{ get{ return 12; } } public override int OldSpeed{ get{ return 30; } } public override int InitMinHits{ get{ return 255; } } public override int InitMaxHits{ get{ return 255; } } //public override int DefMaxRange{ get{return 10; } } private int fModDiv = 48; public SkillMod m_SkillMod0; public SkillMod m_SkillMod1; public SkillMod m_SkillMod2; public StatMod m_StatMod0; [Constructable] public CrookOfAnimalMastery() : base( 0xE81 ) { Name = "Crook Of Animal Mastery"; Weight = 4.0; Hue = 1153; Layer = Layer.OneHanded; DurabilityLevel = WeaponDurabilityLevel.Indestructible; LootType = LootType.Blessed; Attributes.RegenMana = 25; Attributes.RegenHits = 25; Attributes.RegenStam = 25; Attributes.SpellChanneling = 1; Attributes.CastRecovery = 10; Attributes.CastSpeed = 10; Attributes.LowerManaCost = 50; Attributes.SpellDamage = 50; WeaponAttributes.HitDispel = 80; WeaponAttributes.HitLeechHits = 80; WeaponAttributes.HitLeechMana = 80; WeaponAttributes.HitLeechStam = 80; } public override void OnDoubleClick( Mobile from ) { if ( Parent != from ) { from.SendMessage( "You must equip this item to use it." ); return; } if( from.Skills[SkillName.Necromancy].Value < 10 ) { from.SendMessage( "Your necromancy skill is not high enough to summon." ); return; } IPooledEnumerable eable = from.Map.GetItemsInRange(from.Location, 10 ) ; foreach( Item c in eable ) { if( c is Corpse) { Corpse corpse = (Corpse)c; if( !corpse.Owner.Player ) { if( from.Skills[SkillName.Necromancy].Value >= 90 ) { BaseCreature.Summon(new AncientWyrm(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.SpiritSpeak].Value * 3) ); from.Mana -=15; c.Delete(); eable.Free(); return; } if( from.Skills[SkillName.Necromancy].Value >= 50 ) { BaseCreature.Summon(new Dragon(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.SpiritSpeak].Value * 3) ); from.Mana -= 12; c.Delete(); eable.Free(); return; } BaseCreature.Summon(new Drake(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.SpiritSpeak].Value * 3) ); from.Mana -= 10; c.Delete(); eable.Free(); return; } } } from.SendMessage("You must be near a corpse to raise it"); eable.Free(); } public override void Deserialize(GenericReader reader) { base.Deserialize( reader ); int version = reader.ReadInt(); if ( Parent is Mobile ) { m_SkillMod0 = new DefaultSkillMod( SkillName.AnimalTaming, true, 40 ); ((Mobile)Parent).AddSkillMod( m_SkillMod0 ); m_SkillMod1 = new DefaultSkillMod( SkillName.AnimalLore, true, 40 ); ((Mobile)Parent).AddSkillMod( m_SkillMod1 ); m_SkillMod2 = new DefaultSkillMod( SkillName.Magery, true, 40 ); ((Mobile)Parent).AddSkillMod( m_SkillMod2 ); m_StatMod0 = new StatMod( StatType.Int, "Ranger", 40, TimeSpan.Zero ); ((Mobile)Parent).AddStatMod( m_StatMod0 ); } } public override bool OnEquip( Mobile from ) { m_SkillMod0 = new DefaultSkillMod( SkillName.AnimalTaming, true, 40 ); from.AddSkillMod( m_SkillMod0 ); m_SkillMod1 = new DefaultSkillMod( SkillName.AnimalLore, true, 40 ); from.AddSkillMod( m_SkillMod1 ); m_SkillMod2 = new DefaultSkillMod( SkillName.Magery, true, 40 ); from.AddSkillMod( m_SkillMod2 ); m_StatMod0 = new StatMod( StatType.Int, "Ranger", 40, TimeSpan.Zero ); from.AddStatMod( m_StatMod0 ); if( from.Skills[SkillName.Necromancy].Value >= 10 ) { double fMod = (from.Skills[SkillName.Necromancy].Value + from.Skills[SkillName.SpiritSpeak].Value) / fModDiv ; from.FollowersMax += (int)fMod; } return true; } public override void OnRemoved( object parent ) { if ( parent is Mobile ) { ((Mobile)parent).RemoveStatMod("Bane"); ((Mobile)parent).Mana = ((Mobile)parent).ManaMax; } if ( m_SkillMod0 != null ) { m_SkillMod0.Remove(); m_SkillMod0 = null; } if ( m_SkillMod1 != null ) { m_SkillMod1.Remove(); m_SkillMod1 = null; } if ( m_SkillMod2 != null ) { m_SkillMod2.Remove(); m_SkillMod2 = null; } if( parent is Mobile) { if( ((Mobile)parent).Skills[SkillName.Necromancy].Value >= 10 ) { double fMod = (((Mobile)parent).Skills[SkillName.Necromancy].Value + ((Mobile)parent).Skills[SkillName.SpiritSpeak].Value) / fModDiv ; ((Mobile)parent).FollowersMax -= (int)fMod; } base.OnRemoved( parent ); } } public CrookOfAnimalMastery( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } } }