9
3

widgetcandleholder.lua 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --[[
  2. Script Name : SpawnScripts/CryptBetrayal/widgetcandleholder.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.11.01 07:11:08
  5. Script Purpose :
  6. :
  7. --]]
  8. local CellanasLocket = 5389
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 3, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if not HasQuest(Spawn, CellanasLocket) and not HasCompletedQuest(Spawn, CellanasLocket) 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 == 'examine candle holder' then
  20. conversation = CreateConversation()
  21. AddConversationOption(conversation, "Read the inscription.", "offer")
  22. AddConversationOption(conversation, "Ignore it.")
  23. StartDialogConversation(conversation, 1, NPC, Spawn, "You find a worthless necklace made of woven thread wrapped around the base of the candle holder. Attached to the necklace you find a crude tin locket that bears an inscription.")
  24. SetAccessToEntityCommand(Spawn,NPC,"examine candle holder", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. SpawnSet(NPC, "display_hand_icon", 0)
  27. AddTimer(NPC, 10000, "check", 1, Spawn)
  28. end
  29. end
  30. function check(NPC, Spawn)
  31. if not HasQuest(Spawn, CellanasLocket) and not HasCompletedQuest(Spawn, CellanasLocket) then
  32. SpawnSet(NPC, "show_command_icon", 1)
  33. SpawnSet(NPC, "display_hand_icon", 1)
  34. SetAccessToEntityCommand(Spawn,NPC,"examine candle holder", 1)
  35. end
  36. end
  37. function offer(NPC, Spawn)
  38. OfferQuest(NPC, Spawn, CellanasLocket)
  39. conversation = CreateConversation()
  40. AddConversationOption(conversation, "I will avenge her.")
  41. AddConversationOption(conversation, "exit")
  42. StartDialogConversation(conversation, 1, NPC, Spawn, "The locket reads: \"In memory of Cellana, who met her death at the hand of a haunted essence. Only a great adventurer would find this, please avenge her in your travels.\"")
  43. end
  44. function respawn(NPC)
  45. spawn(NPC)
  46. end