From 3a44eacd66fbf863d74b8017f725bdae5cecc7ef Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 15 Sep 2018 17:49:30 -0300 Subject: In other hand, you can use teleporter even while hurt - as long that you're in a TOWN mapflagged town - I'm not sure if all towns use this mapflag but anyway. --- npc/items/teleporter.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'npc') diff --git a/npc/items/teleporter.txt b/npc/items/teleporter.txt index 90deb80c1..85da81188 100644 --- a/npc/items/teleporter.txt +++ b/npc/items/teleporter.txt @@ -8,6 +8,12 @@ - script LoF Teleporter NPC_HIDDEN,{ close; + // Checks if you can warp + function loftel_check { + getmapxy(.@m$, .@x, .@y); + return (readparam(Hp) < readparam(MaxHp) && !getmapflag(.@m$, mf_town)); + } + L_Cooldown: mesn; mesc l("This teleporter is currently recharging."); @@ -43,7 +49,7 @@ OnUse: close; L_Save: - if (readparam(Hp) < readparam(MaxHp)) { + if (loftel_check()) { dispbottom l("You are hurt, and cannot use this."); } else { doevent "shake::OnGM"; @@ -54,7 +60,7 @@ L_Save: end; L_LoF: - if (readparam(Hp) < readparam(MaxHp)) { + if (loftel_check()) { dispbottom l("You are hurt, and cannot use this."); } else { doevent "shake::OnGM"; -- cgit v1.2.3-70-g09d2