RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

custom skill gump.

ultek

Wanderer
custom skill gump.

Hi kidz!

Is there any way to override standard gump with skills %?

I searched thru events (I found ie. ProfileRequest or PaperdollRequest), but there is nothing like 'SkillsRequest' :p

Someone says that I can create command [newskills for players but this is not the best way to do it.

ult :cool:
 

Arvoreen

Sorceror
Well, first I thought it might be SkillsGump.cs, but that's the one admins get when they do the [skills command.

I could be wrong, but is it possible that this would be something in the core?

If it is, you'd have to edit the core to do so, and you can't really get support on a modified core.
 

ultek

Wanderer
Maybe in future the Dev's team will improve runuo code to use SkillsRequest :)

The standard skills gump is awful :p
 

daat99

Moderator
Staff member
ultek said:
Maybe in future the Dev's team will improve runuo code to use SkillsRequest :)

The standard skills gump is awful :p
I wouldn't count on it.
RunUO is designed to be an OSI clone and not "a free customizable shard for all".
 

ultek

Wanderer
daat99 said:
I wouldn't count on it.
RunUO is designed to be an OSI clone and not "a free customizable shard for all".

Then what for all the scripts are? Is there any difference betwen Runuo with "SkillsRequest" and Runuo without it? Performance? I don't think so.
 

daat99

Moderator
Staff member
ultek said:
Then what for all the scripts are? Is there any difference betwen Runuo with "SkillsRequest" and Runuo without it? Performance? I don't think so.
Custom scripts aren't distributed in the core.
"SkillsRequest" will require a core modification.

You can try and ask for it but I'm 100% sure it'll never happen...
 

arul

Sorceror
Client doesn't send any packet to the server when player open the Skills menu, so this modification cannot be done without client modification.
 

ultek

Wanderer
arul said:
Client doesn't send any packet to the server when player open the Skills menu, so this modification cannot be done without client modification.

You're wrong. I was scripting in POL095 and there is posibility to "catch" the packet (hook, event?) and modify that custom gump is displayed (using "skills" in Paperdoll, or macro "Open/Skills" in UO).
 

arul

Sorceror
ultek said:
You're wrong. I was scripting in POL095 and there is posibility to "catch" the packet (hook, event?) and modify that custom gump is displayed (using "skills" in Paperdoll, or macro "Open/Skills" in UO).
The client sends UpdateSkills packet ( 0x3A ) when someones click the Skills button, so yes, I was wrong about it.
So you will need to rewrite that packet, it might be possible without the core modification.
 

ultek

Wanderer
arul said:
The client sends UpdateSkills packet ( 0x3A ) when someones click the Skills button, so yes, I was wrong about it.
So you will need to rewrite that packet, it might be possible without the core modification.

Good idea. Thanks for the tip :)
By the way is there any script in distro which rewrites the existing packets? I think I need example... :rolleyes:
 

arul

Sorceror
Ok, this should work, actually it wasn't 0x3A packet that is sent when the skill lock changes but it's the 0x34 ( client/Mobile query ).

Code:
using System;
using Server.Network;

namespace Server
{
    public class SkillPacketOverride
    {
        public static void Configure()
        {
            PacketHandlers.Register(0x34, 10, true, new OnPacketReceive(CustomDelegateMethod));
        }

        public static void CustomDelegateMethod( NetState state, PacketReader pvSrc )
        {
            Mobile from = state.Mobile;

            pvSrc.ReadInt32(); // 0xEDEDEDED
            int type = pvSrc.ReadByte();
            Mobile m = World.FindMobile(pvSrc.ReadInt32());

            if (m != null)
            {
                switch (type)
                {
                    case 0x00: // Unknown, sent by godclient
                        {
                            if (PacketHandlers.VerifyGC(state))
                                Console.WriteLine("God Client: {0}: Query 0x{1:X2} on {2} '{3}'", state, type, m.Serial, m.Name);

                            break;
                        }
                    case 0x04: // Stats
                        {
                            m.OnStatsQuery(from);
                            break;
                        }
                    case 0x05:
                        {
                            //m.OnSkillsQuery(from);
[COLOR="Red"][B]                            /* ==========
                             * PLACE
                             * CUSTOM CODE
                             * HERE
                             * ==========
                             */[/B][/COLOR]
                            break;
                        }
                    default:
                        {
                            pvSrc.Trace(state);
                            break;
                        }
                }
            }
        }
    }
}
 

HellRazor

Knight
Sorry to necro an old thread, but all the relevent code was here. :)

This code worked at one time to hook the skill window. Now it doesn't work any more (with the newest client and SVN). Does anyone know why?

The code compiles fine, it just doesn't seem to do anything.


arul;448893 said:
Ok, this should work, actually it wasn't 0x3A packet that is sent when the skill lock changes but it's the 0x34 ( client/Mobile query ).

Code:
using System;
using Server.Network;

namespace Server
{
    public class SkillPacketOverride
    {
        public static void Configure()
        {
            PacketHandlers.Register(0x34, 10, true, new OnPacketReceive(CustomDelegateMethod));
        }

        public static void CustomDelegateMethod( NetState state, PacketReader pvSrc )
        {
            Mobile from = state.Mobile;

            pvSrc.ReadInt32(); // 0xEDEDEDED
            int type = pvSrc.ReadByte();
            Mobile m = World.FindMobile(pvSrc.ReadInt32());

            if (m != null)
            {
                switch (type)
                {
                    case 0x00: // Unknown, sent by godclient
                        {
                            if (PacketHandlers.VerifyGC(state))
                                Console.WriteLine("God Client: {0}: Query 0x{1:X2} on {2} '{3}'", state, type, m.Serial, m.Name);

                            break;
                        }
                    case 0x04: // Stats
                        {
                            m.OnStatsQuery(from);
                            break;
                        }
                    case 0x05:
                        {
                            //m.OnSkillsQuery(from);
[COLOR="Red"][B]                            /* ==========
                             * PLACE
                             * CUSTOM CODE
                             * HERE
                             * ==========
                             */[/B][/COLOR]
                            break;
                        }
                    default:
                        {
                            pvSrc.Trace(state);
                            break;
                        }
                }
            }
        }
    }
}
 

HellRazor

Knight
Sorry to bump an old thread, but I just figured out an alternate way to hook the skills window and thought I'd post it in case anyone else was having trouble.

Seems the easiest way is to just override OnSkillsQuery:

Code:
		public override void OnSkillsQuery( Mobile from )
		{
			if( from == this )
			{
				from.Say("Skills window intercepted!");
			}
			// base.OnSkillsQuery( from );
                                                           // Uncomment the above if you still want the skills window to appear.

		}
 

Tabain

Sorceror
The reason your old method didn't work anymore is that you have to Register6017 packet along with the standard one. Overriding seems like a better idea though.
 

Thilgon

Sorceror
So you saying i can intercept and override any request from the client (skills, status, the ugly book with racial bonuses) with an override?

How beautifil is that? *_*

I thought the client alone handled that, so even overriding the packet request, i would simply ended up screwing the client look, at most...

Finally, a way to implement my custom gumps in and use it instead of the standard ones...

Yet. My custom gumps wouldn't be "fluid" like the regular ones, since each button pushed (or, update made, as for the status gump) would need the gump to be re-send... mh... kinda lame... and maybe also resources-consuming... darn.
 

HellRazor

Knight
Thilgon;852017 said:
So you saying i can intercept and override any request from the client (skills, status, the ugly book with racial bonuses) with an override?

How beautifil is that? *_*

I thought the client alone handled that, so even overriding the packet request, i would simply ended up screwing the client look, at most...

Finally, a way to implement my custom gumps in and use it instead of the standard ones...

Yet. My custom gumps wouldn't be "fluid" like the regular ones, since each button pushed (or, update made, as for the status gump) would need the gump to be re-send... mh... kinda lame... and maybe also resources-consuming... darn.

A long time ago someone wrote a patcher for the client that edited the maximum number of skills (which is a hardcoded number in the client). Then the client would support anything you put into skills.mul up to that max number.

Unfortunately something in the client changed and the patcher didn't work any more. :(

Wish this functionality would be added to UOCH or some other program!
 

Pure Insanity

Sorceror
Have you tried opening it in a hex editor? Might be able to find the value there and change it, would be slightly limited to what you could change it to. But seems it might work.
 
you can add/modify skill names using uo fiddler, (i currently have 3 more than SA has - just have to make a custom skill gump)
can even rearange the default skill gump list (but not add skills to it though)
 

HellRazor

Knight
Lord_Greywolf;852059 said:
you can add/modify skill names using uo fiddler, (i currently have 3 more than SA has - just have to make a custom skill gump)
can even rearange the default skill gump list (but not add skills to it though)

That's what we are talking about, no matter how many skills are in skills.mul, new skills above the maximum won't be displayed in the skills gump because the number of skills read from skills.mul is hardcoded in the client.

If this hardcoded value was changed, the client would theoretically read and display as many skills as you added. That's what that patch program did. Unfortunately, that was around the time of client v4.
 
Top