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

Solved Manarune tfs 1.0 (10.31)

zxzxzx

New Member
Joined
Mar 12, 2011
Messages
334
Reaction score
3
Hello I have this script for my manarune, manarune work god on 0.36 and 0.4 but not working on new tfs 1.0 so I need help with repair it, this manarune characterized in that:

- does not give the same amount of mana
- is depented on the lvl and m lvl
- treated the amount is visible over the player
- is defined for some profession

Here is the script


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 = "template", ---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 = 400, max = 800},--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 = {3,4,7,8,11,12} --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
doCreatureAddMana(cid, rand)
setPlayerStorageValue(cid, config.exhaustion_value, (os.time() + config.exhaustion))
doCreatureSay(cid, "+"..tostring(rand).." mana", TALKTYPE_ORANGE_1)
return true
end





For Help thanks and rep + (sry for my bad Eng) :S
 
ok now work but....? look




Astronautic xD...


Script

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 = "template", ---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 = 400, max = 800},--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 = {3,4,7,8,11,12} --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, mana, rand)
setPlayerStorageValue(cid, config.exhaustion_value, (os.time() + config.exhaustion))
doCreatureSay(cid, "+"..tostring(rand).." mana", TALKTYPE_ORANGE_1)
return true
end
 
Try this:
Code:
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 = "template", ---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 = 400, max = 800},--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 = {3,4,7,8,11,12} --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
 
Last edited:
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 900))

function onUse(cid, item, fromPosition, itemEx, toPosition)
local level = getPlayerLevel(cid)
local mlevel = getPlayerMagLevel(cid)
local mana_minimum = (level * 5) + (mlevel * 3) - 50
local mana_maximum = (level * 6) + (mlevel * 4)
local mana_add = math.random(mana_minimum, mana_maximum)

doPlayerAddMana(cid, mana_add)
doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
return TRUE
end

Code:
    <action itemid="2314" script="custom/manarune.lua"/>

TFS 1.1 with Client Version 10.41
 
Code:
local exhaust = Condition(CONDITION_EXHAUST_HEAL)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 900))

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
    if itemEx.itemid ~= 1 or itemEx.type ~= THING_TYPE_PLAYER then
        return true
    end

    --[[
    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        return true
    end
    ]]

    local level, mlevel = player:getLevel(), player:getMagicLevel()
    local min, max = (level * 5) + (mlevel * 3) - 50, (level * 6) + (mlevel * 4)

    if not doTargetCombatMana(0, player, min, max, CONST_ME_MAGIC_BLUE) then
        return false
    end

    --player:addCondition(exhaust)
    player:say("Aaaah...", TALKTYPE_MONSTER_SAY)
    Item(item.uid):remove(1)
    return true
end
 
Great Thanks,!

BTW. It is possible that the coolddown of the manarune is show in the new cooldown bar? because of that i wanted the manarune and not potions :p
 
Great Thanks,!

BTW. It is possible that the coolddown of the manarune is show in the new cooldown bar? because of that i wanted the manarune and not potions :p

Yes there is also cooldown condition. You can create the cooldown condition instead if you like, and use it to set your own specific amount of time, and the cooldown bar icon you want with it, as well as the bar going with the exact amount of time you place for the cooldown. You can also have it do a group cooldown, maybe check out an example of how to use cooldown condition here

http://otland.net/threads/tfs-1-0-spellid-generator.223138/

here are some different condition types
Code:
CONDITION_NONE
CONDITION_POISON
CONDITION_FIRE
CONDITION_ENERGY
CONDITION_BLEEDING
CONDITION_HASTE
CONDITION_PARALYZE
CONDITION_OUTFIT
CONDITION_INVISIBLE
CONDITION_LIGHT
CONDITION_MANASHIELD
CONDITION_INFIGHT
CONDITION_DRUNK
-- CONDITION_EXHAUST_WEAPON
CONDITION_REGENERATION
CONDITION_SOUL
CONDITION_DROWN
CONDITION_MUTED
CONDITION_CHANNELMUTEDTICKS
CONDITION_YELLTICKS
CONDITION_ATTRIBUTES
CONDITION_FREEZING
CONDITION_DAZZLED
CONDITION_CURSED
-- CONDITION_EXHAUST_COMBAT
-- CONDITION_EXHAUST_HEAL
CONDITION_PACIFIED
CONDITION_SPELLCOOLDOWN
CONDITION_SPELLGROUPCOOLDOWN
here are some parameters for conditions
Code:
CONDITION_PARAM_OWNER
CONDITION_PARAM_TICKS
CONDITION_PARAM_HEALTHGAIN
CONDITION_PARAM_HEALTHTICKS
CONDITION_PARAM_MANAGAIN
CONDITION_PARAM_MANATICKS
CONDITION_PARAM_DELAYED
CONDITION_PARAM_SPEED
CONDITION_PARAM_LIGHT_LEVEL
CONDITION_PARAM_LIGHT_COLOR
CONDITION_PARAM_SOULGAIN
CONDITION_PARAM_SOULTICKS
CONDITION_PARAM_MINVALUE
CONDITION_PARAM_MAXVALUE
CONDITION_PARAM_STARTVALUE
CONDITION_PARAM_TICKINTERVAL
CONDITION_PARAM_FORCEUPDATE
CONDITION_PARAM_SKILL_MELEE
CONDITION_PARAM_SKILL_FIST
CONDITION_PARAM_SKILL_CLUB
CONDITION_PARAM_SKILL_SWORD
CONDITION_PARAM_SKILL_AXE
CONDITION_PARAM_SKILL_DISTANCE
CONDITION_PARAM_SKILL_SHIELD
CONDITION_PARAM_SKILL_FISHING
CONDITION_PARAM_STAT_MAXHITPOINTS
CONDITION_PARAM_STAT_MAXMANAPOINTS
CONDITION_PARAM_STAT_SOULPOINTS
CONDITION_PARAM_STAT_MAGICPOINTS
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT
CONDITION_PARAM_STAT_SOULPOINTSPERCENT
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT
CONDITION_PARAM_PERIODICDAMAGE
CONDITION_PARAM_SKILL_MELEEPERCENT
CONDITION_PARAM_SKILL_FISTPERCENT
CONDITION_PARAM_SKILL_CLUBPERCENT
CONDITION_PARAM_SKILL_SWORDPERCENT
CONDITION_PARAM_SKILL_AXEPERCENT
CONDITION_PARAM_SKILL_DISTANCEPERCENT
CONDITION_PARAM_SKILL_SHIELDPERCENT
CONDITION_PARAM_SKILL_FISHINGPERCENT
CONDITION_PARAM_BUFF_SPELL
CONDITION_PARAM_SUBID
CONDITION_PARAM_FIELD
Use that, and what ninja has shown you, see if you can remake it into exactly what you are wanting. If you need anymore help, keep asking here...
 
ehm.. Okay.. so just that?

Code:
local exhaust = Condition(CONDITION_SPELLCOOLDOWN)
exhaust:setParameter(CONDITION_PARAM_TICKS, (configManager.getNumber(configKeys.EX_ACTIONS_DELAY_INTERVAL) - 900))

function onUse(player, item, fromPosition, itemEx, toPosition, isHotkey)
    if itemEx.itemid ~= 1 or itemEx.type ~= THING_TYPE_PLAYER then
        return true
    end

    --[[
    if player:getCondition(CONDITION_EXHAUST_HEAL) then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_YOUAREEXHAUSTED))
        return true
    end
    ]]

    local level, mlevel = player:getLevel(), player:getMagicLevel()
    local min, max = (level * 5) + (mlevel * 3) - 50, (level * 6) + (mlevel * 4)

    if not doTargetCombatMana(0, player, min, max, CONST_ME_MAGIC_BLUE) then
        return false
    end

    --player:addCondition(exhaust)
    player:say("Aaaah...", TALKTYPE_MONSTER_SAY)
    Item(item.uid):remove(1)
    return true
end

:eek:
 
Back
Top