otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.59k stars 1.06k forks source link

Rewrite part of the death system #1471

Open WibbenZ opened 9 years ago

WibbenZ commented 9 years ago
You are dead.
You were killed by X and X and X.
You were blessed with X.
You are still blessed with X.
You died during PvP.
The death penalty has been reduced by 80% because it was an unfair fight.
You lost X experience and 0.22% of all your skills.
You did not wear an Amulet of Loss.
You did not lose any items.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ranisalt commented 9 years ago

Can you post screenshots on how it should be, if it is from Cipsoft's?

WibbenZ commented 9 years ago

Yes, no sorry I don't have an SS, you can look here when Bubba battles if you wanna see it in action - http://www.twitch.tv/bubbagame/profile Or on his youtube channel (bubbagame).

All it does is simply print out does things, and not kicking the player kinda :p

Kamenuvol commented 9 years ago

I think we should put them in a new Player:onDeath event.

WibbenZ commented 9 years ago

Would be a good ide, since then people can still use the old one (if they for some reason want to)!

DaniloMeloo commented 8 years ago

Someone is working to improve the death system?

WibbenZ commented 8 years ago

Probbly not, it's not a hard thing to implement I did it a while ago but the order got fucked so I deleted the code. And since we have some of the code in Lua and some in C++ it's not an easy task to get them in the correct order.

So if we want this we either have to move all of the onDeath codes to Lua or move the Lua codes back to C++.

DaniloMeloo commented 8 years ago

Do you have any idea where to start?

WibbenZ commented 8 years ago

I started here I think, https://github.com/otland/forgottenserver/blob/master/src/player.cpp#L1988 The downgraded code is there. You have to serach for the messages we already have and see where it starts and then see what you can do in Lua and what you can have to do in C++. But you really should have a config boolean to turn it off, since you can't remove it by just editing a Lua file.

EPuncker commented 3 years ago

ref #3251

Zbizu commented 3 years ago

This is pretty complex (imo far more game breaking potential than sightline) so I recommend starting in 1.5 development cycle.

I experimented with the player death code a bit (months ago) and there was a lot of things to redirect. Basically you have to emulate death and logout without sending either of these packets and without removing the player object itself.

The other problem are player related timed events. Giving the player a new creature id (or even whole object) would be perfect, but that's another spot at which crashes may happen (or rooking-caused memory leaks).

On the other hand a timed event (post death) opens new possibilities so making new player id/object might be a problem.