KaczooH
Co tu wpisac?
- Joined
- Oct 12, 2007
- Messages
- 904
- Reaction score
- 0
Hiho all
I'm not even nooby in LUA scripts but I made up some script which DOESN'T work now. Console doesn't show any error in syntax or so. I wish ask you if could you improve it.
Best regards.
I'm not even nooby in LUA scripts but I made up some script which DOESN'T work now. Console doesn't show any error in syntax or so. I wish ask you if could you improve it.
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
-- setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.2, -30, -1.1, 0)
function onCastSpell(cid, var)
local sword = getPlayerSkill(cid,2)
local axe = getPlayerSkill(cid,3)
local club = getPlayerSkill(cid,1)
if sword > axe then
if sword > club then local skill = sword
else local skill = club
end
else local skill = axe
end
local damage_min = skill
local damage_max = skill
local combat = math.random(damage_min, damage_max)
setCombatFormula(combat, var)
local arr = {
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
}
local area = createCombatArea(arr)
setCombatArea(combat, area)
return doCombat(cid, combat, var)
end
Best regards.
Last edited: