atreasurechest.lua 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --[[
  2. Script Name : SpawnScripts/FarJourneyFreeport/atreasurechest.lua
  3. Script Author : LethalEncounter
  4. Script Date : 2020.07.02
  5. Script Purpose :
  6. :
  7. --]]
  8. function prespawn(NPC)
  9. SpawnSet(NPC, "visual_state", 0) -- default visual state of 0, we set the visual state when we open it
  10. end
  11. function spawn(NPC)
  12. ChangeHandIcon(NPC, 0)
  13. SpawnSet(NPC, "targetable", 0)
  14. SetRequiredQuest(NPC, 524, 2, 0,1)
  15. end
  16. function respawn(NPC)
  17. spawn(NPC)
  18. end
  19. function open(NPC, Player)
  20. SendStateCommand(NPC, 399)
  21. AddTimer(NPC, 2000, "finished_open_animation")
  22. if HasPendingLoot(NPC, Player) then
  23. ShowLootWindow(Player, NPC)
  24. DisplayText(Player, 12, "There appears to be something inside this box.")
  25. InstructionWindow(Player, -1.0, "This screen shows the contents of the box you just opened. Left click on the loot all button to take the items from the box.", "voiceover/english/narrator/boat_06p_tutorial02/narrator_013_f0780e49.mp3", 1581263773, 1569244108, "tutorial_stage_17", "Left click on the loot all button.", "server")
  26. SetTutorialStep(player, 16)
  27. else
  28. DisplayText(Player, 12, "This box is empty.")
  29. ChangeHandIcon(NPC, 0)
  30. SpawnSet(NPC, "targetable", 0)
  31. end
  32. end
  33. function finished_open_animation(NPC)
  34. SpawnSet(NPC, "visual_state", 11897)-- this swings open correct in DoF, in AoM its really quick but better, not aware of any time we can expose
  35. AddTimer(NPC,1800, "ChestOpen")
  36. SendStateCommand(NPC, 400)
  37. end
  38. function ChestOpen(NPC)
  39. SpawnSet(NPC, "visual_state", 11903)
  40. end