Browse Source

Update atreasurechest.lua

Fixed treasure chests in AoM client being pre-opened.  They now swing open rather quickly when opened, but not sure we have any control over the speed of the animation.  This is closer to how DoF behaves in far journey.
Image 3 years ago
parent
commit
31f74f7e34
1 changed files with 8 additions and 3 deletions
  1. 8 3
      server/SpawnScripts/FarJourneyFreeport/atreasurechest.lua

+ 8 - 3
server/SpawnScripts/FarJourneyFreeport/atreasurechest.lua

@@ -6,9 +6,13 @@
                    : 
 --]]
 
+function prespawn(NPC)
+	SpawnSet(NPC, "visual_state", 0) -- default visual state of 0, we set the visual state when we open it
+end
+
 function spawn(NPC)
 	ChangeHandIcon(NPC, 0)
-	SpawnSet(NPC, "targetable", 0, true, true)
+	SpawnSet(NPC, "targetable", 0)
 end
 
 function respawn(NPC)
@@ -26,10 +30,11 @@ function open(NPC, Player)
 	else
 		DisplayText(Player, 12, "This box is empty.")
 		ChangeHandIcon(NPC, 0)
-		SpawnSet(NPC, "targetable", 0, true, true)
+		SpawnSet(NPC, "targetable", 0)
 	end
 end
 
 function finished_open_animation(NPC)
+	SpawnSet(NPC, "visual_state", 11903) -- this swings open right in DoF, in AoM its really quick but better, not aware of any time we can expose
 	SendStateCommand(NPC, 400)
-end
+end