digging_machine.lua 762 B

12345678910111213141516171819202122232425262728293031323334
  1. --[[
  2. Script Name : SpawnScripts/Caves/digging_machine.lua
  3. Script Purpose : digging_machine
  4. Script Author : Scatman
  5. Script Date : 2009.05.16
  6. Script Notes :
  7. --]]
  8. local QUEST2_FROM_CONSULBREE = 222
  9. function spawn(NPC)
  10. --SetRequiredQuest(NPC, QUEST2_FROM_CONSULBREE, 2)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function hailed(NPC, Spawn)
  16. end
  17. function casted_on(Caster, Target)
  18. if HasQuest(Caster, QUEST2_FROM_CONSULBREE) and not QuestStepIsComplete(Caster, QUEST2_FROM_CONSULBREE, 2) then
  19. AddStepProgress(Caster, QUEST2_FROM_CONSULBREE, 2, 1)
  20. SendMessage(Caster, "Charges set for 3 seconds.")
  21. AddTimer(Target, 3000, "BlowUpMachine", 1, Caster)
  22. end
  23. end
  24. function BlowUpMachine(NPC, Spawn)
  25. Despawn(NPC)
  26. -- explosives
  27. RemoveItem(Spawn, 4873)
  28. end