Quantcast WoWInterface: SVN - CCWarn - Path Comparison - / Rev 1 and / Rev 2

WoWInterface SVN CCWarn

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1 to Rev 2
    Reverse comparison

Rev 1 → Rev 2

trunk/CCWarn/Localization.xxXX.lua New file
0,0 → 1,11
-- Please e-mail localization files to mcogwheel@gmail.com
 
if GetLocale() == "xxXX" then
local L = CCWarn_Locals
 
--L["/ccwarn"] = "xxxx"
--L["/ccw"] = "xxxx"
--L["Change targets! "] = "xxxx "
--L["Call off your pet! "] = "xxxx "
--L["CCWarn: Usage: CCWarn(unit[, message])"] = "xxxx"
end
trunk/CCWarn/Localization.deDE.lua New file
0,0 → 1,9
if GetLocale() == "deDE" then
local L = CCWarn_Locals
 
--L["/ccwarn"] = "xxxx"
--L["/ccw"] = "xxxx"
L["Change targets! "] = "Ziel wechseln! "
L["Call off your pet! "] = "Rufe Dein Pet zurück"
L["CCWarn: Usage: CCWarn(unit[, message])"] = "CCWarn: Benutzung: CCWarn(unit[, message])"
end
trunk/CCWarn/readme.txt New file
0,0 → 1,81
CCWarn - v1.3
By Cogwheel
 
CCWarn provides a slash command to help keep party/raid members from breaking
your crowd control. It does so by whispering anyone in your party/raid who is
targeting or whose pet is targeting your target. In practice, this is much more
effective than the common channel announcement macros out there.
 
Usage: /ccwarn (/ccw) [options] [<spell>] [message]
 
The bare /ccwarn command will check your target against your party members'
targets, and whisper the following messages: "Change targets!" or "Call off
your pet!" You can add to these by providing an additional message to the slash
command.
 
Example:
/cast Polymorph
/ccwarn Trying to sheep... You break it, you tank it!
 
Whispers:
Change targets! Trying to sheep... You break it, you tank it!
 
or
 
Call off your pet! Trying to sheep... You break it, you tank it!
 
The [target=] macro option allows you to specify which unit of yours to check
against your party's targets. Other macro options can be used as shown in
Neuro's guide on the US UI & Macros Forum:
http://forums.worldofwarcraft.com/board.html?forumId=11114&sid=1
 
Example:
/cast [target=focus, harm] Seduction; [harm] Seduction
/ccwarn [target=focus, harm]; [harm]
 
Since no messages are provided, it will only whisper the default alerts.
 
If you provide a spell inside brackets (see the third example below), CCWarn
will first make sure that you have enough mana and that your spell is in range,
available, and not on cooldown to prevent chat spamming when you are mashing the
macro.
 
Example:
/cast Sap
/ccwarn <Sap> target
 
A few notes:
 
- You can also call the CCWarn function directly from your Lua scripts via:
CCWarn(unit[, message])
- If the unit you specify does not exist (for example, if you run /ccwarn and
you do not have a target), CCWarn will fail silently. This has the side-effect
that the [exists] conditional is meaningless.
- The spell check will not work for pet abilities like Seduction. This is due to
a fundamental difference between your spells and your pet's. If you attempt to
use one of your pet's abilities, it will move closer to your target if it is
out of range.
 
Changes:
 
v1.3
- Added German localization
- Minor code cleanup
- Updated toc version
 
v1.2
- Added <spell> check
- /ccwarn now accepts macro options and uses them to specify your unit (via
[target=unit]) instead of taking a unit directly - INCOMPATIBLE WITH PREVIOUS
VERSION
- Made localizable
 
v1.1.1
- Removed debugging message that caused an error for players without CogsBar
 
v1.1
- Added unit parameter to /ccwarn (/ccw)
- Removed /ccwarnfocus (/ccwf).
 
v1.0
- Initial Release.
\ No newline at end of file
trunk/CCWarn/CCWarn.lua New file
0,0 → 1,64
local L = CCWarn_Locals
 
SLASH_CCWARN1 = L["/ccwarn"]
SLASH_CCWARN2 = L["/ccw"]
SlashCmdList["CCWARN"] = function(text)
local action, unit = SecureCmdOptionParse(text)
if action then
unit = unit or "target"
 
-- Extract spell & message from "<Shackle Undead> You spank, it you tank it!"
local spell, message = action:match("^%s*(%b<>)%s*(.-)%s*$")
if spell then
spell = spell:trim("<>"):trim()
 
local usable, nomana = IsUsableSpell(spell)
local range = not SpellHasRange(spell) or IsSpellInRange(spell, unit) == 1
local cooldown = GetSpellCooldown(spell)
 
-- If the spell isn't usable for any reason, don't do the warning
if not usable or nomana or not range or (cooldown and cooldown > 0) then
return
end
else
-- No spell was provided
message = action:trim()
end
 
CCWarn(unit, message)
end
end
 
function CCWarn(unit, message)
-- To help any addons or scripts that use this function
if not unit then
error(L["CCWarn: Usage: CCWarn(unit[, message])"], 2)
end
 
if UnitExists(unit) then
-- Determine group or raid status
local num = GetNumRaidMembers() - 1
local group = "raid"
 
if num == -1 then
num = GetNumPartyMembers()
group = "party"
end
 
for i = 1, num do
local name = GetUnitName(group..i, 1)
 
-- Send message to players targeting unit
if UnitIsUnit(unit, group..i.."target") then
SendChatMessage(L["Change targets! "]..message,
"WHISPER", nil, name)
end
 
-- Send message to players whose pets are targeting unit
if UnitIsUnit(unit, group..i.."pettarget") then
SendChatMessage(L["Call off your pet! "]..message,
"WHISPER", nil, name)
end
end
end
end
trunk/CCWarn/CCWarn.toc New file
0,0 → 1,9
## Interface: 20100
## Title: CCWarn
## Notes: Provides a slash command to help keep party/raid members from breaking your crowd control
## Author: Cogwheel
 
Localization.enUS.lua
Localization.deDE.lua
 
CCWarn.lua
trunk/CCWarn/Localization.enUS.lua New file
0,0 → 1,8
CCWarn_Locals = {}
local L = CCWarn_Locals
 
L["/ccwarn"] = "/ccwarn"
L["/ccw"] = "/ccw"
L["Change targets! "] = "Change targets! "
L["Call off your pet! "] = "Call off your pet! "
L["CCWarn: Usage: CCWarn(unit[, message])"] = "CCWarn: Usage: CCWarn(unit[, message])"
Property changes : Added: svn:executable +