ID:178824
 
When people log out of my game while in battle, I want to make them suffer. Everyone would lose a certain percentage of their xp, and people in parties, especially party leaders, could lose up to 1/4 of their total xp (tell me that's not a deterrent . . .). The problem is that once a person logs out, I can't modify anything. I tried writing a code in my Logout() proc, but nothing happens since the character is already gone. I'm using deadron's character handling library; does anyone have an idea on how I could implement this code?
when u try it in Logout() just put it before the ..() and that should make it happen before the person is gone. thats how i do it, i am actually putting in mine that if u logout in a fight it gives u a alert saying "are u sure?" with a yes or no answer, if u say yes it says "u stop fighting and the monster easily kills u" then u die and it does the death stuff, then it doesnt log out till after that. thats just how mine is, thought i would give u some ideas.
In response to Loduwijk
Loduwijk wrote:
when u try it in Logout() just put it before the ..() and that should make it happen before the person is gone. thats how i do it, i am actually putting in mine that if u logout in a fight it gives u a alert saying "are u sure?" with a yes or no answer, if u say yes it says "u stop fighting and the monster easily kills u" then u die and it does the death stuff, then it doesnt log out till after that. thats just how mine is, thought i would give u some ideas.

That's an interesting idea, but make sure you spawn() the alert that asks them if they're sure... otherwise, someone who just suddenly drops from the game through no fault of their own will halt that monster in its tracks while it waits for the person to answer the alert box, and they never will.
In response to Loduwijk
I tried doing what you said, but it isn't working for some reason . . . I used the following code as a test:


mob/var/xp_penalty = 0


mob/PC/Logout()
xp_penalty = 0.05
..()


mob/base_InitFromSavefile()
if(src.xp_penalty)
src << src.xp_penalty


It doesn't output anything.