From 31ae85fa7150dbe25f2b4ad701dbb0acbdfc3c0d Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 26 Jan 2019 12:27:30 -0200 Subject: Polish a bit the Random Treasure Chest (aka. the @Krists great experiment). Oh, did I mention special dungeon fishing testing getting in previous commit? --- npc/007-1/treasure.txt | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/npc/007-1/treasure.txt b/npc/007-1/treasure.txt index 6547ae8ee..f4ec03d6f 100644 --- a/npc/007-1/treasure.txt +++ b/npc/007-1/treasure.txt @@ -19,14 +19,15 @@ OnInit: } /* -007-1,87,73,0 duplicate(#fishing_00710) #fishing_00711 NPC_WATER_SPLASH -007-1,31,52,0 duplicate(#fishing_00710) #fishing_00712 NPC_WATER_SPLASH -007-1,30,63,0 duplicate(#fishing_00710) #fishing_00713 NPC_WATER_SPLASH -007-1,64,127,0 duplicate(#fishing_00710) #fishing_00714 NPC_WATER_SPLASH +007-1,x,y,0 duplicate(#fishing_00710) #fishing_00711 NPC_WATER_SPLASH +007-1,x,y,0 duplicate(#fishing_00710) #fishing_00712 NPC_WATER_SPLASH */ // Animation code by Evol Team // 4144, gumi, Hal9000, Reid +// (Random) Treasure Chest +// Authored by Jesusalva +// Regenerates every 6 hours 007-1,0,0,0 script #chest_00710 NPC_CHEST,{ if (!.busy && !.empty) { @@ -73,8 +74,12 @@ OnInit: .dir = .dir == 0 ? 2 : 6; // closed ? opening : closing .busy = true; // lock until available again initnpctimer; + } else if (!.busy) { + mesc l("Someone looted this treasure box already..."); + } else { + end; } - end; + close; OnTimer160: .dir = .dir == 6 ? 0 : 4; // closing ? closed : open @@ -93,12 +98,15 @@ OnInit: end; OnClock0156: +OnClock0756: OnClock1356: - // Try to warp randomly to a walkable spot, up to 30 attempts +OnClock1956: + // Try to warp randomly to a walkable spot, up to 20 attempts + // Otherwise, it'll stay where it already is (but will close and refill). .@e=0; .@x=0; .@y=0; while (!checkcell(.mp$, .@x, .@y, cell_chkpass)) { - if (.@e == 30) { + if (.@e == 20) { .@x=.x; .@y=.y; break; -- cgit v1.2.3-60-g2f50