woodpilewidget.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/woodpilewidget.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.25 09:05:32
  5. Script Purpose :
  6. :
  7. --]]
  8. local StopTheBloodskullLumberjacks = 5233
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, StopTheBloodskullLumberjacks) and not HasCompletedQuest(Spawn, StopTheBloodskullLumberjacks) then
  14. SpawnSet(NPC, "display_hand_icon", 1)
  15. SpawnSet(NPC, "show_command_icon", 1)
  16. AddPrimaryEntityCommand(Spawn, NPC, "examine wood pile", 3, "", "", 100, "")
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. if SpellName == 'examine wood pile' then
  21. local con = CreateConversation()
  22. AddConversationOption(con, "Read parchment. ", "option1")
  23. AddConversationOption(con, "Ignore it.")
  24. StartDialogConversation(con, 1, NPC, Spawn, "You see a piece of parchment stuffed within the stack of wood.")
  25. end
  26. end
  27. function option1(NPC, Spawn)
  28. OfferQuest(NPC, Spawn, StopTheBloodskullLumberjacks )
  29. local con = CreateConversation()
  30. AddConversationOption(con, "I should take care of these orcs.")
  31. AddConversationOption(con, "exit")
  32. StartDialogConversation(con, 1, NPC, Spawn, "The parchment reads, ''You told me this was a safe area! Bloodskull lumberjacks are everywhere! How am I supposed to work?! I QUIT!")
  33. AddTimer(NPC, 150, "remove_access", 1, Spawn)
  34. end
  35. function remove_access(NPC, Spawn)
  36. if HasQuest(Spawn, StopTheBloodskullLumberjacks) then
  37. SpawnSet(NPC, "display_hand_icon", 0)
  38. SpawnSet(NPC, "show_command_icon", 0)
  39. end
  40. end
  41. function respawn(NPC)
  42. spawn(NPC)
  43. end