diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-01-14 00:51:29 -0200 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-01-14 00:51:29 -0200 |
commit | 52afebd44f8e9169fc38be869e84d2ae8e97e1c6 (patch) | |
tree | faeb071154a85737e5e4b36a117a132c5f0b3ff3 | |
parent | 1de81e10aa3efa99dfb15e4f931d4be8a33dcb19 (diff) | |
download | serverdata-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)
-rw-r--r-- | npc/001-8/hub.txt | 30 | ||||
-rw-r--r-- | npc/011-1/manastone.txt | 6 |
2 files changed, 25 insertions, 11 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; } diff --git a/npc/011-1/manastone.txt b/npc/011-1/manastone.txt index ba3e07f9c..a90de1c99 100644 --- a/npc/011-1/manastone.txt +++ b/npc/011-1/manastone.txt @@ -72,10 +72,8 @@ L_LevelUp: if (!MAGIC_LVL) mes l("Magic Power is granted to you, but you die from it."); if (MAGIC_LVL) mes l("More Magic Power is granted to you, but you die from it."); MAGIC_LVL = MAGIC_LVL+1; - // Magic Numbers work better - getexp readparam(NextBaseExp)*771/1000, readparam(NextJobExp)*400/1000; - // Non-magic numbers work bad - //getexp readparam(NextBaseExp)*getbattleflag(death_penalty_base)/1000, readparam(NextJobExp)*getbattleflag(death_penalty_job)/1000; + // No penalty for death provoked by Mana Stone, see npc/001-8/hub.txt for more info + @deathpenalty_override=1; percentheal -100, -100; close; |