From 89c5c2c45836d047bd374fd296bfda237205ca12 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 11 Aug 2015 17:46:05 +0300 Subject: Rewrite chest script to modern way. --- npc/000-1/chest.txt | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'npc/000-1/chest.txt') diff --git a/npc/000-1/chest.txt b/npc/000-1/chest.txt index 5cd8ed1a7..eb1be9b01 100644 --- a/npc/000-1/chest.txt +++ b/npc/000-1/chest.txt @@ -12,27 +12,24 @@ // 1 Treasure Chest has been opened. 000-1,83,70,0 script #chest NPC_CHEST,{ + if (getnpcdir ("") != 4) + { + setnpcdir 2; + initnpctimer; + startnpctimer; + close; + } .@q = getq(ShipQuests_TreasureChest); - if (getnpcdir ("") == 4) goto L_Give; + if (.@q == 0) + { + inventoryplace 514, 1; + setq ShipQuests_TreasureChest, 1; + Zeny = Zeny + 100; + getitem 514, 1; + npctalk3 l("You open the treasure chest."); + } - setnpcdir 2; - initnpctimer; - startnpctimer; - close; - -L_Give: - if (.@q > 0) goto L_Close; - - inventoryplace 514, 1; - - setq ShipQuests_TreasureChest, 1; - - Zeny = Zeny + 100; - getitem 514, 1; - npctalk3 l("You open the treasure chest."); - -L_Close: setnpcdir 6; initnpctimer; startnpctimer; -- cgit v1.2.3-60-g2f50