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

RevScripts if vocation id 10

Lbtg

Intermediate OT User
Joined
Nov 22, 2008
Messages
2,314
Reaction score
136
hey hey , does it possible to make it, if player is vocation Id 10 - cannot wear any eq part, only Bp slot can be used.

if possible, can someone make such script ?

i want set for specific voc, that it can wear only bps type items and only in bp slot, ofc if possible to make that bps can be wear on ammo slot would be wonderfull to, but avoiding the voc to other different ammo items, so it shoud be only bp type items allowed in bp and ammo slot


i hope i make it clear, and its possible to make and someone will try to create such art :))
 
There are too many instances of items being auto-equipped to stop them all.

Would need to do this via source edit.

I mean, unless you want to register every single item into movements.xml that can be equipped, and assign vocations to them.
 
You might need to replace the return values for true, false depending on your source code.
Lua:
local ec = EventCallback
function ec.onMoveItem(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)

    if player:getVocation():getId() ~= 10 then
        return RETURNVALUE_NOERROR
    end

    if toPosition.y <= CONST_SLOT_AMMO and (not item:getType():isContainer() or not isInArray({CONST_SLOT_AMMO, CONST_SLOT_BACKPACK}, toPosition.y)) then
        return RETURNVALUE_NOTPOSSIBLE
    end

    return RETURNVALUE_NOERROR
end
ec:register(65535)
 
You might need to replace the return values for true, false depending on your source code.
Lua:
local ec = EventCallback
function ec.onMoveItem(player, item, count, fromPosition, toPosition, fromCylinder, toCylinder)

    if player:getVocation():getId() ~= 10 then
        return RETURNVALUE_NOERROR
    end

    if toPosition.y <= CONST_SLOT_AMMO and (not item:getType():isContainer() or not isInArray({CONST_SLOT_AMMO, CONST_SLOT_BACKPACK}, toPosition.y)) then
        return RETURNVALUE_NOTPOSSIBLE
    end

    return RETURNVALUE_NOERROR
end
ec:register(65535)

This is a poor solution, as it doesn't solve the problem with auto-equipping at all.
 
as it doesn't solve the problem with auto-equipping at all.
What do you mean by auto-equipping? The Equip feature from hotkeys or common methods as addItem

Edit:

This should cover everything.

C++:
if (getVocation()->getId() == 10 && (slotIndex != CONST_SLOT_BACKPACK && slotIndex != CONST_SLOT_AMMO)) {
    continue;
}

C++:
if (getVocation()->getId() == 10 && index != -1 && ((index != CONST_SLOT_BACKPACK && index != CONST_SLOT_AMMO) || !item->getContainer())) {
    return RETURNVALUE_NOTPOSSIBLE;
}
 
There are too many instances of items being auto-equipped to stop them all.

Would need to do this via source edit.

I mean, unless you want to register every single item into movements.xml that can be equipped, and assign vocations to them.
I did this for my upgrade system. It was paniful.
 
Back
Top