I am new to making add-ons and my programming knowledge is limited. I understand that when new 2.4 patch came out with the new chat interface came out that's what broke my mod. I'd like to fix it and i have a pretty good idea where the problem is but unable to get my mind around the logic.My goal is to detect what the name of a mob is that has been killed last is. Here is the code that I need to modify
function LootRecap_Event_ChatMsgCombatHostileDeath(text)
local start_idx, _, deceased = string.find(text, "(.+) die");
if(start_idx) then
--ignore critters
if(deceased == "Adder") then return;
elseif(deceased == "Beetle") then return;
elseif(deceased == "Biletoad ") then return;
elseif(deceased == "Black Rat") then return;
elseif(deceased == "Chicken") then return;
elseif(deceased == "Frog") then return;
elseif(deceased == "Jungle Toad") then return;
elseif(deceased == "Mouse") then return;
elseif(deceased == "Prairie Dog") then return;
elseif(deceased == "Rabbit") then return;
elseif(deceased == "Rat") then return;
elseif(deceased == "Roach") then return;
elseif(deceased == "Scorpion") then return;
elseif(deceased == "Snake") then return;
elseif(deceased == "Spider") then return;
elseif(deceased == "Squirrel") then return;
elseif(deceased == "Toad") then return ;
elseif(deceased == "Parasitic Serpent") then return;
end
LR.lastmobseen = deceased;
LootRecap_Debug("mob seen: " .. deceased);
end
end
I understand also that when 2.4 came out they changed the programming to the COMBAT_LOG_EVENT but i don't know how to reflect it. please help !
here is more info on the combat_log_event
http://www.wowwiki.com/API_COMBAT_LOG_EVENT