Hello. I've got a problem when I have for example 20 blank rune and I type "adori vita vis" and it consumes whole stack of blank runes regardless of amount...
I have TFS 1.2 from here (TibiaCore 7.4 TFS 1.2 same Nostalrius project. (https://otland.net/threads/tibiacore-7-4-tfs-1-2-same-nostalrius-project.288396/)) and this client (GitHub - mehah/otclient: An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize (https://github.com/mehah/otclient?tab=readme-ov-file))
Already solved problem when using for example 10 runes it consumes whole stack. But can't solve this one with blank runes...
Here is github with spells.cpp player.cpp and player.h
Do you need anything more?
github.com
To anyone who will encounter this problem:
I added this directory to spells.xml "
</conjure>
<conjure name="Sudden Death" words="adori vita vis" maglv="25" mana="220" reagentId="3147" conjureId="3155" conjureCount="1" needlearn="1" cooldown="1000" script="conjure/suddendeath.lua">
<vocation name="Sorcerer" />
<vocation name="Master Sorcerer" />
</conjure>"
Then created script in \data\spells\scripts\conjure and created suddendeath.lua
"
local count = 1
local mana = 220
local txt = 'adori vita vis'
local runeID = 3155
local blank = 3147
function onCastSpell(creature, variant)
if creature:removeItem(blank, 1) then
if creature:getMana() >= mana then
creature:addMana(-mana)
creature:addItem(runeID, count)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
creature:say(txt, TALKTYPE_SAY)
else
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
creature:sendCancelMessage("Not enough mana.")
end
else
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
creature:sendCancelMessage("You need a blank rune to cast this spell.")
end
return false
end
"
And you do it for every rune, gl
I have TFS 1.2 from here (TibiaCore 7.4 TFS 1.2 same Nostalrius project. (https://otland.net/threads/tibiacore-7-4-tfs-1-2-same-nostalrius-project.288396/)) and this client (GitHub - mehah/otclient: An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize (https://github.com/mehah/otclient?tab=readme-ov-file))
Already solved problem when using for example 10 runes it consumes whole stack. But can't solve this one with blank runes...
Here is github with spells.cpp player.cpp and player.h
Do you need anything more?
GitHub - Mitrix89/Tibiacore
Contribute to Mitrix89/Tibiacore development by creating an account on GitHub.
Post automatically merged:
To anyone who will encounter this problem:
I added this directory to spells.xml "
</conjure>
<conjure name="Sudden Death" words="adori vita vis" maglv="25" mana="220" reagentId="3147" conjureId="3155" conjureCount="1" needlearn="1" cooldown="1000" script="conjure/suddendeath.lua">
<vocation name="Sorcerer" />
<vocation name="Master Sorcerer" />
</conjure>"
Then created script in \data\spells\scripts\conjure and created suddendeath.lua
"
local count = 1
local mana = 220
local txt = 'adori vita vis'
local runeID = 3155
local blank = 3147
function onCastSpell(creature, variant)
if creature:removeItem(blank, 1) then
if creature:getMana() >= mana then
creature:addMana(-mana)
creature:addItem(runeID, count)
creature:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
creature:say(txt, TALKTYPE_SAY)
else
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
creature:sendCancelMessage("Not enough mana.")
end
else
creature:getPosition():sendMagicEffect(CONST_ME_POFF)
creature:sendCancelMessage("You need a blank rune to cast this spell.")
end
return false
end
"
And you do it for every rune, gl

Last edited: