widgetbowlmap.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. Script Name : SpawnScripts/Antonica/widgetbowlmap.lua
  3. Script Author : Premierio015
  4. Script Date : 2022.08.11 06:08:22
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheCavemawsSinisterMap = 5714
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange")
  11. end
  12. function InRange(NPC, Spawn)
  13. if HasQuest(Spawn, TheCavemawsSinisterMap) or HasCompletedQuest(Spawn, TheCavemawsSinisterMap) then
  14. SpawnSet(NPC, "show_command_icon", 0)
  15. SpawnSet(NPC, "display_hand_icon", 0)
  16. SetAccessToEntityCommand(Spawn,NPC,"look under bowl", 0)
  17. end
  18. end
  19. function casted_on(NPC, Spawn, SpellName)
  20. SpawnSet(NPC, "show_command_icon", 0)
  21. SpawnSet(NPC, "display_hand_icon", 0)
  22. SetAccessToEntityCommand(Spawn,NPC,"look under bowl", 0)
  23. AddTimer(NPC, 10000, "check", 1, Spawn)
  24. local con = CreateConversation()
  25. AddConversationOption(con, "Examine the parchment.", "con1")
  26. AddConversationOption(con, "Leave it alone.")
  27. StartDialogConversation(con, 1, NPC, Spawn, "You see a piece of parchment being held down by a large bowl.")
  28. end
  29. function con1(NPC, Spawn)
  30. OfferQuest(NPC, Spawn, TheCavemawsSinisterMap)
  31. local con = CreateConversation()
  32. AddConversationOption(con, "I will slay the Cavemaw tunnelers.")
  33. StartDialogConversation(con, 1, NPC, Spawn, "Closer inspection of the parchment reveals that it is a map. The map outlines a Gnollish plan to dig a tunnel from the mountain all the way to Qeynos. Without tunnelers, their progress would be slowed down to a halt.")
  34. end
  35. function check(NPC, Spawn)
  36. if not HasQuest(Spawn, TheCavemawsSinisterMap) and not HasCompletedQuest(Spawn, TheCavemawsSinisterMap) then
  37. SpawnSet(NPC, "show_command_icon", 1)
  38. SpawnSet(NPC, "display_hand_icon", 1)
  39. SetAccessToEntityCommand(Spawn,NPC,"look under bowl", 1)
  40. end
  41. end
  42. function respawn(NPC)
  43. spawn(NPC)
  44. end