• 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 this possible?

Snow

New Member
Joined
Jan 16, 2008
Messages
381
Reaction score
0
If you have x item on your backpack or arrow slot or hand(whatever it is but with you) you get 5% protection against an element, if you have y item you get 5% against another element(expandable action)


If that isn't possible maybe if you made something like....
An item that you place on the arrow slot you get an effect(mortarea) but it'll only protect during 5 mins?
is that easier?

Rep+++
 
Last edited:
Actually it is possible, just not easy (for most. Simple for anyone knowing a bit of c++, though. It can be done in LUA as well, but way more complex.)

;)
 
PHP:
	<movevent type="Equip" itemid="ID" slot="pickupable" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="ID" slot="pickupable" event="function" value="onDeEquipItem"/>

Have fun.

PS: Add information about protections in items.xml.
 
PHP:
	<movevent type="Equip" itemid="ID" slot="pickupable" event="function" value="onEquipItem"/>
	<movevent type="DeEquip" itemid="ID" slot="pickupable" event="function" value="onDeEquipItem"/>

Have fun.

PS: Add information about protections in items.xml.

Will it work even if player logs on with the item already in bp?
 
Will it work even if player logs on with the item already in bp?

Propably yes, but I'm not sure. Just try.

PS: Equip items from "old" slots (head, armor, etc) works when player login. I don't tested this in "pickupable" slot.

#EDIT#
If it won't work onLogin, then I can write simple script, that will add condition after login.
 
this way.

Lua:
function onStatsChange(cid, attacker, type, combat, value)    

    if not isPlayer(attacker) then 
        return true
    end
        
    if (type == STATSCHANGE_HEALTHLOSS) then
        -- check item
        -- compare combat type
        -- calculate new damage
        local value = value - 10
        doTargetCombatHealth(0, cid, type, -value, -value, effect)
        return false
    end
    
    return true
end
 
Propably yes, but I'm not sure. Just try.

PS: Equip items from "old" slots (head, armor, etc) works when player login. I don't tested this in "pickupable" slot.

#EDIT#
If it won't work onLogin, then I can write simple script, that will add condition after login.

I want the item to protect if it's on the backpack...Your way only works if it's on hands or arrow slot.

Is that script for my item?
I don't see any way to make it work for my purpose.
 
I want the item to protect if it's on the backpack...Your way only works if it's on hands or arrow slot.

Is that script for my item?
I don't see any way to make it work for my purpose.

When someone hurts a player (hp loss) it will negate a certain percentage of damage if that player has a certain item on him...
 
Back
Top Bottom