Skip to content

Instantly share code, notes, and snippets.

@nebularg
Last active August 4, 2020 08:00
Show Gist options
  • Save nebularg/370ebd955625db14cf6c6d1cb8fcf73a to your computer and use it in GitHub Desktop.
Save nebularg/370ebd955625db14cf6c6d1cb8fcf73a to your computer and use it in GitHub Desktop.
BigWigs snippets for VSCode
{
// API
"Log": {
"scope": "lua",
"prefix": "bwlog",
"body": "self:Log(\"${1:event}\", \"${2:func}\", ${3:...})$0",
},
"Log AURA_APPLIED": {
"scope": "lua",
"prefix": "bwlogauraapplied",
"body": "self:Log(\"SPELL_AURA_APPLIED\", \"${2:func}\", ${3:...})$0",
},
"Log AURA_APPLIED_DOSE": {
"scope": "lua",
"prefix": "bwlogauraapplieddose",
"body": "self:Log(\"SPELL_AURA_APPLIED_DOSE\", \"${2:func}\", ${3:...})$0",
},
"Log AURA_REMOVED": {
"scope": "lua",
"prefix": "bwlogauraremoved",
"body": "self:Log(\"SPELL_AURA_REMOVED\", \"${2:func}\", ${3:...})$0",
},
"Log AURA_REMOVED_DOSE": {
"scope": "lua",
"prefix": "bwlogauraremoveddose",
"body": "self:Log(\"SPELL_AURA_REMOVED_DOSE\", \"${2:func}\", ${3:...})$0",
},
"Log CAST_START": {
"scope": "lua",
"prefix": "bwlogcaststart",
"body": "self:Log(\"SPELL_CAST_START\", \"${2:func}\", ${3:...})$0",
},
"Log CAST_SUCCESS": {
"scope": "lua",
"prefix": "bwlogcastsuccess",
"body": "self:Log(\"SPELL_CAST_SUCCESS\", \"${2:func}\", ${3:...})$0",
},
"Death": {
"scope": "lua",
"prefix": "bwdeath",
"body": "self:Death(\"${1:func}\", ${2:...})$0",
},
"RegisterEvent": {
"scope": "lua",
"prefix": "bwrevent",
"body": "self:RegisterEvent(\"${1:event}\", \"${2:func...}\")$0",
},
"UnregisterEvent": {
"scope": "lua",
"prefix": "bwuevent",
"body": "self:UnregisterEvent(\"${1:event}\", \"${2:func...}\")$0",
},
"RegisterUnitEvent": {
"scope": "lua",
"prefix": "bwrunitevent",
"body": "self:RegisterUnitEvent(\"${1:UNIT_SPELLCAST_}\", ${2:nil}, \"${3:boss1}\")$0",
},
"UnregisterUnitEvent": {
"scope": "lua",
"prefix": "bwuunitevent",
"body": "self:UnregisterUnitEvent(\"${1:UNIT_SPELLCAST_}\", \"${2:boss1}\")$0",
},
"NewTargetList": {
"scope": "lua",
"prefix": "bwlist",
"body": "mod:NewTargetList()$0",
},
"ColorName": {
"scope": "lua",
"prefix": "bwcolorname",
"body": "self:ColorName(${1:args.destName})$0",
},
"UnitName": {
"scope": "lua",
"prefix": "bwunitname",
"body": "self:UnitName(${1:name})$0",
},
"SpellName": {
"scope": "lua",
"prefix": "bwspellname",
"body": "self:SpellName(${1:args.spellId})$0",
},
"Message": {
"scope": "lua",
"prefix": "bwmsg",
"body": "self:Message2(${1:args.spellId}, \"${2:yellow}\")$0",
},
"Message (Full)": {
"scope": "lua",
"prefix": "bwmsg2",
"body": "self:Message2(${1:args.spellId}, \"${2:yellow}\", ${3:text}, ${4:icon})$0",
},
"TargetMessage": {
"scope": "lua",
"prefix": "bwtmsg",
"body": "self:TargetMessage2(${1:args.spellId}, \"${2:orange}\", ${3:args.destName})$0",
},
"TargetMessage (Full)": {
"scope": "lua",
"prefix": "bwtmsg2",
"body": "self:TargetMessage2(${1:args.spellId}, \"${2:orange}\", ${3:args.destName}, ${4:text}, ${5:icon})$0",
},
"TargetsMessage":{
"scope": "lua",
"prefix": "bwtsmsg",
"body": "self:TargetsMessage(${1:args.spellId}, \"${2:orange}\", ${3:playerTable}, ${4:maxPlayers})$0",
},
"TargetsMessage (Full)": {
"scope": "lua",
"prefix": "bwtsmsg2",
"body": "self:TargetsMessage(${1:args.spellId}, \"${2:orange}\", ${3:playerTable}, ${4:maxPlayers}, \"${5:text}\", ${6:icon}, ${7:0.3}, ${8:markers})$0",
},
"StackMessage": {
"scope": "lua",
"prefix": "bwsmsg",
"body": "self:StackMessage(${1:args.spellId}, ${2:args.destName}, ${3:stack}, \"${4:Urgent}\", \"${5:Warning}\")$0",
},
"StackMessage (Full)": {
"scope": "lua",
"prefix": "bwsmsg2",
"body": "self:StackMessage(${1:args.spellId}, ${2:args.destName}, ${3:stack}, \"${4:Urgent}\", \"${5:Warning}\", ${6:text}, ${7:icon})$0",
},
"PersonalMessage": {
"scope": "lua",
"prefix": "bwpmsg",
"body": "self:PersonalMessage(${1:args.spellId})$0",
},
"PersonalMessage (Full)": {
"scope": "lua",
"prefix": "bwpmsg2",
"body": "self:PersonalMessage(${1:args.spellId}, \"${2:you}\", ${3:text}, ${4:icon})$0",
},
"DelayedMessage": {
"scope": "lua",
"prefix": "bwdmsg",
"body": "self:DelayedMessage(${1:args.spellId}, ${2:delay}, \"${3:Attention}\", ${4:text}, ${5:icon}, \"${6:sound}\")$0",
},
"CancelDelayedMessage": {
"scope": "lua",
"prefix": "bwcmsg",
"body": "self:CancelDelayedMessage(${1:text})$0",
},
"Bar": {
"scope": "lua",
"prefix": "bwbar",
"body": "self:Bar(${1:args.spellId}, ${2:length})$0",
},
"Bar (Full)": {
"scope": "lua",
"prefix": "bwbar2",
"body": "self:Bar(${1:args.spellId}, ${2:length}, ${3:text}, ${4:icon})$0",
},
"CDBar": {
"scope": "lua",
"prefix": "bwcdbar",
"body": "self:CDBar(${1:args.spellId}, ${2:length})$0",
},
"CDBar (Full)": {
"scope": "lua",
"prefix": "bwcdbar2",
"body": "self:CDBar(${1:args.spellId}, ${2:length}, ${3:text}, ${4:icon})$0",
},
"TargetBar": {
"scope": "lua",
"prefix": "bwtbar",
"body": "self:TargetBar(${1:args.spellId}, ${2:length}, ${3:args.destName})$0",
},
"TargetBar (Full)": {
"scope": "lua",
"prefix": "bwtbar2",
"body": "self:TargetBar(${1:args.spellId}, ${2:length}, ${3:args.destName}, ${4:text}, ${5:icon})$0",
},
"CastBar": {
"scope": "lua",
"prefix": "bwcbar",
"body": "self:CastBar(${1:args.spellId}, ${2:length})$0",
},
"CastBar (Full)": {
"scope": "lua",
"prefix": "bwcbar2",
"body": "self:CastBar(${1:args.spellId}, ${2:length}, ${3:text}, ${4:icon})$0",
},
"StopBar": {
"scope": "lua",
"prefix": "bwsbar",
"body": "self:StopBar(${1:args.spellId})$0",
},
"StopBar (player)": {
"scope": "lua",
"prefix": "bwsbar2",
"body": "self:StopBar(${1:args.spellId}, ${2:args.destName})$0",
},
"PrimaryIcon": {
"scope": "lua",
"prefix": "bwpicon",
"body": "self:PrimaryIcon(${1:args.spellId}, ${2:args.destName})$0",
},
"PrimaryIcon (Off)": {
"scope": "lua",
"prefix": "bwpicon2",
"body": "self:PrimaryIcon(${1:args.spellId})$0",
},
"SecondaryIcon": {
"scope": "lua",
"prefix": "bwsicon",
"body": "self:SecondaryIcon(${1:args.spellId}, ${2:args.destName})$0",
},
"SecondaryIcon (Off)": {
"scope": "lua",
"prefix": "bwsicon2",
"body": "self:SecondaryIcon(${1:args.spellId})$0",
},
"Say": {
"scope": "lua",
"prefix": "bwsay",
"body": "self:Say(${1:args.spellId})$0",
},
"Say (Text)": {
"scope": "lua",
"prefix": "bwsay2",
"body": "self:Say(${1:args.spellId}, ${2:msg})$0",
},
"Say (directPrint)": {
"scope": "lua",
"prefix": "bwsayd",
"body": "self:Say(${1:args.spellId}, ${2:msg}, true)$0",
},
"SayCountdown": {
"scope": "lua",
"prefix": "bwsayc",
"body": "self:SayCountdown(${1:args.spellId}, ${2:seconds})$0",
},
"SayCountdown (Full)": {
"scope": "lua",
"prefix": "bwsayc2",
"body": "self:SayCountdown(${1:args.spellId}, ${2:seconds}, ${3:icon}, ${4:3})$0",
},
"CancelSayCountdown": {
"scope": "lua",
"prefix": "bwcsayc",
"body": "self:CancelSayCountdown(${1:args.spellId})$0",
},
"Yell": {
"scope": "lua",
"prefix": "bwyell",
"body": "self:Yell2(${1:args.spellId})$0",
},
"Yell (Text)": {
"scope": "lua",
"prefix": "bwyell2",
"body": "self:Yell2(${1:args.spellId}, ${2:msg})$0",
},
"Yell (directPrint)": {
"scope": "lua",
"prefix": "bwyelld",
"body": "self:Yell2(${1:args.spellId}, ${2:msg}, true)$0",
},
"YellCountdown": {
"scope": "lua",
"prefix": "bwyellc",
"body": "self:YellCountdown(${1:args.spellId}, ${2:seconds})$0",
},
"YellCountdown (Full)": {
"scope": "lua",
"prefix": "bwyellc2",
"body": "self:YellCountdown(${1:args.spellId}, ${2:seconds}, ${3:icon}, ${4:3})$0",
},
"CancelYellCountdown": {
"scope": "lua",
"prefix": "bwcyellc",
"body": "self:CancelYellCountdown(${1:args.spellId})$0",
},
"Flash": {
"scope": "lua",
"prefix": "bwflash",
"body": "self:Flash(${1:args.spellId})$0",
},
"PlaySound": {
"scope": "lua",
"prefix": "bwsound",
"body": "self:PlaySound(${1:args.spellId}, \"${2:alarm}\")$0",
},
"PlaySound (Voice)": {
"scope": "lua",
"prefix": "bwsoundv",
"body": "self:PlaySound(${1:args.spellId}, \"${2:alarm}\", \"${3:voice}\")$0",
},
"PlaySound (ONLY_ME)": {
"scope": "lua",
"prefix": "bwsoundp",
"body": "self:PlaySound(${1:args.spellId}, \"${2:alarm}\", ${3:nil}, ${4:args.destName})$0",
},
"Berserk": {
"scope": "lua",
"prefix": "bwberserk",
"body": "self:Berserk(${1:seconds})$0",
},
"Berserk (Full)": {
"scope": "lua",
"prefix": "bwberserk2",
"body": "self:Berserk(${1:seconds}, ${2:noEngageMessage}, ${3:customBoss}, ${4:customBerserk}, ${5:customFinalMessage})$0",
},
"Me": {
"scope": "lua",
"prefix": "bwme",
"body": "self:Me(${1:args.destGUID})$0",
},
"Dispeller": {
"scope": "lua",
"prefix": "bwdispel",
"body": "self:Dispeller(\"${1:magic}\")$0",
},
"Dispeller (Full)": {
"scope": "lua",
"prefix": "bwdispel2",
"body": "self:Dispeller(\"${1:magic}\", ${2:nil}, ${3:args.spellId})$0",
},
"Interrupter": {
"scope": "lua",
"prefix": "bwinterrupt",
"body": "self:Interrupter(${1:args.sourceGUID})$0",
},
"GetUnitIdByGUID": {
"scope": "lua",
"prefix": "bwfunit",
"body": "self:GetUnitIdByGUID(${1:args.sourceGUID})$0",
},
"GetUnitTarget": {
"scope": "lua",
"prefix": "bwutarget",
"body": "self:GetUnitTarget(${1:printTarget}, ${2:0.3}, ${3:args.sourceGUID})$0",
},
"GetBossTarget": {
"scope": "lua",
"prefix": "bwbtarget",
"body": "self:GetBossTarget(${1:printTarget}, ${2:0.3}, ${3:args.sourceGUID})$0",
},
// Module
"Module Stub": {
"scope": "lua",
"prefix": "bwmod",
"body": [
"",
"--------------------------------------------------------------------------------",
"-- Module Declaration",
"--",
"",
"local mod, CL = BigWigs:NewBoss(${1:bossName}, ${2:mapId}, ${2:ejId})",
"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()",
"\treturn {",
"\t\t\"berserk\",",
"\t}",
"end",
"",
"function mod:OnBossEnable()",
"end",
"",
"function mod:OnEngage()",
"end",
"",
"--------------------------------------------------------------------------------",
"-- Event Handlers",
"--",
"",
"$0",
]
},
"Empty Callback": {
"scope": "lua",
"prefix": "bwfunc",
"body": [
"function mod:${1:Name}(args)",
"\t$0",
"end",
]
},
"Simple Callback": {
"scope": "lua",
"prefix": "bwfunc2",
"body": [
"function mod:${1:Name}(args)",
"\tself:Message2(${2:args.spellId}, \"${3:yellow}\")",
"\tself:PlaySound(${4:args.spellId}, \"${5:alert}\")",
"\tself:Bar(${6:args.spellId}, ${7:duration})$0",
"end",
]
},
"Damage Callback": {
"scope": "lua",
"prefix": "bwfuncdamage",
"body": [
"do",
"\tlocal prev = 0",
"\t\tfunction mod:${1:SpellDamage}(args)",
"\t\tlocal t = GetTime()",
"\t\tif self:Me(args.destGUID) and t-prev > 2 then",
"\t\t\tprev = t",
"\t\t\tself:Flash(${2:args.spellId})",
"\t\t\tself:PersonalMessage(${3:args.spellId}, \"${4:underyou}\")",
"\t\t\tself:PlaySound(${5:args.spellId}, \"${6:alarm}\")$0",
"\t\tend",
"\tend",
"end",
]
},
"Target Callback": {
"scope": "lua",
"prefix": "bwfunctarget",
"body": [
"local function printTarget(self, name, guid)",
"\tif self:Me(guid) then",
"\t\tself:Say(${1:key})",
"\t\tself:Flash(${2:key})",
"\tend",
"\tself:TargetMessage2(${3:key}, name, \"${4:yellow}\")",
"\tself:PlaySound(${5:key}, \"${6:alarm}\")$0",
"end",
]
},
// Common Locale
"BigWigs CL.count": {
"scope": "lua",
"prefix": "bwclcount",
"body": "CL.count:format(${1:args.spellName}, ${2:count})$0",
},
"BigWigs CL.you": {
"scope": "lua",
"prefix": "bwclyou",
"body": "CL.you:format(${1:args.spellName})$0",
},
"BigWigs CL.underyou": {
"scope": "lua",
"prefix": "bwclunderyou",
"body": "CL.underyou:format(${1:args.spellName})$0",
},
"BigWigs CL.cast": {
"scope": "lua",
"prefix": "bwclcast",
"body": "CL.cast:format(${1:args.spellName})$0",
},
"BigWigs CL.casting": {
"scope": "lua",
"prefix": "bwclcasting",
"body": "CL.casting:format(${1:args.spellName})$0",
},
"BigWigs CL.phase": {
"scope": "lua",
"prefix": "bwclphase",
"body": "CL.phase:format(${1:phase})$0",
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment