Resource icon

Spellbar Ver 2.1 [ Final ]

No permission to download

Joshua

Squire
Ehh that is what I was afraid of. I did a partial Test.

I removed the checks again for the books so they became selectable (without the book) in the backpack, and for testing I modified two spells. Create food and clumsy. I Set them both not to check for the book/spell. This allowed them to stay on the toolbar without a book in the backpack. Now when I use the spellbar and choose one of the two spells the spellbar just force closes itself, i can open it again but it doesn't work, just keeps repeating the problem. I'm not at my home machine right now, so I cannot provide the modified code, I can get it later on.

I do agree, there is a lot of repeated code here that could be simplified. So I will do what i do best, take apart code and ask questions, to hopefully help you redo sections to better improve the project.
 

zerodowned

Moderator
ServUO Developer
tried to follow instructions on using wildcards for find/replace in VS but couldn't get it to work

but when i do get around to rewriting it i'll include your idea for no requirement to have spellbooks
 

Joshua

Squire
So i followed the code path and I got it working the way I intended. Here are the line numbers I changed to SpellBarGump.cs

Line 348 - Copied the 205,13,115 down to not have to keep same color scheme on page
Code:
                        if ( HasSpell( from, 0 ) ) { AddLabel(205, 13, 1153, @"Clumsy"); }
                        else if ( !HasSpell( from, 0 ) ) { AddLabel(205, 13, 1153, @"Clumsy"); }

Line 2833 - Keep Icon on bar after selecting it from menu
Code:
            if ( !HasSpell( from, 0 ) && m_Scroll.W00_ClumsySpell == 1)

Line 3464 - Added ' ! ' to indicate the spell scroll does not exist and to permit casting which keeps icon alive as well.
Code:
                case 1: {           if ( !HasSpell( from, 0 ) ) { new ClumsySpell( from, null ).Cast(); from.SendGump( new SpellBar_BarGump( from,  m_Scroll, m_Scroll.Xo, m_Scroll.Yo ) ); } break; }

Ultimately this whole thing (fix) is a work around, still a lot of work to do here, however at least this me an idea on what needs to be adjusted and hopefully helps you come up with a better method to implement this.

Full Script is attached, tried inserting it here however for some reason servuo kept throwing the error insert a valid message to me... lol
[doublepost=1497416112][/doublepost]So the easy way to adjust the rest of the script is just replace all the HasSpell to !HasSpell . seems adjusting the color of the entries isn't required if that is done so the change is actually rather simple. Now to try to setup list and forloops. (not my strongest point LOL)
 

Attachments

  • SpellBarGump.cs
    354.6 KB · Views: 6
Last edited: