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

Skrypt Mana Rune TFS 1.1 Działa :) ale mana runa się nie kończy pomocy!

Cygan123

Member
Joined
Jan 1, 2022
Messages
35
Reaction score
8
Witam posiadam taki skrypt na Mana Rune wszystko działa jak należy :),ale Mana Runa się nie kończy ;o chciałbym aby się kończyła jak inne runy,co zmienić ?:)
function onUse(cid, item, frompos, itemEx, topos)
local playerinfo = -- Please don't touch
{
level = getPlayerLevel(cid),
mlevel = getPlayerMagLevel(cid),
voc = getPlayerVocation(cid)
}
local config =
{
strenght = "constant", ---Values: template (strenght dependent on level and magic level), constant (on all level adding same mana)
template = {min = (((playerinfo.level * 8) + (playerinfo.mlevel * 2)) / 1.5) , max =(((playerinfo.level * 12) + (playerinfo.mlevel * 4)) / 1.5)}, -- liczymy - lvl * 4 /1.5 = x m lvl * 2 /1.5 = x lvl + m lvl = Minimum, lvl * 6 /1.5 = x m lvl * 4 /1.5 = x lvl + m lvl = Maximum
constant = {min = 300, max = 500},--only if strenght is constant
exhaustion = 1,--exhaustion in secs
exhaustion_value = 56789, --exhaustion storage value
minimum_level = 1,--minimum level to use manarune
minimum_mlevel = 0,--minimum magic level to use manarune
cannot_use_voc = {0} --id vocation which cannot use
}
local rand = 0
if(isPlayer(itemEx.uid) == false) then
return true
end
if(playerinfo.level < config.minimum_level) then
return true
end
if(playerinfo.mlevel < config.minimum_mlevel) then
return true
end
if(isInArray(config.cannot_use_voc, playerinfo.voc)) then
return true
end
if(config.strenght ~= "template" and config.strenght ~= "constant") then
config.strenght = "constant"
end
if(getPlayerStorageValue(cid, config.exhaustion_value) > os.time()) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You are exhausted.")
return true
end
if(config.strenght == "template") then
rand = math.random(config.template.min, config.template.max)
elseif (config.strenght == "constant") then
rand = math.random(config.constant.min, config.constant.max)
end
doPlayerAddMana(cid, rand)
setPlayerStorageValue(cid, config.exhaustion_value, (os.time() + config.exhaustion))
doCreatureSay(cid, "+"..math.floor(rand).." mana", TALKTYPE_ORANGE_1)
return true
end
Action.xml:
<action itemid="2298" script="other/manarune.lua"/>
 
dodac pod
Code:
doCreatureSay(cid, "+"..math.floor(rand).." mana", TALKTYPE_ORANGE_1)

to
Lua:
doChangeTypeItem(item.uid, item.type - 1)
 

Similar threads

Back
Top