widgetbrokentable.lua 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/CryptBetrayal/widgetbrokentable.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.11.02 05:11:23
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheHiddenWantedPoster = 5393
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 3, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, TheHiddenWantedPoster) and not HasCompletedQuest(Spawn, TheHiddenWantedPoster) then
  14. SpawnSet(NPC, "show_command_icon", 1)
  15. SpawnSet(NPC, "display_hand_icon", 1)
  16. end
  17. end
  18. function casted_on(NPC, Spawn, SpellName)
  19. if SpellName == 'examine table' then
  20. conversation = CreateConversation()
  21. AddConversationOption(conversation, "Look under table. ", "offer")
  22. AddConversationOption(conversation, "Move table aside.")
  23. StartDialogConversation(conversation, 1, NPC, Spawn, "You see something poking out from under the broken table.")
  24. SetAccessToEntityCommand(Spawn,NPC,"examine table", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. SpawnSet(NPC, "display_hand_icon", 0)
  27. AddTimer(NPC, 10000, "check", 1, Spawn)
  28. end
  29. end
  30. function check(NPC, Spawn)
  31. if not HasQuest(Spawn, TheHiddenWantedPoster) and not HasCompletedQuest(Spawn, TheHiddenWantedPoster) then
  32. SpawnSet(NPC, "show_command_icon", 1)
  33. SpawnSet(NPC, "display_hand_icon", 1)
  34. SetAccessToEntityCommand(Spawn,NPC,"examine table", 1)
  35. end
  36. end
  37. function offer(NPC, Spawn)
  38. OfferQuest(NPC, Spawn, TheHiddenWantedPoster)
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "I will bring them to justice.")
  41. AddConversationOption(conversation, "exit")
  42. StartDialogConversation(conversation, 1, NPC, Spawn, "Once you move the table aside you see a Qeynos wanted poster torn in half seeking the heads of Bloodsaber sentinels. You should bring them to justice for the city of Qeynos!")
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end