hiddentools.lua 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. Script Name : SpawnScripts/ForestRuins/hiddentools.lua
  3. Script Author : Dorbin
  4. Script Date : 2022.03.01 04:03:10
  5. Script Purpose :
  6. NOTE on how script on live works.
  7. Player uses 'Sprinkle Nullification Powder' on hidden tools bush;
  8. Bush glows with purple aura for 3-5 seconds;
  9. Final glow intesnifies and appearance changes to mechanical device with same glowing aura;
  10. 'a Tool Guardian' spawns and attacks player;
  11. Player can uses device and command_code 'Destroy Device';
  12. Quest is updated, Expolsion spell animation on device occurs, and visual of the device & aura disappears;
  13. 15-30 seconds later the aura returns on the invisable device (or the actual device if player didn't Destroy it);
  14. 3 seconds later the appearance changes back to a visable bush with the aura;
  15. 1-2 seconds later the aura fades, leaving the bush;
  16. --]]
  17. local CACHES_QUEST_ID = 5492
  18. local toolGuard = 1960098
  19. function spawn(NPC)
  20. SetRequiredQuest(NPC, CACHES_QUEST_ID, 1, 0)
  21. end
  22. function hailed(NPC, Spawn)
  23. FaceTarget(NPC, Spawn)
  24. end
  25. function respawn(NPC)
  26. end
  27. function casted_on(NPC, Spawn, Message)
  28. if HasQuest(Spawn, CACHES_QUEST_ID) then
  29. if Message == "Spinkle nullification powder" then
  30. AddStepProgress(Spawn, FAVORS_QUEST_ID, 1, 1)
  31. SetModelType(NPC,5210)
  32. SpawnMob(NPC, toolGuard)
  33. Attack(toolGuard, Spawn)
  34. AddTimer(NPC,15000,Despawn)
  35. end
  36. end
  37. end