Advertisement
hlmbugle

Untitled

Jul 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.20 KB | None | 0 0
  1. -----------------------------------
  2. -- Area: Al'Taieu
  3. -- NM: Jailer of Love
  4. -----------------------------------
  5.  
  6. require("scripts/globals/status");
  7. require("scripts/globals/magic");
  8.  
  9. -----------------------------------
  10. -- onMobSpawn Action
  11. -----------------------------------
  12.  
  13. function onMobSpawn(mob)
  14. --setmob
  15. mob:setMod(MOD_REGEN, 500);--SBS
  16. mob:setMod(MOD_FIRE_ABSORB, 0);
  17. mob:setMod(MOD_EARTH_ABSORB, 0);
  18. mob:setMod(MOD_WIND_ABSORB, 0);
  19. mob:setMod(MOD_WATER_ABSORB, 0);
  20. mob:setMod(MOD_ICE_ABSORB, 0);
  21. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  22. mob:setMod(MOD_DARK_ABSORB, 0);
  23. end;
  24.  
  25. -----------------------------------
  26. -- onMobEngaged
  27. -----------------------------------
  28.  
  29. function onMobEngaged(mob, target)
  30. mob:hideName(false);
  31. mob:untargetable(false);
  32. mob:AnimationSub(6);--SBS
  33. end;
  34.  
  35. -----------------------------------
  36. -- onMobFight Action
  37. -----------------------------------
  38.  
  39.  
  40.  
  41. function onMobFight(mob, target)
  42. -- Only 9 Qn'xzomit and 9 Qn'hpemde can be summoned. Ru'phuabo (Sharks) are unlimited.
  43. local XZOMITS = mob:getLocalVar("JoL_Qn_xzomit_Killed");
  44. local HPEMDES = mob:getLocalVar("JoL_Qn_hpemde_Killed");
  45.  
  46.  
  47. -- Spell selection SBS
  48.  
  49. local lastSpell = mob:getLocalVar("last_spell");
  50.  
  51. if (os.time() - lastSpell > 20) then
  52. local SPELLSCAST = mob:getLocalVar("SPELLSCAST");
  53.  
  54. if (SPELLSCAST == 0) then
  55. local spellTimer = math.random(1,2)
  56. switch (spellTimer):caseof
  57. {
  58. [0] = function (x)
  59. mob:castSpell(157) --Aero IV
  60. mob:setMod(MOD_FIRE_ABSORB, 0);
  61. mob:setMod(MOD_EARTH_ABSORB, 0);
  62. mob:setMod(MOD_WIND_ABSORB, 100);
  63. mob:setMod(MOD_WATER_ABSORB, 0);
  64. mob:setMod(MOD_ICE_ABSORB, 0);
  65. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  66. mob:setMod(MOD_DARK_ABSORB, 0);
  67. end,
  68. [1] = function (x)
  69. mob:castSpell(147) --Fire IV
  70. mob:setMod(MOD_FIRE_ABSORB, 100);
  71. mob:setMod(MOD_EARTH_ABSORB, 0);
  72. mob:setMod(MOD_WIND_ABSORB, 0);
  73. mob:setMod(MOD_WATER_ABSORB, 0);
  74. mob:setMod(MOD_ICE_ABSORB, 0);
  75. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  76. mob:setMod(MOD_DARK_ABSORB, 0);
  77. end,
  78. [2] = function (x)
  79. mob:castSpell(152) --Blizzard 4
  80. mob:setMod(MOD_FIRE_ABSORB, 0);
  81. mob:setMod(MOD_EARTH_ABSORB, 0);
  82. mob:setMod(MOD_WIND_ABSORB, 0);
  83. mob:setMod(MOD_WATER_ABSORB, 0);
  84. mob:setMod(MOD_ICE_ABSORB, 100);
  85. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  86. mob:setMod(MOD_DARK_ABSORB, 0);
  87. end,
  88. [3] = function (x)
  89. mob:castSpell(186) --Aeroga 3
  90. mob:setMod(MOD_FIRE_ABSORB, 0);
  91. mob:setMod(MOD_EARTH_ABSORB, 0);
  92. mob:setMod(MOD_WIND_ABSORB, 100);
  93. mob:setMod(MOD_WATER_ABSORB, 0);
  94. mob:setMod(MOD_ICE_ABSORB, 0);
  95. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  96. mob:setMod(MOD_DARK_ABSORB, 0);
  97. end,
  98. [4] = function (x)
  99. mob:castSpell(176) --Firaga 3
  100. mob:setMod(MOD_FIRE_ABSORB, 100);
  101. mob:setMod(MOD_EARTH_ABSORB, 0);
  102. mob:setMod(MOD_WIND_ABSORB, 0);
  103. mob:setMod(MOD_WATER_ABSORB, 0);
  104. mob:setMod(MOD_ICE_ABSORB, 0);
  105. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  106. mob:setMod(MOD_DARK_ABSORB, 0);
  107. end,
  108. [5] = function (x)
  109. mob:castSpell(181) --Blizzaga 3
  110. mob:setMod(MOD_FIRE_ABSORB, 0);
  111. mob:setMod(MOD_EARTH_ABSORB, 0);
  112. mob:setMod(MOD_WIND_ABSORB, 0);
  113. mob:setMod(MOD_WATER_ABSORB, 0);
  114. mob:setMod(MOD_ICE_ABSORB, 100);
  115. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  116. mob:setMod(MOD_DARK_ABSORB, 0);
  117. end,
  118. [6] = function (x)
  119. mob:castSpell(167) --Thunder 4
  120. mob:setMod(MOD_FIRE_ABSORB, 0);
  121. mob:setMod(MOD_EARTH_ABSORB, 0);
  122. mob:setMod(MOD_WIND_ABSORB, 0);
  123. mob:setMod(MOD_WATER_ABSORB, 0);
  124. mob:setMod(MOD_ICE_ABSORB, 0);
  125. mob:setMod(MOD_LIGHTNING_ABSORB, 100);
  126. mob:setMod(MOD_DARK_ABSORB, 0);
  127. end,
  128. [7] = function (x)
  129. mob:castSpell(196) --Thundaga 3
  130. mob:setMod(MOD_FIRE_ABSORB, 0);
  131. mob:setMod(MOD_EARTH_ABSORB, 0);
  132. mob:setMod(MOD_WIND_ABSORB, 0);
  133. mob:setMod(MOD_WATER_ABSORB, 0);
  134. mob:setMod(MOD_ICE_ABSORB, 0);
  135. mob:setMod(MOD_LIGHTNING_ABSORB, 100);
  136. mob:setMod(MOD_DARK_ABSORB, 0);
  137. end,
  138. [8] = function (x)
  139. mob:castSpell(172) --Water 4
  140. mob:setMod(MOD_FIRE_ABSORB, 0);
  141. mob:setMod(MOD_EARTH_ABSORB, 0);
  142. mob:setMod(MOD_WIND_ABSORB, 0);
  143. mob:setMod(MOD_WATER_ABSORB, 100);
  144. mob:setMod(MOD_ICE_ABSORB, 0);
  145. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  146. mob:setMod(MOD_DARK_ABSORB, 0);
  147. end,
  148. [9] = function (x)
  149. mob:castSpell(201) --Waterga 3
  150. mob:setMod(MOD_FIRE_ABSORB, 0);
  151. mob:setMod(MOD_EARTH_ABSORB, 0);
  152. mob:setMod(MOD_WIND_ABSORB, 0);
  153. mob:setMod(MOD_WATER_ABSORB, 100);
  154. mob:setMod(MOD_ICE_ABSORB, 0);
  155. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  156. mob:setMod(MOD_DARK_ABSORB, 0);
  157. end,
  158. [10] = function(x)
  159. mob:castSpell(162) --Stone 4
  160. mob:setMod(MOD_FIRE_ABSORB, 0);
  161. mob:setMod(MOD_EARTH_ABSORB, 100);
  162. mob:setMod(MOD_WIND_ABSORB, 0);
  163. mob:setMod(MOD_WATER_ABSORB, 0);
  164. mob:setMod(MOD_ICE_ABSORB, 0);
  165. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  166. mob:setMod(MOD_DARK_ABSORB, 0);
  167. end,
  168. [11] = function(x)
  169. mob:castSpell(191) --Stonega3
  170. mob:setMod(MOD_FIRE_ABSORB, 0);
  171. mob:setMod(MOD_EARTH_ABSORB, 100);
  172. mob:setMod(MOD_WIND_ABSORB, 0);
  173. mob:setMod(MOD_WATER_ABSORB, 0);
  174. mob:setMod(MOD_ICE_ABSORB, 0);
  175. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  176. mob:setMod(MOD_DARK_ABSORB, 0);
  177. end,
  178. [12] = function(x)
  179. mob:castSpell(362) --Bindga 2
  180. mob:setMod(MOD_FIRE_ABSORB, 0);
  181. mob:setMod(MOD_EARTH_ABSORB, 0);
  182. mob:setMod(MOD_WIND_ABSORB, 0);
  183. mob:setMod(MOD_WATER_ABSORB, 0);
  184. mob:setMod(MOD_ICE_ABSORB, 100);
  185. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  186. mob:setMod(MOD_DARK_ABSORB, 0);
  187. end,
  188. [13] = function(x)
  189. mob:castSpell(366) --Graviga
  190. mob:setMod(MOD_FIRE_ABSORB, 0);
  191. mob:setMod(MOD_EARTH_ABSORB, 0);
  192. mob:setMod(MOD_WIND_ABSORB, 100);
  193. mob:setMod(MOD_WATER_ABSORB, 0);
  194. mob:setMod(MOD_ICE_ABSORB, 0);
  195. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  196. mob:setMod(MOD_DARK_ABSORB, 0);
  197. end,
  198. [14] = function(x)
  199. mob:castSpell(360) --Dispelga
  200. mob:setMod(MOD_FIRE_ABSORB, 0);
  201. mob:setMod(MOD_EARTH_ABSORB, 0);
  202. mob:setMod(MOD_WIND_ABSORB, 0);
  203. mob:setMod(MOD_WATER_ABSORB, 0);
  204. mob:setMod(MOD_ICE_ABSORB, 0);
  205. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  206. mob:setMod(MOD_DARK_ABSORB, 100);
  207. end,
  208. [15] = function(x)
  209. mob:castSpell(274) --Sleepga 2
  210. mob:setMod(MOD_FIRE_ABSORB, 0);
  211. mob:setMod(MOD_EARTH_ABSORB, 0);
  212. mob:setMod(MOD_WIND_ABSORB, 0);
  213. mob:setMod(MOD_WATER_ABSORB, 0);
  214. mob:setMod(MOD_ICE_ABSORB, 0);
  215. mob:setMod(MOD_LIGHTNING_ABSORB, 0);
  216. mob:setMod(MOD_DARK_ABSORB, 100);
  217. end,
  218. }
  219.  
  220.  
  221. mob:setLocalVar("last_spell", os.time());
  222. mob:setLocalVar("SPELLSCAST", 1);
  223.  
  224. elseif (SPELLSCAST >= 1) then
  225. mob:setLocalVar("SPELLSCAST", 0);
  226. end
  227. end
  228.  
  229. ---------------------------------------------------------------------
  230.  
  231. -- Increment these by 1 each time they are slain, in that mobs onMobDeath() script.
  232. if (mob:getLocalVar("JoL_Regen_Reduction") == 0) then
  233. if (mob:getLocalVar("JoL_Qn_xzomit_Killed") == 9
  234. and mob:getLocalVar("JoL_Qn_hpemde_Killed") == 9) then
  235. mob:setLocalVar("JoL_Regen_Reduction", 1);
  236. end
  237. end
  238. if (mob:getLocalVar("JoL_Regen_Reduction") == 1) then --SBS
  239. mob:setMod(MOD_REGEN, 100);
  240. end
  241.  
  242. local lastPop = mob:getLocalVar("pop_pets");
  243. if (os.time() - lastPop > 150) then
  244. local SPAWNS = mob:getLocalVar("SPAWNS");
  245. local phuabo1 = GetMobAction(16912849);
  246. local phuabo2 = GetMobAction(16912852);
  247. local phuabo3 = GetMobAction(16912855);
  248.  
  249. if (SPAWNS == 0) then -- Spawns first 3 xzomit
  250. SpawnMob(16912858, 300):updateEnmity(target);
  251. SpawnMob(16912859, 300):updateEnmity(target);
  252. SpawnMob(16912860, 300):updateEnmity(target);
  253. mob:setLocalVar("pop_pets", os.time());
  254. mob:setLocalVar("SPAWNS", 1);
  255. elseif (SPAWNS == 1) then -- spawns first 3 hpemde
  256. SpawnMob(16912867, 300):updateEnmity(target);
  257. SpawnMob(16912868, 300):updateEnmity(target);
  258. SpawnMob(16912869, 300):updateEnmity(target);
  259. mob:setLocalVar("pop_pets", os.time());
  260. mob:setLocalVar("SPAWNS", 2);
  261. mob:setLocalVar("JoL_Qn_xzomit_Killed", 3);--SBS
  262. elseif (SPAWNS == 2) then -- spawns first 3 phuabo
  263. SpawnMob(16912849, 300):updateEnmity(target);
  264. SpawnMob(16912850, 300):updateEnmity(target);
  265. SpawnMob(16912851, 300):updateEnmity(target);
  266. mob:setLocalVar("pop_pets", os.time());
  267. mob:setLocalVar("SPAWNS", 3);
  268. mob:setLocalVar("JoL_Qn_hpemde_Killed", 3);
  269. elseif (SPAWNS == 3) then -- Spawns second 3 xzomit
  270. SpawnMob(16912861, 300):updateEnmity(target);
  271. SpawnMob(16912862, 300):updateEnmity(target);
  272. SpawnMob(16912863, 300):updateEnmity(target);
  273. mob:setLocalVar("pop_pets", os.time());
  274. mob:setLocalVar("SPAWNS", 4);
  275. elseif (SPAWNS == 4) then -- spawns second 3 hpemde
  276. SpawnMob(16912870, 300):updateEnmity(target);
  277. SpawnMob(16912871, 300):updateEnmity(target);
  278. SpawnMob(16912872, 300):updateEnmity(target);
  279. mob:setLocalVar("pop_pets", os.time());
  280. mob:setLocalVar("SPAWNS", 5);
  281. mob:setLocalVar("JoL_Qn_xzomit_Killed", 6);
  282. elseif (SPAWNS == 5) then -- spawns second 3 phuabo
  283. SpawnMob(16912852, 300):updateEnmity(target);
  284. SpawnMob(16912853, 300):updateEnmity(target);
  285. SpawnMob(16912854, 300):updateEnmity(target);
  286. mob:setLocalVar("pop_pets", os.time());
  287. mob:setLocalVar("SPAWNS", 6);
  288. mob:setLocalVar("JoL_Qn_hpemde_Killed", 6);
  289. elseif (SPAWNS == 6) then -- Spawns last 3 xzomit
  290. SpawnMob(16912864, 300):updateEnmity(target);
  291. SpawnMob(16912865, 300):updateEnmity(target);
  292. SpawnMob(16912866, 300):updateEnmity(target);
  293. mob:setLocalVar("pop_pets", os.time());
  294. mob:setLocalVar("SPAWNS", 7);
  295. elseif (SPAWNS == 7) then -- spawns last 3 hpemde
  296. SpawnMob(16912873, 300):updateEnmity(target);
  297. SpawnMob(16912874, 300):updateEnmity(target);
  298. SpawnMob(16912875, 300):updateEnmity(target);
  299. mob:setLocalVar("pop_pets", os.time());
  300. mob:setLocalVar("SPAWNS", 8);
  301. mob:setLocalVar("JoL_Qn_xzomit_Killed", 9);
  302. elseif (SPAWNS >= 8) then -- switch to ONLY popping phuabo (still up to 3 at a time)
  303. if (phuabo1 == ACTION_NONE or phuabo1 == ACTION_SPAWN) then
  304. SpawnMob(16912849, 300):updateEnmity(target);
  305. SpawnMob(16912850, 300):updateEnmity(target);
  306. SpawnMob(16912851, 300):updateEnmity(target);
  307. mob:setLocalVar("pop_pets", os.time());
  308. mob:setLocalVar("JoL_Qn_hpemde_Killed", 9);
  309. elseif (phuabo2 == ACTION_NONE or phuabo2 == ACTION_SPAWN) then
  310. SpawnMob(16912852, 300):updateEnmity(target);
  311. SpawnMob(16912853, 300):updateEnmity(target);
  312. SpawnMob(16912854, 300):updateEnmity(target);
  313. mob:setLocalVar("pop_pets", os.time());
  314. elseif (phuabo3 == ACTION_NONE or phuabo3 == ACTION_SPAWN) then
  315. SpawnMob(16912855, 300):updateEnmity(target);
  316. SpawnMob(16912856, 300):updateEnmity(target);
  317. SpawnMob(16912857, 300):updateEnmity(target);
  318. mob:setLocalVar("pop_pets", os.time());
  319. end
  320. end
  321. end
  322. end;
  323.  
  324. -----------------------------------
  325. -- onMobDespawn
  326. -----------------------------------
  327.  
  328. function onMobDespawn(mob)
  329. local AV_CHANCE = 100; --set back to 25 after testing JoL mobs killed variables/regen effects on AV
  330. if (AV_CHANCE > math.random(0,99)) then
  331. SpawnMob(16912876, 180);
  332. end
  333. end;
  334.  
  335. -----------------------------------
  336. -- onMobDeath
  337. -----------------------------------
  338.  
  339. function onMobDeath(mob, player, isKiller)
  340. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement