Code: Select all
local VNfear = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.VNfear = VNfear -- expose it to the global scope
local frame = _G.VNfear_Frame -- made in the XML
function VNfear.VN()
if (chkDebuff("player", "Enter Nightmare") == true) then
SendChatMessage(">>FEAR INCOMING ON ME<<", "Say")
SendChatMessage(">>FEAR INCOMING ON ME<<", "Party")
elseif
(chkDebuff("player", "Deadly Nightmare") == true) then
SendChatMessage(">>FEAR,CLEAN ME PLEASE!!!<<", "Say")
SendChatMessage(">>FEAR,CLEAN ME PLEASE!!!<<", "Party")
elseif
(chkDebuff("player", "Blood Poison") == true) then
SendChatMessage("player" has dead debuff!!!<<", "Party")
elseif
(chkDebuff("player", "Venom's Wound") == true) then
SendChatMessage(">>"player" is bleeding!!!<<", "Party")
elseif
(chkDebuff("player", "Fear") == true) then
UseEmote("Kneel")
SendChatMessage(">>"player" is Feared!!!<<", "Party")
elseif
(chkDebuff("player", "Terror") == true) then
UseEmote("Kneel")
SendChatMessage(">>"player" is Feared!!!<<", "Say")
SendChatMessage(">>"player" is Feared!!!<<", "Party")
elseif
(chkDebuff("player", "Light Lock") == true) then
SendChatMessage("player" Is Locked", "Party")
elseif
(chkDebuff("player", "Body Freeze") == true) then
SendChatMessage("player" is Frozen!!!<<", "Party")
elseif
(chkDebuff("player", "Shattered Armor") == true) then
SendChatMessage("player" defense is broken!!!<<", "Party")
elseif
(chkDebuff("player", "Shout") == true) then
SendChatMessage(">>"player" is Stunned!!!<<", "Party")
elseif
(chkDebuff("player", "Stun") == true) then
SendChatMessage(">>"player"is Stunned!!!<<", "Party")
elseif
(chkDebuff("player", "Charge") == true) then
SendChatMessage(">>"player" is Stunned!!!<<", "Party")
elseif
(chkDebuff("player", "Low Roar") == true) then
UseEmote("Kneel")
SendChatMessage(">>"player" is Feared!!!<<", "Party")
elseif
(chkDebuff("player", "Bleed") == true) then
SendChatMessage("player" is Bleeding!!!<<", "Party")
DoEmote(21)
end
end;
function chkDebuff(player,debuffName)
local i = 1;
local r = false;
while (UnitDebuff(player,i) ~= nil) do
if (UnitDebuff(player, i) == debuffName) then
r = true;
end
i = i + 1;
end
return r;
end
frame:RegisterEvent("UNIT_BUFF_CHANGED")
function VNfear:OnEvent(event, arg1, arg2, arg3)
self[event](self, arg1, arg2, arg3)
end
local time_remaining = 0.5 -- in seconds
function VNfear:OnUpdate(elapsed)
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2 seconds
self.VN()
end
Code: Select all
local VNfear = {} -- the AddOn namespace, all your functions should be placed inside here instead of as globals.
_G.VNfear = VNfear -- expose it to the global scope
local frame = _G.VNfear_Frame -- made in the XML
function VNfear.VN()
if (chkDebuff("raid1", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid2", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid3", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid4", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid5", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid6", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid7", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid8", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid9", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid10", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid11", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
elseif
(chkDebuff("raid12", "Bleed") == true) then
SendChatMessage("player name" is Bleeding!!!<<", "Party")
DoEmote(21)
end
end;
function chkDebuff(raidn,debuffName)
local i = 1;
local r = false;
while (UnitDebuff(raidn,i) ~= nil) do
if (UnitDebuff(raidn, i) == debuffName) then
r = true;
end
i = i + 1;
end
return r;
end
frame:RegisterEvent("UNIT_BUFF_CHANGED")
function VNfear:OnEvent(event, arg1, arg2, arg3)
self[event](self, arg1, arg2, arg3)
end
local time_remaining = 0.5 -- in seconds
function VNfear:OnUpdate(elapsed)
-- elapsed is the amount of time in seconds since the last frame tick
time_remaining = time_remaining - elapsed
if time_remaining > 0 then
-- cut out early, we're not ready yet
return
end
time_remaining = 0.5 -- reset to 2 seconds
self.VN()
end