Advertisement
hlmbugle

Untitled

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