widgetwinebottle.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : SpawnScripts/SerpentSewer/widgetwinebottle.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.01 05:07:59
  5. Script Purpose :
  6. :
  7. --]]
  8. local ZizlsMessageIntheBottle = 5266
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, ZizlsMessageIntheBottle) and not HasCompletedQuest(Spawn, ZizlsMessageIntheBottle) 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 == 'Open' then
  20. OfferQuest(NPC, Spawn, ZizlsMessageIntheBottle)
  21. conversation = CreateConversation()
  22. AddConversationOption(conversation, "Get note", "dlg1")
  23. AddConversationOption(conversation, "Ignore it")
  24. StartDialogConversation(conversation, 1, NPC, Spawn, "You are able to see that there is a note inside the bottle.")
  25. SetAccessToEntityCommand(Spawn,NPC,"Leave the supplies", 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. end
  31. function check(NPC, Spawn)
  32. if not HasQuest(Spawn, ZizlsMessageIntheBottle) and not HasCompletedQuest(Spawn, ZizlsMessageIntheBottle) then
  33. SpawnSet(NPC, "show_command_icon", 1)
  34. SpawnSet(NPC, "display_hand_icon", 1)
  35. end
  36. end
  37. function dlg1(NPC, Spawn)
  38. local con = CreateConversation()
  39. AddConversationOption(con, "I should find and free Zizl")
  40. StartDialogConversation(con, 1, NPC, Spawn, "After fishing the bottle out of the water and retrieving the note you read: \"Help! Abettors have me captive! Zizl.\"")
  41. end
  42. function respawn(NPC)
  43. spawn(NPC)
  44. end