• 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!

Lua "Magic Patch - exura infir"

Kownikuzyt

Member
Joined
Feb 11, 2020
Messages
170
Solutions
1
Reaction score
8
Hello, someone has a script for the spell "Magic Patch - exura infir"
I'm looking for other TFS and can't find it.

(I am using TFS version 1.1)

"Magic Patch - exura infir"
Spell group: "healing"
Damage type: "-"

Description: Heals a small amount of hp.
 
Solution
XML:
    <instant group="healing" spellid="172" name="Magic Patch" words="exura infir" lvl="1" mana="6" aggressive="0" selftarget="1" exhaustion="1000" groupcooldown="1000" needlearn="1" script="healing/magic patch.lua">
        <vocation name="Sorcerer" />
        <vocation name="Druid" />
        <vocation name="Paladin" />
        <vocation name="Master Sorcerer" />
        <vocation name="Elder Druid" />
        <vocation name="Royal Paladin" />
    </instant>
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function...
XML:
    <instant group="healing" spellid="172" name="Magic Patch" words="exura infir" lvl="1" mana="6" aggressive="0" selftarget="1" exhaustion="1000" groupcooldown="1000" needlearn="1" script="healing/magic patch.lua">
        <vocation name="Sorcerer" />
        <vocation name="Druid" />
        <vocation name="Paladin" />
        <vocation name="Master Sorcerer" />
        <vocation name="Elder Druid" />
        <vocation name="Royal Paladin" />
    </instant>
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 0.4) + 3
    local max = (level / 5) + (maglevel * 0.6) + 4
    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end
 
Solution
XML:
    <instant group="healing" spellid="172" name="Magic Patch" words="exura infir" lvl="1" mana="6" aggressive="0" selftarget="1" exhaustion="1000" groupcooldown="1000" needlearn="1" script="healing/magic patch.lua">
        <vocation name="Sorcerer" />
        <vocation name="Druid" />
        <vocation name="Paladin" />
        <vocation name="Master Sorcerer" />
        <vocation name="Elder Druid" />
        <vocation name="Royal Paladin" />
    </instant>
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HEALING)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, 0)
combat:setParameter(COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 0.4) + 3
    local max = (level / 5) + (maglevel * 0.6) + 4
    return min, max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    return combat:execute(creature, var)
end

@M0ustafa

Thank you :)
 
Back
Top