NettlevilleBlackburrowStout.lua 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. --[[
  2. Script Name : SpawnScripts/Nettleville/NettlevilleBlackburrowStout.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.06.21 10:06:42
  5. Script Purpose :
  6. :
  7. --]]
  8. local Stout = 5594
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 16, "InRange", Spawn)
  11. end
  12. function casted_on(NPC, Spawn, SpellName)
  13. if SpellName == 'Inspect' then
  14. local con = CreateConversation()
  15. AddConversationOption(con, "Take the cask and try to find the owner.", "offer")
  16. AddConversationOption(con, "Leave the cask alone.")
  17. StartDialogConversation(con, 1, NPC, Spawn, "This worn cask appears to have been forgetten. As you wipe away some grime Gnollish symbols and the word 'Starcrest' becomes visable.")
  18. end
  19. end
  20. function offer(NPC, Spawn)
  21. OfferQuest(NPC, Spawn, Stout)
  22. local con = CreateConversation()
  23. AddConversationOption(con, "Perhaps a tavern would be interested in this brew.")
  24. StartDialogConversation(con, 1, NPC, Spawn, "You go to pick up the cask and wrack your brain on who might want this.")
  25. SetAccessToEntityCommand(Spawn,NPC,"Inspect coffin", 0)
  26. SpawnSet(NPC, "show_command_icon", 0)
  27. SpawnSet(NPC, "display_hand_icon", 0)
  28. AddTimer(NPC, 10000, "check", 1, Spawn)
  29. end
  30. function InRange(NPC, Spawn)
  31. if HasQuest(Spawn, Stout) or HasCompletedQuest(Spawn, Stout) then
  32. SetAccessToEntityCommand(Spawn,NPC,"Inspect", 0)
  33. SpawnSet(NPC, "show_command_icon", 0)
  34. SpawnSet(NPC, "display_hand_icon", 0)
  35. -- SpawnSet(NPC, "model_type", 0)
  36. end
  37. end
  38. function check(NPC, Spawn)
  39. if not HasQuest(Spawn, Stout) and not HasCompletedQuest(Spawn, Stout) then
  40. SpawnSet(NPC, "show_command_icon", 1)
  41. SpawnSet(NPC, "display_hand_icon", 1)
  42. SetAccessToEntityCommand(Spawn,NPC,"Inspect", 1)
  43. -- SpawnSet(NPC, "model_type", 2942)
  44. else
  45. SetAccessToEntityCommand(Spawn,NPC,"Inspect", 0)
  46. SpawnSet(NPC, "show_command_icon", 0)
  47. SpawnSet(NPC, "display_hand_icon", 0)
  48. -- SpawnSet(NPC, "model_type", 0)
  49. end
  50. end
  51. function respawn(NPC)
  52. spawn(NPC)
  53. end