From df47304d11b9b38c5d61374b6f37a407b6f78aa4 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 9 Jul 2018 12:29:10 -0300 Subject: Cannot use teleporter if hurt --- npc/items/teleporter.txt | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'npc/items/teleporter.txt') diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt index 9679d280e..3abfc210e 100644 --- a/npc/items/teleporter.txt +++ b/npc/items/teleporter.txt @@ -17,6 +17,10 @@ L_Cooldown: OnUse: if (TELEPORTER_TIME > gettimetick(2)) goto L_Cooldown; + if (readparam(Hp) < readparam(MaxHp)) { + dispbottom l("You are hurt, and cannot use this."); + end; + } mesn; mesc l("Ozthokk, a great sage from the Land Of Fire, holds secrets of time and space travel."); @@ -33,16 +37,24 @@ OnUse: close; L_Save: - doevent "shake::OnGM"; - warp "Save", 0, 0; - TELEPORTER_TIME=gettimetick(2)+(60*30); + if (readparam(Hp) < readparam(MaxHp)) { + dispbottom l("You are hurt, and cannot use this."); + } else { + doevent "shake::OnGM"; + warp "Save", 0, 0; + TELEPORTER_TIME=gettimetick(2)+(60*30); + } closedialog; end; L_LoF: - doevent "shake::OnGM"; - warp "017-1", 0, 0; - TELEPORTER_TIME=gettimetick(2)+(60*30); + if (readparam(Hp) < readparam(MaxHp)) { + dispbottom l("You are hurt, and cannot use this."); + } else { + doevent "shake::OnGM"; + warp "017-1", 0, 0; + TELEPORTER_TIME=gettimetick(2)+(60*30); + } closedialog; end; } -- cgit v1.2.3-60-g2f50