• 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
119
Reaction score
16
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]...
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
119
Reaction score
16
Will check it out in some mins
Post automatically merged:

So you want to use your mana + sd at same time?
This rune is working together to SD
I was trying to do 2 attack runes works at almost same time (less then 2 secs exausted)
It almost working, but not like should be
There are a few problems
1- There is no distance effect
2- There is no dmg element
3- When it attacks, it don't show any damage remove, like a normal attack or any other rune
4- It have no fight,combat effect, i mean i can kill you with this without even get PK
5- It just ignore utamo vita (should i make a calc? or there is any other better way to fix this?)
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
119
Reaction score
16
u guys know how to make a rune in actions do damage?
the others stuffs are details, but that problem:
"you can kill another player without make damage, so you can just kill a guy and don't gain a injust"
is so broken, is anyone know a way to fix this?
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
4,807
Solutions
271
Reaction score
2,883
u guys know how to make a rune in actions do damage?
the others stuffs are details, but that problem:
"you can kill another player without make damage, so you can just kill a guy and don't gain a injust"
is so broken, is anyone know a way to fix this?

Lua:
doTargetCombatHealth(cid, target, type, min, max, effect)
doCombatAreaHealth(cid, type, pos, area, min, max, effect)

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)
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
119
Reaction score
16
Lua:
doTargetCombatHealth(cid, target, type, min, max, effect)
doCombatAreaHealth(cid, type, pos, area, min, max, effect)

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)

i tried, but got some strange stuffs:

if i add

Code:
    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)

it prints

160
280


but don't do any damage and i don't get pk

if i coment min/max
Code:
    -- local min = ( (((getPlayerMagLevel(cid)) * 10) * 0.5 ) + (40) )
    -- local max = ( (((getPlayerMagLevel(cid)) * 10) * 1.0 ) + (40) )
    -- print(min)
    -- print(max)
it don't do any damage, but i got pk


full script for now:
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)


    -- 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)
    -- doCombatAreaHealth(cid, type, pos, area, min, max, effect)

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

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
4,807
Solutions
271
Reaction score
2,883
i tried, but got some strange stuffs:

if i add

Code:
    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)

it prints

160
280


but don't do any damage and i don't get pk

if i coment min/max
Code:
    -- local min = ( (((getPlayerMagLevel(cid)) * 10) * 0.5 ) + (40) )
    -- local max = ( (((getPlayerMagLevel(cid)) * 10) * 1.0 ) + (40) )
    -- print(min)
    -- print(max)
it don't do any damage, but i got pk


full script for now:
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)


    -- 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)
    -- doCombatAreaHealth(cid, type, pos, area, min, max, effect)

    -- 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
damage needs to be a negative value

change
Lua:
doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, min, max, CONST_ME_HOLYDAMAGE)
for
Lua:
doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, -min, -max, CONST_ME_HOLYDAMAGE)
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
119
Reaction score
16
damage needs to be a negative value

change
Lua:
doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, min, max, CONST_ME_HOLYDAMAGE)
for
Lua:
doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, -min, -max, CONST_ME_HOLYDAMAGE)

did u know why is printing
37.5
75


but damage was
24



---

i also tried:

Code:
    local min = 100
    local max = 200
    print(min)
    print(max)
    doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, -min, -max, CONST_ME_HOLYDAMAGE)

but damage was 84,81,64
why?
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
4,807
Solutions
271
Reaction score
2,883
did u know why is printing
37.5
75


but damage was
24



---

i also tried:

Code:
    local min = 100
    local max = 200
    print(min)
    print(max)
    doTargetCombatHealth(cid, target, COMBAT_HOLYDAMAGE, -min, -max, CONST_ME_HOLYDAMAGE)

but damage was 84,81,64
why?
What are you attacking? A player?
All damage is reduced by 50% when attacking a player, by default.
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
119
Reaction score
16
What are you attacking? A player?
All damage is reduced by 50% when attacking a player, by default.

oh fuck i'm so dumb XD

thank you so much

one last thing

how play with this area stuff?

i tried to do like fireball rune:
Code:
doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), AREA_CIRCLE2X2, -min, -max, CONST_ME_HOLYDAMAGE)

but it is only target attack :/
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
4,807
Solutions
271
Reaction score
2,883
not sure. I've never used it before, tbh.
Maybe try setting the combat area manually?

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}
}
doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), targetArea, -min, -max, CONST_ME_HOLYDAMAGE)
 
OP
sabodden

sabodden

Member
Joined
Sep 27, 2019
Messages
119
Reaction score
16
not sure. I've never used it before, tbh.
Maybe try setting the combat area manually?

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}
}
doCombatAreaHealth(cid, COMBAT_HOLYDAMAGE, getPlayerPosition(target), targetArea, -min, -max, CONST_ME_HOLYDAMAGE)

it stills target damage :(
 

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
4,807
Solutions
271
Reaction score
2,883
it hits only one
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)
 
Top