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!

Basic ML & Elf functionality

arul

Sorceror
[Obsolete] Basic ML & Elf functionality

No longer supported, update to RunUO 2.0!

ADDITION:
Race Change client 'gump'
Packet structure:
Code:
Server -> Client
BYTE 0xBF
WORD Length ( 7 )
WORD Subcommand - 0x2A
BYTE Gender ( 0 = male, 1 = female )
BYTE Race ( 1 = human, 2 = elf )

Client -> Server
BYTE 0xBF
WORD Length ( 15 )
WORD Subcommand - 0x2A
WORD BodyHue
WORD HairId
WORD HairHue
WORD BeardId
WORD BeardHue

Code example:
Code:
using System;
using Server.Items;

namespace Server.Network
{
    public sealed class ChangeRace : Packet
    {
        public static void Initialize()
        {
            Commands.Register("Race", AccessLevel.Player, new CommandEventHandler(OnCommand));
            PacketHandlers.RegisterExtended(0x2A, true, new OnPacketReceive(Change));
        }

        private static void Change( NetState state, PacketReader pvSrc )
        {
            short bodyHue  = pvSrc.ReadInt16();
            short hairId   = pvSrc.ReadInt16();
            short hairHue  = pvSrc.ReadInt16();
            short beardId  = pvSrc.ReadInt16();
            short beardHue = pvSrc.ReadInt16();

            if ( ( bodyHue
                | hairId
                | hairHue
                | beardId
                | beardHue )
                    == 0 ) return;

            Mobile sender     = state.Mobile;

            Item currentHair  = sender.FindItemOnLayer( Layer.Hair );
            Item currentBeard = sender.FindItemOnLayer( Layer.FacialHair );

            if ( currentBeard != null ) currentBeard.Delete();
            if ( currentHair  != null ) currentHair.Delete();

            sender.Body     = sender.Female ? ( sender.Elf ? 0x191 : 0x25E ) : ( sender.Elf ? 0x190 : 0x25D );
            sender.Hue      = bodyHue;
            sender.Elf      ^= true;

            sender.AddItem( Hair.CreateByID( hairId, hairHue ) );

            if ( !sender.Female && !sender.Elf ) sender.AddItem( Beard.CreateByID( beardId, beardHue ) );
        }

        public static void OnCommand(CommandEventArgs e)
        {
            Mobile m = e.Mobile;

            if (m != null)
            {
                m.Send(new ChangeRace( (byte)(m.Female ? 1 : 0), (byte)(m.Elf ? 1 : 2)));
            }
        }

        public ChangeRace(byte gender, byte race)
            : base(0xBF)
        {
            EnsureCapacity(7);

            m_Stream.Write( (short) 0x2A     );
            m_Stream.Write( (byte)  gender   );
            m_Stream.Write( (byte)  race     );
        }
    }
}
 

REDiR2

Sorceror
What magic file are you talking about dude?

None of the files I've looked at have 2000 lines... like network.cs or packets.cs (and which one there are like 6). Am I just a tard or what? Please let me know a bit more. THANKS :)
 
REDiR2 said:
None of the files I've looked at have 2000 lines... like network.cs or packets.cs (and which one there are like 6). Am I just a tard or what? Please let me know a bit more. THANKS :)

These modifications are for the core. Sounds to me like your looking at the files in /scripts/

PacketHandlers.cs has 2222 lines.
 

Falafel

Wanderer
How can i explore core? I searched for this .cs fils but i found nothung... can you give me exzact patch of thoose files? thanks
 

Livewire

Wanderer
The core is a separate download, and didn't come with the already-compiled RunUO 1.0.0.

But, I have good news (no, I didn't save money by switching to Geico, I actually lost about $5 a month from that): this thread popped up recently: http://www.runuo.com/forums/showthread.php?t=62588 - there is a valid link to the source there.

Just a friendly little tidbit though, be careful when you're messing with the core. The RunUO forums do not, to my knowledge, support modified cores, so if something gets totally buggered, there isn't much we can do to help. But, on that note, if it works great and you never have a problem with it, you'll never have to worry about that will you? :)

Off Topic: Out of curiosity, is it bad luck to post at 4:04am/pm? Just curious....
 

Livewire

Wanderer
IHaveRegistered said:
lmao, we need more people like you :p
Eh...Might not be the best of ideas. I'm not the sharpest knife in the drawer, brightest bulb in the lamp, I'm a taco short of a combination plate, the list goes on and on...
 
Livewire said:
Eh...Might not be the best of ideas. I'm not the sharpest knife in the drawer, brightest bulb in the lamp, I'm a taco short of a combination plate, the list goes on and on...

Well, lets get out those knife-sharpeners, those bulb-lighteners, and those combination plates! lol
 

Iakona

Wanderer
ehhe ok nps sorry to waist everyones time then just thought it would be nice to have the new walls and tiles for the houses :)
 

Admin_V

Wanderer
ok did this and get the screen to pick elf etc.. all working now except when you actually get in game it changes body id to human and hair from elf is gone ok nm i figured that i had t add it to char creation just having prob now with body
 

Shadowdark

Wanderer
So, now what?

So once I've modified this core, how do I start up the server using the new code?

I started with just the Runuo server download, and Just, as i was reading this post got the Source.

So, How do i start using this modified source?


I stopped to think for a moment, if i can modify the core......why can;t i figue out how to use it?


Simple.....comying and pasting code...is not the same as knowing what im doing.....so i aprreciate the help
 

Shadowdark

Wanderer
Wooo

Hehe, allright thanks.

I just happen to have a full Visual Studio laying around. :)


It's been so long since i've done anything with VS though
 

Courageous

Wanderer
You don't really need it. Here's my bat file for compiling the server:

SET DOTNET=C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
SET PATH=%DOTNET%
csc.exe /debug /nowarn:0618 /nologo /out:.\Server.exe /unsafe /recurse:*.cs

Note I am using the 2.0 framework. For you to do this, there's a bit more to be done. Namely, I had to fix I think one actual error, plus suppress a whole slew of (legitimate) warnings that were new to the 2.0 compiler.
 
Top