-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christoffer Stokbæk
committed
Feb 3, 2018
1 parent
210bbfd
commit ff2c18b
Showing
4 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
# ResurrectionAnnounce | ||
Plugin for HealComm (WoW 1.12.1) to announce who you are resurrecting | ||
|
||
Usage:|cffffff55 /sayres {chat|help} | ||
chat {number}: | ||
* 0: Dynamic (Party/Raid) | ||
* 1: Raid | ||
* 2: Say |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## Interface: 11200 | ||
## Title: |cFFFF8080R|resurrection |cFFFF8080A|rnnouncement | ||
## Author: stokbaek | ||
## Notes: Plugin That Adds Resurrection Announce to Chat | ||
## Version: 1.0 | ||
## Note: This Plugin needs to either have HealComm or LunaFrames installed to work | ||
## SavedVariablesPerCharacter: sayres_options | ||
|
||
# main | ||
core.lua | ||
cmd.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
SLASH_SAYRES1, SLASH_SAYRES2 = '/sayres', '/sr' | ||
function SlashCmdList.SAYRES(msg, editbox) | ||
local cmd, opt = strsplit(" ", msg) | ||
local chatformat_cmd = "|cFFFF8080rA |\124|cffffff55" | ||
local chatformat_info = "|cFFFF8080rA |\124|cffff0000" | ||
if cmd == "chat" then | ||
if opt == "0" then | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_cmd.."Chat Output set to: |cff00ff00DYNAMIC") | ||
elseif opt == "1" then | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_cmd.."Chat Output set to: |cffff7d00RAID") | ||
elseif opt == "2" then | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_cmd.."Chat Output set to: |rSAY") | ||
else | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."Unknown Chat Option") | ||
return | ||
end | ||
ra_options[cmd] = opt | ||
elseif msg == "help" or "" then | ||
if msg ~= "help" then | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."Unkown Command") | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."----") | ||
end | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."About:|cffffff55 Announces when you resurrect a player in your Raid/Party") | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."Usage:|cffffff55 /sayres {chat\124|help}") | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."chat {number}:|cffffff55 0, Dynamic (Party/Raid); 1, Party; 2, Say") | ||
DEFAULT_CHAT_FRAME:AddMessage(chatformat_info.."help:|cffffff55 Shows this message") | ||
return | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
local events = {} | ||
local ress = {} | ||
|
||
ra_options = {} | ||
|
||
rahealcomm = CreateFrame("Frame") | ||
rahealcomm:RegisterEvent("CHAT_MSG_ADDON") | ||
rahealcomm:SetScript("OnEvent", function() | ||
if event == "CHAT_MSG_ADDON" and arg1 == "HealComm" then | ||
this:ParseChatMessage(arg4, arg2) | ||
end | ||
end) | ||
|
||
rahealcomm:SetScript("OnUpdate", function() | ||
for timestamp, targets in pairs(events) do | ||
if GetTime() >= timestamp then | ||
for id, target in pairs(targets) do | ||
rahealcomm:TriggerUpdate(target) | ||
end | ||
events[timestamp] = nil | ||
end | ||
end | ||
end) | ||
|
||
function rahealcomm:ParseChatMessage(sender, msg) | ||
local _, _, evtype, target = string.find(msg, '(Resurrection)/(%a+)/(start)/') | ||
if evtype and target then | ||
rahealcomm:Ress(sender, target) | ||
return | ||
end | ||
end | ||
|
||
function rahealcomm:Ress(sender, target) | ||
ress[target] = ress[target] or {} | ||
ress[target][sender] = true | ||
|
||
if sender == UnitName("player") and target ~= UnitName("player") then | ||
if ra_options.chat == "0" then | ||
SendChatMessage("Resurrecting " .. target, UnitInRaid("player") and "Raid" or "Party") | ||
elseif ra_options.chat == "1" then | ||
if UnitInRaid("player") and "Raid" then | ||
SendChatMessage("Resurrecting " .. target, "Raid") | ||
end | ||
else | ||
SendChatMessage("Resurrecting " .. target, "Say") | ||
end | ||
end | ||
end |