• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Protective armor.

Werewolf

Forbidden Ascension
Joined
Jul 15, 2012
Messages
886
Reaction score
123
Alright here is my idea, i dunno if its possible but i hope someone can make it, Rep +

Alright so is it possible to make specific armors to have this effect:

When you are attacked - has a 5% chance to shrug off the damage or in other words be 100% immune to dmg for that single attack,
and if you put on more then 1 armor piece with the same effect, the 5% turns into 10%, then 15% and so on till you got a full set on.

is anyone able to make this? i will rep++ :D thank you all for reading this idea
 
Last edited:
Well Not reflect, more like some sort of script that activates when you are attacked, has a 5% chance to make you 100% immune to dmg, for that 1 attack that triggered the % if it is even possible to make
 
You can always use onStatsChange in creatureevents.

I think something like that may do the job :

Add 'and isCreature(attacker)' if you want it to trigger only when hitted bye monsters/players
Add 'and combat == COMBAT_PHYSICALDAMAGE' if you want it to only cancel physical damage

Code:
local itemlist = {7864, 8888} -- just add the item id here

function onStatsChange(cid, attacker, type, combat, value)
	if isPlayer(cid) then -- in case you register monsters later
		if type == STATSCHANGE_HEALTHLOSS and value > 0 then --add the upper condition here if you want them
			local chance = 0
			for i = 0, 10, 1 do
				if (not(getPlayerSlotItem(cid,i).id == 0)) then
					if isInArray(itemlist, getPlayerSlotItem(cid,i).id)
						chance = chance + 5
					end
				end
			end
			if math.random(100) <= chance then
				return false
			end
		end
	end
end

Not tested but it should works ( in any way just use onStatsChange with return false to nullify the damages )
 
Back
Top