hey dont bother with a spell book, here use what i am using.. i made this item so players can only use the spells if they had this rare item.
i just quickly smashed it in with some other scripts so its not all that clean but it works ;0)
[code:1]
using System;
using Server.Network;
using System.Collections;
using Server.Mobiles;
using Server.Gumps;
using Server.Targeting;
using Server.Items;
using Server.Prompts;
namespace Server.Items
{
[FlipableAttribute( 0x13F9, 0x13F8 )]
public class ClericStaff : BaseStaff
{
public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.WhirlwindAttack; } }
public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.ArmorIgnore; } }
public override int AosIntelligenceReq{ get{ return 30;} }
public override int AosDexterityReq{ get{ return 30;} }
public override int AosStrengthReq{ get{ return 20; } }
public override int AosMinDamage{ get{ return 12; } }
public override int AosMaxDamage{ get{ return 20; } }
public override int AosSpeed{ get{ return 39; } }
public override int OldStrengthReq{ get{ return 35; } }
public override int OldMinDamage{ get{ return 8; } }
public override int OldMaxDamage{ get{ return 33; } }
public override int OldSpeed{ get{ return 35; } }
[Constructable]
public ClericStaff() : base( 0x13F8 )
{
Name = "Cleric Staff";
Hue = 1150;
WeaponAttributes.HitLeechMana = 10;
Attributes.WeaponDamage = 30;
Attributes.SpellChanneling = 1;
Consecrated = true;
Attributes.CastSpeed = 2;
Attributes.Luck = 50;
Attributes.CastRecovery = 2;
Attributes.AttackChance = 25;
Attributes.DefendChance = 25;
}
public override void GetDamageTypes( out int phys, out int fire, out int cold, out int pois, out int nrgy )
{
phys = 20;
nrgy = 40;
pois = 0;
fire = 20;
cold = 20;
}
public SkillMod m_SkillMod0;
public override bool OnEquip( Mobile from )
{
m_SkillMod0 = new DefaultSkillMod( SkillName.SpiritSpeak, true, 15 );
from.AddSkillMod( m_SkillMod0 );
Mobile m = (Mobile)from;
string modName = this.Serial.ToString();
m.AddStatMod( new StatMod( StatType.Int, modName + "Int", 10, TimeSpan.Zero ) );
return base.OnEquip( from );
}
public override void OnRemoved( object parent )
{
if ( m_SkillMod0 != null )
{
m_SkillMod0.Remove();
m_SkillMod0 = null;
}
if ( parent is Mobile )
{
Mobile m = (Mobile) parent;
string modName = this.Serial.ToString();
m.RemoveStatMod( modName + "Int" );
}
base.OnRemoved( parent );
}
public override void OnDoubleClick( Mobile from )
{
if ( Parent != from )
{
from.SendMessage( "You must equip this item to use it.."
;
}
else
{
from.CloseGump( typeof ( ClericGump ) );
from.SendGump( new ClericGump( from ) );
}
}
public ClericStaff( 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();
}
}
}
[/code:1]