atreasurechest.lua 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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 spawn(NPC)
  9. ChangeHandIcon(NPC, 0)
  10. SpawnSet(NPC, "targetable", 0, true, true)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function open(NPC, Player)
  16. SendStateCommand(NPC, 399)
  17. AddTimer(NPC, 2000, "finished_open_animation")
  18. if HasPendingLoot(NPC, Player) then
  19. ShowLootWindow(Player, NPC)
  20. DisplayText(Player, 12, "There appears to be something inside this box.")
  21. 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")
  22. SetTutorialStep(player, 16)
  23. else
  24. DisplayText(Player, 12, "This box is empty.")
  25. ChangeHandIcon(NPC, 0)
  26. SpawnSet(NPC, "targetable", 0, true, true)
  27. end
  28. end
  29. function finished_open_animation(NPC)
  30. SendStateCommand(NPC, 400)
  31. end