--- scripts/zones/Giddeus/npcs/Treasure_Chest.lua	(revision 3739)
+++ scripts/zones/Giddeus/npcs/Treasure_Chest.lua	(working copy)
@@ -1,16 +1,13 @@
 -----------------------------------
 -- Area: Giddeus
 -- NPC:  Treasure Chest
--- 
--- @pos -158.563 0.999 -226.058 145
+-- @zone 145
 -----------------------------------
 package.loaded["scripts/zones/Giddeus/TextIDs"] = nil;
 -----------------------------------
 
 require("scripts/globals/settings");
-require("scripts/globals/keyitems");
 require("scripts/globals/treasure");
-require("scripts/globals/quests");
 require("scripts/zones/Giddeus/TextIDs");
 
 local TreasureType = "Chest";
@@ -22,11 +19,10 @@
 -----------------------------------
 
 function onTrade(player,npc,trade)
-
-	--trade:hasItemQty(1026,1); 		-- Treasure Key
-	--trade:hasItemQty(1115,1);			-- Skeleton Key
-	--trade:hasItemQty(1023,1);			-- Living Key
-	--trade:hasItemQty(1022,1);			-- Thief's Tools
+	-- trade:hasItemQty(1026,1); 		-- Treasure Key
+	-- trade:hasItemQty(1115,1);			-- Skeleton Key
+	-- trade:hasItemQty(1023,1);			-- Living Key
+	-- trade:hasItemQty(1022,1);			-- Thief's Tools
 	local questItemNeeded = 0;
 	
 	-- Player traded a key.
@@ -40,10 +36,10 @@
 		else
 			success = pack[1];
 		end
-		
+
 		if(success ~= -2) then
 			player:tradeComplete();
-			
+
 			if(math.random() <= success) then
 				-- Succeded to open the coffer
 				player:messageSpecial(CHEST_UNLOCKED);
@@ -53,7 +49,7 @@
 					-- print("loot array: "); -- debug
 					-- print("[1]", loot[1]); -- debug
 					-- print("[2]", loot[2]); -- debug
-					
+
 				if(loot[1]=="gil") then
 					player:addGil(loot[2]*GIL_RATE);
 					player:messageSpecial(GIL_OBTAINED,loot[2]*GIL_RATE);
@@ -62,11 +58,13 @@
 					player:addItem(loot[2]);
 					player:messageSpecial(ITEM_OBTAINED,loot[2]);
 				end
+
+				UpdateTreasureSpawnPoint(npc:getID());
 			end
 		end
 	end
+end;
 
-end;
 -----------------------------------
 -- onTrigger Action
 -----------------------------------
