• 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 Rune without runes exausted

sabodden

Member
Joined
Sep 27, 2019
Messages
138
Reaction score
18
i want to make some runes that are alloweds to use together with attack runes (i mean, this rune + sd or hmm)?

i've tried this:
Code:
local maglv = 3

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

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

    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

    -- 1 how to use COMBAT_PARAM_DISTANCEEFFECT = CONST_ANI_ENERGYBALL ?
    doSendMagicEffect(getThingPos(target), CONST_ME_ENERGYHIT)

    -- 2 how to set elemental damage? COMBAT_PARAM_TYPE: COMBAT_ENERGYDAMAGE ?
    local dmg = onGetFormulaValues(cid) * -1
   
    -- 3 it don't print the damage
    -- 4 player can kill other players without even get an injust
    -- 5 how to check UTAMO VITA to remove mana instead HP (if there is mana enoght until remove health) ?
    doCreatureAddHealth(target, dmg)

    setPlayerStorageValue(cid, spellcfg_actions_exausted_storage, os.time())
    doRemoveItem(item.uid, 1)
    return TRUE
end

it's working so far, but there are some bugs idk how to fix

-- 1 how to use COMBAT_PARAM_DISTANCEEFFECT = CONST_ANI_ENERGYBALL ?
-- 2 how to set elemental damage? COMBAT_PARAM_TYPE: COMBAT_ENERGYDAMAGE ?
-- 3 it don't print the damage
-- 4 player can kill other players without even get an injust
-- 5 how to check UTAMO VITA to remove mana instead HP (if there is mana enoght until remove health) ?

is anybody here know how to do?
 
Solution
also don't work
what are u mean?

the only script i found here using this is:
and they used createCombatArea
Post automatically merged:

hmmm there is an error on console using:

Code:
    local targetArea = createCombatArea{
        {0, 1, 1, 1, 0},
        {1, 1, 1, 1, 1},
        {1, 1, 3, 1, 1},
        {1, 1, 1, 1, 1},
        {0, 1, 1, 1, 0}
    }
    doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), createCombatArea(targetArea), -min, -max, CONST_ME_HOLYDAMAGE)

Code:
[15:38:07.271] [Error - Action Interface]
[15:38:07.271] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:38:07.271] Description:
[15:38:07.271]...
Maybe I used createcombatarea incorrectly..

try this lol

If this doesn't work, maybe the 'area' portion is bugged or something.
Lua:
local targetArea = {
    {0, 1, 1, 1, 0},
    {1, 1, 1, 1, 1},
    {1, 1, 3, 1, 1},
    {1, 1, 1, 1, 1},
    {0, 1, 1, 1, 0}
}
doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), createCombatArea(targetArea), -min, -max, CONST_ME_HOLYDAMAGE)

also don't work
what are u mean?

the only script i found here using this is:
and they used createCombatArea
Post automatically merged:

hmmm there is an error on console using:

Code:
    local targetArea = createCombatArea{
        {0, 1, 1, 1, 0},
        {1, 1, 1, 1, 1},
        {1, 1, 3, 1, 1},
        {1, 1, 1, 1, 1},
        {0, 1, 1, 1, 0}
    }
    doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), createCombatArea(targetArea), -min, -max, CONST_ME_HOLYDAMAGE)

Code:
[15:38:07.271] [Error - Action Interface]
[15:38:07.271] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:38:07.271] Description:
[15:38:07.271] (luaCreateCombatArea) This function can only be used while loading the script.

[15:38:07.271] [Error - Action Interface]
[15:38:07.271] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:38:07.272] Description:
[15:38:07.272] (luaCreateCombatArea) This function can only be used while loading the script.




Code:
    local targetArea = {
        {0, 1, 1, 1, 0},
        {1, 1, 1, 1, 1},
        {1, 1, 3, 1, 1},
        {1, 1, 1, 1, 1},
        {0, 1, 1, 1, 0}
    }

too
Code:
[15:39:57.121] [Error - Action Interface] 
[15:39:57.121] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:39:57.121] Description: 
[15:39:57.121] (luaCreateCombatArea) This function can only be used while loading the script.
 
Last edited:
also don't work
what are u mean?

the only script i found here using this is:
and they used createCombatArea
Post automatically merged:

hmmm there is an error on console using:

Code:
    local targetArea = createCombatArea{
        {0, 1, 1, 1, 0},
        {1, 1, 1, 1, 1},
        {1, 1, 3, 1, 1},
        {1, 1, 1, 1, 1},
        {0, 1, 1, 1, 0}
    }
    doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), createCombatArea(targetArea), -min, -max, CONST_ME_HOLYDAMAGE)

Code:
[15:38:07.271] [Error - Action Interface]
[15:38:07.271] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:38:07.271] Description:
[15:38:07.271] (luaCreateCombatArea) This function can only be used while loading the script.

[15:38:07.271] [Error - Action Interface]
[15:38:07.271] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:38:07.272] Description:
[15:38:07.272] (luaCreateCombatArea) This function can only be used while loading the script.




Code:
    local targetArea = {
        {0, 1, 1, 1, 0},
        {1, 1, 1, 1, 1},
        {1, 1, 3, 1, 1},
        {1, 1, 1, 1, 1},
        {0, 1, 1, 1, 0}
    }

too
Code:
[15:39:57.121] [Error - Action Interface] 
[15:39:57.121] data/actions/scripts/runes_spellexausted/holy_gfb.lua:onUse
[15:39:57.121] Description: 
[15:39:57.121] (luaCreateCombatArea) This function can only be used while loading the script.
ugh. ok. lol

lmao this script is so ugly rn.

try like this, with the combat area outside of the main function
Lua:
local targetArea = createCombatArea({
	{0, 1, 1, 1, 0},
	{1, 1, 1, 1, 1},
	{1, 1, 3, 1, 1},
	{1, 1, 1, 1, 1},
	{0, 1, 1, 1, 0}
})

local maglv = 3

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

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

    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

    -- 1 how to use COMBAT_PARAM_DISTANCEEFFECT = CONST_ANI_ENERGYBALL ?
    -- doSendMagicEffect(getThingPos(target), CONST_ME_ENERGYHIT)

    -- 2 how to set elemental damage? COMBAT_PARAM_TYPE: COMBAT_ENERGYDAMAGE ?
    -- local dmg = onGetFormulaValues(cid) * -1
    
    -- 3 it don't print the damage
    -- 4 player can kill other players without even get an injust
    -- 5 how to check UTAMO VITA to remove mana instead HP (if there is mana enoght until remove health) ?
    -- doCreatureAddHealth(target, dmg)


    -- combat condition
    -- local min = ( (((getPlayerMagLevel(cid)) * 10) * 0.5 ) + (40) )
    -- local max = ( (((getPlayerMagLevel(cid)) * 10) * 1.0 ) + (40) )
    -- print(min)
    -- print(max)
    -- doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, min, max, CONST_ME_HOLYDAMAGE)
	
	local targetPosition = getThingPosition(target)
    doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, targetPosition, targetArea, -min, -max, CONST_ME_HOLYDAMAGE)

    -- doTargetCombatMana(cid, target, min, max, effect)
    -- doCombatAreaMana(cid, pos, area, min, max, effect)

    -- doTargetCombatCondition(cid, target, condition, effect)
    -- doCombatAreaCondition(cid, pos, area, condition, effect)

    -- doTargetCombatDispel(cid, target, type, effect)
    -- doCombatAreaDispel(cid, pos, area, type, effect)

    setPlayerStorageValue(cid, spellcfg_actions_exausted_storage, os.time())
    doRemoveItem(item.uid, 1)
    return TRUE
end
 
Solution
ugh. ok. lol

lmao this script is so ugly rn.

try like this, with the combat area outside of the main function
Lua:
local targetArea = createCombatArea({
    {0, 1, 1, 1, 0},
    {1, 1, 1, 1, 1},
    {1, 1, 3, 1, 1},
    {1, 1, 1, 1, 1},
    {0, 1, 1, 1, 0}
})

local maglv = 3

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

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

    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

    -- 1 how to use COMBAT_PARAM_DISTANCEEFFECT = CONST_ANI_ENERGYBALL ?
    -- doSendMagicEffect(getThingPos(target), CONST_ME_ENERGYHIT)

    -- 2 how to set elemental damage? COMBAT_PARAM_TYPE: COMBAT_ENERGYDAMAGE ?
    -- local dmg = onGetFormulaValues(cid) * -1
   
    -- 3 it don't print the damage
    -- 4 player can kill other players without even get an injust
    -- 5 how to check UTAMO VITA to remove mana instead HP (if there is mana enoght until remove health) ?
    -- doCreatureAddHealth(target, dmg)


    -- combat condition
    -- local min = ( (((getPlayerMagLevel(cid)) * 10) * 0.5 ) + (40) )
    -- local max = ( (((getPlayerMagLevel(cid)) * 10) * 1.0 ) + (40) )
    -- print(min)
    -- print(max)
    -- doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, min, max, CONST_ME_HOLYDAMAGE)
   
    local targetPosition = getThingPosition(target)
    doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, targetPosition, targetArea, -min, -max, CONST_ME_HOLYDAMAGE)

    -- doTargetCombatMana(cid, target, min, max, effect)
    -- doCombatAreaMana(cid, pos, area, min, max, effect)

    -- doTargetCombatCondition(cid, target, condition, effect)
    -- doCombatAreaCondition(cid, pos, area, condition, effect)

    -- doTargetCombatDispel(cid, target, type, effect)
    -- doCombatAreaDispel(cid, pos, area, type, effect)

    setPlayerStorageValue(cid, spellcfg_actions_exausted_storage, os.time())
    doRemoveItem(item.uid, 1)
    return TRUE
end

WOOOOOOORKS!

THAAAAAAAANK YOU
 
Back
Top