9
3

quest_shipment_1.lua 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/quest_shipment_1.lua
  3. Script Purpose : quest_shipment_1
  4. Script Author : Scatman
  5. Script Date : 2009.05.11
  6. Script Notes :
  7. --]]
  8. local QUEST_4 = 218
  9. function spawn(NPC)
  10. --SetRequiredQuest(NPC, QUEST_4)
  11. end
  12. function respawn(NPC)
  13. Spawn(NPC)
  14. end
  15. function hailed(NPC, Spawn)
  16. end
  17. function casted_on(Target, Caster)
  18. if HasQuest(Caster, QUEST_4) then
  19. if IsBox1(Target) == true and not QuestStepIsComplete(Caster, QUEST_4, 1) then
  20. SendMessage(Caster, "Charges set for 5 seconds.")
  21. SetStepComplete(Caster, QUEST_4, 1)
  22. AddTimer(Target, 5000, "BlowUpBox")
  23. elseif IsBox2(Target) == true and not QuestStepIsComplete(Caster, QUEST_4, 2) then
  24. SendMessage(Caster, "Charges set for 5 seconds.")
  25. SetStepComplete(Caster, QUEST_4, 2)
  26. AddTimer(Target, 5000, "BlowUpBox")
  27. elseif IsBox3(Target) == true and not QuestStepIsComplete(Caster, QUEST_4, 3) then
  28. SendMessage(Caster, "Charges set for 5 seconds.")
  29. SetStepComplete(Caster, QUEST_4, 3)
  30. AddTimer(Target, 5000, "BlowUpBox")
  31. end
  32. end
  33. end
  34. function IsBox1(Box)
  35. if math.floor(GetX(Box)) == 688 and math.floor(GetY(Box)) == -35 and math.floor(GetZ(Box)) == 600 then
  36. return true
  37. else
  38. return false
  39. end
  40. end
  41. function IsBox2(Box)
  42. if math.floor(GetX(Box)) == 753 and math.floor(GetY(Box)) == -33 and math.floor(GetZ(Box)) == 604 then
  43. return true
  44. else
  45. return false
  46. end
  47. end
  48. function IsBox3(Box)
  49. if math.floor(GetX(Box)) == 797 and math.floor(GetY(Box)) == -33 and math.floor(GetZ(Box)) == 580 then
  50. return true
  51. else
  52. return false
  53. end
  54. end
  55. function BlowUpBox(Box)
  56. -- make box go boom. need visual
  57. Despawn(Box)
  58. end