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

Protection from elements!

nOstap

New Member
Joined
Jan 6, 2009
Messages
19
Reaction score
1
i need spell which protects against the elements?


eg. utamo frigo
It gives 20% protection against ice for 20sec

if is possible to do that please help :)
 
Not sure tho.

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

function onCastSpell(cid, var)
	exhaustion.set(cid, 1333, 20)
	doCombat(cid, combat, var)
	return true
end

Code:
function onStatsChange(cid, attacker, type, combat, value)
	if(exhaustion.get(cid, 1333) ~= false and isInArray({STATSCHANGE_HEALTHLOSS, STATSCHANGE_MANALOSS}, type) and combat == COMBAT_ICEDAMAGE) then
		value = math.ceil(0.8 * value)
	end
	return true
end
 
Thanx, but not work ;/

but with your help I'm make something like this:
Code:
function onStatsChange(cid, attacker, type, combat, value)
local pid = getCreaturePosition(cid)
local procent = 20
	if(exhaustion.get(cid, 9797) ~= false and isInArray({STATSCHANGE_HEALTHLOSS, STATSCHANGE_MANALOSS}, type) and combat == COMBAT_FIREDAMAGE) then
		valuehit = math.ceil(((0.01 * procent) - 1) * value)
		doCreatureAddHealth(cid, valuehit)
		doSendAnimatedText(pid, "" .. valuehit .. "", 80)
				return false
	end
	
	return true
end
this block fire attack and give player 20% of hit
 
Last edited:
Back
Top