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!

Skill/Stat Lock

Klaytron

Wanderer
Hello,

So i have been struggling with this all day, and have exhausted all the search engines in pursuit of a fix.
I downloaded a distro that is PREUOR and everythings been great - except stat/skill lock is disabled. When clicking on the arrow you get a message and it doesn't work.

Every page I found references packethandlers.cs which makes sense, because that's where I find this message.


Now where it gets strange: This distro has two packethandlers.cs, one in \server\network and one in the traditional place according to other distros, \scripts\engines\remoteadmin

The first one appears to contain the code that has the undesired effects. Funny thing is though, I can delete the entire packethandlers.cs file that lives in server\network and nothing changes. Compiles with no problems and skill lock is still not functional.

I am way over my head. Please someone help

Edit: I realize now this isn't the correct section of the forum but I cant seem to find a way to move or delete the thread, sorry about that.


Anyway, this is in relation to packet 6017 I think?

Code:
Line 63:        private static PacketHandler[] m_6017Handlers;
    Line 79:            m_6017Handlers = new PacketHandler[0x100];
    Line 154:            Register6017( 0x08, 15, true, new OnPacketReceive( DropReq6017 ) );
    Line 154:            Register6017( 0x08, 15, true, new OnPacketReceive( DropReq6017 ) );
    Line 182:            if ( m_6017Handlers[packetID] == null )
    Line 183:                m_6017Handlers[packetID] = new PacketHandler( packetID, length, ingame, onReceive );
    Line 191:        public static void Register6017( int packetID, int length, bool ingame, OnPacketReceive onReceive )
    Line 193:            m_6017Handlers[packetID] = new PacketHandler( packetID, length, ingame, onReceive );
    Line 196:        public static PacketHandler Get6017Handler( int packetID )
    Line 198:            return m_6017Handlers[packetID];
    Line 264:            ph = Get6017Handler( packetID );
    Line 1010:        public static void DropReq6017( NetState state, PacketReader pvSrc )
Search "6017" (12 hits in 1 file)
  H:\C3.1\Server\Network\PacketHandlers.cs (12 hits)
    Line 63:        private static PacketHandler[] m_6017Handlers;
    Line 79:            m_6017Handlers = new PacketHandler[0x100];
    Line 154:            Register6017( 0x08, 15, true, new OnPacketReceive( DropReq6017 ) );
    Line 154:            Register6017( 0x08, 15, true, new OnPacketReceive( DropReq6017 ) );
    Line 182:            if ( m_6017Handlers[packetID] == null )
    Line 183:                m_6017Handlers[packetID] = new PacketHandler( packetID, length, ingame, onReceive );
    Line 191:        public static void Register6017( int packetID, int length, bool ingame, OnPacketReceive onReceive )
    Line 193:            m_6017Handlers[packetID] = new PacketHandler( packetID, length, ingame, onReceive );
    Line 196:        public static PacketHandler Get6017Handler( int packetID )
    Line 198:            return m_6017Handlers[packetID];
    Line 264:            ph = Get6017Handler( packetID );
    Line 1010:        public static void DropReq6017( NetState state, PacketReader pvSrc )



(from packethandlers.cs)
Code:
        public static void ConfigurationFile( NetState state, PacketReader pvSrc )
        {
        }
 
        public static void LogoutReq( NetState state, PacketReader pvSrc )
        {
            state.Send( new LogoutAck() );
        }
 
        public static void ChangeSkillLock( NetState state, PacketReader pvSrc )
        {
            Skill s = state.Mobile.Skills[pvSrc.ReadInt16()];
 
            if (s != null)
            {
                state.Mobile.SendAsciiMessage("You cannot set your skills DOWN or LOCKED. This has been disabled for historical accuracy.");
                s.SetLockNoRelay(SkillLock.Up);//((SkillLock)pvSrc.ReadByte());
                s.Update();
            }
        }
 
        public static void HelpRequest( NetState state, PacketReader pvSrc )
        {
            EventSink.InvokeHelpRequest( new HelpRequestEventArgs( state.Mobile ) );
        }
 
        public static void TargetResponse( NetState state, PacketReader pvSrc )
        {
            int type = pvSrc.ReadByte();
            int targetID = pvSrc.ReadInt32();
            int flags = pvSrc.ReadByte();
            Serial serial = pvSrc.ReadInt32();
            int x = pvSrc.ReadInt16(), y = pvSrc.ReadInt16(), z = pvSrc.ReadInt16();
            int graphic = pvSrc.ReadUInt16();
 
            if ( targetID == unchecked( (int) 0xDEADBEEF ) )
                return;
 
            Mobile from = state.Mobile;
 
            Target t = from.Target;
 

tindo

Sorceror
Change it to this:

Code:
public static void ChangeSkillLock(NetState state, PacketReader pvSrc)
                {
                        Skill s = state.Mobile.Skills[pvSrc.ReadInt16()];
 
 
                        if (s != null)
                        {
                                s.SetLockNoRelay((SkillLock)pvSrc.ReadByte());
                        }
                }
 

Klaytron

Wanderer
Thanks for your reply,

I changed it as you suggested and it still persists. I am doubtful that any changes in this server\network\packethandlers.cs will make a difference since I can literally type all sorts of gibberish in it or completely delete it and everything's A-O-K. Is this not getting compiled? I just don't see any other place where I could make a change to affect skill or stat lock.



If you care to help a very frustrated noob out... the entire distro is here: https://github.com/uoorigins


I guess in the meantime I will try and teach myself some more OOP. Feel like this would be an easy fix! but eh
 

Klaytron

Wanderer
Finding all sorts of resources for this. THANK YOU I will try this and report back in case anyone else picks this up on Google some day.
 

tindo

Sorceror
No, definitely not. Anything in the server folder is a change to the Core files. This means you need to recompile the core files that build the exe. Until it is recompiled, nothing you change in the server folder is going to take effect. Did the origins download come with a .bat file to compile the core?
 

tindo

Sorceror
Yeah, I would try to walk you thru, but I'm out camping right now and just on a laptop with 3g internet, lol.

There are several posts out there on compiling the core, its not really all that hard, despite all the warnings you will see against it, lol.

If you are still stuck, PM me on Monday and I will be back home and can help more.
 

Klaytron

Wanderer
I didnt see a .bat file but i was able to create one using:

c:\windows\microsoft.net\Framework\v4.0.30319\csc.exe /unsafe /out:Server.exe /recurse:server\*.cs /win32icon:Server\runuo.ico

Does that seem about right? Skills are now unlocked!!!!! Just have to find the part for stats now. I'm ecstatic.

I hope your camping trip is awesome; man, you saved me a headache
 

tindo

Sorceror
You got it, that's the compile. Use that anytime you make a change to a core file (anything in the server folder). That compile can be more complicated depending on the library files ( the .dll files) that you need to compile with it, but if that worked then most likely the UOOrigins doesn't use any librarys and you should be fine.
 

Klaytron

Wanderer
Suddenly things make more sense. I take it this 'SVN' I hear about is where I get the .exe before its been compiled? Would be nice to have another packethandlers.cs to reference.
 

tindo

Sorceror
Yes, SVN means Subversion - think of it as a periodic release between official versions. An official release is going to have everything built for you, but a subversion is going to be a version you can test between official versions. They don't bother to make a build and release for every little change.
 
Top