Mercurial > wow > ouroloot
comparison bossmods.lua @ 56:fcc0d0ff5832
- instance_tag() also returns max instance size as a plain number, adjust
call sites
- clean up .raiders table, add some new fields, use copies of this instead
of a single string
- make sure datarev field is properly updated when it's already present
- avoid multiple GetRaidRosterInfo loops scattered throughout the addon,
instead just traverse the .raiders list, regularly updated
- make the 'loot' and 'boss' broadcasts versioned. Handle receiving older.
- new format for plaintext attendance output
| author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
|---|---|
| date | Fri, 13 Apr 2012 04:28:46 +0000 |
| parents | 4f1e71f62776 |
| children | c01875b275ca |
comparison
equal
deleted
inserted
replaced
| 55:ac57a4342812 | 56:fcc0d0ff5832 |
|---|---|
| 33 -- Lua | 33 -- Lua |
| 34 local pairs, ipairs, tinsert, tremove = pairs, ipairs, table.insert, table.remove | 34 local pairs, ipairs, tinsert, tremove = pairs, ipairs, table.insert, table.remove |
| 35 local tonumber = tonumber | 35 local tonumber = tonumber |
| 36 | 36 |
| 37 -- WoW | 37 -- WoW |
| 38 local GetRaidRosterInfo = GetRaidRosterInfo | 38 --local GetRaidRosterInfo = GetRaidRosterInfo |
| 39 | 39 |
| 40 -- OL | 40 -- OL |
| 41 local addon_do_boss | 41 local addon_do_boss |
| 42 | 42 |
| 43 | 43 |
| 44 ------ Deadly Boss Mods | 44 ------ Deadly Boss Mods |
| 45 do | 45 do |
| 46 local DBM | 46 local DBM |
| 47 local location | 47 local location, maxsize |
| 48 local real_loadmod | 48 local real_loadmod |
| 49 -- When zoning into a raid instance not seen this session, make sure | 49 -- When zoning into a raid instance not seen this session, make sure |
| 50 -- we don't report a previous raid instance as current location. DBM | 50 -- we don't report a previous raid instance as current location. DBM |
| 51 -- has no callback event for this, so we do a small hook instead. | 51 -- has no callback event for this, so we do a small hook instead. |
| 52 local function resetting_loadmod (...) | 52 local function resetting_loadmod (...) |
| 64 name = mod.id | 64 name = mod.id |
| 65 else | 65 else |
| 66 name = "Unknown Boss" | 66 name = "Unknown Boss" |
| 67 end | 67 end |
| 68 | 68 |
| 69 local it = location or self.instance_tag() | 69 local it |
| 70 if location then | |
| 71 it = location | |
| 72 else | |
| 73 it, maxsize = self.instance_tag() | |
| 74 end | |
| 70 self.latest_instance = it | 75 self.latest_instance = it |
| 71 location = nil | 76 location = nil |
| 72 | 77 |
| 73 local duration = 0 | 78 local duration = 0 |
| 74 if mod.combatInfo and mod.combatInfo.pull then | 79 if mod.combatInfo and mod.combatInfo.pull then |
| 75 duration = math.floor (GetTime() - mod.combatInfo.pull) | 80 duration = math.floor (GetTime() - mod.combatInfo.pull) |
| 76 end | 81 end |
| 77 | 82 |
| 78 -- attendance: maybe put people in groups 6,7,8 into a "backup/standby" | 83 return addon_do_boss (self, reason, name, it, maxsize, duration) |
| 79 -- list? probably too specific to guild practices. | |
| 80 local raiders = {} | |
| 81 for i = 1, GetNumRaidMembers() do | |
| 82 local name = GetRaidRosterInfo(i) | |
| 83 if name then | |
| 84 tinsert (raiders, name) | |
| 85 end | |
| 86 end | |
| 87 table.sort(raiders) | |
| 88 | |
| 89 return addon_do_boss (self, reason, name, it, duration, raiders) | |
| 90 end | 84 end |
| 91 | 85 |
| 92 local function callback(...) DBMBossCallback(addon,...) end | 86 local function callback(...) DBMBossCallback(addon,...) end |
| 93 | 87 |
| 94 local function _registerDBM (self, OL_boss_worker) | 88 local function _registerDBM (self, OL_boss_worker) |
| 100 return | 94 return |
| 101 end | 95 end |
| 102 addon_do_boss = OL_boss_worker | 96 addon_do_boss = OL_boss_worker |
| 103 local r = DBM:RegisterCallback("kill", callback) | 97 local r = DBM:RegisterCallback("kill", callback) |
| 104 DBM:RegisterCallback("wipe", callback) | 98 DBM:RegisterCallback("wipe", callback) |
| 105 DBM:RegisterCallback("pull", function() location = self.instance_tag() end) | 99 DBM:RegisterCallback("pull", function() |
| 100 location, maxsize = self.instance_tag() | |
| 101 end) | |
| 106 real_loadmod = DBM.LoadMod | 102 real_loadmod = DBM.LoadMod |
| 107 DBM.LoadMod = resetting_loadmod | 103 DBM.LoadMod = resetting_loadmod |
| 108 return r > 0 | 104 return r > 0 |
| 109 else | 105 else |
| 110 self.status_text = "|cffff1010Ouro Loot cannot find Deadly Boss Mods, loot will not be grouped by boss.|r" | 106 self.status_text = "|cffff1010Ouro Loot cannot find Deadly Boss Mods, loot will not be grouped by boss.|r" |
