9
3

digging_machine_1.lua 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --[[
  2. Script Name : SpawnScripts/Caves/digging_machine_1.lua
  3. Script Purpose : digging_machine_2
  4. Script Author : Scatman
  5. Script Date : 2009.10.18
  6. Script Notes :
  7. --]]
  8. local QUEST2_FROM_EMMA = 227
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, QUEST2_FROM_EMMA, 1)
  11. end
  12. function respawn(NPC)
  13. spawn(NPC)
  14. end
  15. function hailed(NPC, Spawn)
  16. end
  17. function casted_on(Target, Caster, SpellName)
  18. if HasQuest(Caster, QUEST2_FROM_EMMA) and not QuestStepIsComplete(Caster, QUEST2_FROM_EMMA, 1) and SpellName == "Place Explosives" then
  19. SetStepComplete(Caster, QUEST2_FROM_EMMA, 1)
  20. AddTimer(Target, 1000, "DespawnMachine")
  21. end
  22. end
  23. function DespawnMachine(NPC)
  24. local digging_machine1 = GetSpawn(NPC, 1970108)
  25. Despawn(digging_machine1)
  26. local control_device1 = GetSpawn(NPC, 1970114)
  27. Despawn(control_device1)
  28. local crate1 = GetSpawn(NPC, 1970116)
  29. Despawn(crate1)
  30. local instructions1 = GetSpawn(NPC, 1970113)
  31. Despawn(instructions1)
  32. local shovel1 = GetSpawn(NPC, 1970115)
  33. while shovel1 ~= nil do
  34. Despawn(shovel1)
  35. shovel1 = GetSpawn(NPC, 1970115)
  36. end
  37. -- spawn smashed machine
  38. Despawn(NPC)
  39. end