wow-addons/WA-MasterLootHelper/MasterLootHelper.table
2020-11-21 11:55:51 +01:00

125 lines
5.2 KiB
Plaintext
Executable file

{
"d": {
"actions": {
"finish": [],
"init": {
"custom": "if not _G.WA_MasterLootHelper then\n _G.WA_MasterLootHelper = {\n [\"sands\"] = {},\n [\"coins\"] = {},\n [\"bijous\"] = {},\n }\nend\n\n\nfunction roundRobin(lookupKey)\n local wanted = 1\n local function loot(slot)\n local _, _, itemQuantity = GetLootSlotInfo(slot)\n local r = math.random(GetNumGroupMembers())\n for c0 = 1, GetNumGroupMembers() do\n local c = ((c0 + r) % GetNumGroupMembers()) + 1\n local candidate = GetMasterLootCandidate(slot, c)\n if candidate ~= nil then\n local candidateReceived = _G.WA_MasterLootHelper[lookupKey][candidate]\n if candidateReceived == nil or candidateReceived < wanted then\n GiveMasterLoot(slot, c)\n _G.WA_MasterLootHelper[lookupKey][candidate] = itemQuantity\n return true\n end\n end\n end\n wanted = wanted + 1\n return loot(slot)\n end\n return loot\nend\n\n\nlocal lootStrategies = {\n { -- BWL Hourglass Sand\n [\"ids\"] = {19183},\n [\"func\"] = roundRobin(\"sands\")\n },\n { -- Zul'Gurub Coins\n [\"ids\"] = {19698, 19699, 19700, 19701, 19702, 19703, 19704, 19705, 19706},\n [\"func\"] = roundRobin(\"coins\")\n },\n { -- Zul'Gurub Bijous\n [\"ids\"] = {19707, 19708, 19709, 19710, 19711, 19712, 19713, 19714, 19715},\n [\"func\"] = roundRobin(\"bijous\")\n }\n \n}\naura_env.lootStrategies = {}\nfor _, strategy in ipairs(lootStrategies) do\n for _, id in ipairs(strategy.ids) do\n aura_env.lootStrategies[id] = strategy.func\n end\nend\n\n\n",
"do_custom": true
},
"start": []
},
"anchorFrameType": "SCREEN",
"anchorPoint": "CENTER",
"animation": {
"finish": {
"duration_type": "seconds",
"easeStrength": 3,
"easeType": "none",
"type": "none"
},
"main": {
"duration_type": "seconds",
"easeStrength": 3,
"easeType": "none",
"type": "none"
},
"start": {
"duration_type": "seconds",
"easeStrength": 3,
"easeType": "none",
"type": "none"
}
},
"authorOptions": [],
"automaticWidth": "Auto",
"color": [
1,
1,
1,
1
],
"conditions": [],
"config": [],
"customTextUpdate": "event",
"displayText": "",
"fixedWidth": 200,
"font": "Friz Quadrata TT",
"fontSize": 12,
"frameStrata": 1,
"id": "MasterLootHelper",
"internalVersion": 33,
"justify": "LEFT",
"load": {
"class": {
"multi": []
},
"ingroup": {
"multi": {
"raid": true
},
"single": "raid"
},
"size": {
"multi": {
"flexible": true,
"fortyman": true,
"ten": true,
"twenty": true,
"twentyfive": true
}
},
"spec": {
"multi": []
},
"use_ingroup": true,
"use_never": false,
"use_size": false,
"use_zone": false,
"zone": ""
},
"outline": "OUTLINE",
"regionType": "text",
"selfPoint": "CENTER",
"semver": "1.0.0",
"shadowColor": [
0,
0,
0,
1
],
"shadowXOffset": 1,
"shadowYOffset": -1,
"subRegions": [],
"tocversion": 11305,
"triggers": {
"1": {
"trigger": {
"custom": "function(event)\n lootMethod, masterLooterPartyID, masterLooterRaidID = GetLootMethod()\n if lootMethod ~= \"master\" then\n return false\n end\n if not UnitIsUnit(\"raid\"..masterLooterRaidID, \"player\") then\n return false\n end\n \n for slot = 1, GetNumLootItems() do\n if GetLootSlotType(slot) ~= LOOT_SLOT_ITEM then\n LootSlot(slot)\n else\n local itemID = tonumber(GetLootSlotLink(slot):match(\"item:(%d+):\"))\n local lootStrategy = aura_env.lootStrategies[itemID]\n if lootStrategy == nil or not lootStrategy(slot) then -- lootStrategy returns true if item looted by it\n -- default loot to own bag\n for candidate = 1, GetNumGroupMembers() do\n if GetMasterLootCandidate(slot, candidate) == UnitName(\"player\") then\n GiveMasterLoot(slot, candidate)\n break\n end\n end \n end \n end \n end\n return true\nend",
"custom_hide": "timed",
"custom_type": "event",
"debuffType": "HELPFUL",
"event": "Health",
"events": "LOOT_READY",
"names": [],
"spellIds": [],
"subeventPrefix": "SPELL",
"subeventSuffix": "_CAST_START",
"type": "custom",
"unit": "player"
},
"untrigger": []
},
"activeTriggerMode": -10
},
"uid": "1UCRMNroKKs",
"url": "https://wago.io/5nBntpDHR/1",
"version": 1,
"wordWrap": "WordWrap",
"xOffset": 0,
"yOffset": 0
},
"m": "d",
"s": "2.18.2",
"v": 1421,
"wagoID": "5nBntpDHR"
}