ServUO Version
Publish 57
Ultima Expansion
Endless Journey
I would like to add a whole new spell to the paladin spellbook, but I am still missing how the contents are rendered. I think displayTo function in spellbook.cs is close to what I need. Here is what I've done so far. (I want to add a bless spell to the paladin book).

1. Copied an existing spell in the scripts/spells/chivalry folder. Renamed the file to Blessing.cs and updated class name to BlessingSpell following the scheme by other paladin spells.
2. Updated scripts/spells/ initializer.cs - register a new spell, for chivalry the next sequence spellID was 210 and I named it type of Chivalry.BlessingSpell. Following the paladin spell schema already in place.
3. Updated cliloc.enu file on my client and added a new cliloc number and made it say "Obsu Graci". Updated the mantra number in my blessing.cs spell.

I thought that would create the spell. So, now I need it to display in the spellbook.

1. In scripts/items/equipment/spellbooks/ BookofChivalry.cs - updated my BookOffset and BookCount. Left BookOffset at 200 and BookCount updated from 10 to 11. This should match initializer.cs.
2. In scripts/items/equipment/spellbooks/ spellbook.cs - updated function public static SpellbookType GetTypeForSpell(int spellID). I set the spellID numerical bound of the SpellbookType.Paladin to be within initializer.cs. So spellIDs between 200 and 217. I just made the upper bound a few more higher than 210 which is the new spell.
3. Unpacked the legacygump uop and made a new spell icon. I named it in sequence 0x5110.bmp. Sacred Journey is 0x5109.bmp. I also edited a few icons just to see if this would work and I was able to successfully colorize the spell icons. I also unpacked my gumps after I patched the client to make sure 0x5110.bmp was in the uop and it was.

So, my server loads with no errors. But here is what I get:

1. I add a new chivalry spellbook to my backpack. It has only 10 spells. I run [allspells and it updates to 11.
2. I open the spellbook to the index. It's added 11 spells but the new spell says Bad Spell.
3. When I click on the spell. It runs blessing.cs and my player says "Obsu Graci".
4. When I open up to the page of the spell, it has some weird background icon that is not the spell icon.

Can someone help explain how the spellbook is rendered? I figured getting the spell icon in the book was a long shot by just naming a new icon 0x5110.bmp, but I'm not quite sure why the spell is showing as "Bad Spell" in the book. What other files are involved in building the spellbook? Like spellbook.cs has a few functions that look like they build the content but I can't find those anywhere.
NewSpellbookContent and SpellbookContent6017 and SpellbookContent

Also, I thought the variable m_Content may be what I need but it is registered as a ulong which is just a bigInt so I wish I knew where the numbers were being compiled and interpreted if somehow that integer is somehow represents all the bmps that are supposed to be in the spellbook.

Thanks for your help.
 
messing with the spells has been a huge pain for me too even just making certain spells not require regs or skills has been a pain. You will need to edit a lot of scripts to get this working it probably wont be worth it in the long run either
 
There is an old RunUO plugin called ACC Custom spells system that I updated and use. Its very drag and drop to make new spellbooks with new spells. The interface is kind of janky but I find it a lot easier for my purposes that trying to add stuff to the current spell system:
 

Attachments

  • ACC Custom Spells.rar
    345.4 KB · Views: 7
ACC was throwing me a lot of errors. I fixed the Icommodity code but it just cropping up new errors like whack a mole when trying to activate the druid spellbook.

Creating entirely new spell systems is super intriguing, but I'd hope to just modify the existing books. Adding a new spell was a proof of concept for me and I noticed very little documentation for spell managing or servuo entirely. For my purposes, editing spells will get me to where I need. Such as it is my understanding that spellinfo sets the reagents for the spell. It is just a matter of feeding it the right numerical parameters and array of reagents. I think I can just modify the remove curse spell and add the extra mods to it.

I wish the code was more verbose and descriptive. Configurations are set with numbers and/or hex sometimes which is just a pain without any documentation to go off of.
 
Core spell books are pretty much hard coded in the client as far as displayed You can change an existing ones name and icons and coding of spell but adding a additional new spell is not going to happen. Most of the time when creating new spells and system you have to create a whole new spellbook gump which can come close to looking like original spellbooks but do not function exactly like originals. I don't think anyone has figured out how to get the spell icon to pull off the spell book as of yet to function as a button castable like originals. I have looked into this for many years and have yet to find a system to replicate an original spellbook gump that functions like the originals.
 
Back