Skip to content

Instantly share code, notes, and snippets.

@nebularg
Last active April 17, 2016 10:54
Show Gist options
  • Save nebularg/e918af49c1332a6a89bc68f598c1b7f4 to your computer and use it in GitHub Desktop.
Save nebularg/e918af49c1332a6a89bc68f598c1b7f4 to your computer and use it in GitHub Desktop.
BigWigs snippets for Atom
'.source.lua':
################
# BigWigs stuff
################
# API
'Log':
'prefix': 'bwlog'
'body': 'self:Log("${1:event}", "${2:func}", ${3:...})$4'
'Log AURA_APPLIED':
'prefix': 'bwlogauraapplied'
'body': 'self:Log("SPELL_AURA_APPLIED", "${2:func}", ${3:...})$4'
'Log AURA_APPLIED_DOSE':
'prefix': 'bwlogauraapplieddose'
'body': 'self:Log("SPELL_AURA_APPLIED_DOSE", "${2:func}", ${3:...})$4'
'Log AURA_REMOVED':
'prefix': 'bwlogauraremoved'
'body': 'self:Log("SPELL_AURA_REMOVED", "${2:func}", ${3:...})$4'
'Log AURA_REMOVED_DOSE':
'prefix': 'bwlogauraremoveddose'
'body': 'self:Log("SPELL_AURA_REMOVED_DOSE", "${2:func}", ${3:...})$4'
'Log CAST_START':
'prefix': 'bwlogcaststart'
'body': 'self:Log("SPELL_CAST_START", "${2:func}", ${3:...})$4'
'Log CAST_SUCCESS':
'prefix': 'bwlogcaststart'
'body': 'self:Log("SPELL_CAST_SUCCESS", "${2:func}", ${3:...})$4'
'Emote':
'prefix': 'bwemote'
'body': 'self:Emote("${1:func}", ${2:...})$3'
'Yell':
'prefix': 'bwyell'
'body': 'self:Yell("${1:func}", ${2:...})$3'
'Death':
'prefix': 'bwdeath'
'body': 'self:Death("${1:func}", ${2:...})$3'
'RegisterEvent':
'prefix': 'bwrevent'
'body': 'self:RegisterEvent("${1:event}", "${2:func...}")$3'
'UnregisterEvent':
'prefix': 'bwuevent'
'body': 'self:UnregisterEvent("${1:event}", "${2:func...}")$3'
'RegisterUnitEvent':
'prefix': 'bwrunitevent'
'body': 'self:RegisterUnitEvent("${1:UNIT_SPELLCAST_}", ${2:nil}, "${3:boss1}")$4'
'UnregisterUnitEvent':
'prefix': 'bwuunitevent'
'body': 'self:UnregisterUnitEvent("${1:UNIT_SPELLCAST_}", "${2:boss1}")$3'
'NewTargetList':
'prefix': 'bwlist'
'body': 'mod:NewTargetList()$1'
'ColorName':
'prefix': 'bwcolorname'
'body': 'self:ColorName(${1:args.destName})$2'
'UnitName':
'prefix': 'bwunitname'
'body': 'self:UnitName(${1:name})$2'
'SpellName':
'prefix': 'bwspellname'
'body': 'self:SpellName(${1:args.spellId})$2'
'Message':
'prefix': 'bwmsg'
'body': 'self:Message(${1:args.spellId}, "${2:Attention}", "${3:Info}")$4'
'Message (Full)':
'prefix': 'bwmsg2'
'body': 'self:Message(${1:args.spellId}, "${2:Attention}", "${3:Info}", ${4:text}, ${5:icon})$6'
'TargetMessage':
'prefix': 'bwtmsg'
'body': 'self:TargetMessage(${1:args.spellId}, ${2:args.destName}, "${3:Urgent}", "${4:Alarm}")$5'
'TargetMessage (Full)':
'prefix': 'bwtmsg2'
'body': 'self:TargetMessage(${1:args.spellId}, ${2:args.destName}, "${3:Urgent}", "${4:Alarm}", ${5:text}, ${6:icon}, ${7:alwaysPlaySound})$8'
'StackMessage':
'prefix': 'bwsmsg'
'body': 'self:StackMessage(${1:args.spellId}, ${2:args.destName}, ${3:stack}, "${4:Urgent}", "${5:Warning}")$6'
'StackMessage (Full)':
'prefix': 'bwsmsg2'
'body': 'self:StackMessage(${1:args.spellId}, ${2:args.destName}, ${3:stack}, "${4:Urgent}", "${5:Warning}", ${6:text}, ${7:icon})$8'
'RangeMessage':
'prefix': 'bwrmsg'
'body': 'self:RangeMessage(${1:args.spellId})$2'
'RangeMessage (Full)':
'prefix': 'bwrmsg2'
'body': 'self:RangeMessage(${1:args.spellId}, "${2:Personal}", "${3:Alarm}", ${4:text}, ${5:icon})$6'
'DelayedMessage':
'prefix': 'bwdmsg'
'body': 'self:DelayedMessage(${1:args.spellId}, ${2:delay}, "${3:Attention}", ${4:text}, ${5:icon}, "${6:sound}")$7'
'CancelDelayedMessage':
'prefix': 'bwcmsg'
'body': 'self:CancelDelayedMessage(${1:text})$2'
'Bar':
'prefix': 'bwbar'
'body': 'self:Bar(${1:args.spellId}, ${2:length})$3'
'Bar (Full)':
'prefix': 'bwbar2'
'body': 'self:Bar(${1:args.spellId}, ${2:length}, ${3:text}, ${4:icon})$5'
'CDBar':
'prefix': 'bwcdbar'
'body': 'self:CDBar(${1:args.spellId}, ${2:length})$3'
'CDBar (Full)':
'prefix': 'bwcdbar2'
'body': 'self:CDBar(${1:args.spellId}, ${2:length}, ${3:text}, ${4:icon})$5'
'TargetBar':
'prefix': 'bwtbar'
'body': 'self:TargetBar(${1:args.spellId}, ${2:args.destName}, ${3:length})$4'
'TargetBar (Full)':
'prefix': 'bwtbar2'
'body': 'self:TargetBar(${1:args.spellId}, ${2:args.destName}, ${3:length}, ${4:text}, ${5:icon})$6'
'StopBar':
'prefix': 'bwsbar'
'body': 'self:StopBar(${1:args.spellId})$2'
'StopBar (player)':
'prefix': 'bwsbar2'
'body': 'self:StopBar(${1:args.spellId}, ${2:args.destName})$3'
'PrimaryIcon':
'prefix': 'bwpicon'
'body': 'self:PrimaryIcon(${1:args.spellId}, ${2:args.destName})$3'
'PrimaryIcon (Off)':
'prefix': 'bwpicon2'
'body': 'self:PrimaryIcon(${1:args.spellId})$3'
'SecondaryIcon':
'prefix': 'bwsicon'
'body': 'self:SecondaryIcon(${1:args.spellId}, ${2:args.destName})$3'
'SecondaryIcon (Off)':
'prefix': 'bwsicon2'
'body': 'self:SecondaryIcon(${1:args.spellId})$3'
'Say':
'prefix': 'bwsay'
'body': 'self:Say(${1:args.spellId})$2'
'Say (Text)':
'prefix': 'bwsay2'
'body': 'self:Say(${1:args.spellId}, ${2:msg})$3'
'Say (directPrint)':
'prefix': 'bwsayd'
'body': 'self:Say(${1:args.spellId}, ${2:msg}, true)$3'
'Flash':
'prefix': 'bwflash'
'body': 'self:Flash(${1:args.spellId})$2'
'PlaySound':
'prefix': 'bwsound'
'body': 'self:PlaySound(${1:args.spellId}, "${2:Warning}")$3'
'Berserk':
'prefix': 'bwberserk'
'body': 'self:Berserk(${1:seconds})$6'
'Berserk (Full)':
'prefix': 'bwberserk2'
'body': 'self:Berserk(${1:seconds}, ${2:noEngageMessage}, ${3:customBoss}, ${4:customBerserk}, ${5:customFinalMessage})$6'
'Me':
'prefix': 'bwme'
'body': 'self:Me(${1:args.destGUID})$2'
'Dispeller':
'prefix': 'bwdispel'
'body': 'self:Dispeller("${1:magic}")$4'
'Dispeller (Full)':
'prefix': 'bwdispel2'
'body': 'self:Dispeller("${1:magic}", ${2:nil}, ${3:args.spellId})$4'
'Interrupter':
'prefix': 'bwinterrupt'
'body': 'self:Interrupter(${1:args.sourceGUID})$2'
'Range':
'prefix': 'bwdist'
'body': 'self:Range(${1:args.destName})$2'
'GetUnitIdByGUID':
'prefix': 'bwfunit'
'body': 'self:GetUnitIdByGUID(${1:args.sourceGUID})$2'
'GetUnitTarget':
'prefix': 'bwutarget'
'body': 'self:GetUnitTarget(${1:printTarget}, ${2:0.3}, ${3:args.sourceGUID})$4'
'GetBossTarget':
'prefix': 'bwbtarget'
'body': 'self:GetBossTarget(${1:printTarget}, ${2:0.3}, ${3:args.sourceGUID})$4'
# Module
'Module Stub':
'prefix': 'bwmod'
'body': """
--------------------------------------------------------------------------------
-- Module Declaration
--
local mod, CL = BigWigs:NewBoss(${1:bossName}, ${2:mapId})
if not mod then return end
mod:RegisterEnableMob(${3:bossId})
--mod.engageId = 0
--mod.respawnTime = 0
--------------------------------------------------------------------------------
-- Locals
--
--------------------------------------------------------------------------------
-- Localization
--
local L = mod:GetLocale()
--------------------------------------------------------------------------------
-- Initialization
--
function mod:GetOptions()
return {
"berserk",
}
end
function mod:OnBossEnable()
end
function mod:OnEngage()
self:Message("berserk", "Neutral", nil, self.displayName.." engaged")$4
end
--------------------------------------------------------------------------------
-- Event Handlers
--
"""
'Empty Callback':
'prefix': 'bwfunc'
'body': """
function mod:${1:Name}(args)
$2
end
"""
'Simple Callback':
'prefix': 'bwfunc2'
'body': """
function mod:${1:Name}(args)
self:Message(${2:args.spellId}, "${3:Attention}")
self:Bar(${4:args.spellId}, ${5:duration})$6
end
"""
'Damage Callback':
'prefix': 'bwfuncdamage'
'body': """
do
local prev = 0
function mod:${1:SpellDamage}(args)
local t = GetTime()
if self:Me(args.destGUID) and t-prev > 2 then
prev = t
self:Flash(${2:args.spellId})
self:Message(${3:args.spellId}, "${4:Personal}", "${5:Alarm}", CL.underyou:format(${6:args.spellName}))$7
end
end
end
"""
'Target Callback':
'prefix': 'bwfunctarget'
'body': """
local function printTarget(self, name, guid)
if self:Me(guid) then
self:Say(${1:key})
self:Flash(${2:key})
end
self:TargetMessage(${3:key}, name, "${4:Attention}", "${5:Alarm}")$6
end
"""
# Common Locale
'BigWigs CL.count':
'prefix': 'bwclcount'
'body': 'CL.count:format(${1:args.spellName}, ${2:count})$3'
'BigWigs CL.you':
'prefix': 'bwclyou'
'body': 'CL.you:format(${1:args.spellName})$2'
'BigWigs CL.underyou':
'prefix': 'bwclunderyou'
'body': 'CL.underyou:format(${1:args.spellName})$2'
'BigWigs CL.cast':
'prefix': 'bwclcast'
'body': 'CL.cast:format(${1:args.spellName})$2'
'BigWigs CL.casting':
'prefix': 'bwclcasting'
'body': 'CL.casting:format(${1:args.spellName})$2'
'BigWigs CL.phase':
'prefix': 'bwclphase'
'body': 'CL.phase:format(${1:phase})$2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment