questwheelofvaniki.lua 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/Commonlands/questwheelofvaniki.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.23 10:05:30
  5. Script Purpose :
  6. :
  7. --]]
  8. local TheWheelOfVaniki = 5230
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange")
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function InRange(NPC, Spawn)
  16. if GetQuestStep(Spawn, TheWheelOfVaniki) == 1 then
  17. SpawnSet(NPC, "display_hand_icon", 1)
  18. SpawnSet(NPC, "show_command_icon", 1)
  19. AddPrimaryEntityCommand(Spawn, NPC, "Examine rock", 2, "", "", 100, "")
  20. end
  21. end
  22. function casted_on(NPC, Spawn, SpellName)
  23. if SpellName == 'Examine rock' then
  24. if GetQuestStep(Spawn, TheWheelOfVaniki) == 1 then
  25. SetStepComplete(Spawn, TheWheelOfVaniki, 1)
  26. end
  27. AddTimer(NPC, 150, "remove_access", 1)
  28. local con = CreateConversation()
  29. AddConversationOption(con, "Look more closely.", "Option1")
  30. AddConversationOption(con, "Leave the rocks alone.")
  31. StartDialogConversation(con, 1, NPC, Spawn, "Though you feel as though you've seen these types of rocks hundreds of times, upon closer examination you notice this particular one is tilted slightly, as though it is concealing something.")
  32. end
  33. end
  34. function remove_access(NPC, Spawn)
  35. SpawnSet(NPC, "display_hand_icon", 0)
  36. SpawnSet(NPC, "show_command_icon", 0)
  37. end
  38. function Option1(NPC, Spawn)
  39. local con = CreateConversation()
  40. AddConversationOption(con, "Put the rock back the way you found it.")
  41. StartDialogConversation(con, 1, NPC, Spawn, "You gently push the rock to one side and find a flat, somewhat battered object half-buried beneath it. Could this waterlogged disc be the Wheel of Vaniki? If so, it's going to need some repairs.")
  42. end