• 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!

Exori gran

gullfisk

- Hoster / Mapper -
Joined
Aug 2, 2008
Messages
64
Reaction score
0
Location
With my mother :D
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-
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
 
here this is my ethereal spear script

ethereal 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)

function getSpellDamage(cid, weaponSkill, weaponAttack, attackStrength)
    local attack = 25
    local skill = math.max(getPlayerSkill(cid, 4))
    local level = getPlayerLevel(cid)
    local min = -(skill+attack)/3-level/5
    local max = -(skill+attack)-level/5

    return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "getSpellDamage")


function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
 
Back
Top