Full Version : spell book ring
xmlspawner >>Scripting Support >>spell book ring


<< Prev | Next >>

ozzy- 01-17-2007
Im trying to see if i can get a ring to pull up a full spell book gump, without having a spellbook in your bag and work.Here is the script piece i have so far.

CODE

using System;
using Server;
//using Server.Network;
//using Server.Spells;
using Server.Mobiles;
using Server.Items;
//using System.Collections;
//using Server.Targeting;
//using Server.Scripts.Commands;
using Server.EventHandler;

namespace Server.Items
{
 public enum RingbookType
{
       Invalid = -1,
 Regular,  
}
public class OzzysMysteryBookRing : BaseArmor
{

    public override int BasePhysicalResistance{ get{ return 20; } }
    public override int BaseFireResistance{ get{ return 20; } }
    public override int BaseColdResistance{ get{ return 20; } }
    public override int BasePoisonResistance{ get{ return 20; } }
    public override int BaseEnergyResistance{ get{ return 20; } }
 
 public override ArmorMaterialType MaterialType{ get{ return ArmorMaterialType.Cloth; } }
 
 public override int ArtifactRarity{ get{ return 421; } }

 [Constructable]
 public OzzysMysteryBookRing() : base( 0x108a )
 {
     Weight = 0.0;
           Name = "Ozzy's Mystery Book Ring";
  Hue = 0;
  Attributes.AttackChance = 30;
  Attributes.DefendChance = 30;
  Attributes.BonusStr = 35;
  Attributes.BonusInt = 25;
  Attributes.BonusDex = 30;
  Attributes.BonusHits = 50;
  Attributes.LowerManaCost = 15;
  Attributes.Luck = 100;
  Attributes.RegenHits = 10;
  Attributes.ReflectPhysical = 65;
  Attributes.NightSight = 1;
  Attributes.WeaponDamage = 40;
  Attributes.WeaponSpeed = 30;

           LootType = LootType.Blessed;  
 
 }
 private static void EventSink_OpenSpellbookRequest( OpenSpellbookRequestEventArgs e )
 {
  Mobile from = e.Mobile;
  case 1: type = RingbookType.Regular; break;      
 }
 public override void OnDoubleClick( Mobile m )
       {
        if( Parent != m )        
  {
           m.SendMessage( "You must be wearing the robe to use it!" );
        }
        else
  {
  EventSink.OpenSpellbookRequest += new OpenSpellbookRequestEventHandler( EventSink_OpenSpellbookRequest );
  EventSink.CastSpellRequest += new CastSpellRequestEventHandler( EventSink_CastSpellRequest );
  }
 }


I tryed those diff using directives they didnt seem to work so, I commented them out. Here is the error i get.

CODE

- Error: Scripts\New Stuff\OzzysMysteryBook.cs: CS0234: (line 11, column 14) Th
e type or namespace name 'EventHandler' does not exist in the class or namespace
'Server' (are you missing an assembly reference?)


Did i code something wrong? or did i leave out a using directive?



ozzy- 01-17-2007
And this is the error i get when this is commented out.

[/CODE]
//using Server.EventHandler;
CODE




- Error: Scripts\New Stuff\OzzysMysteryBook.cs: CS0103: (line 70, column 68) Th
e name 'EventSink_CastSpellRequest' does not exist in the class or namespace 'Se
rver.Items.OzzysMysteryBookRing'
[CODE]

ozzy- 01-17-2007
grr I keep messing up the stupid easy to use code tags lol

ArteGordon- 01-17-2007
you cannot bring up the standard spellbook gump without a spellbook. It is a client limitation.

ozzy- 01-17-2007
hmm ok would it be possible to copy the spell book script and rename it add those attributes and change the id to that of a ring? Yes i know i have very wierd ideas lol.

ArteGordon- 01-17-2007
that isnt going to work either. Different itemids have tiledata flags associated with them that determine how they behave on the client. The client just wont treat a ring like a spellbook.

ozzy- 01-17-2007
Ok I guess that idea went out the window then. Well I guess I never know for sure till I ask thanks again.

ozzy- 01-17-2007
My buddy asked a good question. I know it would be a total pain to do but, here is the question. Would it be possible to write a totaly new script for the spell book. Using the same spells, and remove the old spell book script all together. I know you would have to change the info in any and all other scripts that call for the book, if there is any but, its an idea would it work?

ArteGordon- 01-18-2007
yes that is possible. I believe that is the way that the AllSpells script by Lucid Nagual on RunUO works, but it is not going to be exactly like the old spell book, only similar.

ozzy- 01-18-2007
ok ill see if i can give it a whirl wish me luck I forsee alot of errors