Spell Reflect Code (UPDATED)
Name: Spell Reflect
SpellID: 0
Target: Player
LUA Code:
Code:
local ReflectID = {
33786, -- Cyclone
28272, -- Pig Poly
118, -- Sheep Poly
61305, -- Cat Poly
61721, -- Rabbit Poly
61780, -- Turkey Poly
28271, -- Turtle Poly
51514, -- Hex
51505, -- Lava Burst
339, -- Entangling Roots
30451, -- Acrane Blast
605 -- Mind Control
}
local CastingTarget = nil
for _, reflectID in ipairs(ReflectID) do
for i=1, 5 do
local aTarget = "arena"..tostring(i)
local inRange = IsSpellInRange(tostring(GetSpellInfo(57755)), aTarget)
if UnitExists(aTarget) and inRange == 1 then
if UnitCastingInfo(aTarget) == GetSpellInfo(reflectID) then
if GetSpellCooldown(23920) == 0 then
local stance = GetShapeshiftForm()
if UnitPower("player") > 15 then
if stance == 1 or stance == 2 then
spellReflect = 1
CastingTarget = aTarget
else
CastSpellByID(2457, "player")
spellReflect = 1
CastingTarget = aTarget
end
end
end
end
end
end
if UnitExists("focus") then
if UnitCastingInfo("focus") == GetSpellInfo(reflectID) then
if GetSpellCooldown(23920) == 0 then
local stance = GetShapeshiftForm()
if UnitPower("player") > 15 then
if stance == 1 or stance == 2 then
spellReflect = 1
CastingTarget = "focus"
else
CastSpellByID(2457, "player")
spellReflect = 1
CastingTarget = "focus"
end
end
end
end
end
if UnitExists("target") then
if UnitCastingInfo("target") == GetSpellInfo(reflectID) then
if GetSpellCooldown(23920) == 0 then
local stance = GetShapeshiftForm()
if UnitPower("player") > 15 then
if stance == 1 or stance == 2 then
spellReflect = 1
CastingTarget = "target"
else
CastSpellByID(2457, "player")
spellReflect = 1
CastingTarget = "target"
end
end
end
end
end
end
if spellReflect == 1 and CastingTarget then
if IsEquippedItemType("Shields") then
if UnitBuffID("player", 23920) and UnitCastingInfo(CastingTarget) then
return true
elseif not UnitCastingInfo(CastingTarget) then
spellReflect = nil
RunMacroText("/equip Axe of Earthly Sundering")
return true
elseif UnitCastingInfo(CastingTarget) then
CastSpellByID(23920, "player")
return true
end
elseif not IsEquippedItemType("Shields") then
if UnitCastingInfo(CastingTarget) then
RunMacroText("/equip Riftrent Waraxe")
RunMacroText("/equip Catapult Loading Scoop")
return true
elseif not UnitCastingInfo(CastingTarget) then
spellReflect = nil
end
end
elseif IsEquippedItemType("Shields") then
spellReflect = nil
RunMacroText("/equip Axe of Earthly Sundering")
return true
end
swap red with your shield set or 2 handers...... same as other spell reflect.... but this one SHOULD be stronger if it works.... i have no means of testing this right now so please some1 test if for me ty!!!!!
edit, i know this looks like a lot, but this is seriously just a base code, if this works I'll be building on this to make it epic
*edit edit*
for the record i have no way of testing this so a speedy answer makes for quicker fixes