Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. -- overwrite UI function SwapRaidSubgroup which doesn't work on ED
  2. function SwapRaidSubgroup(index1,index2)
  3. local num = GetNumRaidMembers()
  4.  
  5. if num == 40 then
  6. return -- full raid, can't swap
  7. end
  8.  
  9. -- retrieve info of players to swap
  10. name1,_,group1 = GetRaidRosterInfo(index1)
  11. namm2,_,group2 = GetRaidRosterInfo(index2)
  12.  
  13. groups = {}
  14.  
  15. -- count members per group, check for non-full groups
  16. for raidIndex = 1,num do
  17. name, _, subgroup = GetRaidRosterInfo(raidIndex)
  18.  
  19. if not groups[subgroup] then
  20. groups[subgroup] = 1
  21. else
  22. groups[subgroup] = groups[subgroup] + 1
  23. end
  24. end
  25.  
  26. firstNonFull = nil
  27. lsatNonFull = nil
  28.  
  29. -- this fails on bugged raids where one group can hold 6 players whereas another group is limited to 4 players
  30. -- unfortunately it doesn't seem to be possible to confirm the success of SetRaidSubgroup, since GetRaidRosterInfo still yields the old group number
  31. for n = 1,8 do
  32. if not groups[n] or groups[n] < 5 then
  33. if not firstNonFull then firstNonFull = n end
  34. lastNonFull = n
  35. end
  36. end
  37.  
  38. -- use last non-full group as temporary group
  39. SetRaidSubgroup(index1, lastNonFull)
  40. SetRaidSubgroup(index2, group1)
  41. SetRaidSubgroup(index1, group2)
  42. end
  43. ChatTypeInfo["OFFICER"].sticky = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement