• 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.3] Buff your damage with a spell for 5 sec

Levi999x

AoT
Joined
Dec 14, 2017
Messages
1,796
Solutions
35
Reaction score
997
Location
Germany
Buff Spell for 5secs :D

data/creaturescripts.xml:
Lua:
<event type="healthchange" name="BuffSystemO" script="BuffSystemO"/>

data/creaturescripts/scripts/BuffSystemO
Lua:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
    if not creature or not attacker or not attacker:isPlayer() then
        return primaryDamage, primaryType, secondaryDamage, secondaryType
    end
   
    if attacker:getStorageValue(7373) == 1 then
        primaryDamage = primaryDamage + (primaryDamage * 50 / 100)
        secondaryType = secondaryType + (secondaryType * 50 / 100)
    end
    return primaryDamage, primaryType, primaryDamage, secondaryType
end

login.lua
Lua:
player:registerEvent("BuffSystemO")
Lua:
player:setStorageValue(7373, 0)

data/scripts/BatMan
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_EFFECT, 1)

local function castSpellTo(cid, variant)
    local player = Player(cid)
    if player then
        player:setStorageValue(7373, 0)
    end
end

local buff = Spell(SPELL_INSTANT)

function buff.onCastSpell(creature, variant)
    creature:setStorageValue(7373, 1)
    local cid = creature:getId()
        addEvent(castSpellTo, 5000, cid, variant)
    return true
end

buff:name("exura buff")
buff:words("exura buff")
buff:group("support")
buff:vocation("Knight", "master sorecerer")
buff:id(1)
buff:cooldown(1000)
buff:level(200)
buff:manaPercent(1)
buff:blockWalls(true)
buff:register()
 
Top