From b63163fd6705c1ac55935dd63d9818a5562e158e Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 8 Aug 2024 20:02:43 -0300 Subject: Warp Mage favorite code (Jailer Respawn Point Changer) --- npc/sec_pri/jailer.txt | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/npc/sec_pri/jailer.txt b/npc/sec_pri/jailer.txt index e585ba813..5c0076481 100644 --- a/npc/sec_pri/jailer.txt +++ b/npc/sec_pri/jailer.txt @@ -8,7 +8,7 @@ sec_pri,22,21,0 script Warp Feltchstick NPC_PLAYER,{ mesn; mesq l("Carry on, criminal. I am %s and this jail was entrusted to me by kytty herself.", .name$); next; - if ($HARDCORE && getstatus(SC_JAILED,0) && is_admin()) { + if ($HARDCORE && getstatus(SC_JAILED,0)) { // Hardcore Server Logic (DOES NOT WORK well for some reason?) .@v1=getstatus(SC_JAILED, 1); .@v2=getstatus(SC_JAILED, 2); @@ -26,15 +26,22 @@ sec_pri,22,21,0 script Warp Feltchstick NPC_PLAYER,{ mes ""; closeclientdialog; if (!getstatus(SC_JAILED,0)) end; + debugmes "sc4 (%d, %d, %d, %d)", .@v1, .@v2, .@v3, .@v4; + debugmes "003-9 (%d) -> 000-1 (3)", getmapinfo(MAPINFO_ID, "003-9"); + debugmes "Target %s (%d,%d)", getmapinfo(MAPINFO_NAME, .@v3 - 1), (.@v4|0xFFFF), (.@v4 >> 16); switch (@menu) { case 2: debugmes "Change MID from %d to %d", .@v2, getmapinfo(MAPINFO_ID, "000-1"); - // Removing the comments below "work", except it warps you to 000-0 - // ...and when jail term expires you go back to jail. "warp" fails. - //sc_end SC_JAILED; - sc_start4 SC_JAILED, .@ti, .@v1, getmapinfo(MAPINFO_ID, "000-1"), 22, 22, 10000, SCFLAG_FIXEDRATE|SCFLAG_FIXEDTICK|SCFLAG_NOAVOID; - //warp .@m$, .@x, .@y; - debugmes "MID is now %d", getstatus(SC_JAILED, 2); + // When renewing status' information: val3 = map_index+1 val4 = coords + // coords are done with &0xFFFF and <<16 + // (22&0xFFFF|22<<16) + // ...However, @v4 has other stuff, so at the moment only save point + sc_start4 SC_JAILED, .@ti, .@v1, .@v2, getmapinfo(MAPINFO_ID, "000-1")+1, .@v4, 10000, SCFLAG_FIXEDRATE|SCFLAG_FIXEDTICK|SCFLAG_NOAVOID; + // Debug info + .@v3=getstatus(SC_JAILED, 3); + .@v4=getstatus(SC_JAILED, 4); + debugmes "sc4 (%d, %d, %d, %d)", .@v1, .@v2, .@v3, .@v4; + debugmes "Target %s (%d,%d)", getmapinfo(MAPINFO_NAME, .@v3 - 1), (.@v4|0xFFFF), (.@v4 >> 16); break; } } else { -- cgit v1.2.3-70-g09d2