end |
end |
|
function EventEquip.UNIT_SPELLCAST_SUCCEEDED(unit, spell) |
if unit == "player" then |
if spell == "Activate Primary Spec" and EventEquipDB["Primary Talent Spec"] ~= "None" then |
EquipmentManager_EquipSet(EventEquipDB["Primary Talent Spec"]) |
elseif spell == "Activate Secondary Spec" and EventEquipDB["Secondary Talent Spec"] ~= "None" then |
EquipmentManager_EquipSet(EventEquipDB["Secondary Talent Spec"]) |
end |
--NEW EVENT! - ACTIVE_TALENT_GROUP_CHANGED - arg1 = active talent index, arg2 = previous talent index |
function EventEquip.ACTIVE_TALENT_GROUP_CHANGED(spec) |
if spec == 1 and EventEquipDB["Primary Talent Spec"] ~= "None" then |
EquipmentManager_EquipSet(EventEquipDB["Primary Talent Spec"]) |
elseif spec == 2 and EventEquipDB["Secondary Talent Spec"] ~= "None" then |
EquipmentManager_EquipSet(EventEquipDB["Secondary Talent Spec"]) |
end |
end |
|
EventEquip["Primary Talent Spec"] = function() |
if EventEquipDB["Primary Talent Spec"] == "None" and EventEquipDB["Secondary Talent Spec"] == "None" then |
EventEquip:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED") |
EventEquip:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
return |
else |
EventEquip:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") |
EventEquip:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
end |
end |
|
EventEquip["Secondary Talent Spec"] = function() |
if EventEquipDB["Secondary Talent Spec"] == "None" and EventEquipDB["Primary Talent Spec"] == "None" then |
EventEquip:UnregisterEvent("UNIT_SPELLCAST_SUCCEEDED") |
EventEquip:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
return |
else |
EventEquip:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") |
EventEquip:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
end |
end |
|