fgepicaccessurn.lua 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. --[[
  2. Script Name : SpawnScripts/FallenGate/fgepicaccessurn.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.07.12 07:07:09
  5. Script Purpose :
  6. :
  7. --]]
  8. local SearchTheDepthsOfFallenGate = 5307
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 10, "InRange", Spawn)
  11. end
  12. function InRange(NPC, Spawn)
  13. if HasQuest(Spawn, SearchTheDepthsOfFallenGate) then
  14. if GetQuestStep(Spawn, SearchTheDepthsOfFallenGate) == 2 then
  15. SetAccessToEntityCommand(Spawn,NPC,"look in the urn", 1)
  16. SpawnSet(NPC, "show_command_icon", 1)
  17. SpawnSet(NPC, "display_hand_icon", 1)
  18. elseif QuestStepIsComplete(Spawn, SearchTheDepthsOfFallenGate, 2) then
  19. SetAccessToEntityCommand(Spawn,NPC,"look in the urn", 0)
  20. SpawnSet(NPC, "show_command_icon", 0)
  21. SpawnSet(NPC, "display_hand_icon", 0)
  22. end
  23. elseif not HasQuest(Spawn, SearchTheDepthsOfFallenGate) then
  24. SetAccessToEntityCommand(Spawn,NPC,"look in the urn", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. SpawnSet(NPC, "display_hand_icon", 0)
  27. end
  28. end
  29. function casted_on(NPC, Spawn, SpellName)
  30. if SpellName == 'look in the urn' then
  31. if GetQuestStep(Spawn, SearchTheDepthsOfFallenGate) == 2 then
  32. SetStepComplete(Spawn, SearchTheDepthsOfFallenGate, 2)
  33. end
  34. SendMessage(Spawn, "The urn is filled with ashes. The markings around the edge match the inscriptions noted in the tome you read in the Academy. This must be what you're looking for!")
  35. SetAccessToEntityCommand(Spawn,NPC,"look in the urn", 0)
  36. SpawnSet(NPC, "show_command_icon", 0)
  37. SpawnSet(NPC, "display_hand_icon", 0)
  38. end
  39. end
  40. function respawn(NPC)
  41. spawn(NPC)
  42. end