9
3

nekfmushroomayoung.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. --[[
  2. Script Name : SpawnScripts/Nektulos/nekfmushroomayoung.lua
  3. Script Author : Premierio015
  4. Script Date : 2021.05.17 09:05:41
  5. Script Purpose : Required by the quest "Mushroom Madness"
  6. :
  7. --]]
  8. local MushroomMadness = 437
  9. function spawn(NPC)
  10. SetPlayerProximityFunction(NPC, 5, "InRange")
  11. end
  12. function hailed(NPC, Spawn)
  13. FaceTarget(NPC, Spawn)
  14. end
  15. function respawn(NPC)
  16. spawn(NPC)
  17. end
  18. function InRange(NPC, Spawn)
  19. if GetQuestStep(Spawn, MushroomMadness) == 1 then
  20. AddPrimaryEntityCommand(Spawn, NPC, "Pick a Dark Forest Cap", 2, "", "", 10000, "")
  21. SpawnSet(NPC, "display_hand_icon", 1)
  22. SpawnSet(NPC, "show_command_icon", 1)
  23. else
  24. SpawnSet(NPC, "display_hand_icon", 0)
  25. SpawnSet(NPC, "show_command_icon", 0)
  26. end
  27. end
  28. function casted_on(NPC, Spawn, SpellName)
  29. if SpellName == 'Pick a Dark Forest Cap' then
  30. AddStepProgress(Spawn, MushroomMadness, 1, 1)
  31. RemoveSpawnAccess(NPC, Spawn)
  32. AddTimer(NPC, 30000, "return_access", 1, Spawn)
  33. end
  34. end
  35. function return_access(NPC, Spawn)
  36. AddSpawnAccess(NPC, Spawn)
  37. end