summaryrefslogtreecommitdiff
path: root/npc/001-8
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-01-14 00:51:29 -0200
committerJesusaves <cpntb1@ymail.com>2019-01-14 00:51:29 -0200
commit52afebd44f8e9169fc38be869e84d2ae8e97e1c6 (patch)
treefaeb071154a85737e5e4b36a117a132c5f0b3ff3 /npc/001-8
parent1de81e10aa3efa99dfb15e4f931d4be8a33dcb19 (diff)
downloadserverdata-52afebd44f8e9169fc38be869e84d2ae8e97e1c6.tar.gz
serverdata-52afebd44f8e9169fc38be869e84d2ae8e97e1c6.tar.bz2
serverdata-52afebd44f8e9169fc38be869e84d2ae8e97e1c6.tar.xz
serverdata-52afebd44f8e9169fc38be869e84d2ae8e97e1c6.zip
Really Implement death penalty override handler, @deathpenalty_override
Accepted input: (0: full penalty) (1: No penalty) (2: Half penalty)
Diffstat (limited to 'npc/001-8')
-rw-r--r--npc/001-8/hub.txt30
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;
}