View Full Version : Anyway to set a player level 1 after death?
Silentrath
07-06-2015, 11:30 PM
I am looking in the db, to see if there's a way to revert a player to level 1 after they die. I think I might just need to edit the code to where the xp lost upon death is calculated, unless someone knows of an easier way? Also while I'm there, I want it so when a player dies they get spawned with their starter gear.
Thanks in advance!
Silentrath
provocating
07-07-2015, 10:13 AM
I would think you would do this in attack.cpp
Keep in mind my source is custom and older. The routine you would want is Client::Death
On mine there is a line
mylevel = mylevel ? mylevel : 1;
You could try just changing that to a flat out....
mylevel = 1;
Silentrath
07-07-2015, 02:30 PM
Got level 1 working by, modifying where it calculates how much xp is lost, just commented out that code and put
SetLevel(1);
kardath2
07-07-2015, 03:03 PM
Where's the delete button? I'm too slow.
kimura
07-07-2015, 03:32 PM
You should be able to just add an event death to the global player.pl for that
Leetsauce
07-07-2015, 06:31 PM
You should be able to just add an event death to the global player.pl for that
This. So much easier than a code change. If you need a sample let us know.
chasem
08-15-2015, 09:46 AM
I've been looking into this in a way - Leet or someone, would you mind showing a sample of how to edit it in player.pl?
kimura
08-15-2015, 11:05 AM
should be as simple as putting this in your global_player.pl file...(not tested though)
sub EVENT_DEATH {
quest::level(1);
}
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.