RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Full Spellbooks

Almassey

Sorceror
Full Spellbooks

I was wondering how to add full spellbooks on vendors. I know how to add the spellbook to the vendors, I jsut want them to have all the spells.
 

awdball

Sorceror
At character creation, in the base install, a full spellbook is created in the players bankbox by passing a parameter to one of the creator methods for the spellbook, see ...\Scripts\Misc\CharacterCreation.cs

To pass parameters to vendor buy info see the docs manual page for the GenericBuyInfo ...\docs\types\GenericBuyInfo.html and the list of allowed creators are there. Pick one that accepts arguments for the item creation (last parameter of args) and add it to the Vendor script(s) of your choice in ...\Scripts\Mobiles\Vendors\SBInfo\

If you need more detailed help after trying it please feel free to post what you tried and your errors.
---------------------------------------------------------
awdball (old school c coder learning and luvin c#)
 

awdball

Sorceror
NOTE there is a bug that makes this a bit harder to use than just that though, see http://bugzilla.runuo.com/show_bug.cgi?id=9 for details. The short of it is for the args to work you need to add one line to your GenericBuy.cs
Missing between line 81 and 98 of Scripts\Mobiles\Vendors\SBInfo\GenericBuy.cs
is the following line to actually store the passed args into the member
variable m_Args.

m_Args = args;

---------------------------------------------------------
awdball (old school c coder learning and luvin c#)
 

David

Moderate
Or you can add a FullSpellBook item with the following simple script. Then add that item to the vendors.
Code:
using System; 
using Server; 

namespace Server.Items 
{ 
   public class FullSpellbook : Spellbook
   { 

      [Constructable] 
      public FullSpellbook()
      { 
            this.Content = ulong.MaxValue; 
      } 

      public FullSpellbook( Serial serial ) : base( serial ) 
      { 
      } 

      public override void Serialize( GenericWriter writer ) 
      { 
         base.Serialize( writer ); 
         writer.Write( (int) 0 ); 
      } 

      public override void Deserialize( GenericReader reader ) 
      { 
         base.Deserialize( reader ); 
         int version = reader.ReadInt(); 
      } 
   } 
}
 

Maxi - II

Wanderer
ok that one works but how would I make it make a Necromancers spell book,,,, I tried this but it doesnt compile


using System;
using Server;

namespace Server.Items
{
public class FullNecromancerSpellbook : NecromancerSpellbook
{

[Constructable]
public Full NecromancerSpellbook()
{
this.Content = ulong.MaxValue;
}

public Fullnecromancerspellbook( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}


thanks for any help
 

Maxi - II

Wanderer
sorry this was the error I got when I tried changing it to make a the necro book

Scripts: Compiling C# scripts...failed (3 errors, 0 warnings)
- Error: Scripts\temp\Fullnecromancerspellbook.cs: CS1520: (line 15, column 14)
Class, struct, or interface method must have a return type
- Error: Scripts\temp\Fullnecromancerspellbook.cs: CS1002: (line 15, column 56)
; expected
- Error: Scripts\temp\Fullnecromancerspellbook.cs: CS1519: (line 15, column 71)
Invalid token ')' in class, struct, or interface member declaration
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
 

Maxi - II

Wanderer
thanks for the reply but it didnt work,,,,,, this is what I have and when I loaded the server it did compile but when I do [add fullNecromancerSpellbook it just adds a normal full spellbook..lol

this is what I have now

using System;
using Server;

namespace Server.Items
{
public class fullNecromancerSpellbook : Spellbook
{

[Constructable]
public fullNecromancerSpellbook()
{
this.Content = ulong.MaxValue;
}

public fullNecromancerSpellbook( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}


thanks for any more help
 

Maxi - II

Wanderer
ok i think I kind of got it but still need help...... I put this in and it let the server load up and when I added the item in game I got a necrospellbook,, BUT it says it has 64 spells and when you open it it has all the necro spells plus two bad ones.... this is what I got now.......


using System;
using Server;

namespace Server.Items
{
public class fullNecromancerSpellbook : NecromancerSpellbook
{

[Constructable]
public fullNecromancerSpellbook()
{
this.Content = ulong.MaxValue;//something to do with this line... not sure what to put
}

public fullNecromancerSpellbook( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
 

David

Moderate
Try this... ingame create a necro spellbook and manually add all the spells to it. Then type [get Content and target the spellbook. you will get a long number, use that instead of int.MaxValue.
 

Mixoplix

Wanderer
Full NecroBook

Here is my Necromancer Spellbook that when added will have all 16 spells in it. Hope this helps...

using System;
using Server.Network;
using Server.Spells;

namespace Server.Items
{
public class NecromancerSpellbook : Spellbook
{
public override SpellbookType SpellbookType{ get{ return SpellbookType.Necromancer; } }
public override int BookOffset{ get{ return 100; } }
public override int BookCount{ get{ return 16; } }

public override Item Dupe( int amount )
{
Spellbook book = new NecromancerSpellbook();

book.Content = this.Content;

return base.Dupe( book, amount );
}

[Constructable]
public NecromancerSpellbook() : this( (ulong)0xFFFF )
{
}

[Constructable]
public NecromancerSpellbook( ulong content ) : base( content, 0x2253 )
{
Layer = Layer.Invalid;
}

public NecromancerSpellbook( 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();
Layer = Layer.Invalid;
}
}
}
 

Phantom

Knight
Is there a reason you guys. bumped a 8 month old topic?

Please don't do that...is it that hard to look when the last post was posted before you bump a topic?
 

Mixoplix

Wanderer
Phantom,

I understand the importance of not bumping posts. However, I also understand that Almassy may not be the only person that may need this answer. The answer was not given so I gave it. These forums are for helping others, not for stifling their experience or others charity.
 

Phantom

Knight
Actually he did get his answer, David gave it to him. He had no other questions, thats how I know.

In the future don't reply or help people or help the authors of threads that have not been replied to for 8 months.
 

Maxi - II

Wanderer
Thanks you all it was this part I was getting wrong>>>

[Constructable]
public NecromancerSpellbook() : this( (ulong)0xFFFF )
{
}

[Constructable]
public NecromancerSpellbook( ulong content ) : base( content, 0x2253 )


and yes I figured why start a new thread when I could see if the one already regaring this topic good help me.... which it did..... thanks again.....
 

Maxi - II

Wanderer
Here are both scripts just make a new note pad and name them
Fullnecromancerspellbook.cs and FullSpellbook.cs and then place in your custom folder


//##1FullSpellbook.cs

using System;
using Server;

namespace Server.Items
{
public class FullSpellbook : Spellbook
{

[Constructable]
public FullSpellbook()
{
this.Content = ulong.MaxValue;
}

public FullSpellbook( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}




///////////////////////////////////////////////////////////////////////////////////////////////

now for the necrobook

//##2Fullnecromancerspellbook.cs

using System;
using Server;

namespace Server.Items
{
public class FullNecromancerSpellbook : NecromancerSpellbook
{

[Constructable]
public Full NecromancerSpellbook()
{
this.Content = ulong.MaxValue;
}

public Fullnecromancerspellbook( Serial serial ) : base( serial )
{
}

public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}

public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}




/////////////////////////////////////////////////////////////////////////////////////////



I know its not much but at least the people that need it can find it....


take care and merry hohohohohohohohohoho =)
 
MixoPlix

Hey thanks I've been looking for a solution to this problem. I'll have to do this to the rest of my books. I'm glade you bumped :)


*Edit - One problem left....tried doing this with custom books and had no success. :(
 
Top