Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.25 KB | None | 0 0
  1. -----------------------------------
  2. -- Area: Al'Taieu
  3. --  HNM: Absolute Virtue
  4. -----------------------------------
  5.  
  6. require("scripts/globals/titles");
  7. require("scripts/globals/status");
  8. require("scripts/globals/magic");
  9.  
  10. -----------------------------------
  11. -- onMobSpawn Action
  12. -----------------------------------
  13.  
  14. function onMobSpawn(mob)
  15.     -- setMod
  16.     mob:setMod(MOD_REGEN, 500);
  17.     SetServerVariable("AV_Regen_Reduction", 1);--SBS
  18.     local JoL = GetMobByID(16912848);
  19.     -- Special check for regen modification by JoL pets killed
  20.     if (JoL:getLocalVar("JoL_Qn_xzomit_Killed") == 9) then
  21.         mob:addMod(MOD_REGEN, -190);
  22.     end
  23.     if (JoL:getLocalVar("JoL_Qn_hpemde_Killed") == 9) then
  24.         mob:addMod(MOD_REGEN, -190);
  25.     end
  26. end;
  27.  
  28.  
  29. -----------------------------------
  30. -- onMobFight Action
  31. -----------------------------------
  32.  
  33. function onMobFight(mob, target)
  34.            
  35.    -- Spawn the pets if they are despawned
  36.     -- TODO: summon animations?
  37.     if (GetMobAction(16912877) == 0) then
  38.         GetMobByID(16912877):setSpawn(mob:getXPos()+math.random(1,5), mob:getYPos(), mob:getZPos()+math.random(1,5));
  39.         SpawnMob(16912877, 300):updateEnmity(target);
  40.     elseif (GetMobAction(16912878) == 0) then
  41.         GetMobByID(16912878):setSpawn(mob:getXPos()+math.random(1,5), mob:getYPos(), mob:getZPos()+math.random(1,5));
  42.         SpawnMob(16912878, 300):updateEnmity(target);
  43.     elseif (GetMobAction(16912879) == 0) then
  44.         GetMobByID(16912879):setSpawn(mob:getXPos()+math.random(1,5), mob:getYPos(), mob:getZPos()+math.random(1,5));
  45.         SpawnMob(16912879, 300):updateEnmity(target);
  46.     end
  47.  
  48.     -- Ensure all spawned pets are doing stuff..
  49.     for pets = 16912877, 16912879 do
  50.         if (GetMobAction(pets) == 16) then
  51.             -- Send pet after current target..
  52.             GetMobByID(pets):updateEnmity(target);
  53.         end
  54.     end
  55. end
  56.  
  57. --SBS increase damage on Aeroga 3 to put it in line with damage from non-functioning Aeroga 4
  58. --function onSpellCast (mob, target)
  59.    
  60.     --if (spell:getID()== 186) then
  61.         --dmg = dmg * 1.5;--NOT CURRENTLY WORKING SBS
  62.     --end
  63. --end; 
  64.  
  65. ------------------------------------
  66. -- onSpellPrecast
  67. ------------------------------------   
  68.        
  69. function onSpellPrecast(mob, spell)
  70.     if (spell:getID() == 218) then -- Meteor
  71.         spell:setAoE(SPELLAOE_RADIAL);
  72.         spell:setFlag(SPELLFLAG_HIT_ALL);
  73.         spell:setRadius(30);
  74.         spell:setAnimation(280); -- AoE Meteor Animation
  75.         spell:setMPCost(1);
  76.     end
  77. end;
  78.  
  79. ------------------------------------
  80. -- onMonsterMagicPrepare
  81. ------------------------------------
  82.  
  83. function onMonsterMagicPrepare(caster, target)
  84. end;
  85.  
  86. -----------------------------------
  87. -- onMagicHit
  88. -----------------------------------
  89.  
  90. function onMagicHit(caster, target, spell)
  91.     local REGEN = target:getMod(MOD_REGEN);
  92.     local DAY = VanadielDayElement();
  93.     local ELEM = spell:getElement();
  94.     if (GetServerVariable("AV_Regen_Reduction") < 60) then
  95.         -- Had to serverVar the regen instead of localVar because localVar reset on claim loss.
  96.         if (ELEM == DAY and (caster:isPC() or caster:isPet())) then
  97.             SetServerVariable("AV_Regen_Reduction", 1+GetServerVariable("AV_Regen_Reduction"));
  98.             target:addMod(MOD_REGEN, -2);
  99.         end
  100.     end
  101.     return 1;
  102. end;
  103.  
  104. -----------------------------------
  105. -- onMobDespawn
  106. -----------------------------------
  107.  
  108. function onMobDespawn(mob)
  109.     --SBS reset variable
  110.     mob:setLocalVar("JoL_Qn_hpemde_Killed", 0);
  111.     mob:setLocalVar("JoL_Qn_hpemde_Killed", 0);
  112.     SetServerVariable("AV_Regen_Reduction", 0);
  113.     --DespawnMob(mob:getID()+1);
  114.     --DespawnMob(mob:getID()+2);
  115.     -- Despawn pets..
  116.     DespawnMob(16912877);
  117.     DespawnMob(16912878);
  118.     DespawnMob(16912879);
  119.  
  120. end;
  121.  
  122. -----------------------------------
  123. -- onMobDeath
  124. -----------------------------------
  125.  
  126. function onMobDeath(mob, player, isKiller)
  127.     player:addTitle(VIRTUOUS_SAINT);
  128.     --SBS reset variable
  129.     mob:setLocalVar("JoL_Qn_hpemde_Killed", 0);
  130.     mob:setLocalVar("JoL_Qn_hpemde_Killed", 0);
  131.     SetServerVariable("AV_Regen_Reduction", 0);
  132.     --DespawnMob(mob:getID()+1);
  133.     --DespawnMob(mob:getID()+2);
  134.     -- Despawn pets..
  135.     DespawnMob(16912877);
  136.     DespawnMob(16912878);
  137.     DespawnMob(16912879);
  138. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement