Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local legendaries =
- {
- [SPEC_ID] =
- {
- LEGENDARY_ID,
- }
- }
- local LEGGO_CAP = 10
- local function getLeggoCount(s)
- --print('calling get leggo count')
- local count = 0
- for k,v in pairs(legendaries[s]) do
- if GetItemCount( v, true) > 0 or IsEquippedItem( v ) then
- count = count + 1
- end
- end
- return count
- end
- local function getSpec(s)
- --print('calling get spec')
- if getLeggoCount(s) >= LEGGO_CAP then
- local _s = GetSpecialization() + 1;
- if _s > 3 then _s = 1 end
- return getSpec(GetSpecializationInfo(_s))
- else
- return s
- end
- end
- local function showMessage(item)
- --print('calling show message')
- if not item then return end
- local col = "|cff02a100"
- local name = UnitName("player")
- local _,class = UnitClass("player")
- local classCol = RAID_CLASS_COLORS[class]
- print(col .. "You recieve loot: |r" .. item .. col .. ".|r")
- col = "|cff40FB40"
- print(col.."[".."|c"..classCol.colorStr .. name.."|r"..col.."] has recieved |r"..item..col.."!|r")
- end
- local function getLeggo()
- --print('calling get leggo')
- local s = getSpec(GetLootSpecialization() ~= 0 and GetLootSpecialization() or GetSpecializationInfo(GetSpecialization()))
- local leggo = seed or math.random(1, 10)
- if GetItemCount( legendaries[s][leggo], true) > 0 or IsEquippedItem( legendaries[s][leggo] ) then
- return getLeggo()
- else
- return legendaries[s][leggo]
- end
- end
- local function pooper( f )
- --print('calling pooper')
- local leggo = getLeggo()
- local item, link, rare, _, _, _, _, _, _, texture = GetItemInfo( leggo )
- if not link then return end
- f.Icon:SetTexture( texture )
- f.ItemName:SetText( item )
- local color = ITEM_QUALITY_COLORS[ 5 ]
- f.ItemName:SetVertexColor( color.r, color.g, color.b )
- f.hyperlink = link
- f.Background2.animIn:Play()
- f.Background3.animIn:Play()
- PlaySound("UI_LegendaryLoot_Toast")
- showMessage(link)
- end
- local function showalert()
- local f = LegendaryItemAlertSystem
- local alertFrame, isNew = f.alertFramePool:Acquire()
- if isNew then
- alertFrame.queue = f
- alertFrame:SetScript( "OnHide", function( frame ) frame.queue:OnFrameHide( frame ) end )
- if f.localizationHook then
- f.localizationHook( alertFrame )
- end
- end
- if pooper then
- local result = pooper(alertFrame)
- if result == false then
- f.alertFramePool:Release(alertFrame)
- return false
- end
- end
- AlertFrame:AddAlertFrame( alertFrame )
- f:CheckQueuedCoalesceData()
- return true
- end
- showalert()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement