Hucaru / Valhalla

A Golang MapleStory (v28) server
MIT License
274 stars 71 forks source link

Mob Status #22

Closed ErwinsExpertise closed 4 years ago

ErwinsExpertise commented 4 years ago

I'm currently working on implementing mob status effects( stun, slow, curse, etc) and I am needing the opcode for server to send. I've been looking through IDB but I am not finding what I need. Do you know what this opcode is by chance, or even which method it might be under in IDB?

ErwinsExpertise commented 4 years ago

For reference it would be the same opcode needed as this packet: https://github.com/diamondo25/WvsGlobal/blob/master/WvsBeta.Common/Sessions/ServerMessages.cs#L144

Is there a method you recommend for finding opcodes other than reviewing the IDB? Just cant seem to find this one.

Hucaru commented 4 years ago

image

Opcode order generally stays the same between versions (unless new opcodes are introduced) therefore I suspect it is one of the ones in the screenshot between 0x8B (Acknowledge movement) and 0x91 (Mob damage).

EDIT: sub_5100e6 is the following: image

Don't forget there are 4 bytes that are decoded before the function call that indicate the spawnID. The packet would be something like: [spawnID] [int32 (status encoded as individual bits?)] [int16 (something to do with time?)] [byte (only gets used if status & 0x40 passes)]

Hucaru commented 4 years ago

Is there a method you recommend for finding opcodes other than reviewing the IDB?

Without the IDB all I can suggest is trial and error. You can generally know around where an opcode should exist if you can anchor it against another known opcode.

ErwinsExpertise commented 4 years ago

This is perfect. Thank you for looking into it. This is a rather extensive method so it will take a little while to put together. It seems that skills are controlled server side rather than the client attempting a skill. The mob struct is not populating the skills struct either so I am working on getting the mob struct built with those at the moment and then I will work on performing the skill.

Hucaru commented 4 years ago

I had a very crude implementation of mobs skills in an earlier version of the server: https://github.com/Hucaru/Valhalla/blob/4f761cead9281d8abffd898850cc7fa4762edc40/handlers/channel/mob.go

This might make a good starting point? If I remember correctly the WZ/NX file contains a lot of the information needed regarding mp usage and skill re-use time.

ErwinsExpertise commented 4 years ago

That is a great starting point actually. Thank you for providing that. I should be able to build upon that implementation nicely.