Skip to content

Instantly share code, notes, and snippets.

@Romain-P
Created February 16, 2018 16:38
Show Gist options
  • Select an option

  • Save Romain-P/f39b2259d56bdeca269f9965cb6412ed to your computer and use it in GitHub Desktop.

Select an option

Save Romain-P/f39b2259d56bdeca269f9965cb6412ed to your computer and use it in GitHub Desktop.
--[[ AntiCCv3 EPvP Pand0r]]--
--[[ Settings ]]--
local Spells1 = {"Scatter Shot", "Blind", "Paralysis", "Gouge"}
local Spells2 = {"Silence", "Counterspell", "Silencing Shot", "Strangulate", "Garrote", "Solar Beam", "Spell Lock"}
local Spells3 = {"Intimidating Shout"}
local Spells4 = {"Kick", "Rebuke", "Wind Shear", "Pummel", "Mind Freeze", "Skull Bash"}
local Spells5 = {"Deep Freeze"}
local ShowInfo = true; -- Prints information about taken actions in Chatwindow
local Delay = 0.002; -- The Delay the Script waits for casting in seconds.
local SetStopCasting = true;
function ACCprint(msg)
if ShowInfo == true then print("|cFF00CCFFAntiCC: |r" .. msg); end
end
function IsCastingOrChanneling()
if UnitCastingInfo("player") or UnitChannelInfo("player") and SetStopCasting == true then return 1; end
end
local Timer, Reset, ACCSpell = 0, true;
local type, hideCaster, srcGUID, srcName, srcFlags, srcFlags2, dstGUID, dstName, spellName, spellSchool, missType;
function Queue()
if GetTime() >= Timer and Reset == false then
if GetSpellCooldown(ACCSpell) == 0 then
if IsCastingOrChanneling() == 1 then SpellStopCasting(); end
ACCprint("|cFFFF6060" .. srcName .. "|r" .. " hits you with " .. "|cFFFFFF00" .. spellName .. "|r" .. ". Trying to cast " .. ACCSpell .. "...");
else
ACCprint("|cFFFF6060" .. srcName .. "|r" .. " hits you with " .. "|cFFFFFF00" .. spellName .. "|r" .. ". Unfortunately " .. ACCSpell .. " is on Cooldown. :(");
end
CCSrc = GetObjectFromGUID(srcGUID);
CCSrc:CastSpellByName(ACCSpell);
Reset = true;
end
end
SetTimerCallback (Queue, 1);
local frame = CreateFrame("FRAME", "AntiCC");
frame:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
local function eventHandler(self, event, ...)
type, hideCaster, srcGUID, srcName, srcFlags, srcFlags2, dstGUID, dstName = select(2, ...); -- Read Combat Log
if type == "SPELL_CAST_SUCCESS" then
spellName = select(13, ...)
if dstName == UnitName("player") and tContains(Spells1, spellName) then
Timer = GetTime() + Delay;
Reset = false;
ACCSpell = "Shadow Word: Death";
elseif dstName == UnitName("player") and tContains(Spells2, spellName) then
Timer = GetTime() + Delay;
Reset = false;
ACCSpell = "Inner Focus";
elseif dstName == UnitName("player") and tContains(Spells3, spellName) then
Timer = GetTime() + Delay;
Reset = false;
ACCSpell = "Fear Ward";
elseif dstName == UnitName("player") and tContains(Spells4, spellName) then
Timer = GetTime() + Delay;
Reset = false;
ACCSpell = "Auto Attack";
elseif dstName == UnitName("player") and tContains(Spells5, spellName) then
Timer = GetTime() + Delay;
Reset = false;
ACCSpell = "Spectral Guise";
end
elseif type == "SPELL_MISSED" then
spellName, spellSchool, missType = select(13, ...)
if dstName == UnitName("player") and (tContains(Spells1, spellName) or tContains(Spells2, spellName) or tContains(Spells3, spellName) ) and not missType == "ABSORB" then
Reset = true;
ACCprint("|cFFFF6060" .. srcName .. "|r" .. " casted " .. "|cFFFFFF00" .. spellName .. "|r" .. " on you, but it failed (" .. missType .. ").");
end
end
end
frame:SetScript("OnEvent", eventHandler);
print("|cFF00CCFFAntiCC EPvP Pand0r: |r" .. "loaded.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment