9
3

hiddentools.lua 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 zone = GetZone(NPC)
  18. local CACHES_QUEST_ID = 5492
  19. local toolGuard = 1960098
  20. function spawn(NPC)
  21. SetRequiredQuest(NPC, CACHES_QUEST_ID, 1, 0)
  22. end
  23. function hailed(NPC, Spawn)
  24. FaceTarget(NPC, Spawn)
  25. end
  26. function respawn(NPC)
  27. end
  28. function casted_on(NPC, Spawn, Message)
  29. if HasQuest(Spawn, CACHES_QUEST_ID) then
  30. if Message == "Spinkle nullification powder" then
  31. AddStepProgress(Spawn, FAVORS_QUEST_ID, 1, 1)
  32. SetModelType(NPC,5210)
  33. SpawnMob(NPC, toolGuard)
  34. Attack(toolGuard, Spawn)
  35. AddTimer(NPC,15000,Despawn)
  36. end
  37. end
  38. end