|
||
|
|||||||
| New Join Forum So your new to RunUO and looking to work with people that are new, this is the place. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
Join Date: Feb 2004
Location: Canada eh
Posts: 413
|
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 |
|
|
|
|
|
#3 (permalink) | |
|
Join Date: Feb 2004
Location: Canada eh
Posts: 413
|
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:
awdball (old school c coder learning and luvin c#)
__________________
awdball |
|
|
|
|
|
|
#4 (permalink) |
|
Moderate
Join Date: Nov 2002
Location: USA
Posts: 6,598
|
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 |
|
|
|
|
|
#5 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
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 |
|
|
|
|
|
#6 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
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 |
|
|
|
|
|
#8 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
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 |
|
|
|
|
|
#9 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
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 |
|
|
|
|
|
#10 (permalink) |
|
Moderate
Join Date: Nov 2002
Location: USA
Posts: 6,598
|
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 |
|
|
|
|
|
#12 (permalink) |
|
Forum Newbie
Join Date: Dec 2003
Posts: 6
|
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; } } } |
|
|
|
|
|
#14 (permalink) |
|
Forum Newbie
Join Date: Dec 2003
Posts: 6
|
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. |
|
|
|
|
|
#16 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
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 |
|
|
|
|
|
#18 (permalink) |
|
Join Date: Apr 2003
Location: Vancouver BC, Canada
Age: 35
Posts: 129
|
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 |
|
|
|
|
|
#19 (permalink) |
|
Forum Expert
Join Date: Nov 2004
Location: Beyond the Gates of Hell
Age: 36
Posts: 3,509
|
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. ![]() |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|