Okay, so my New Sorcery spell book must remain open for my players to cast the new spells. When they logout or die the spellbook closes automatically. Is there a way to either:
{*The below code was not coded by me only edited by me.}
- Make the spell-book so that it never closes unless the player double clicks it.
- or, Make the spell-book re-open upon death and login if its in their pack.
{*The below code was not coded by me only edited by me.}
Code:
using System;
using Server.Items;
using System.Collections.Generic;
using Server;
using Server.Commands;
using Server.Engines.Craft;
using Server.Network;
using Server.Spells;
using Server.Targeting;
namespace Server.ACC.CSS.Systems.Druid
{
public class DruidSpellbook : CSpellbook
{
public override School School{ get{ return School.Druid; } }
[Constructable]
public DruidSpellbook() : this( (ulong)0, CSSettings.FullSpellbooks )
{
Hue = 1917;
}
[Constructable]
public DruidSpellbook( bool full ) : this( (ulong)0, full )
{
Hue = 1917;
}
[Constructable]
public DruidSpellbook( ulong content, bool full ) : base( content, 0xEFA, full )
{
Hue = 1917;
Name = "Manual of Sorcery";
}
public override void OnDoubleClick( Mobile from )
{
if ( from.AccessLevel == AccessLevel.Player )
{
Container pack = from.Backpack;
if( !(Parent == from || (pack != null && Parent == pack)) )
{
from.SendMessage( "The spellbook must be in your backpack [and not in a container within] to open." );
return;
}
else if( SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions( from, this.School ) )
{
return;
}
}
//from.CloseGump( typeof( DruidSpellbookGump ) );
from.SendGump( new DruidSpellbookGump( this ) );
}
public DruidSpellbook( 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();
}
}
}