local frame = CreateFrame("Frame","ACFrame",UIParent)
frame:SetPoint("CENTER",UIParent)
frame:SetSize(40+40+20,(7*40)+20)
frame:SetBackdrop(StaticPopup1:GetBackdrop())
frame:EnableMouse(true)
frame:SetScale(0.8)
frame:SetMovable(true)
frame:SetClampedToScreen(true)
frame:RegisterForDrag("LeftButton")-- Register left button for dragging
frame:SetScript("OnDragStart",frame.StartMoving)-- Set script for drag start
frame:SetScript("OnDragStop",frame.StopMovingOrSizing)-- Set script for drag stop
frame:SetUserPlaced(true)
-- disabled for testing purposes frame:RegisterEvent("PLAYER_ENTERING_WORLD")-- Load screen disapears
-- disabled for testing purposes frame:RegisterEvent("ZONE_CHANGED_NEW_AREA")-- Moved into new area
-- disabled for testing purposes frame:SetScript("OnEvent",function(self,event) self:SetShown(GetZoneText()==GetMapNameByID(978)) end)
local CreateButton; do-- Prototype for function
-- Drag Handlers
local function OnDragStart(self) self:GetParent():StartMoving(); end
local function OnDragStop(self) self:GetParent():StopMovingOrSizing(); end
-- Tooltip Handlers
local function OnEnter(self)
if self.Tooltip then
GameTooltip:SetOwner(self,"ANCHOR_TOP");
GameTooltip:AddLine(self.Tooltip,0,1,0.5,1,1,1);
GameTooltip:Show();
end
end
local function OnLeave(self) if GameTooltip:IsOwned(self) then GameTooltip:Hide(); end end
-- Button Generator (this will be assigned to the upvalue noted as a function prototype)
function CreateButton(parent,name,texture,text,tooltip)
tooltip=tooltip or text;-- If no tooltip, use button text
-- Create our button
local btn=CreateFrame("Button",name,parent,"SecureActionButtonTemplate");
btn:SetSize(40,40);
-- Setup button text
btn:SetNormalFontObject("GameFontNormalSmall");
btn:SetHighlightFontObject("GameFontHighlightSmall");
btn:SetDisabledFontObject("GameFontDisableSmall");
btn:SetText(text);
-- Setup button's backgorund, you can use :SetNormalTexture() and other functions to set state-based textures
local tex=btn:CreateTexture(nil,"BACKGROUND");
tex:SetAllPoints(btn);
tex:SetTexture(texture);
btn.Texture=tex;
-- Register handlers
btn:RegisterForClicks("AnyUp");-- Register all buttons
btn:RegisterForDrag("LeftButton");-- Register for left drag
btn:SetScript("OnDragStart",function(self)
local f = frame:GetScript("OnDragStart") -- get the frame OnDragStart script
f(frame) -- run it
end);
btn:SetScript("OnDragStop",function(self)
local f = frame:GetScript("OnDragStop") -- get the frame OnDragStop script
f(frame) -- run it
end);
btn:SetScript("OnDragStop",OnDragStop);
btn:SetScript("OnEnter",OnEnter);
btn:SetScript("OnLeave",OnLeave);
btn.Tooltip=tooltip;
-- Return our button
return btn;
end
end
local button=CreateButton(frame,"AshranCommanderButton1","Interface\\Icons\\achievement_pvp_a_h",nil,"Warspear Keep");
button:SetPoint("TOPRIGHT",frame,"TOPRIGHT",-10,-10);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Warspear Keep! ","INSTANCE_CHAT")
SendChatMessage("Warspear Keep! ","RAID_WARNING")
DoEmote("follow")
end )
local button=CreateButton(frame,"AshranCommanderButton2","Interface\\Icons\\achievement_garrison_tier02_horde",nil,"Emberfall Tower");
button:SetPoint("TOP",AshranCommanderButton1,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Emberfall Tower! Go Go Go! Stack at the flag","INSTANCE_CHAT")
SendChatMessage("Emberfall Tower! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton3","Interface\\Icons\\achievement_garrison_tier01_horde",nil,"Volrath's Advance");
button:SetPoint("TOP",AshranCommanderButton2,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Volrath's Advance! Go Go Go! Stack at the flag","INSTANCE_CHAT")
SendChatMessage("Volrath's Advance! VA VA VA","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton4","Interface\\Icons\\achievement_doublejeopardy",nil,"The Crossroads");
button:SetPoint("TOP",AshranCommanderButton3,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("The Crossroads - Get to Crossroads! Stack at the flag","INSTANCE_CHAT")
SendChatMessage("The Crossroads - XR XR XR ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton5","Interface\\Icons\\achievement_garrison_tier01_alliance",nil,"Tremblade's Vanguard");
button:SetPoint("TOP",AshranCommanderButton4,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Tremblade's Vanguard! Go Go Go! Stack at the flag","INSTANCE_CHAT")
SendChatMessage("Tremblade's Vanguard! TV TV TV ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton6","Interface\\Icons\\achievement_garrison_tier02_alliance",nil,"Archmage Overwatch");
button:SetPoint("TOP",AshranCommanderButton5,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Archmage Overwatch! Go Go Go! Stack at the flag","INSTANCE_CHAT")
SendChatMessage("Archmage Overwatch! AO AO AO ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton7","Interface\\Icons\\achievement_pvp_h_a",nil,"Stormshield Stronghold");
button:SetPoint("TOP",AshranCommanderButton6,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Stormshield Stronghold! ","INSTANCE_CHAT")
SendChatMessage("Stormshield Stronghold! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton8","Interface\\Icons\\Ability_rogue_sprint",nil,"Amphitheater of Annihilation(AoA)");
button:SetPoint("RIGHT",AshranCommanderButton1,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Amphitheater of Annihilation(AoA) - EVENT:STADIUM RACING - Block the entrance!","INSTANCE_CHAT")
SendChatMessage("AoA AoA GO NOW! - Block the entrance!","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton9","Interface\\Icons\\spell_fire_fire",nil,"Brute's Rise(BR)");
button:SetPoint("RIGHT",AshranCommanderButton2,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Brute's Rise(BR) - EVENT:OGRE FIRES - Block the stairs! ","INSTANCE_CHAT")
SendChatMessage("BR BR GO NOW! MOVE IT! Block the stairs! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton10","Interface\\Icons\\achievement_boss_furyfurnace",nil,"Ring of Conquest(RoC)");
button:SetPoint("RIGHT",AshranCommanderButton3,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Ring of Conquest GO RoC - Let's get some fragments, scrolls, wands and class books","INSTANCE_CHAT")
SendChatMessage("Ring of Conquest GO RoC ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton11","Interface\\Icons\\Trade_archaeology_apexisstatue",nil,"Ashran Excavation(Mines)");
button:SetPoint("RIGHT",AshranCommanderButton4,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Ashran Excavation(Mines) - EVENT:APEXIS MARKS - Secure the center! ","INSTANCE_CHAT")
SendChatMessage("MINES! GO NOW! MOVE IT! - Secure the center! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton12","Interface\\Icons\\achievement_reputation_ogre",nil,"Seat of Kor'lok");
button:SetPoint("RIGHT",AshranCommanderButton5,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Seat of Kor'lok - Kor'lok - Kill the ogre! ","INSTANCE_CHAT")
SendChatMessage("Kor'lok! - Kill the ogre! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton13","Interface\\Icons\\Inv_ore_blackrock_nugget",nil,"Molten Quarry(MQ)");
button:SetPoint("RIGHT",AshranCommanderButton6,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Molten Quarry(MQ) - EVENT:Empowered Ore - Block the entrance! ","INSTANCE_CHAT")
SendChatMessage("MQ MQ GO NOW! MOVE IT! - Block the entrance! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton14","Interface\\Icons\\Achievement_halloween_ghost_01",nil,"Ashmaul Burial Grounds(ABG)");
button:SetPoint("RIGHT",AshranCommanderButton7,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Ashmaul Burial Grounds(ABG) - EVENT:RISEN SPIRITS - Clear the center and block the entrance! ","INSTANCE_CHAT")
SendChatMessage("ABG ABG GO NOW! MOVE IT! - Clear the center and block the entrance! ","RAID_WARNING")
DoEmote("follow" , UnitName("target"))
end )
local frame = CreateFrame("Frame","ACFrame2",UIParent)
frame:SetPoint("CENTER",UIParent)
frame:SetSize(40+40+40+20,(3*40)+20)
frame:SetBackdrop(StaticPopup1:GetBackdrop())
frame:EnableMouse(true)
frame:SetScale(0.8)
frame:SetMovable(true)
frame:SetClampedToScreen(true)
frame:RegisterForDrag("LeftButton")-- Register left button for dragging
frame:SetScript("OnDragStart",frame.StartMoving)-- Set script for drag start
frame:SetScript("OnDragStop",frame.StopMovingOrSizing)-- Set script for drag stop
frame:SetUserPlaced(true)
-- disabled for testing purposes frame:RegisterEvent("PLAYER_ENTERING_WORLD")-- Load screen disapears
-- disabled for testing purposesframe:RegisterEvent("ZONE_CHANGED_NEW_AREA")-- Moved into new area
-- disabled for testing purposesframe:SetScript("OnEvent",function(self,event) self:SetShown(GetZoneText()==GetMapNameByID(978)) end)
local CreateButton; do-- Prototype for function
-- Drag Handlers
local function OnDragStart(self) self:GetParent():StartMoving(); end
local function OnDragStop(self) self:GetParent():StopMovingOrSizing(); end
-- Tooltip Handlers
local function OnEnter(self)
if self.Tooltip then
GameTooltip:SetOwner(self,"ANCHOR_TOP");
GameTooltip:AddLine(self.Tooltip,0,1,0.5,1,1,1);
GameTooltip:Show();
end
end
local function OnLeave(self) if GameTooltip:IsOwned(self) then GameTooltip:Hide(); end end
-- Button Generator (this will be assigned to the upvalue noted as a function prototype)
function CreateButton(parent,name,texture,text,tooltip)
tooltip=tooltip or text;-- If no tooltip, use button text
-- Create our button
local btn=CreateFrame("Button",name,parent,"SecureActionButtonTemplate");
btn:SetSize(40,40);
-- Setup button text
btn:SetNormalFontObject("GameFontNormalSmall");
btn:SetHighlightFontObject("GameFontHighlightSmall");
btn:SetDisabledFontObject("GameFontDisableSmall");
btn:SetText(text);
-- Setup button's backgorund, you can use :SetNormalTexture() and other functions to set state-based textures
local tex=btn:CreateTexture(nil,"BACKGROUND");
tex:SetAllPoints(btn);
tex:SetTexture(texture);
btn.Texture=tex;
-- Register handlers
btn:RegisterForClicks("AnyUp");-- Register all buttons
btn:RegisterForDrag("LeftButton");-- Register for left drag
btn:SetScript("OnDragStart",function(self)
local f = frame:GetScript("OnDragStart") -- get the frame OnDragStart script
f(frame) -- run it
end);
btn:SetScript("OnDragStop",function(self)
local f = frame:GetScript("OnDragStop") -- get the frame OnDragStop script
f(frame) -- run it
end);
btn:SetScript("OnDragStop",OnDragStop);
btn:SetScript("OnEnter",OnEnter);
btn:SetScript("OnLeave",OnLeave);
btn.Tooltip=tooltip;
-- Return our button
return btn;
end
end
local button=CreateButton(frame,"AshranCommanderButton20","Interface\\Icons\\Inv_enchant_formulasuperior_01",nil,"Scroll of Protection");
button:SetPoint("TOPRIGHT",frame,"TOPRIGHT",-10,-10);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("One player use Scroll of Protection(SoP) now. If you see another player use one, don't use yours for 10-15 sec. SoP reduces damage taken by 60% for 15 seconds.","INSTANCE_CHAT")
SendChatMessage("Use Scroll of Protection! ","RAID_WARNING")
DoEmote("incoming")
end )
local button=CreateButton(frame,"AshranCommanderButton21","Interface\\Icons\\achievement_bg_xkills_avgraveyard",nil,"Market Graveyard");
button:SetPoint("TOP",AshranCommanderButton20,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Capture Market Graveyard. No more than 5 should disengage from combat to capture the graveyard, unless the raid is moving past it anyway or not engaged in combat. ","INSTANCE_CHAT")
SendChatMessage("CAP THE GY! ","RAID_WARNING")
DoEmote("go" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton22","Interface\\TargetingFrame\\UI-RaidTargetingIcon_8",nil,"Place World Marker/Right-click to remove");
button:SetPoint("TOP",AshranCommanderButton21,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetAttribute("type","macro");-- "type" without a number will handle all clicks unless a more specific attribute is found
button:SetAttribute("macrotext1",SLASH_WORLD_MARKER1.." 8");-- Adds world marker 1 on left-click
button:SetAttribute("macrotext2",SLASH_CLEAR_WORLD_MARKER1.." 8");-- Clears world marker 1 on right-click
--button:SetScript("OnClick", function()
-- SendChatMessage("{skull} is used by a commander to mark the battlefront, gathering spots, defensive lines and on AA if it is dropped.","INSTANCE_CHAT")
-- SendChatMessage("{skull} Get to {skull}", "RAID_WARNING")
--SetRaidTarget("mouseover",6);
-- end )
local button=CreateButton(frame,"AshranCommanderButton23","Interface\\Icons\\misc_arrowlup",nil,"Push");
button:SetPoint("RIGHT",AshranCommanderButton20,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("PUSH PUSH! Give them nothing! But take from them EVERYTHING!","INSTANCE_CHAT")
SendChatMessage("PUSH PUSH PUSH! ","RAID_WARNING")
DoEmote("charge" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton24","Interface\\Icons\\ability_defend",nil,"Hold Position");
button:SetPoint("TOP",AshranCommanderButton23,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Hold this position. Stay grouped. Form a wall and let any attackers break upon it. Protect the healers. ","INSTANCE_CHAT")
SendChatMessage("HOLD THE POSITION - STAY GROUPED ","RAID_WARNING")
DoEmote("encourage")
end )
local button=CreateButton(frame,"AshranCommanderButton25","Interface\\Icons\\misc_arrowdown",nil,"Retreat");
button:SetPoint("TOP",AshranCommanderButton24,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Time for a tactical retreat. Stay grouped. Disengage from combat quickly. Like Top Gear, we will leave stragglers behind","INSTANCE_CHAT")
SendChatMessage("MOVE BACK! STAY GROUPED! ","RAID_WARNING")
DoEmote("flee" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton26","Interface\\Icons\\Spell_holy_mindvision",nil,"Song flower");
button:SetPoint("RIGHT",AshranCommanderButton23,"LEFT",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Song Flower - Increases all stats by 15%. This effect persists through death. Pick them up in The Dark Woods (the arakkoa area) ","INSTANCE_CHAT")
SendChatMessage("Use Song Flower! 15% to all stats ","RAID_WARNING")
SendChatMessage("You should also pick up Star Root Tuber in Root Den (the saberon area). It gives you are small heal and 40% damage reduction for 10 sec. when used. The Tuber is not as visible as the Song Flowers, but once you know what to look for, it's easy to find them.","INSTANCE_CHAT")
DoEmote("drink")
end )
local button=CreateButton(frame,"AshranCommanderButton27","Interface\\Icons\\Misc_arrowleft",nil,"Get out of the road");
button:SetPoint("TOP",AshranCommanderButton26,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Get out of the main road - Stampede or Frost wyrm incoming - Move it!","INSTANCE_CHAT")
SendChatMessage("GET OUT OF THE ROAD! STAMPEDE OR FROST WYRM INCOMING!","RAID_WARNING")
DoEmote("duck" , UnitName("target"))
end )
local button=CreateButton(frame,"AshranCommanderButton28","Interface\\Icons\\Spell_nature_bloodlust",nil,"Bloodlust");
button:SetPoint("TOP",AshranCommanderButton27,"BOTTOM",0,0);-- Anchors always default to an object's parent
button:SetScript("OnClick", function()
SendChatMessage("Time to fight! Pop Bloodlust/Time Warp/Heroism","INSTANCE_CHAT")
SendChatMessage("Pop Bloodlust - Time Warp - Heroism!! ","RAID_WARNING")
DoEmote("flex" , UnitName("target"))
end )