Ok so I have been looking into to switching up some weapon abilities on special weapons when I came across this post on RunUO.
http://www.runuo.com/community/threads/runuo-2-0-rc1-customizable-weaponabilities.92919/

It all works pretty good. The problem I see with the system is that it does not update when the ability is used, without closing and reopening the gump itself. I have been trying to figure out where and what to do to get it to refresh as soon as the ability is used.
I guess the next question would be is it actually able to be done with this set up?
 
I also did that on my server, and never really fixed that problem.
I'm not too sure if there's a way to see if the book is currently opened, if so, it means you could close it and reopen it.

I suggest you to look at the core files that are related to gumps, maybe you would be able to find some infos.
 
Ok so I have looked at different things on how gumps and gump buttons work. I haven't found a way to get the grey flag in the gump to update after the ability is used. I did however find a way to get it to sort of refresh the ability without closing the gump and reopening it.

Code:
if(PrimaryState==9781)
                {
                    if(CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile,Primary))
                    {
                        PrimaryState=9780;
                        SecondaryState=9781;
                        ThirdState=9781;
                        FourthState=9781;
                        FifthState=9781;
                    }
                    sender.Mobile.CloseGump(typeof(SpecialAttackGump));
                    sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState));
                }
                else
                {
                    WeaponAbility.ClearCurrentAbility( sender.Mobile );
                    PrimaryState=9781;
                 
                }
            }

All I did was switch the 2 lines for ClearCurrentAbility . Also for some reason now you have to click on the actual ability icon instead of the flag. But it is still not updating the flag from red to grey after the ability is used. To update the ability you can click on the other ability and back to the one you want to use.
 
Something like this maybe?

Code:
if (player.HasGump(typeof(MyGump)))
{
    player.CloseGump(typeof(MyGump));
    player.SendGump(new MyGump());
}
 
This what I tried to get it to work.

Code:
if(PrimaryState==9781)
                {
                    if(CustomWeaponAbilities.ServerSideSetAbility(sender.Mobile,Primary))
                    {
                        PrimaryState=9780;
                        SecondaryState=9781;
                        ThirdState=9781;
                        FourthState=9781;
                        FifthState=9781;
                    }
                    sender.Mobile.CloseGump(typeof(SpecialAttackGump));
                    sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState));
                }
                else
                {
                    WeaponAbility.ClearCurrentAbility( sender.Mobile );
                    PrimaryState=9781;                   
                    sender.Mobile.CloseGump(typeof(SpecialAttackGump));
                    sender.Mobile.SendGump(new SpecialAttackGump(m_weapon, sender.Mobile, Abilities, PrimaryState, SecondaryState, ThirdState, FourthState, FifthState));                   
                }
            }

It does work somewhat. You have to doubleclick the icon to reactivate the ability but it is closer than it was.

Did try your idea Lokai but that went a step back.
 
this is a very old one i found no idea on its current compatibility with servuo
 

Attachments

  • [RunUO 2.0 SVN 303] Changeable Weapon Abilities.rar
    383.5 KB · Views: 29
Thx mate
[doublepost=1536034462][/doublepost]That is a addon for the base script what i'm need but thx for that too :)
 
Gandalf are you looking for a working version of this system? If so I do have a complete working version. Not sure which version of ServUO it is compatible with though.
 
Gandalf are you looking for a working version of this system? If so I do have a complete working version. Not sure which version of ServUO it is compatible with though.

Yeah, the main system, I have the addon already, just never got the main system. Any version works. I'm sure I'll have to make changes anyway.
 
Back