Its working

This commit is contained in:
Leonetienne
2022-06-04 16:51:29 +02:00
parent 42edac0060
commit 42242a2362
12 changed files with 47 additions and 1 deletions

View File

@@ -1 +1,45 @@
print("HAHAHHAHA")
Sitcomify = {}
Sitcomify.Laugh = function()
randomIndex = random(0,9);
PlaySoundFile("Interface\\AddOns\\Sitcomify\\laughtracks\\Audience Laughing-0" .. randomIndex .. ".wav", "MASTER");
end
local eventFrame = CreateFrame("frame", "SitcomifyMainframe");
eventFrame:RegisterEvent("PLAYER_DEAD");
eventFrame:RegisterEvent("ENCOUNTER_END");
eventFrame:RegisterEvent("LFG_PROPOSAL_FAILED");
eventFrame:RegisterEvent("LOSS_OF_CONTROL_ADDED");
eventFrame:SetScript("OnEvent", function(self, e, ...)
--> Laugh if the player dies
if (e == "PLAYER_DEAD") then
Sitcomify.Laugh();
--> Laugh if the players group wipes
elseif (e == "ENCOUNTER_END") then
encounterSuccessful = select(5, ...);
if (encounterSuccessful == 0) then
Sitcomify.Laugh();
end
--> Laugh if someone doesn't accept the LFR/LFG invite
elseif (e == "LFG_PROPOSAL_FAILED") then
Sitcomify.Laugh();
--> Laugh if the player gets stunned
elseif (e == "LOSS_OF_CONTROL_ADDED") then
Sitcomify.Laugh();
end
end);
SLASH_SITCOMIFY1 = "/laughtrack"
SLASH_SITCOMIFY1 = "/lt"
SlashCmdList["SITCOMIFY"] = function(msg)
Sitcomify.Laugh();
end