Olá, boa tarde.
Gostaria de saber se é possível adaptar a fórmula antiga das SD's, como era feita, nos dias de hoje...
Segue o modelo do otserver 7.6:
-- doTargetMagic-- attackType: Type of attack
-- cid: creature id.
-- Targetpos: Target position.
-- animationEffect: Projectile animation.
-- damageEffect: Effect to show when spell hits a player.
-- animationColor: Color of the text that is shown above the player when hit.
-- offensive: Indicates if the spell is a healing/attack spell.
-- drawblood: Determines if the spell causes blood splash.
-- minDmg: Minimal damage.
-- maxDmg: Maximum damage.
-- returns true if the spell was casted.
attackType = ATTACK_PHYSICAL
animationEffect = NM_ANI_SUDDENDEATH
hitEffect = NM_ME_MORT_AREA
damageEffect = NM_ME_DRAW_BLOOD
animationColor = RED
offensive = true
drawblood = true
SuddenDeathObject = (attackType, animationEffect, hitEffect, damageEffect, animationColor, offensive, drawblood, 0, 0)
function onCast(cid, creaturePos, level, maglv, var)
centerpos = {x=creaturePos.x, y=creaturePos.y, z=creaturePos.z}
SuddenDeathObject.minDmg = (level * 2 + maglv *3) * 1.2 - 30
SuddenDeathObject.maxDmg = (level * 2 + maglv *3) * 1.6
return doTargetMagic(cid, centerpos, SuddenDeathObject:ordered())
end
E o modelo atual:
local combat = createCombatObject()setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_DEATH)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1.005, -25, -1.75, 0)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end