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

Problem with rune charges

Kanqwerty

New Member
Joined
Jan 2, 2017
Messages
5
Reaction score
0
Hello! I just added manarune and hprune for my ots and it works, but if you set these runes on hotkey and use it there will be always text "Using one of 0 spell runes" even when there are many more of them in backpack.
I would love to let it show how many runes are still in backpack after using one.

Here's script for manarune:

Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local level = getPlayerLevel(cid)
    local mlevel = getPlayerMagLevel(cid)
    local mana_minimum = (level * 1) + (mlevel * 4) + 75
    local mana_maximum = (level * 1) + (mlevel * 4) + 80
    local mana_add = math.random(mana_minimum, mana_maximum)
   
    if(getPlayerItemCount(cid, 2275) >= 1) then
    doPlayerRemoveItem(cid,2275,1)
    doPlayerAddMana(cid, mana_add)
   
   
    doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
    doCreatureSay(itemEx.uid, "Mana UP!", TALKTYPE_ORANGE_1)
    return TRUE
    end
end
 
it should tell you how many you have on you whenever you use it
the message is dealt with in sources, not in lua
 
But the thing is it works for different runes... But even if there are for example 100sds it uses everything after first cast.
 
But the thing is it works for different runes... But even if there are for example 100sds it uses everything after first cast.
what works for different runes?
the text?
what uses everything after first cast? are you saying that all 100 would be removed if you used one?
 
Yeah, text works for different runes, but all runes in one slot are dissapearing after using one. I'm holding 100sds and after using one it shows "using one of 100 sudden death runes" and uses all of them :/
 
probably because its removing the item altogether + the stack instead of removing 1 from the stack
show the script for sd
 
It's just standard script for sd, wasn't editing anything. Using tfs 0.3.6 for tibia 8.6

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -60, -1, -60, 5, 5, 4, 7)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end
 
Back
Top