Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
57 stars 45 forks source link

Editable DispID for chars #1178

Closed DavideRei closed 9 months ago

DavideRei commented 10 months ago

Editable DispID for chars to change char graphic/body without changing baseid/defname, like it was in 0.56c

Jhobean commented 10 months ago

I tested it. Work Great. Cool feature

raydienull commented 10 months ago

LGTM

cbnolok commented 10 months ago

There's a problem with that. You are changing the CHARDEF (CCharBase) dispid, not the dispid of a specific instance of that char (CChar). I'd do the following: create a CChar::m_dwDispID member and a CChar::SetDispID method to set that. If a valid dispid wasn't set (0 or CREID_INVALID), get the chardef one with Char_GetDef() and return that

Jhobean commented 10 months ago

There's a problem with that. You are changing the CHARDEF (CCharBase) dispid, not the dispid of a specific instance of that char (CChar). I'd do the following: create a CChar::m_dwDispID member and a CChar::SetDispID method to set that. If a valid dispid wasn't set (0 or CREID_INVALID), get the chardef one with Char_GetDef() and return that

Are you saying if I change a specific zombie to c_bird, all zombie will look like bird?

cbnolok commented 10 months ago

From the code, it looks so

DavideRei commented 10 months ago

lol it's true, just tried.

DavideRei commented 10 months ago

Fixed

DavideRei commented 10 months ago

it seems that if i set dispid on a npc with a spawn, the dispid remain attached to the spawn. Even if the npc dies, the modified graphic remain on the new spawned npc. The new dispid seems to remain saved somewhere. How is that possible? @cbnolok

Jhobean commented 10 months ago

Need to do a manual .update to see modification. possible to force it in the server?

Jhobean commented 9 months ago

I'm not able reproduce the spawn point bug you mentionned. Seem ok on my side

DavideRei commented 9 months ago

yes, seems fine now