Small library, which will help addon authors to parse CHAT_MSG_LOOT messages.
All you need to do, is define desired functions like this:
ELootChatMonitor.onLootItem = function (event, player, item_link, item_amount) end
ELootChatMonitor.onLootMoney = function (event, copper_amount) end
ELootChatMonitor.onRollChoice = function (event, player, item) end
ELootChatMonitor.onRollResult = function (event, player, item, roll) end
ELootChatMonitor.onRollFinish = function (event, player, item) end
ELOOT_LOOT_ITEM is called when any type of loot appears in chat (looted, created, player or other players)
ELOOT_LOOT_MONEY is called when player loots money from mob
ELOOT_ROLL_CHOICE_NEED is called when player or group/raid members choose to roll need on item
ELOOT_ROLL_CHOICE_GREED is called when player or group/raid members choose to roll greed on item
ELOOT_ROLL_CHOICE_DE is called when player or group/raid members choose to roll on disenchant item
ELOOT_ROLL_CHOICE_PASS is called when player or group/raid members chose to pass on item
ELOOT_ROLL_RESULT_NEED is called when need roll result appeared
ELOOT_ROLL_RESULT_GREED is called when greed roll result appeared
ELOOT_ROLL_RESULT_DE is called when disenchant roll result appeared
ELOOT_ROLL_WON is called when someone wins item
ELOOT_ROLL_ALL_PASSED is called when all party/raid members passed on item
- player can be "me" for player, name for other players, or "all" in case of "everyone passed on ... "
- item is always chat item link. you can extract item name, quality and id from it
- copper amount is summary value, and if you loot 1 silver and 1 copper it will be 101
- if some of your AddOns changing _G.LOOT_MONEY_SPLIT, make sure to do it before ELootChatMonitor loading, otherwise it will not track money loot.
- this lib is only tested on ruRU game client, and needs more testing on other locales
Big thanks to lokyst, NeedyGreedy addon author for his awesome implementation of chat_msg_loot parsing. i've just created some sort of lib, based on it.
* Fixed error with undefined event handlers