El Man
«لَا إِلَٰهَ إِلَّا ٱللَّٰهُ»
- Joined
- Mar 23, 2013
- Messages
- 161
- Reaction score
- 33
i want a little help in combat spells
when i use spells on monster its do combatf on monster and when i use spells on player its do combate on player
combatf= firedamage
combate= energydamage
how i do this ?
Spells =
i use
local target = getCreatureTarget(cid)
if isPlayer(target) then
its work when i attack on player and if im not attacking player its dosent work
when i use spells on monster its do combatf on monster and when i use spells on player its do combate on player
combatf= firedamage
combate= energydamage
how i do this ?
Spells =
Lua:
local combatf = createCombatObject()
setCombatParam(combatf, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combatf, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combatf, COMBAT_FORMULA_LEVELMAGIC, 0, -5000, 0, -7500)
local combate = createCombatObject()
setCombatParam(combate, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combate, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combate, COMBAT_FORMULA_LEVELMAGIC, 0, -10000, 0, -10500)
local arr = {
{1, 1, 1},
{1, 2, 1},
{1, 1, 1}
}
local area = createCombatArea(arr)
setCombatArea(combatf, area)
setCombatArea(combate, area)
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if isPlayer(target) then
return doCombat(cid, combate, var)
else
return doCombat(cid, combatf, var)
end
end
i use
local target = getCreatureTarget(cid)
if isPlayer(target) then
its work when i attack on player and if im not attacking player its dosent work