From b1ef48d172803c6c73ecc366cf9b20d4657cd429 Mon Sep 17 00:00:00 2001
From: Reid <reidyaro@gmail.com>
Date: Sat, 30 Jun 2012 17:43:34 +0200
Subject: Correct initnpctimer and startnpctimer on chest.txt .

---
 npc/000-1/chest.txt | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

(limited to 'npc')

diff --git a/npc/000-1/chest.txt b/npc/000-1/chest.txt
index ea886b97..cf924891 100644
--- a/npc/000-1/chest.txt
+++ b/npc/000-1/chest.txt
@@ -1,27 +1,41 @@
 // Evol scripts.
 // Authors:
-//  Hal9000 (Francesco Miglietta), Reid
+//    Hal9000 (Francesco Miglietta), Reid
 // Description:
 //    An opening treasure chest.
 // Variable:
-//  ShipQuests_TreasureChest
+//    ShipQuests_TreasureChest
 // Values:
-//  0: Not opened.
-//  1: Opened.
+//    0: Not opened.
+//    1: Opened.
 
 000-1.gat,58,31,0	script	Chest	316;2,{
 
-    set @q, geta(ShipQuests, ShipQuests_TreasureChest);
-    if (@q == 1) close;
-    
+    set @q, geta2(ShipQuests, ShipQuests_TreasureChest);
+    if (getnpcdir ("") == 4) goto l_Give;
 
-L_FirstEncounter:
-    seta ShipQuests, ShipQuests_TreasureChest, 1;
+    setnpcdir 2;
+    initnpctimer;
+    startnpctimer;
+    close;
 
-    mesn;
-    mesq l("Hey it works!");
+l_Give:
+    if (@q > 1) goto l_Close;
+    seta2 ShipQuests, ShipQuests_TreasureChest, 1;
+    getitem "WornShirt", 1;
+    getitem "WornShorts", 1;
     close;
 
+l_Close:
+    setnpcdir 6;
+    initnpctimer;
+    startnpctimer;
+    close;
 
+OnTimer220:
+    stopnpctimer;
+    if (getnpcdir ("") == 2) setnpcdir 4;
+    if (getnpcdir ("") == 6) setnpcdir 0;
+    end;
 
-}
+}
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2