qey_blacksmith_oven001.lua 870 B

123456789101112131415161718192021222324252627282930313233343536
  1. --[[
  2. Script Name : SpawnScripts/Caves/qey_blacksmith_oven001.lua
  3. Script Purpose : digging_machine
  4. Script Author : Scatman
  5. Script Date : 2009.10.08
  6. Script Notes :
  7. --]]
  8. local QUEST2_FROM_CONSULBREE = 224
  9. function spawn(NPC)
  10. SetRequiredQuest(NPC, QUEST2_FROM_CONSULBREE, 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_CONSULBREE) and not QuestStepIsComplete(Caster, QUEST2_FROM_CONSULBREE, 1) and SpellName == "Place Explosives" then
  19. -- explosives
  20. if HasItem(Caster, 6052) then
  21. RemoveItem(Caster, 6052)
  22. end
  23. SendMessage(Caster, "Charges set for 3 seconds.")
  24. SetStepComplete(Caster, QUEST2_FROM_CONSULBREE, 1)
  25. AddTimer(Target, 3000, "BlowUpMachine")
  26. end
  27. end
  28. function BlowUpMachine(NPC)
  29. Despawn(NPC)
  30. end