using System; using Server.Network; using Server.Items; using Server.Mobiles; namespace Server.Items { [FlipableAttribute( 0xDF1, 0xDF0 )] public class StaffOfDaemonSummoning : BaseStaff { public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.WhirlwindAttack; } } public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ParalyzingBlow; } } public override int InitMinHits{ get{ return 255; } } public override int InitMaxHits{ get{ return 255; } } public override int AosStrengthReq{ get{ return 25; } } public override int AosMinDamage{ get{ return 13; } } public override int AosMaxDamage{ get{ return 16; } } public override int AosSpeed{ get{ return 39; } } public override int OldStrengthReq{ get{ return 25; } } public override int OldMinDamage{ get{ return 8; } } public override int OldMaxDamage{ get{ return 33; } } public override int OldSpeed{ get{ return 35; } } private int fModDiv = 75; [Constructable] public StaffOfDaemonSummoning() : base( 0xDF1 ) { Hue = 2599; Name = "staff of Daemon summoning"; Weight = 5.0; Attributes.SpellChanneling = 1; } 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.Anatomy].Value >= 90 ) { BaseCreature.Summon(new ChaosDaemon(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.Anatomy].Value * 3) ); from.Mana -=15; c.Delete(); eable.Free(); return; } if( from.Skills[SkillName.Anatomy].Value >= 50 ) { BaseCreature.Summon(new Balron(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.Anatomy].Value * 3) ); from.Mana -= 12; c.Delete(); eable.Free(); return; } BaseCreature.Summon(new Daemon(),from,c.Location, 0x48D, TimeSpan.FromSeconds(from.Skills[SkillName.Anatomy].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 bool OnEquip( Mobile from ) { if( from.Skills[SkillName.Anatomy].Value >= 10 ) { double fMod = (from.Skills[SkillName.Anatomy].Value + from.Skills[SkillName.Anatomy].Value) / fModDiv ; from.FollowersMax += (int)fMod; } base.OnEquip(from); return true; } public override void OnRemoved( object o ) { if( o is Mobile) { if( ((Mobile)o).Skills[SkillName.Anatomy].Value >= 10 ) { double fMod = (((Mobile)o).Skills[SkillName.Anatomy].Value + ((Mobile)o).Skills[SkillName.Anatomy].Value) / fModDiv ; ((Mobile)o).FollowersMax -= (int)fMod; } } base.OnRemoved( o ); } public StaffOfDaemonSummoning( Serial serial ) : base( serial ) { } public override void Serialize( GenericWriter writer ) { base.Serialize( writer ); writer.Write( (int) 0 ); // version } public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); } } } // created on 10/17/2003 at 9:07 PM