• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.5] Magic that reduces 100% of damage taken

Shoorkill

Member
Joined
Dec 17, 2018
Messages
126
Reaction score
21
Can any kind soul help me? I need a spell that works as follows, when using the spell the character receives 100% protection against damage received for 5 seconds, during this period his outfit becomes completely black, after 5 seconds everything returns to normal! I'm lost, I don't know if there's any way to pull Absorbpercentall into a script and leave it 100%
 
Solution
Search function: 100% protection spell (https://otland.net/threads/100-protection-spell.252477/#post-2450160)

I have edited it into 1 script aka revscript

Lua:
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)...
Search function: 100% protection spell (https://otland.net/threads/100-protection-spell.252477/#post-2450160)

I have edited it into 1 script aka revscript

Lua:
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()
 
Solution
Search function: 100% protection spell (https://otland.net/threads/100-protection-spell.252477/#post-2450160)

I have edited it into 1 script aka revscript

Lua:
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()
That's what I was talking about! Thank you for your availability and goodwill xD
 
Back
Top