Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- overwrite UI function SwapRaidSubgroup which doesn't work on ED
- function SwapRaidSubgroup(index1,index2)
- local num = GetNumRaidMembers()
- if num == 40 then
- return -- full raid, can't swap
- end
- -- retrieve info of players to swap
- name1,_,group1 = GetRaidRosterInfo(index1)
- namm2,_,group2 = GetRaidRosterInfo(index2)
- groups = {}
- -- count members per group, check for non-full groups
- for raidIndex = 1,num do
- name, _, subgroup = GetRaidRosterInfo(raidIndex)
- if not groups[subgroup] then
- groups[subgroup] = 1
- else
- groups[subgroup] = groups[subgroup] + 1
- end
- end
- firstNonFull = nil
- lsatNonFull = nil
- -- this fails on bugged raids where one group can hold 6 players whereas another group is limited to 4 players
- -- unfortunately it doesn't seem to be possible to confirm the success of SetRaidSubgroup, since GetRaidRosterInfo still yields the old group number
- for n = 1,8 do
- if not groups[n] or groups[n] < 5 then
- if not firstNonFull then firstNonFull = n end
- lastNonFull = n
- end
- end
- -- use last non-full group as temporary group
- SetRaidSubgroup(index1, lastNonFull)
- SetRaidSubgroup(index2, group1)
- SetRaidSubgroup(index1, group2)
- end
- ChatTypeInfo["OFFICER"].sticky = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement