Advertisement
Guest User

Untitled

a guest
Sep 1st, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.44 KB | None | 0 0
  1. local GroupsByGUID = {};
  2.  
  3. local Frame = CreateFrame("Frame");
  4. Frame:SetScript("OnEvent",
  5.     function (self, Event, ...)
  6.         if Event == "GROUP_ROSTER_UPDATE" then
  7.             GroupsByGUID = {};
  8.            
  9.             if IsInRaid() then
  10.                 for Index = 1, GetNumGroupMembers() do
  11.                     local Subgroup = select(3, GetRaidRosterInfo(Index));
  12.                     GroupsByGUID[UnitGUID("Raid" .. Index)] = Subgroup;
  13.                 end
  14.             else
  15.                 for Index = 1, GetNumGroupMembers() - 1 do
  16.                     GroupsByGUID[UnitGUID("Party" .. Index)] = 1;
  17.                 end
  18.             end
  19.         end
  20.     end
  21. );
  22. Frame:RegisterEvent("GROUP_ROSTER_UPDATE");
  23.  
  24. function UnitGroupNumber (Unit)
  25.     return GroupsByGUID[UnitGUID(Unit)];
  26. end
  27.  
  28. function DispelUnits()
  29.     local dispeltbl = {143446, 144351, 143791}
  30.     if IsInGroup() then
  31.         for i = 1, GetNumGroupMembers() do
  32.             if IsInRaid() then Unit = "raid" .. i
  33.             else Unit = "party" .. i end
  34.             for i = 1, #dispeltbl do
  35.                 if UnitDebuffID(Unit, dispeltbl[i]) and Soapbox.validHealingTarget(Unit) then
  36.                     SoapboxRotations.dsl.parsedTarget = Unit
  37.                     return true
  38.                 end
  39.             end
  40.         end
  41.     end
  42.     return false
  43. end
  44.  
  45. SoapboxRotations.condition.register("bubbleunits", function(target)
  46.     local Results = {};
  47.     for Index = 1, GetUnitCount() do
  48.      local Unit3 = GetUnitByIndex(Index);
  49.         if UnitExists(target) and UnitExists(Unit3) then
  50.              if not UnitIsUnit(target, Unit3) aand not tContains(Results, UnitGUID(Unit3)) and UnitIsPlayer(Unit3) == 1
  51.             and ((IsInRaid("player") and UnitGroupNumber(Unit3) == UnitGroupNumber(target))
  52.             or (not IsInRaid("player") and UnitInParty(Unit3) == 1))
  53.             and not UnitIsDeadOrGhost(Unit3) and not SoapboxRotations.dsl.get("buff")(Unit3, 114908)
  54.             and GetDistanceBetweenUnits(UnitGUID(Unit3), UnitGUID(target)) <= 30 then
  55.                 table.insert(Results, Unit3);
  56.             end
  57.         end
  58.     end
  59.     return #Results;
  60. end)
  61.  
  62. function advancedspiritlogic5()
  63.     for i = 1, GetNumGroupMembers() do
  64.         if IsInRaid("player") then
  65.         Unit4 = "raid" ..i
  66.         else Unit4 = "party" ..i
  67.         end
  68.         if (not IsInRaid("player") or UnitGroupNumber(Unit4) ~= LastParty) then
  69.             if Unit4 ~= LastTarget then
  70.                 if not SoapboxRotations.dsl.get("buff")(Unit4, 114908) and SoapboxRotations.dsl.get("bubbleunits")(Unit4) > 3
  71.                 and SoapboxRotations.dsl.get("los")(Unit4) and SoapboxRotations.dsl.get("spell.range")(Unit4, 17) then
  72.                     SoapboxRotations.dsl.parsedTarget = Unit4
  73.                     LastTarget = Unit4
  74.                     Spirit = true
  75.                     Trt = Unit4
  76.                     return true
  77.                 end
  78.             end
  79.         end
  80.     end
  81.     return false
  82. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement