Go Back   RunUO - Ultima Online Emulation > RunUO > New Join Forum

New Join Forum So your new to RunUO and looking to work with people that are new, this is the place.

Reply
 
Thread Tools Display Modes
Old 04-04-2004, 04:59 AM   #1 (permalink)
Forum Novice
 
Join Date: Dec 2003
Location: The Restaruant at the End of the Universe
Age: 34
Posts: 289
Default 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.
Almassey is offline   Reply With Quote
Old 04-04-2004, 05:12 AM   #2 (permalink)
 
Join Date: Feb 2004
Location: Canada eh
Posts: 413
Default

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
awdball is offline   Reply With Quote
Old 04-04-2004, 05:18 AM   #3 (permalink)
 
Join Date: Feb 2004
Location: Canada eh
Posts: 413
Default

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
Quote:
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#)
__________________
awdball
awdball is offline   Reply With Quote
Old 04-04-2004, 05:46 PM   #4 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

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(); 
      } 
   } 
}
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 12-04-2004, 04:04 AM   #5 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

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
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-04-2004, 04:08 AM   #6 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

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.
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-04-2004, 04:39 AM   #7 (permalink)
Whatever
 
Hybrid's Avatar
 
Join Date: Mar 2003
Location: Helsinki, Finland
Posts: 176
Default

try this

public class NecromancerSpellbook : Spellbook
Hybrid is offline   Reply With Quote
Old 12-04-2004, 05:26 AM   #8 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

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
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-04-2004, 05:45 AM   #9 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

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();
}
}
}
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-04-2004, 12:34 PM   #10 (permalink)
Moderate
 
David's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 6,598
Default

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.
__________________
David Forum Moderator
The RunUO.com Forum Moderator Team

Forum Rules and Guidelines
RunUO Forum Search Engine
Download RunUO 2.0 RC2
David is offline   Reply With Quote
Old 12-05-2004, 12:25 AM   #11 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

I already did try that (65535) or 0xFFFF and both didnt work......
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-06-2004, 10:39 PM   #12 (permalink)
Forum Newbie
 
Join Date: Dec 2003
Posts: 6
Red face 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;
}
}
}
Mixoplix is offline   Reply With Quote
Old 12-06-2004, 11:57 PM   #13 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

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?
Phantom is offline   Reply With Quote
Old 12-07-2004, 12:48 AM   #14 (permalink)
Forum Newbie
 
Join Date: Dec 2003
Posts: 6
Default

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.
Mixoplix is offline   Reply With Quote
Old 12-07-2004, 02:58 AM   #15 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

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.
Phantom is offline   Reply With Quote
Old 12-09-2004, 04:26 AM   #16 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

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.....
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-13-2004, 05:55 PM   #17 (permalink)
 
Join Date: Dec 2004
Age: 26
Posts: 40
Default

any place i can still find the fullspellbook.cs and fullnecro ?
DragonNick is offline   Reply With Quote
Old 12-14-2004, 11:24 AM   #18 (permalink)
 
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
Default

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 =)
__________________
Admin Root (aka Maxi - II)
Shard name :DragonKeep
uog://DBDA58AD15136310D9D53EA6617C8F40
Maxi - II is offline   Reply With Quote
Old 12-25-2004, 01:50 PM   #19 (permalink)
Forum Expert
 
Lucid Nagual's Avatar
 
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 36
Posts: 3,509
Thumbs up 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.
Lucid Nagual is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5