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

Is there a way to "intercept" weapon damage ?

desalib

New Member
Joined
Jul 4, 2010
Messages
30
Reaction score
0
Hello everyone,

I want to know if there is a way to intercept ALL damage dealt by weapons use. (using weapon script maybe?)

I have this script (posted by neon)

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
 
-- this function is used to determine the damage done on a hit
function onGetFormulaValues(cid, level, skill, attack, element, factor)
    local rebs = getPlayerStorageValue(cid, 85987)
	if rebs < 1 then 
	    rebs = 1
	end -- this if condition must be used , because if it isn't the weapon damage will be 0 on 0 rebirth players
    local formula = ((rebs*xx)*-1) -- change xx to be how much damage you want per rebirth
	return formula/2, formula*1.5
end
setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
-- function ends here
 
function onUseWeapon(cid, var)
	return doCombat(cid, combat, var)
end

It's easy to modify the damage output this way but I want a way to clearly get the damage dealt.
That I may set to 0 with a condition maybe? Or do another action acording the damage dealt.
I'm open to source edit.
 
Back
Top