Advertisement
Deozaan

demigodmode.lua

Oct 16th, 2016
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.89 KB | None | 0 0
  1. ---------------------------------------------------------------------------------------------------
  2. -- func: demigodmode
  3. -- desc: Toggles a lesser god mode on the player; granting them several special abilities,
  4. --       but not invulnerability.
  5. ---------------------------------------------------------------------------------------------------
  6.  
  7. cmdprops =
  8. {
  9.     permission = 1,
  10.     parameters = ""
  11. };
  12.  
  13. function onTrigger(player)
  14.     if (player:getVar("DemiGodMode") == 0) then
  15.         -- Toggle DemiGodMode on..
  16.         player:setVar("DemiGodMode", 1);
  17.  
  18.         -- Add bonus effects to the player..
  19.         player:addStatusEffect(EFFECT_MAX_HP_BOOST,500,0,0);
  20.         player:addStatusEffect(EFFECT_MAX_MP_BOOST,500,0,0);
  21.         player:addStatusEffect(EFFECT_SENTINEL,100,0,0);
  22.         player:addStatusEffect(EFFECT_MANAFONT,1,0,0);
  23.         player:addStatusEffect(EFFECT_REGAIN,150,1,0);
  24.         player:addStatusEffect(EFFECT_REFRESH,99,0,0);
  25.         player:addStatusEffect(EFFECT_REGEN,99,0,0);
  26.  
  27.         -- Add bonus mods to the player..
  28.         player:addMod(MOD_RACC,2500);
  29.         player:addMod(MOD_ACC,2500);
  30.         player:addMod(MOD_MACC,2500);
  31.  
  32.         -- Heal the player from the new buffs..
  33.         player:addHP( 50000 );
  34.         player:setMP( 50000 );
  35.     else
  36.         -- Toggle DemiGodMode off..
  37.         player:setVar("DemiGodMode", 0);
  38.  
  39.         -- Remove bonus effects..
  40.         player:delStatusEffect(EFFECT_MAX_HP_BOOST);
  41.         player:delStatusEffect(EFFECT_MAX_MP_BOOST);
  42.         player:delStatusEffect(EFFECT_SENTINEL);
  43.         player:delStatusEffect(EFFECT_MANAFONT);
  44.         player:delStatusEffect(EFFECT_REGAIN);
  45.         player:delStatusEffect(EFFECT_REFRESH);
  46.         player:delStatusEffect(EFFECT_REGEN);
  47.  
  48.         -- Remove bonus mods..
  49.         player:delMod(MOD_RACC,2500);
  50.         player:delMod(MOD_ACC,2500);
  51.         player:delMod(MOD_MACC,2500);
  52.     end
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement