/
## Notes: Shows totems dropped by other people in the raid. |
## SavedVariablesPerCharacter: TotemGuruConfig |
## Title: TotemGuru |
## Version: 7.0a |
## Version: 6.2a |
## SVN wowi:revision |
TotemAssignments.lua |
y = -100 |
y = self:createButton("Assign","Assign",x,y,self.AssignmentPanel,TotemGuruAssignments_LoadWindow) |
y = self:createButton("ShowButton","TotemBar",x,y,self.AssignmentPanel,TotemGuruwindows_SingleButtonCast) |
y = self:CreateMulticastDropdown(x + 10,y-10) |
InterfaceOptions_AddCategory(self.AssignmentPanel); |
InterfaceOptions_AddCategory(self.AssignmentPanel); |
end |
UIDropDownMenu_AddButton(TotemGuruSettingsGUI.info); |
end |
------------------------------------------------ |
-- TotemGuruSettingsGUI:CreateMulticastDropdown -- |
------------------------------------------------ |
function TotemGuruSettingsGUI:CreateMulticastDropdown(x,y) |
local parent = self.AssignmentPanel |
local title = "Select Multicast button to use for Assigned totems" |
local frame = CreateFrame('Frame', "MulticastTypeDropDownFrame" , parent,'UIDropDownMenuTemplate') |
frame:SetPoint("TOPLEFT", parent, "TOPLEFT", x, y-20) |
frame.titletext = frame:CreateFontString(nil, 'BACKGROUND') |
frame.titletext:SetPoint('BOTTOMLEFT', frame, 'TOPLEFT') |
frame.titletext:SetFontObject('GameFontNormal') |
frame.titletext:SetText(title) |
if TotemGuruConfig and TotemGuruConfig.Multicast then |
if TotemGuruConfig.Multicast.Ancestors then |
getglobal("MulticastTypeDropDownFrameText"):SetText("Ancestors") |
elseif TotemGuruConfig.Multicast.Elements then |
getglobal("MulticastTypeDropDownFrameText"):SetText("Elements") |
elseif TotemGuruConfig.Multicast.Spirits then |
getglobal("MulticastTypeDropDownFrameText"):SetText("Spirits") |
end |
end |
UIDropDownMenu_Initialize(frame, CreateMulticastMenu) |
return (y-20) |
end |
----------------------- |
-- CreateMulticastMenu -- |
----------------------- |
function CreateMulticastMenu() |
TotemGuruSettingsGUI.info.text = "Ancestors"; |
TotemGuruSettingsGUI.info.value = someglobalvariable; |
TotemGuruSettingsGUI.info.func = function () |
TotemGuruConfig.Multicast = {Spirits = false,Elements = false,Ancestors = true} |
getglobal("MulticastTypeDropDownFrameText"):SetText("Ancestors") |
end |
UIDropDownMenu_AddButton(TotemGuruSettingsGUI.info); |
TotemGuruSettingsGUI.info.text = "Elements"; |
TotemGuruSettingsGUI.info.value = someglobalvariable; |
TotemGuruSettingsGUI.info.func = function () |
TotemGuruConfig.Multicast = {Spirits = false,Elements = true,Ancestors = false} |
getglobal("MulticastTypeDropDownFrameText"):SetText("Elements") |
end |
UIDropDownMenu_AddButton(TotemGuruSettingsGUI.info); |
TotemGuruSettingsGUI.info.text = "Spirits"; |
TotemGuruSettingsGUI.info.value = someglobalvariable; |
TotemGuruSettingsGUI.info.func = function () |
TotemGuruConfig.Multicast = {Spirits = true,Elements = false,Ancestors = false} |
getglobal("MulticastTypeDropDownFrameText"):SetText("Spirits") |
end |
UIDropDownMenu_AddButton(TotemGuruSettingsGUI.info); |
end |
------------------------------- |
-- TotemGuru_CreateTotemsWindow |
------------------------------- |
SendAddonMessage("TotemGuru_TA",message,"WHISPER",PlayerName:GetText()); |
end |
end |
------------------------------ |
-- ReceivedTotemAssignments -- |
------------------------------ |
function ReceivedTotemAssignments(player,msg) |
TotemGuru_air_school=1 |
TotemGuru_water_school=2 |
TotemGuru_earth_school=3 |
TotemGuru_fire_school=4 |
local Ancestors = {140, 139, 138,137} |
--local Ancestors = {138, 137, 139,140} |
local Elements = {136, 135, 134,133} |
local Spirits = {144, 143, 142, 141} |
local spellID |
local totemNumber = 1 |
local version = 0 |
totemNumber = 1 |
version = 0 |
TotemGuruData.AssignedTotems = {} |
print("received totem assignments " .. msg) |
--for w in string.gmatch(msg, "%a%d+") do |
for w in string.gmatch(msg, "%a%d+") do |
if (string.find(w,"V")==1) then |
TotemGuruWindows["SBC"..totemNumber.."Button"]:SetAttribute("spell", TotemGuruTotemsInfo[texture].name); |
TotemGuruWindows["SBC"..totemNumber.."Button"]:SetNormalTexture(texture) |
totemNumber = totemNumber +1 |
if TotemGuruConfig.Multicast.Ancestors then |
print("multicast set to Ancestors") |
MButton = Ancestors[TotemGuruTotemsInfo[texture].school] |
elseif TotemGuruConfig.Multicast.Elements then |
print("multicast set to Elements") |
MButton = Elements[TotemGuruTotemsInfo[texture].school] |
elseif TotemGuruConfig.Multicast.Spirits then |
print("multicast set to Spirits") |
MButton = Spirits[TotemGuruTotemsInfo[texture].school] |
end |
print("MButton= ") |
print(MButton) |
print(TotemGuruTotemsInfo[texture].name) |
spellID = (GetSpellLink(TotemGuruTotemsInfo[texture].name) or ""):match("Hspell:(%d+)") |
spellID = spellID and tonumber(spellID) |
print(spellID) |
SetMultiCastSpell(MButton, spellID) |
end |
else |
print ("version didn't match") |
end |
end |
end |
------------------ |
-- CreateButton -- |
------------------ |
Searing = "Interface\\Icons\\Spell_Fire_SearingTotem", |
Magma = "Interface\\Icons\\Spell_Fire_SelfDestruct", |
FlameTongue = "Interface\\Icons\\Spell_Nature_GuardianWard", |
--FireNova = "Interface\\Icons\\Spell_Fire_SealOfFire", |
FireNova = "Interface\\Icons\\Spell_Fire_SealOfFire", |
FrostResistance = "Interface\\Icons\\Spell_FrostResistanceTotem_01", |
FireElemental = "Interface\\Icons\\Spell_Fire_Elemental_Totem", |
[TotemGuru_Textures.Magma] = 19, |
[20] = TotemGuru_Textures.FlameTongue, |
[TotemGuru_Textures.FlameTongue] = 20, |
--[21] = TotemGuru_Textures.FireNova, |
--[TotemGuru_Textures.FireNova] = 21, |
[21] = TotemGuru_Textures.FrostResistance, |
[TotemGuru_Textures.FrostResistance] = 21, |
[22] = TotemGuru_Textures.FireElemental, |
[TotemGuru_Textures.FireElemental] = 22, |
[21] = TotemGuru_Textures.FireNova, |
[TotemGuru_Textures.FireNova] = 21, |
[22] = TotemGuru_Textures.FrostResistance, |
[TotemGuru_Textures.FrostResistance] = 22, |
[23] = TotemGuru_Textures.FireElemental, |
[TotemGuru_Textures.FireElemental] = 23, |
} |
["58656"] = "Rank 8", |
} |
}, |
-- [TotemGuru_Textures.FireNova] = |
-- { |
-- school = TotemGuru_fire_school, |
-- name = "Fire Nova Totem", |
-- effect = "Inflicts fire damage to enemies when it explodes.", |
-- range = "10", |
-- duration = 5, |
-- |
-- ranks = |
-- { |
-- ["0"] = "Rank 9", |
-- ["1535"] = "Rank 1*", |
-- ["8498"] = "Rank 2*", |
-- ["8499"] = "Rank 3*", |
-- ["11314"] = "Rank 4*", |
-- ["11315"] = "Rank 5*", |
-- ["25546"] = "Rank 6*", |
-- ["25547"] = "Rank 7*", |
-- ["61649"] = "Rank 8*", |
-- ["61657"] = "Rank 9", |
-- } |
-- }, |
[TotemGuru_Textures.FireNova] = |
{ |
school = TotemGuru_fire_school, |
name = "Fire Nova Totem", |
effect = "Inflicts fire damage to enemies when it explodes.", |
range = "10", |
duration = 5, |
ranks = |
{ |
["0"] = "Rank 9", |
["1535"] = "Rank 1*", |
["8498"] = "Rank 2*", |
["8499"] = "Rank 3*", |
["11314"] = "Rank 4*", |
["11315"] = "Rank 5*", |
["25546"] = "Rank 6*", |
["25547"] = "Rank 7*", |
["61649"] = "Rank 8*", |
["61657"] = "Rank 9", |
} |
}, |
[TotemGuru_Textures.FrostResistance] = |
{ |
school = TotemGuru_fire_school, |
["ShowBuffFlash"] = true, |
["NoEnemyPlayers"] = true, |
["Monitor"] = {["Raid"] = false,["Party"] = false,["All"] = true,}, |
["Multicast"] = {["Spirits"] = false,["Elements"] = false,["Ancestors"] = true,}, |
["Totems"] = {[1] = {},[2] = {},[3] = {},[4] = {},}, |
["MonitoredTotems"] = {}, |
["RangeCheckInterval"] = 1.0; |