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

Moving items to backpack = Benefits

kito2

www.masteria.net
Joined
Mar 9, 2009
Messages
3,764
Solutions
1
Reaction score
227
Location
Chile, Santiago
Like topic name says, anyone knows how to make that if you pick up a item with an action_id (a number from a list, so you can add a lot of effects depending of the action_id) then it would be a benefit. It is important to just have the item at your backpack.

The idea is to make an item, that depending of its action_id it can give you benefits.

Is this possible?
 
Maybe is not the best way, but should be working... I guess.
Code:
melee = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(melee, CONDITION_PARAM_TICKS, -1)
setConditionParam(melee, CONDITION_PARAM_SKILL_CLUB, 10)
setConditionParam(melee, CONDITION_PARAM_SKILL_SWORD, 10)
setConditionParam(melee, CONDITION_PARAM_SKILL_AXE, 10)

function onMoveItem(cid, item, fromPosition, toPosition, fromItem, toItem, fromGround, toGround, status)
    if status.inInvBag == 1 then
        if item.actionid == 20000 and getPlayerStorageValue(cid, 123456) < 1 then
            doAddCondition(cid, melee)
            setPlayerStorageValue(cid, 123456, 1)
        end
    else
        if item.actionid == 20000 and getPlayerStorageValue(cid, 123456) < 0 then
            doRemoveCondition(cid, CONDITION_ATTRIBUTES)
            setPlayerStorageValue(cid, 123456, 0)
        end
    end
return true  
end

As far as I know you can't handle movements on your backpack without OnMove by Doggynub.
Pd: Ahora que se que va a volver Mtibia tirare mi proyecto a la basura...
 
Back
Top