PeatBog.lua 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. --[[
  2. Script Name : ZoneScripts/PeatBog.lua
  3. Script Purpose : Peat Bog
  4. Script Author : Scatman
  5. Script Date : 2009.05.10
  6. Script Notes :
  7. --]]
  8. local QUEST_4 = 218
  9. local QUEST_5 = 219
  10. function init_zone_script(Zone)
  11. SetLocationProximityFunction(Zone, 688.815, -34.2423, 600.400, 30, "InRange1")
  12. SetLocationProximityFunction(Zone, 753.824, -32.7236, 604.844, 30, "InRange2")
  13. SetLocationProximityFunction(Zone, 797.389, -32.9127, 580.472, 30, "InRange3")
  14. SetLocationProximityFunction(Zone, 772.80, -33.68, 489.37, 30, "SpawnDentfang")
  15. end
  16. function InRange1(Zone, Spawn)
  17. if HasQuest(Spawn, QUEST_4) and not QuestStepIsComplete(Spawn, QUEST_4, 1) then
  18. local Box = SpawnMob(Zone, 1980131, false, 688.815, -34.2423, 600.400)
  19. SpawnGnolls(Zone, Spawn)
  20. Despawn(Box, 120000)
  21. end
  22. end
  23. function InRange2(Zone, Spawn)
  24. if HasQuest(Spawn, QUEST_4) and not QuestStepIsComplete(Spawn, QUEST_4, 2) then
  25. local Box = SpawnMob(Zone, 1980131, false, 753.824, -32.7236, 604.844)
  26. SpawnGnolls(Zone, Spawn)
  27. Despawn(Box, 120000)
  28. end
  29. end
  30. function InRange3(Zone, Spawn)
  31. if HasQuest(Spawn, QUEST_4) and not QuestStepIsComplete(Spawn, QUEST_4, 3) then
  32. local Box = SpawnMob(Zone, 1980131, false, 797.389, -32.9127, 580.472)
  33. SpawnGnolls(Zone, Spawn)
  34. Despawn(Box, 120000)
  35. end
  36. end
  37. function GetRandomGnollID()
  38. -- a gnoll guard: 1980111, 1980118
  39. -- a gnoll machinist: 1980112
  40. -- a machinist assistant: 1980113, 1980120
  41. choice = math.random(1, 5)
  42. if choice == 1 then
  43. return 1980111
  44. elseif choice == 2 then
  45. return 1980118
  46. elseif choice == 3 then
  47. return 1980112
  48. elseif choice == 4 then
  49. return 1980113
  50. elseif choice == 5 then
  51. return 1980120
  52. end
  53. end
  54. function SpawnGnolls(Zone, Spawn)
  55. local Gnoll1 = SpawnMob(Zone, GetRandomGnollID(), false, GetX(Spawn), GetY(Spawn), GetZ(Spawn))
  56. local Gnoll2 = SpawnMob(Zone, GetRandomGnollID(), false, GetX(Spawn), GetY(Spawn), GetZ(Spawn))
  57. local Gnoll3 = SpawnMob(Zone, GetRandomGnollID(), false, GetX(Spawn), GetY(Spawn), GetZ(Spawn))
  58. AddHate(Spawn, Gnoll1, 100)
  59. AddHate(Spawn, Gnoll2, 100)
  60. AddHate(Spawn, Gnoll3, 100)
  61. end
  62. function SpawnDentfang(Zone, Spawn)
  63. if HasQuest(Spawn, QUEST_5) and GetQuestStep(Spawn, QUEST_5) == 1 then
  64. -- Overseer Dentfang: 1980127
  65. -- a gnoll conspirator: 1980126
  66. -- a gnoll conspirator: 1980124
  67. -- a gnoll conspirator: 1980125
  68. if GetSpawn(Spawn, 1980127) == nil then
  69. SpawnMob(Zone, 1980127, false, 785.003, -33.8173, 486.281, 339.984)
  70. end
  71. if GetSpawn(Spawn, 1980126) == nil then
  72. SpawnMob(Zone, 1980126, false, 786.260, -33.7061, 482.401, 160)
  73. end
  74. if GetSpawn(Spawn, 1980124) == nil then
  75. SpawnMob(Zone, 1980124, false, 782.728, -33.6797, 483.157, 219.984)
  76. end
  77. if GetSpawn(Spawn, 1980125) == nil then
  78. SpawnMob(Zone, 1980125, false, 789.354, -33.5120, 484.623, 110.016)
  79. end
  80. end
  81. end