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

Maybe try a little harder? You are working in the right direction. You seen where you could change the condition, however you only changed it in one place. Also you have the parameter setting the time based off a config value, that's not necessary anymore...
 
you know that i know not much about scripts? :p wtf.. parameter setting? necessary??? .. oh damn <.<

Here is the facts, whether good or not, it is irrelevant. People here won't be of much help to you if all you do is come here and ask for people to make a script the way you need it to work. It is a much better option to learn how to construct these scripts for yourself, then to ask help when they are not doing what you want them to do, or if you are struggling in some other kind of way. Then people will see you are trying to learn. People help people who are trying to learn WAY more often than those who just come here and ask for scripts.

There are MANY tutorials here on scripting. My suggestion would be if you don't already have notepad++, or sublime, or some awesome color coded text editor, then download one, it will become your best friend. Then go through and read tutorials on anything and everything. Once you learn something about scripting, play with it! Alter it, change it with some other kind of variable or constant, or w/e, once you learn you will know what those words mean.... Read, read, and keep reading. That's how you will make it all easier and faster on yourself.
 
That is not the Problem.. but i have first problem with translation from german to english.. that is my biggest problem.. and second.. i try my best to understand all lua xml and other basics..
 
Back
Top