Rhyund
New Member
- Joined
- May 3, 2010
- Messages
- 23
- Reaction score
- 0
I have this .lua file:
So, if I use itemid 7438 the combat changes from combat1 to combat2. I would like to add another itemid with another formula (combat3). How can I do this?
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 22)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.65, 0, 2.0, 0)
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat2, COMBAT_PARAM_DISTANCEEFFECT, 22)
setCombatFormula(combat2, COMBAT_FORMULA_SKILL, 0.845, 0, 2.6, 0)
function onUseWeapon(cid, var)
if getPlayerSlotItem(cid, CONST_SLOT_RIGTH).itemid == 7438 or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 7438 then
return doCombat(cid, combat2, var)
else
return doCombat(cid, combat, var)
end
end
So, if I use itemid 7438 the combat changes from combat1 to combat2. I would like to add another itemid with another formula (combat3). How can I do this?
Last edited: