Adds a new method to add and remove mechanic immunities.
Tested with:
local function ImmunityOff(eventid, delay, repeats, creature)
creature:SetImmuneTo(26, false)
creature:SendUnitSay("I am interruptable now.", 0)
end
local function Cast(eventid, delay, repeats, creature)
creature:CastSpell(creature, 57775, false)
end
local function EnterCombat(event, creature, target)
creature:SetImmuneTo(26, true)
creature:SendUnitSay("You can not interrupt me.", 0)
creature:RegisterEvent(Cast, 5500, 0)
creature:RegisterEvent(ImmunityOff, 15000, 1)
end
local function LeaveCombat(event, creature)
creature:RemoveEvents()
end
RegisterCreatureEvent(113, 1, EnterCombat)
RegisterCreatureEvent(113, 2, LeaveCombat) -- OnLeaveCombat
RegisterCreatureEvent(113, 4, LeaveCombat) -- OnDied
Adds a new method to add and remove mechanic immunities.
Tested with: