PeatBog.lua 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 = 510
  9. local QUEST_5 = 511
  10. local SunDog = 5559
  11. function init_zone_script(Zone)
  12. -- SetLocationProximityFunction(Zone, 688.815, -34.2423, 600.400, 30, "InRange1") DISABLED SINCE OBJECT ACTION REPLACED THE NEED FOR THESE.
  13. -- SetLocationProximityFunction(Zone, 753.824, -32.7236, 604.844, 30, "InRange2")
  14. -- SetLocationProximityFunction(Zone, 797.389, -32.9127, 580.472, 30, "InRange3")
  15. SetLocationProximityFunction(Zone, 772.80, -33.68, 489.37, 17, "SpawnDentfang")
  16. -- PlagueBringers(Zone,Spawn)
  17. end
  18. function InRange1(Zone, Spawn)
  19. if HasQuest(Spawn, QUEST_4) and not QuestStepIsComplete(Spawn, QUEST_4, 1) then
  20. local Box = SpawnMob(Zone, 1980091, false, 688.815, -34.2423, 600.400)
  21. SpawnGnolls(Zone, Spawn)
  22. Despawn(Box, 120000)
  23. end
  24. end
  25. function InRange2(Zone, Spawn)
  26. if HasQuest(Spawn, QUEST_4) and not QuestStepIsComplete(Spawn, QUEST_4, 2) then
  27. local Box = SpawnMob(Zone, 1980091, false, 753.824, -32.7236, 604.844)
  28. SpawnGnolls(Zone, Spawn)
  29. Despawn(Box, 120000)
  30. end
  31. end
  32. function InRange3(Zone, Spawn)
  33. if HasQuest(Spawn, QUEST_4) and not QuestStepIsComplete(Spawn, QUEST_4, 3) then
  34. local Box = SpawnMob(Zone, 1980091, false, 797.389, -32.9127, 580.472)
  35. SpawnGnolls(Zone, Spawn)
  36. Despawn(Box, 120000)
  37. end
  38. end
  39. function GetRandomGnollID()
  40. -- a gnoll guard: 1980064
  41. -- a gnoll machinist: 1980065, 1980062
  42. -- a machinist assistant: 1980066
  43. choice = math.random(1, 4)
  44. if choice == 1 then
  45. return 1980064
  46. elseif choice == 2 then
  47. return 1980065
  48. elseif choice == 3 then
  49. return 1980062
  50. elseif choice == 4 then
  51. return 1980066
  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 --1980070 actual
  65. -- a gnoll conspirator: 1980126 --1980068 actual
  66. -- a gnoll conspirator: 1980124 --1980067 actual
  67. -- a gnoll conspirator: 1980125 --1980069 actual
  68. if SpawnByLocationID(Zone, 329637) == nil then
  69. SpawnByLocationID(Zone,329637)
  70. -- SpawnMob(Zone, 1980070, false, 785.003, -33.8173, 486.281, 339.984)
  71. end
  72. if SpawnByLocationID(Zone, 329633) == nil then
  73. --SpawnMob(Zone, 1980068, false, 786.260, -33.7061, 482.401, 160)
  74. SpawnByLocationID(Zone,329633)
  75. end
  76. if GetSpawnLocationID(Zone, 329632) == nil then
  77. -- SpawnMob(Zone, 1980067, false, 782.728, -33.6797, 483.157, 219.984)
  78. SpawnByLocationID(Zone,329632)
  79. end
  80. if GetSpawnLocationID(Zone, 329636) == nil then
  81. -- SpawnMob(Zone, 1980069, false, 789.354, -33.5120, 484.623, 110.016)
  82. SpawnByLocationID(Zone,329636)
  83. end
  84. end
  85. end