Yeah that's probably it. What it is saying is to subtract nHPOnExit from your maximum hitpoints.
So what the script is trying to prevent is players logging when they are probably going to die and then relogging with full hitpoints. I used something similar to these scripts and occassionally had the same problem. Also there is a nocheat execute at the top too, no idea what that is nor the other exectuable. Yeah it's probably something in the ondying of the PC and/or ondeath as you can see the check for the item dead, which will prevent dead players from logging back in to avoid being dead, they will still be dead. Basically an anti-cheat mechanism, gone awry.
So say your max hits are 100 and the HpONExit is 10: i.e. 100 - 10 = 90. When you log back in it will do 90 hitpoints of damage to your PC, which should leave you with 10hp, but clearly something is mucking up the works here. One way instead of just dropping the line entirely would be to halve max hp - hpoexit number,actually halving maxhp number, which lowers the damage done. In this way the player would still be down some hits just not dead, hopefully.
So the line would look like this:
effect dmg = EffectDamage(nMaxHP/2 - nHPOnExit);
So going back to the placed values 100/2 = 50 - 10 which is HPOnExit = 40 pts of damage on enter.
That is if you want players to log back in with fewer hits. Another way would be to put a delaycommand on the damage line say of 20 seconds or so, and then to send a msg to the PC that their recent battle has left them still wounded, giving them time to quaff a potion to offset the coming loss of hits. Just another approach. Of course this approach would reguire you to divide the total damage and inflict it in increments maybe in 1/4 increments 4 times. Something like:
effect dmg = EffectDamage(nMaxHP - nHPOnExit/4);
DelayCommand(15.0,SendMessageToPC(oPC, " Your previous wounds are still untreated"));
DelayCommand(20.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, oPC));
DelayCommand(25.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, oPC));
DelayCommand(30.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, oPC));
DelayCommand(35.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, dmg, oPC));
My last thought on this is that the reason it is happening is that somewhere you are receiving additional damage so you log in already down a few more hits than expected, that's why I asked about combat. Thus exiting on combat there may be some residual damage to your PC and then when you log in and take all that damage at once it is dropping you below zero hits, which is death unless you have a bleed down script, in which case you expire at -10, which is the maximum you can bleed dow too, actually -9 is the maximum you can bleed down too since -1 more hit and you are dead.
Modifié par ffbj, 06 octobre 2011 - 01:34 .