thalmonn
New Member
- Joined
- Aug 18, 2019
- Messages
- 9
- Reaction score
- 0
Hello folks! I'm not a expert on dev otserver, so in this moment i'm trying to "convert" this code to a new version. This script is write to work on tfs 0.4 (i think) on a otserver 7.92.
I need to convert him to a tfs 1.2 params, to do the same thing as the original version. I need to run it on a 10.90 otserver.
The code is:
So, anyone can help me?
I need to convert him to a tfs 1.2 params, to do the same thing as the original version. I need to run it on a 10.90 otserver.
The code is:
Lua:
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,2)
level = getPlayerLevel(cid)
min = -((skill*1)+level*1)
max = -((skill*7)+level*1)
return min, max
end
setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 31)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,2)
level = getPlayerLevel(cid)
min = -((skill*9)+level*2)
max = -((skill*12)+level*3)
return min, max
end
local condition = createConditionObject(CONDITION_EMO)
rande = math.random(67,112)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 100, 3100, -rande)
setCombatCondition(combat2, condition)
setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
fala = math.random(1,29)
rand = math.random(1,645)
if rand <= getPlayerSkill(cid,2) then
if fala == 1 then
doPlayerSay(cid,"For honor!",16)
doPlayerAddHealth(cid,(getPlayerMaxHealth(cid)/5))
doSendAnimatedText(getPlayerPosition(cid),"Critical!",129)
doCombat(cid, combat2, var)
else
--doPlayerSay(cid,"Fell my fury!",16)
doPlayerAddHealth(cid,(getPlayerMaxHealth(cid)/5))
doSendAnimatedText(getPlayerPosition(cid),"Critical!",129)
doCombat(cid, combat2, var)
end
else
doCombat(cid, combat1, var)
end
end
So, anyone can help me?