• 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 Spells explanation 0.3.1

Jarhead

New Member
Joined
Feb 2, 2012
Messages
81
Reaction score
2
Location
Poland
Yo, I need explanation of attack spells.
So: 0.4 - 0.6 is damage from skill
-20 and 0 = ?

ethernal spear.lua:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.4, -20, 0.6, 0)

function onCastSpell(cid, var)
   return doCombat(cid, combat, var)
end
 
Yo, I need explanation of attack spells.
So: 0.4 - 0.6 is damage from skill
-20 and 0 = ?
im not sure but as far as i remember is something like this:
setCombarFormula(combat, type, minA, minB, maxA, maxB)
which means
combat = combat you want to set this formulae
type = what you want to use to increase damage, skill, maglv or nothing
minA = minimal damage to your spell
minB = minimal increase in damage your type will do.
maxA = maximal damage to your spell
maxB = maximal increase in damage your type will do.

i think formulae is something like this
weapon damage * maxA + maxB
then the damage is a random number between your minb and result of above formula
 
Here I go:

local combat = createCombatObject() <--- This line is creating the Combat Object (Something that causes combat to begin)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) <--- The type of damage the combat object will deal
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, TRUE) <--- This line is optional in spells, it works setting the damage to be reduced by armor
setCombatParam(combat, COMBAT_PARAM_EFFECT, 27) <---- This line will set an area animation of the combat object
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ETHEREALSPEAR) <---- This line sets the distance animation of the combat object
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.4, -20, 0.6, 0) <---- This line will set the min to max values of the damage from the combat object
You can understand better the min to max values in the reply from @andu.

function onCastSpell(cid, var) <--- This is onCastSpell function. When you have this function it will create the combat object from above when you cast the spell correctly. The next lines are gears for this function that can be edited if you need complex spells.
return doCombat(cid, combat, var)
end
 
Back
Top