gullfisk
- Hoster / Mapper -
how come this spell hit with such variables.. sometimes 200 and second hit may be 1200.. i want it to be based on the level u are and with a hit difference from 100+ 100-
and this spell, ethereal spear hit the player but no dmg to the player at all..
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatFormula(combat, COMBAT_FORMULA_LEVEL, 2.8, 0, 2.9, 0)
local area = createCombatArea(AREA_SQUARE2X2)
setCombatArea(combat, area)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
and this spell, ethereal spear hit the player but no dmg to the player at all..
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)
function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
local attack = 25 --Spear's attack
local skill = getPlayerSkill(cid, CONST_SKILL_DISTANCE)
local maxWeaponDamage = (skill * attack) / 20 + attack
local damage = -((math.random(0, maxWeaponDamage) * attackStrength) / 100) * 1.7 --0.8 is the multiplier
return damage, damage --The random part of the formula has already been made, just return the normal damage
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end