Thread Tools Display Modes
04-02-08, 11:10 AM   #1
Azures
A Defias Bandit
Join Date: Apr 2008
Posts: 3
Very easy warning addon with 2.4 (Combatlog - Changes)

Hello
My english isn't so good but I will try to explain my problem I have an AddOn called "Don't Mana Burn Me, Bro" which simply warns me every time a opponent starts to cast manaburn, fear or sheep. But since 2.4 the AddOn doesn't work -.-. I think that i have to change only a few things but i do not now which.
Please help me

Here is the code:

function DMBMB_OnLoad()
this:RegisterEvent("CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE");
end

function DMBMB_OnEvent(event)

--------------------------------------------------------------------------------------------------------------------------------------
if (event == "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE") then
if (string.find(arg1,"beginnt, Manabrand zu wirken.")) then
ZoneTextString:SetText("Vorsicht Manabrand!");
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 1
ZoneTextFrame.fadeOutTime = 2
ZoneTextString:SetTextColor(0, 1, 0);
PVPInfoTextString:SetText("");
ZoneTextFrame:Show()
PlaySoundFile("Interface\\AddOns\\DMBMB\\Sounds\\manaburn.wav");
end
end

if (event == "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE") then
if (string.find(arg1,"beginnt, Verwandlung zu wirken.")) then
ZoneTextString:SetText("Vorsicht Verwandlung!");
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 1
ZoneTextFrame.fadeOutTime = 2
ZoneTextString:SetTextColor(0, 1, 0);
PVPInfoTextString:SetText("");
ZoneTextFrame:Show()
PlaySoundFile("Interface\\AddOns\\DMBMB\\Sounds\\sheep.wav");
end
end

if (event == "CHAT_MSG_SPELL_HOSTILEPLAYER_DAMAGE") then
if (string.find(arg1,"beginnt, Furcht zu wirken.")) then
ZoneTextString:SetText("Vorsicht Furcht!");
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 1
ZoneTextFrame.fadeOutTime = 2
ZoneTextString:SetTextColor(0, 1, 0);
PVPInfoTextString:SetText("");
ZoneTextFrame:Show()
PlaySoundFile("Interface\\AddOns\\DMBMB\\Sounds\\fear.wav");
end
end
--------------------------------------------------------------------------------------------------------------------------------------

end
  Reply With Quote
04-02-08, 12:45 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
May I direct you to this thread, 2 down from yours? http://www.wowinterface.com/forums/s...ad.php?t=15629
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-03-08, 01:14 PM   #3
Azures
A Defias Bandit
Join Date: Apr 2008
Posts: 3
I have read this article but it doesn't help me I just can't code an addon...I have never done it

Can somone other code it for me? pls
  Reply With Quote
04-03-08, 04:58 PM   #4
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Is the author planning on updating the mod for 2.4? Or is there an updated version already, perhaps?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-04-08, 10:21 AM   #5
Azures
A Defias Bandit
Join Date: Apr 2008
Posts: 3
Is the author planning on updating the mod for 2.4? Or is there an updated version already, perhaps?
There is no update so far and i don't think that the author is planning on updating the mod I have sent him an PM at Cusre but he hasn't answered yet.
  Reply With Quote
04-05-08, 08:27 PM   #6
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
i haven't tested this, but i think it would do what you want. i tried to keep it compact and easy to modify like the original was...although the argN stuff really should be updated:

Code:
function DMBMB_OnLoad()
this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
end

function DMBMB_OnEvent(event)
if arg2 ~= "SPELL_CAST_START" then return end
if bit.band(arg5, bit.bor(COMBATLOG_OBJECT_TYPE_PLAYER, COMBATLOG_OBJECT_REACTION_HOSTILE, COMBATLOG_OBJECT_AFFILIATION_OUTSIDER)) ~= arg5 then return end
if arg6 ~= UnitGUID("player") then return end
local spell = arg10
--------------------------------------------------------------------------------------------------------------------------------------

if spell == "Manabrand" then
ZoneTextString:SetText("Vorsicht Manabrand!");
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 1
ZoneTextFrame.fadeOutTime = 2
ZoneTextString:SetTextColor(0, 1, 0);
PVPInfoTextString:SetText("");
ZoneTextFrame:Show()
PlaySoundFile("Interface\\AddOns\\DMBMB\\Sounds\\manaburn.wav");
end

if spell == "Verwandlung" then
ZoneTextString:SetText("Vorsicht Verwandlung!");
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 1
ZoneTextFrame.fadeOutTime = 2
ZoneTextString:SetTextColor(0, 1, 0);
PVPInfoTextString:SetText("");
ZoneTextFrame:Show()
PlaySoundFile("Interface\\AddOns\\DMBMB\\Sounds\\sheep.wav");
end

if spell == "Furcht" then
ZoneTextString:SetText("Vorsicht Furcht!");
ZoneTextFrame.startTime = GetTime()
ZoneTextFrame.fadeInTime = 0
ZoneTextFrame.holdTime = 1
ZoneTextFrame.fadeOutTime = 2
ZoneTextString:SetTextColor(0, 1, 0);
PVPInfoTextString:SetText("");
ZoneTextFrame:Show()
PlaySoundFile("Interface\\AddOns\\DMBMB\\Sounds\\fear.wav");
end

--------------------------------------------------------------------------------------------------------------------------------------

end
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Very easy warning addon with 2.4 (Combatlog - Changes)


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off