9
3

NektroposCastle.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. --[[
  2. Script Name : ZoneScripts/NektroposCastle.lua
  3. Script Purpose : Nektropos Castle
  4. Script Author : smash
  5. Script Date : 2016.1.24
  6. Script Notes :
  7. --]]
  8. function init_zone_script(Zone)
  9. SetLocationProximityFunction(Zone, -0.05, -0.34, 33.54, 10, "OfferVisionsOfHatred", "Leave")
  10. SetLocationProximityFunction(Zone, -51, 14, 80, 10, "SpawnArchfiend", "Leave")
  11. SetLocationProximityFunction(Zone, 57, 14, -84, 10, "SpawnNythDollsBed", "Leave")
  12. SetLocationProximityFunction(Zone, -27, 13, -28, 7, "SpawnNythDollsBedroomMaltus", "Leave")
  13. SetLocationProximityFunction(Zone, -40, -13, -45, 7, "SpawnNythDollsBasement1", "Leave")
  14. SetLocationProximityFunction(Zone, -24, -13, -45, 7, "SpawnNythDollsBasement2", "Leave")
  15. SetLocationProximityFunction(Zone, 48, -13.5, 10, 7, "MaltusHallwayTrap1", "Leave")
  16. SetLocationProximityFunction(Zone, 81, -13.5, 11, 7, "MaltusHallwayTrap2", "Leave")
  17. SetLocationProximityFunction(Zone, 130, -13.5, 11, 7, "MaltusHallwayTrap4", "Leave")
  18. SetLocationProximityFunction(Zone, 157, -13.5, 11, 7, "MaltusHallwayTrap5", "Leave")
  19. end
  20. function OfferVisionsOfHatred(Zone, Player)
  21. if CanReceiveQuest(Player, 173) then
  22. OfferQuest(nil,Player, 173)
  23. SendMessage(Player, "A strange hatred grows inside you.")
  24. end
  25. end
  26. function Leave(Zone, Player)
  27. end
  28. function SpawnArchfiend(Zone, Player)
  29. --Using deirdre's door to keep track on if this mob was spawned
  30. local door = GetSpawnByLocationID(Zone, 1439497)
  31. if door == nil then
  32. return
  33. end
  34. if GetTempVariable(door, "ArchfiendSpawned") ~= "true" then
  35. --Spawn Archfiend Izzoroth
  36. SetTempVariable(door, "ArchfiendSpawned", "true")
  37. SpawnByLocationID(Zone, 616612)
  38. end
  39. end
  40. function SpawnNythDollsBed(Zone, Player)
  41. local bed = GetSpawnByLocationID(Zone, 439534)
  42. if GetTempVariable(bed, "NythDollsSpawned") ~= "true" then
  43. SpawnGroupByID(Zone, 1043630)
  44. SetTempVariable(bed, "NythDollsSpawned", "true")
  45. SendMessage(Player, "As you approach the bed dolls scurry out from under the bed to attack.")
  46. end
  47. end
  48. function SpawnNythDollsBedroomMaltus(Zone, Player)
  49. local door = GetSpawnByLocationID(Zone, 1439456)
  50. if GetTempVariable(door, "NythDollsSpawned") ~= "true" then
  51. SpawnGroupByID(Zone, 43686)
  52. SetTempVariable(door, "NythDollsSpawned", "true")
  53. SendMessage(Player, "You hear the sound of tiny voices laughing at you.")
  54. end
  55. end
  56. function SpawnNythDollsBasement1(Zone, Player)
  57. local door = GetSpawnByLocationID(Zone, 1439456)
  58. if GetTempVariable(door, "NythDollsBasementSpawned") ~= "true" then
  59. SpawnGroupByID(Zone, 43685)
  60. SetTempVariable(door, "NythDollsBasementSpawned", "true")
  61. SendMessage(Player, "You hear the sound of tiny voices laughing at you.")
  62. end
  63. end
  64. function SpawnNythDollsBasement2(Zone, Player)
  65. local door = GetSpawnByLocationID(Zone, 1439456)
  66. if GetTempVariable(door, "NythDollsBasementSpawned2") ~= "true" then
  67. SpawnGroupByID(Zone, 43686)
  68. SetTempVariable(door, "NythDollsBasementSpawned2", "true")
  69. SendMessage(Player, "You hear the sound of tiny voices laughing at you.")
  70. end
  71. end
  72. function MaltusHallwayTrap1(Zone, Player)
  73. local door = GetSpawnByLocationID(Zone, 619853)
  74. if GetTempVariable(door, "MaltusHallwayTrap1") ~= "true" then
  75. SetTempVariable(door, "MaltusHallwayTrap1", "true")
  76. local door2 = GetSpawnByLocationID(Zone, 619850)
  77. UseWidget(door)
  78. UseWidget(door2)
  79. SendMessage(Player, "You hear the sound of grating stone as the doors slide open.")
  80. local fleshripper = GetSpawnByLocationID(Zone, 616395)
  81. if fleshripper ~= nil then
  82. Attack(fleshripper, Player)
  83. end
  84. end
  85. end
  86. function MaltusHallwayTrap2(Zone, Player)
  87. local door = GetSpawnByLocationID(Zone, 619866)
  88. if GetTempVariable(door, "MaltusHallwayTrap2") ~= "true" then
  89. SetTempVariable(door, "MaltusHallwayTrap2", "true")
  90. local door2 = GetSpawnByLocationID(Zone, 619867)
  91. local door3 = GetSpawnByLocationID(Zone, 439514)
  92. local door4 = GetSpawnByLocationID(Zone, 439515)
  93. UseWidget(door)
  94. UseWidget(door2)
  95. UseWidget(door3)
  96. UseWidget(door4)
  97. SendMessage(Player, "You're not sure but you think the walls were making noise.")
  98. local fleshripper = GetSpawnByLocationID(Zone, 616646)
  99. if fleshripper ~= nil then
  100. Attack(fleshripper, Player)
  101. end
  102. end
  103. end
  104. function MaltusHallwayTrap4(Zone, Player)
  105. local door = GetSpawnByLocationID(Zone, 439516)
  106. if GetTempVariable(door, "MaltusHallwayTrap4") ~= "true" then
  107. SetTempVariable(door, "MaltusHallwayTrap4", "true")
  108. local door2 = GetSpawnByLocationID(Zone, 619871)
  109. UseWidget(door)
  110. UseWidget(door2)
  111. SendMessage(Player, "You hear a grating noise as the walls begin to shift, but the doors fail to open completely.")
  112. end
  113. end
  114. function MaltusHallwayTrap5(Zone, Player)
  115. local door = GetSpawnByLocationID(Zone, 619886)
  116. if GetTempVariable(door, "MaltusHallwayTrap5") ~= "true" then
  117. SetTempVariable(door, "MaltusHallwayTrap5", "true")
  118. local door2 = GetSpawnByLocationID(Zone, 619884)
  119. UseWidget(door)
  120. UseWidget(door2)
  121. SendMessage(Player, "You're not sure but you think the walls were making noise.")
  122. end
  123. end