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

Lua Reduce Knight and Paladins ManaHeal in 8.6 OT

mernes

New Member
Joined
Jul 30, 2009
Messages
41
Reaction score
0
Hey OTland,
so recently I've been noticing that the manarune that I have is giving the same amount to every voc in my OT (8.6), and that is affecting the balance in all the vocs, so my solution to this is to multiply the amount given by lets say half for knight, So in the script to the manarune you add "x 0,5 if Voc Knight, x 0,75 if Voc paladin", that will reduce the amount of given mana to Knights by 50 % and to Paladins by 25 %.
Now the problem is that I don't have enough experience in programming and scripting to do this, so I am asking if any of you guys might help me out, I would appreciate it very much!

Here is the Script
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_MANADRAIN)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 950)

function getCombatFormulas(cid, lv, maglv)
local formula_min = ((lv*2.5 + maglv*3.7) + 100 * 1.0)
local formula_max = ((lv*3 + maglv*4.6) + 100 * 1.0)

if(formula_max < formula_min) then
local tmp = formula_max
formula_max = formula_min
formula_min = tmp
end
return formula_min, formula_max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "getCombatFormulas")

function onCastSpell(cid, var)

return doCombat(cid, combat, var)
end

Thanks in advance!
Mernes
 
function getCombatFormulas(cid, lv, maglv)
local formula_min = ((lv*2.5 + maglv*3.7) + 100 * 1.0)
local formula_max = ((lv*3 + maglv*4.6) + 100 * 1.0)
Something like this: If Voc (1, 5) then *0,5?
 
Hmm, that looks like an spell script, not manarune :p
Anyway, just do an script where it checks what vocation and set the variables depending on voc.
 
Oh yeah, stupid me :rolleyes:
Well then, so make a script where it checks vocation and sets the variables after the vocs, got it.
Hmm, is there an complete and done script out there somewhere? I'm pretty off when it comes to making scripts heh ^^
 
Oh yeah, stupid me :rolleyes:
Well then, so make a script where it checks vocation and sets the variables after the vocs, got it.
Hmm, is there an complete and done script out there somewhere? I'm pretty off when it comes to making scripts heh ^^

I will not do it all, i just give an example how i do it in TFS 1.0 and just change the functions and so on.

Code:
local exhausted = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhausted, CONDITION_PARAM_TICKS, 900 )

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local pos = getCreaturePosition(cid)
    if getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) then
        return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
    end
    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 6 then
        -- If sorcerer, druid, master sorcerer or elder druid
        local count = getPlayerMaxMana(cid) / 100 * 25
    elseif getPlayerVocation(cid) == 3 then
        -- If paladin
        local count = getPlayerMaxMana(cid) / 100 * 10
    end
    return doPlayerAddMana(itemEx.uid, count) and doCreatureSay(itemEx.uid, "+"..count.." ", TALKTYPE_ORANGE_1) and doSendMagicEffect(pos, 31) and doAddCondition(cid, exhausted)
end

This add 25 % of maximum mana if vocation is equal to 1 (sorcerer)
And add 10 % of maximum mana if vocation is equaal to 3 ( paladin)
 
Back
Top