diff options
Diffstat (limited to 'npc/001-8/hub.txt')
-rw-r--r-- | npc/001-8/hub.txt | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/npc/001-8/hub.txt b/npc/001-8/hub.txt index 51abfc258..9abec0abe 100644 --- a/npc/001-8/hub.txt +++ b/npc/001-8/hub.txt @@ -416,11 +416,16 @@ OnPCLogoutEvent: if (!is_staff()) atcommand "@jail "+strcharinfo(0); } - - - // I want to know if it is already safe to read your current exp - // to implement a no-death-penalty and a halved-penalty system - if (is_staff() && @qhub_died) { + // Death at terranite cave + if (.@mapa$ ~= "015-6") + @deathpenalty_override=2; + + // This allows code to override death penalty, just once: + // @deathpenalty_override + // Valid values: 1- No penalty. 2- Halved penalty. + if (@deathpenalty_override && @qhub_died) { + @deathpenalty_realvalue=readparam(BaseExp); + @deathpenalty_realvaljob=readparam(JobExp); addtimer(200, "#QuirinoHUB::OnNoPenaltyCommand"); } @@ -434,8 +439,19 @@ OnCancel: end; OnNoPenaltyCommand: - dispbottom l("Exp: @@", readparam(BaseExp)); - dispbottom l("JExp: @@", readparam(JobExp)); + .@realvalue=readparam(BaseExp)-@deathpenalty_realvalue; + .@realvaljob=readparam(JobExp)-@deathpenalty_realvaljob; + if (@deathpenalty_override == 1) + getexp .@realvalue, .@realvaljob; + else if (@deathpenalty_override == 2) + getexp .@realvalue/2, .@realvaljob/2; + else + dispbottom l("BUG, REPORT ME: QHUB PENALTY OVERRIDE INVALID SIGNAL @@", @deathpenalty_override); + + // Clear temporary variables + @deathpenalty_override=0; + @deathpenalty_realvalue=0; + @deathpenalty_realvaljob=0; end; } |