9
3

widgetcampfire.lua 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. --[[
  2. Script Name : SpawnScripts/Feerrott/widgetcampfire.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.10.14 07:10:52
  5. Script Purpose :
  6. :
  7. --]]
  8. local VisionsOfFlame = 5370 -- Visions of Flame quest
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function casted_on(NPC, Spawn, SpellName)
  13. if SpellName == 'examine fire' then
  14. local con = CreateConversation()
  15. AddConversationOption(con, "Gaze into flames.", "offer")
  16. AddConversationOption(con, "Ignore it.")
  17. StartDialogConversation(con, 1, NPC, Spawn, "You find a flickering camp fire.")
  18. end
  19. end
  20. function offer(NPC, Spawn)
  21. OfferQuest(NPC, Spawn, VisionsOfFlame)
  22. local con = CreateConversation()
  23. AddConversationOption(con, "I will slay them.")
  24. AddConversationOption(con, "exit")
  25. StartDialogConversation(con, 1, NPC, Spawn, "As you gaze into the flames you begin to see flickering images of the lizardmen of the Feerott gathering in force and spilling out into the Commonlands and Antonica. They should be stopped before this prophecy ever comes to pass!")
  26. SetAccessToEntityCommand(Spawn,NPC,"examine fire", 0)
  27. SpawnSet(NPC, "show_command_icon", 0)
  28. SpawnSet(NPC, "display_hand_icon", 0)
  29. AddTimer(NPC, 10000, "check", 1, Spawn)
  30. end
  31. function InRange(NPC, Spawn)
  32. if HasQuest(Spawn, VisionsOfFlame) or HasCompletedQuest(Spawn, VisionsOfFlame) then
  33. SetAccessToEntityCommand(Spawn,NPC,"examine fire", 0)
  34. SpawnSet(NPC, "show_command_icon", 0)
  35. SpawnSet(NPC, "display_hand_icon", 0)
  36. end
  37. end
  38. function check(NPC, Spawn)
  39. if not HasQuest(Spawn, VisionsOfFlame) and not HasCompletedQuest(Spawn, VisionsOfFlame) then
  40. SpawnSet(NPC, "show_command_icon", 1)
  41. SpawnSet(NPC, "display_hand_icon", 1)
  42. SetAccessToEntityCommand(Spawn,NPC,"examine fire", 1)
  43. end
  44. end
  45. function respawn(NPC)
  46. spawn(NPC)
  47. end