From d8c9ff3ba3ece0973d313847f43fc9a866868d3b Mon Sep 17 00:00:00 2001 From: gumi Date: Tue, 20 Aug 2019 23:14:12 -0400 Subject: avoid killing players in quest NPCs --- world/map/npc/magic/_procedures.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'world/map/npc/magic/_procedures.txt') diff --git a/world/map/npc/magic/_procedures.txt b/world/map/npc/magic/_procedures.txt index 6ba748a9..95958fcb 100644 --- a/world/map/npc/magic/_procedures.txt +++ b/world/map/npc/magic/_procedures.txt @@ -116,8 +116,13 @@ L_Escape: L_Backfire: message strcharinfo(0), "Magic : ##3##BYour spell backfires!"; - if (rand(110) < Luk) heal 0 - ((BaseLevel+1)*(BaseLevel+2)*(rand(28)+3)), 0; - else heal 0 - (BaseLevel + 1), 0; + if (rand(110) < Luk) heal max(0 - Hp + 1, 0 - ((BaseLevel+1)*(BaseLevel+2)*(rand(28)+3))), 0; + else heal max(0 - Hp + 1, 0 - (BaseLevel + 1)), 0; + if (Hp <= 2) goto L_Warp; + return; + +L_Warp: + warp getsavepoint(0), getsavepoint(1), getsavepoint(2); return; L_Perfect: -- cgit v1.2.3-60-g2f50