• 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 0.X UH/IH together to EXURA/EXANA MORT



U can try using SaiyansKing/optimized_forgottenserver (https://github.com/SaiyansKing/optimized_forgottenserver) with cooldowngroups instead outdated 0.X

Or - Port the Code from 1.X to 0.X (Spell groups)
 
If you don't want to edit sources, you can edit 'data'. Move healing runes to 'actions'. You will need to add 'level / magic level' limits on your own in LUA code, but it won't check 'healing cooldown' as it does for healing spells.
 
I've tried to do on actions:

And i have a few questions on the code:

Code:
<action itemid="2273" event="script" value="runes_spellexausted/uh.lua"/>
<action itemid="2295" event="script" value="runes_spellexausted/holy_hmm.lua"/>

uh.lua
-- 1 how to check if rune was used in a real player? i mean, not only cid, others players/monsters
Code:
local itemID = 2273
local maglv = 3
-- potions exausted
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onGetFormulaValues(cid)
    local min = ( (((getPlayerMagLevel(cid)) * 100) * 0.5 ) + (40)) * -1
    local max = ( (((getPlayerMagLevel(cid)) * 100) * 1.0 ) + (40)) * -1
    local value = math.random(min, max)
    return value
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local target = cid
    -- 1 how to check if rune was used in a real player? i mean, not only cid, others players/monsters
    if target == 0 then
        doPlayerSendCancel(cid, "You need to have a target to use this rune.")
        return true
    end

    -- 2 why exausted is not working?
    if(os.time() - getPlayerStorageValue(cid, spellcfg_actions_exausted_storage)) < spellcfg_actions_exausted_secs then
       doPlayerSendCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return true
   end

    if getPlayerMagLevel(cid) < maglv then
        doPlayerSendCancel(cid, "You do not have enought magic level.")
        return true
    end

    doSendMagicEffect(getThingPos(target), CONST_ME_MAGIC_BLUE)

    local dmg = onGetFormulaValues(cid)
    doCreatureAddHealth(cid, dmg)

    setPlayerStorageValue(cid, spellcfg_actions_exausted_storage, os.time())
    doRemoveItem(item.uid, 1) -- 3 why the item is not removing?
    return TRUE
end

holy_hmm.lua
-- 2 how to use this rune together with attack runes (i mean, this rune + sd or hmm) ?
-- 3 how to limit distance ?
-- 4 how to check if there are walls blocking ?
-- 5 how to use COMBAT_PARAM_DISTANCEEFFECT = CONST_ANI_ENERGYBALL ?
-- 6 how to set elemental damage? COMBAT_PARAM_TYPE: COMBAT_ENERGYDAMAGE ?
-- 7 how to check UTAMO VITA to remove mana instead HP (if there is mana enoght until remove health) ?


Code:
-- 2 how to use this rune together with attack runes (i mean, this rune + sd or hmm) ?

local maglv = 3

function onGetFormulaValues(cid)
    local min = ( (((getPlayerMagLevel(cid)) * 100) * 0.5 ) + (40) )
    local max = ( (((getPlayerMagLevel(cid)) * 100) * 1.0 ) + (40) )
    local value = math.random(min, max)
    return value
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local target = getCreatureTarget(cid)
    if target == 0 then
        doPlayerSendCancel(cid, "You need to have a target to use this rune.")
        return true
    end

    -- 3 how to limit distance ?
    -- 4 how to check if there are walls blocking ?

    if(os.time() - getPlayerStorageValue(cid, spellcfg_actions_exausted_storage)) < spellcfg_actions_exausted_secs then
       doPlayerSendCancel(cid, "You are exausted.")
       doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
       return true
    end

    if getPlayerMagLevel(cid) < maglv then
        doPlayerSendCancel(cid, "You do not have enought magic level.")
        return true
    end

    -- 5 how to use COMBAT_PARAM_DISTANCEEFFECT = CONST_ANI_ENERGYBALL ?

    doSendMagicEffect(getThingPos(target), CONST_ME_ENERGYHIT)

    -- 6 how to set elemental damage? COMBAT_PARAM_TYPE: COMBAT_ENERGYDAMAGE ?
    local dmg = onGetFormulaValues(cid) * -1
    -- 7 how to check UTAMO VITA to remove mana instead HP (if there is mana enoght until remove health) ?
    doCreatureAddHealth(cid, dmg)

    setPlayerStorageValue(cid, spellcfg_actions_exausted_storage, os.time())
    doRemoveItem(item.uid, 1)
    return TRUE
end
 
@Gesior.pl did u know this 2? pls
-- 1 how to check if rune was used in a real player? i mean, not only cid, others players/monsters
-- 2 how to use this rune together with attack runes (i mean, this rune + sd or hmm) ?
 
Do you want a manarune script which works with SD at same time?

How much should the manarune heal?

No, the rune i want to work at the same time with SD is the rune 2 (it is a holy HMM)

The heal rune i just want to make possible to use in others players and monsters
 
Back
Top