Mercurial > wow > breuesk
comparison Looting.lua @ 82:db7e4ee34dce
Lots of support for mobs with multiple loots
| author | John@Yosemite-PC |
|---|---|
| date | Fri, 13 Apr 2012 23:14:03 -0400 |
| parents | 62805e6b46c5 |
| children | ef4f6dc262ea |
comparison
equal
deleted
inserted
replaced
| 81:62805e6b46c5 | 82:db7e4ee34dce |
|---|---|
| 39 local n = _G.GetNumLootItems() | 39 local n = _G.GetNumLootItems() |
| 40 for i = 1,n do | 40 for i = 1,n do |
| 41 _G.LootSlot(i) | 41 _G.LootSlot(i) |
| 42 end | 42 end |
| 43 local items = {} | 43 local items = {} |
| 44 local threshold = _G.GetLootThreshold() | |
| 45 print("threshold: ", threshold) | |
| 44 for i = 1,n do | 46 for i = 1,n do |
| 47 local _,_,_,rarity,_ = _G.GetLootSlotInfo(i) | |
| 48 print("item: rarity: ",rarity) | |
| 45 local link = _G.GetLootSlotLink(i) | 49 local link = _G.GetLootSlotLink(i) |
| 46 if link then | 50 if link and rarity >= threshold then |
| 47 table.insert(items,{link=link,mlid=i}) | 51 table.insert(items,{link=link,mlid=i}) |
| 48 print("Item: ", link, i) | 52 print("Item: ", link, i) |
| 49 end | 53 end |
| 50 end | 54 end |
| 51 if not isMasterLootEvent then return end | 55 if not isMasterLootEvent then return end |
| 154 event:RegisterEvent("UPDATE_MASTER_LOOT_LIST",UpdateMasterLootList) | 158 event:RegisterEvent("UPDATE_MASTER_LOOT_LIST",UpdateMasterLootList) |
| 155 event:RegisterEvent("LOOT_CLOSED",LootClosed) | 159 event:RegisterEvent("LOOT_CLOSED",LootClosed) |
| 156 event:RegisterEvent("LOOT_OPENED",LootOpened) | 160 event:RegisterEvent("LOOT_OPENED",LootOpened) |
| 157 | 161 |
| 158 -- todo: what are these | 162 -- todo: what are these |
| 159 event:RegisterEvent("LOOT_SLOT_CLEARED",function() print("LSCleared") end) | 163 event:RegisterEvent("LOOT_SLOT_CLEARED",function(_,index) InitiateLSClear(index) end) |
| 160 event:RegisterEvent("LOOT_SLOT_CHANGED",function() print("LSChanged") end) | 164 event:RegisterEvent("LOOT_SLOT_CHANGED",function() print("LSChanged") end) |
| 161 | 165 |
| 162 RegisterListenerStateChange(statelistener) | 166 RegisterListenerStateChange(statelistener) |
| 163 statelistener:StateEvent() | 167 statelistener:StateEvent() |
| 164 end | 168 end |
