9
3

questshipment1.lua 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. --[[
  2. Script Name : SpawnScripts/PeatBog/questshipment1.lua
  3. Script Author : Shatou
  4. Script Date : 2020.01.08 09:01:53
  5. Script Purpose :
  6. :
  7. --]]
  8. local ON_THE_MOVE_QUEST_ID = 510
  9. local A_GNOLL_MACHINIST_ID = 1980065
  10. local A_GNOLL_GUARD_ID = 1980064
  11. local A_MACHINIST_ASSISTANT_ID = 1980066
  12. function spawn(NPC)
  13. if GetSpawnLocationID(NPC)== 456189 then
  14. SetRequiredQuest(NPC, ON_THE_MOVE_QUEST_ID, 1, 1,0,0)
  15. elseif GetSpawnLocationID(NPC)== 456191 then
  16. SetRequiredQuest(NPC, ON_THE_MOVE_QUEST_ID, 2, 1,0,0)
  17. elseif GetSpawnLocationID(NPC)== 1587455 then
  18. SetRequiredQuest(NPC, ON_THE_MOVE_QUEST_ID, 3, 1,0,0)
  19. end
  20. end
  21. function hailed(NPC, Spawn)
  22. FaceTarget(NPC, Spawn)
  23. end
  24. function respawn(NPC)
  25. end
  26. function casted_on(NPC, Spawn, Message)
  27. PlayFlavor(NPC,"","","result_explosion_fireworks",0,0,Spawn)
  28. PlaySound(NPC,"sounds/liveevents/samhain2005/samhain05_explosion001.wav",GetX(NPC), GetY(NPC), GetZ(NPC),Spawn)
  29. AddTimer(NPC,800,"QuestUpdate",1,Spawn)
  30. if HasQuest(Spawn, ON_THE_MOVE_QUEST_ID) then
  31. if GetQuestStep(Spawn, ON_THE_MOVE_QUEST_ID) == 1 then
  32. if Message == "Place Explosives" then
  33. if GetSpawnLocationID(NPC)== 456189 then
  34. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 1)
  35. elseif GetSpawnLocationID(NPC)== 456191 then
  36. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 2)
  37. elseif GetSpawnLocationID(NPC)== 1587455 then
  38. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 3)
  39. end
  40. end
  41. elseif GetQuestStep(Spawn, ON_THE_MOVE_QUEST_ID) == 2 then
  42. if Message == "Place Explosives" then
  43. if GetSpawnLocationID(NPC)== 456189 then
  44. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 1)
  45. elseif GetSpawnLocationID(NPC)== 456191 then
  46. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 2)
  47. elseif GetSpawnLocationID(NPC)== 1587455 then
  48. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 3)
  49. end
  50. end
  51. elseif GetQuestStep(Spawn, ON_THE_MOVE_QUEST_ID) == 3 then
  52. if Message == "Place Explosives" then
  53. if GetSpawnLocationID(NPC)== 456189 then
  54. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 1)
  55. elseif GetSpawnLocationID(NPC)== 456191 then
  56. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 2)
  57. elseif GetSpawnLocationID(NPC)== 1587455 then
  58. SetStepComplete(Spawn, ON_THE_MOVE_QUEST_ID, 3)
  59. end
  60. end
  61. end
  62. end
  63. function QuestUpdate(NPC, Spawn, Message)
  64. local new_spawn_1 = SpawnMob(GetZone(Spawn), A_GNOLL_MACHINIST_ID, false, GetX(NPC) + 2.5, GetY(NPC), GetZ(NPC) - 3, 0)
  65. local new_spawn_2 = SpawnMob(GetZone(Spawn), A_GNOLL_GUARD_ID, false, GetX(NPC) + 2.5, GetY(NPC), GetZ(NPC) + 2.5, 0)
  66. local new_spawn_3 = SpawnMob(GetZone(Spawn), A_MACHINIST_ASSISTANT_ID, false, GetX(NPC) - 2.5, GetY(NPC), GetZ(NPC) + 2.5, 0)
  67. AddHate(Spawn, new_spawn_1, 100)
  68. AddHate(Spawn, new_spawn_2, 100)
  69. AddHate(Spawn, new_spawn_3, 100)
  70. end
  71. end