- 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.
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.