local outfitId = 200
local activeSeconds = 5
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
local protect = Condition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT)
protect:setParameter(CONDITION_PARAM_SUBID, 56)
protect:setParameter(CONDITION_PARAM_BUFF_SPELL, true)
protect:setParameter(CONDITION_PARAM_TICKS, activeSeconds * 1000)
combat:addCondition(protect)
local outfit = Condition(CONDITION_OUTFIT)
outfit:setParameter(CONDITION_PARAM_TICKS, activeSeconds * 1000)
outfit:setOutfit({lookType = outfitId})
combat:addCondition(outfit)
local spell = Spell(SPELL_INSTANT)
function spell.onCastSpell(creature, variant, isHotkey)
local creature = creature:isPlayer()
if not creature then
return true
end
combat:execute(creature, variant)
end
spell:name("exevo test")
spell:words("exevo test")
spell:group("attack")
spell:vocation("sorcerer", "master sorcerer")
spell:cooldown(1 * 1000)
spell:groupCooldown(1 * 1000)
spell:level(1)
spell:mana(1)
spell:register()
------------------------------------------------------------------------------------------------------------------------------------------------------
local creatureEvent = CreatureEvent("BlockDamage")
function creatureEvent.onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
if primaryType == COMBAT_HEALING or secondaryType == COMBAT_HEALING then
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
if creature and creature:isPlayer() then
if creature:getCondition(CONDITION_ATTRIBUTES, CONDITIONID_COMBAT, 56) then
primaryDamage = 0
secondaryDamage = 0
end
end
return primaryDamage, primaryType, secondaryDamage, secondaryType
end
creatureEvent:register()
------------------------------------------------------------------------------------------------------------------------------------------
local creatureEvent = CreatureEvent("BlockDamageLogin")
function creatureEvent.onLogin(player)
player:registerEvent("BlockDamage")
return true
end
creatureEvent:register()