• 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 Player vs player Damage

were can i get a hold of combat.ccp ? ;)
Post automatically merged:

If you can help me fix this problem am willing to pay!
 
Last edited:
managed to fix it like this


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TARGETCASTERORTOPMOST, true)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_DEATHDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MORTAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SUDDENDEATH)

function onGetFormulaValues(cid, level, maglevel)
local min = -(2.8 * level + 50)
local max = -(5.5 * level + 100)
return min, max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var)
local target = variantToNumber(var)

if target > 0 and isPlayer(target) then
local level = getPlayerLevel(cid)
local min = -(2.8 * level + 50) * 2
local max = -(3.5 * level + 100) * 2
doTargetCombatHealth(cid, target, COMBAT_DEATHDAMAGE, min, max, CONST_ME_MORTAREA)
return true
else
-- Normal damage calculation for monsters or invalid target
return doCombat(cid, combat, var)
end
end
Post automatically merged:

just made the spell that you usualy pvp with that kind of script so it works now :)
 

Similar threads

Back
Top