Guest User

Untitled

a guest
Dec 11th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. function SendOOM:ProcessPower(event, arg1)
  2.     if not MrtWoo.db.profile.modules.oom_enable or arg1 ~= "player" then
  3.         return false;
  4.     end;
  5.  
  6.     local powerType, powerTypeString = UnitPowerType(arg1);
  7.     if powerTypeString == "MANA" then
  8.         local mana = (UnitPower(arg1) / UnitPowerMax(arg1));
  9.         if ( mana <= MrtWoo.db.profile.modules.oom_level/100 ) then
  10.             if ( not SendOOM.lowMana ) then
  11.                 --MrtWoo:Print(MrtWoo.db.profile.modules.oom_message, COMBAT_TEXT_LOW_MANA_THRESHOLD);
  12.  
  13.                 if not UnitIsDeadOrGhost(arg1) then
  14.                     if GetNumRaidMembers() > 0 then
  15.                         SendChatMessage(MrtWoo.db.profile.modules.oom_message, "RAID");
  16.                     elseif GetNumPartyMembers() > 0 then
  17.                         SendChatMessage(MrtWoo.db.profile.modules.oom_message, "PARTY");
  18.                     else
  19.                         SendChatMessage(MrtWoo.db.profile.modules.oom_message, "WHISPER", nil, MrtWoo.MyName);
  20.                     end
  21.                 end;
  22.  
  23.                 SendOOM.lowMana = 1;
  24.             end
  25.         elseif ( mana > MrtWoo.defaults.profile.modules.oom_reset/100 ) then
  26.             SendOOM.lowMana = nil;
  27.         end
  28.     end;
  29.  
  30. end;
Add Comment
Please, Sign In to add comment