TFS 1.X+ Help new inventory slot TFS 1.3 and OTClient

ijuchia

New Member
Joined
Dec 30, 2014
Messages
17
Reaction score
0
I know there are other posts about this but I do not see my error.
I'm sure I'm too close to discovering it, so I ask for your help.
I can not put any item in the new slot
in my console I don't have errors, and in client the terminal are clear only in the client only says you cannot dress there

thanks in advance

i change sources tfs 1.3 to this

creature.h

i change this
C++:
enum slots_t : uint8_t {
    CONST_SLOT_WHEREEVER = 0,
    CONST_SLOT_HEAD = 1,
    CONST_SLOT_NECKLACE = 2,
    CONST_SLOT_BACKPACK = 3,
    CONST_SLOT_ARMOR = 4,
    CONST_SLOT_RIGHT = 5,
    CONST_SLOT_LEFT = 6,
    CONST_SLOT_LEGS = 7,
    CONST_SLOT_FEET = 8,
    CONST_SLOT_RING = 9,
    CONST_SLOT_AMMO = 10,
    CONST_SLOT_STORE_INBOX = 11,

    CONST_SLOT_FIRST = CONST_SLOT_HEAD,
    CONST_SLOT_LAST = CONST_SLOT_STORE_INBOX ,
};
to
C++:
enum slots_t : uint8_t {
    CONST_SLOT_WHEREEVER = 0,
    CONST_SLOT_HEAD = 1,
    CONST_SLOT_NECKLACE = 2,
    CONST_SLOT_BACKPACK = 3,
    CONST_SLOT_ARMOR = 4,
    CONST_SLOT_RIGHT = 5,
    CONST_SLOT_LEFT = 6,
    CONST_SLOT_LEGS = 7,
    CONST_SLOT_FEET = 8,
    CONST_SLOT_RING = 9,
    CONST_SLOT_AMMO = 10,
    CONST_SLOT_STORE_INBOX = 11,
    CONST_SLOT_RING2 = 12,
    CONST_SLOT_WING = 13,

    CONST_SLOT_FIRST = CONST_SLOT_HEAD,
    CONST_SLOT_LAST = CONST_SLOT_WING,
};
luascript.cpp

i change this
C++:
    registerEnum(CONST_SLOT_HEAD)
    registerEnum(CONST_SLOT_NECKLACE)
    registerEnum(CONST_SLOT_BACKPACK)
    registerEnum(CONST_SLOT_ARMOR)
    registerEnum(CONST_SLOT_RIGHT)
    registerEnum(CONST_SLOT_LEFT)
    registerEnum(CONST_SLOT_LEGS)
    registerEnum(CONST_SLOT_FEET)
    registerEnum(CONST_SLOT_RING)
    registerEnum(CONST_SLOT_AMMO)
    registerEnum(CONST_SLOT_STORE_INBOX)
to
C++:
    registerEnum(CONST_SLOT_HEAD)
    registerEnum(CONST_SLOT_NECKLACE)
    registerEnum(CONST_SLOT_BACKPACK)
    registerEnum(CONST_SLOT_ARMOR)
    registerEnum(CONST_SLOT_RIGHT)
    registerEnum(CONST_SLOT_LEFT)
    registerEnum(CONST_SLOT_LEGS)
    registerEnum(CONST_SLOT_FEET)
    registerEnum(CONST_SLOT_RING)
    registerEnum(CONST_SLOT_AMMO)
    registerEnum(CONST_SLOT_STORE_INBOX)
    registerEnum(CONST_SLOT_RING2)
    registerEnum(CONST_SLOT_WING)
and this
C++:
    registerEnum(SLOTP_WHEREEVER)
    registerEnum(SLOTP_HEAD)
    registerEnum(SLOTP_NECKLACE)
    registerEnum(SLOTP_BACKPACK)
    registerEnum(SLOTP_ARMOR)
    registerEnum(SLOTP_RIGHT)
    registerEnum(SLOTP_LEFT)
    registerEnum(SLOTP_LEGS)
    registerEnum(SLOTP_FEET)
    registerEnum(SLOTP_RING)
    registerEnum(SLOTP_AMMO)
    registerEnum(SLOTP_DEPOT)
    registerEnum(SLOTP_TWO_HAND)
to
C++:
    registerEnum(SLOTP_WHEREEVER)
    registerEnum(SLOTP_HEAD)
    registerEnum(SLOTP_NECKLACE)
    registerEnum(SLOTP_BACKPACK)
    registerEnum(SLOTP_ARMOR)
    registerEnum(SLOTP_RIGHT)
    registerEnum(SLOTP_LEFT)
    registerEnum(SLOTP_LEGS)
    registerEnum(SLOTP_FEET)
    registerEnum(SLOTP_RING)
    registerEnum(SLOTP_AMMO)
    registerEnum(SLOTP_DEPOT)
    registerEnum(SLOTP_TWO_HAND)
    registerEnum(SLOTP_RING2)
    registerEnum(SLOTP_WING)
movement.cpp

i change this
C++:
MoveEvent* MoveEvents::getEvent(Item* item, MoveEvent_t eventType, slots_t slot)
{
    uint32_t slotp;
    switch (slot) {
    case CONST_SLOT_HEAD: slotp = SLOTP_HEAD; break;
    case CONST_SLOT_NECKLACE: slotp = SLOTP_NECKLACE; break;
    case CONST_SLOT_BACKPACK: slotp = SLOTP_BACKPACK; break;
    case CONST_SLOT_ARMOR: slotp = SLOTP_ARMOR; break;
    case CONST_SLOT_RIGHT: slotp = SLOTP_RIGHT; break;
    case CONST_SLOT_LEFT: slotp = SLOTP_LEFT; break;
    case CONST_SLOT_LEGS: slotp = SLOTP_LEGS; break;
    case CONST_SLOT_FEET: slotp = SLOTP_FEET; break;
    case CONST_SLOT_AMMO: slotp = SLOTP_AMMO; break;
    case CONST_SLOT_RING: slotp = SLOTP_RING; break;
    default: slotp = 0; break;
    }
to
C++:
MoveEvent* MoveEvents::getEvent(Item* item, MoveEvent_t eventType, slots_t slot)
{
    uint32_t slotp;
    switch (slot) {
    case CONST_SLOT_HEAD: slotp = SLOTP_HEAD; break;
    case CONST_SLOT_NECKLACE: slotp = SLOTP_NECKLACE; break;
    case CONST_SLOT_BACKPACK: slotp = SLOTP_BACKPACK; break;
    case CONST_SLOT_ARMOR: slotp = SLOTP_ARMOR; break;
    case CONST_SLOT_RIGHT: slotp = SLOTP_RIGHT; break;
    case CONST_SLOT_LEFT: slotp = SLOTP_LEFT; break;
    case CONST_SLOT_LEGS: slotp = SLOTP_LEGS; break;
    case CONST_SLOT_FEET: slotp = SLOTP_FEET; break;
    case CONST_SLOT_AMMO: slotp = SLOTP_AMMO; break;
    case CONST_SLOT_RING: slotp = SLOTP_RING; break;
    case CONST_SLOT_RING2: slotp = SLOTP_RING2; break;
    case CONST_SLOT_WING: slotp = SLOTP_WING; break;
    default: slotp = 0; break;
    }
and this
C++:
    if (eventType == MOVE_EVENT_EQUIP || eventType == MOVE_EVENT_DEEQUIP) {
        pugi::xml_attribute slotAttribute = node.attribute("slot");
        if (slotAttribute) {
            tmpStr = asLowerCaseString(slotAttribute.as_string());
            if (tmpStr == "head") {
                slot = SLOTP_HEAD;
            } else if (tmpStr == "necklace") {
                slot = SLOTP_NECKLACE;
            } else if (tmpStr == "backpack") {
                slot = SLOTP_BACKPACK;
            } else if (tmpStr == "armor") {
                slot = SLOTP_ARMOR;
            } else if (tmpStr == "right-hand") {
                slot = SLOTP_RIGHT;
            } else if (tmpStr == "left-hand") {
                slot = SLOTP_LEFT;
            } else if (tmpStr == "hand" || tmpStr == "shield") {
                slot = SLOTP_RIGHT | SLOTP_LEFT;
            } else if (tmpStr == "legs") {
                slot = SLOTP_LEGS;
            } else if (tmpStr == "feet") {
                slot = SLOTP_FEET;
            } else if (tmpStr == "ring") {
                slot = SLOTP_RING;
            } else if (tmpStr == "ammo") {
                slot = SLOTP_AMMO;           
            } else {
                std::cout << "[Warning - MoveEvent::configureMoveEvent] Unknown slot type: " << slotAttribute.as_string() << std::endl;
to
C++:
    if (eventType == MOVE_EVENT_EQUIP || eventType == MOVE_EVENT_DEEQUIP) {
        pugi::xml_attribute slotAttribute = node.attribute("slot");
        if (slotAttribute) {
            tmpStr = asLowerCaseString(slotAttribute.as_string());
            if (tmpStr == "head") {
                slot = SLOTP_HEAD;
            } else if (tmpStr == "necklace") {
                slot = SLOTP_NECKLACE;
            } else if (tmpStr == "backpack") {
                slot = SLOTP_BACKPACK;
            } else if (tmpStr == "armor") {
                slot = SLOTP_ARMOR;
            } else if (tmpStr == "right-hand") {
                slot = SLOTP_RIGHT;
            } else if (tmpStr == "left-hand") {
                slot = SLOTP_LEFT;
            } else if (tmpStr == "hand" || tmpStr == "shield") {
                slot = SLOTP_RIGHT | SLOTP_LEFT;
            } else if (tmpStr == "legs") {
                slot = SLOTP_LEGS;
            } else if (tmpStr == "feet") {
                slot = SLOTP_FEET;
            } else if (tmpStr == "ring") {
                slot = SLOTP_RING;
            } else if (tmpStr == "ammo") {
                slot = SLOTP_AMMO;           
            } else if (tmpStr == "ring2") {
                slot = SLOTP_RING2;
            } else if (tmpStr == "wing") {
                slot = SLOTP_WING;
            } else {
                std::cout << "[Warning - MoveEvent::configureMoveEvent] Unknown slot type: " << slotAttribute.as_string() << std::endl;
player.cpp

i change this
C++:
int32_t Player::getArmor() const
{
    int32_t armor = 0;

    static const slots_t armorSlots[] = {CONST_SLOT_HEAD, CONST_SLOT_NECKLACE, CONST_SLOT_ARMOR, CONST_SLOT_LEGS, CONST_SLOT_FEET, CONST_SLOT_RING};
    for (slots_t slot : armorSlots) {
        Item* inventoryItem = inventory[slot];
        if (inventoryItem) {
            armor += inventoryItem->getArmor();
        }
    }
    return static_cast<int32_t>(armor * vocation->armorMultiplier);
}
to
C++:
int32_t Player::getArmor() const
{
    int32_t armor = 0;

    static const slots_t armorSlots[] = {CONST_SLOT_HEAD, CONST_SLOT_NECKLACE, CONST_SLOT_ARMOR, CONST_SLOT_LEGS, CONST_SLOT_FEET, CONST_SLOT_RING, CONST_SLOT_RING2, CONST_SLOT_WING};
    for (slots_t slot : armorSlots) {
        Item* inventoryItem = inventory[slot];
        if (inventoryItem) {
            armor += inventoryItem->getArmor();
        }
    }
    return static_cast<int32_t>(armor * vocation->armorMultiplier);
}
i change this
C++:
    const int32_t& slotPosition = item->getSlotPosition();
    if ((slotPosition & SLOTP_HEAD) ||
      (slotPosition & SLOTP_NECKLACE) ||
      (slotPosition & SLOTP_BACKPACK) ||
      (slotPosition & SLOTP_ARMOR) ||
      (slotPosition & SLOTP_LEGS) ||
      (slotPosition & SLOTP_FEET) ||
      (slotPosition & SLOTP_RING)){
        ret = RETURNVALUE_CANNOTBEDRESSED;
    } else if (slotPosition & SLOTP_TWO_HAND) {
        ret = RETURNVALUE_PUTTHISOBJECTINBOTHHANDS;
    } else if ((slotPosition & SLOTP_RIGHT) || (slotPosition & SLOTP_LEFT)) {
        if (!g_config.getBoolean(ConfigManager::CLASSIC_EQUIPMENT_SLOTS)) {
            ret = RETURNVALUE_CANNOTBEDRESSED;
        } else {
            ret = RETURNVALUE_PUTTHISOBJECTINYOURHAND;
        }
    }
to
C++:
    const int32_t& slotPosition = item->getSlotPosition();
    if ((slotPosition & SLOTP_HEAD) ||
      (slotPosition & SLOTP_NECKLACE) ||
      (slotPosition & SLOTP_WING) ||
      (slotPosition & SLOTP_BACKPACK) ||
      (slotPosition & SLOTP_ARMOR) ||
      (slotPosition & SLOTP_LEGS) ||
      (slotPosition & SLOTP_FEET) ||
      (slotPosition & SLOTP_RING) ||
      (slotPosition & SLOTP_RING2)){
        ret = RETURNVALUE_CANNOTBEDRESSED;
    } else if (slotPosition & SLOTP_TWO_HAND) {
        ret = RETURNVALUE_PUTTHISOBJECTINBOTHHANDS;
    } else if ((slotPosition & SLOTP_RIGHT) || (slotPosition & SLOTP_LEFT)) {
        if (!g_config.getBoolean(ConfigManager::CLASSIC_EQUIPMENT_SLOTS)) {
            ret = RETURNVALUE_CANNOTBEDRESSED;
        } else {
            ret = RETURNVALUE_PUTTHISOBJECTINYOURHAND;
        }
    }
and under this
C++:
        case CONST_SLOT_AMMO: {
            if (slotPosition & SLOTP_AMMO) {
                ret = RETURNVALUE_NOERROR;
            }
            break;
        }
i add
C++:
        case CONST_SLOT_RING2: {
            if (slotPosition & SLOTP_RING2) {
                ret = RETURNVALUE_NOERROR;
            }
            break;
        }

        case CONST_SLOT_WING: {
            if (slotPosition & SLOTP_WING) {
                ret = RETURNVALUE_NOERROR;
            }
            break;
        }
{
and
C++:
void Player::internalAddThing(uint32_t index, Thing* thing)
{
    Item* item = thing->getItem();
    if (!item) {
        return;
    }

    //index == 0 means we should equip this item at the most appropiate slot (no action required here)
    if (index > 0 && index < 12) {
        if (inventory[index]) {
            return;
        }

        inventory[index] = item;
        item->setParent(this);
    }
}
to
C++:
void Player::internalAddThing(uint32_t index, Thing* thing)
{
    Item* item = thing->getItem();
    if (!item) {
        return;
    }

    //index == 0 means we should equip this item at the most appropiate slot (no action required here)
    if (index > 0 && index < 14) {
        if (inventory[index]) {
            return;
        }

        inventory[index] = item;
        item->setParent(this);
    }
}
protocolgamebase.cpp

i change this
C++:
    sendInventoryItem(CONST_SLOT_HEAD, player->getInventoryItem(CONST_SLOT_HEAD));
    sendInventoryItem(CONST_SLOT_NECKLACE, player->getInventoryItem(CONST_SLOT_NECKLACE));
    sendInventoryItem(CONST_SLOT_BACKPACK, player->getInventoryItem(CONST_SLOT_BACKPACK));
    sendInventoryItem(CONST_SLOT_ARMOR, player->getInventoryItem(CONST_SLOT_ARMOR));
    sendInventoryItem(CONST_SLOT_RIGHT, player->getInventoryItem(CONST_SLOT_RIGHT));
    sendInventoryItem(CONST_SLOT_LEFT, player->getInventoryItem(CONST_SLOT_LEFT));
    sendInventoryItem(CONST_SLOT_LEGS, player->getInventoryItem(CONST_SLOT_LEGS));
    sendInventoryItem(CONST_SLOT_FEET, player->getInventoryItem(CONST_SLOT_FEET));
    sendInventoryItem(CONST_SLOT_RING, player->getInventoryItem(CONST_SLOT_RING));
    sendInventoryItem(CONST_SLOT_AMMO, player->getInventoryItem(CONST_SLOT_AMMO));
    sendInventoryItem(CONST_SLOT_STORE_INBOX, player->getInventoryItem(CONST_SLOT_STORE_INBOX));
to
C++:
    sendInventoryItem(CONST_SLOT_HEAD, player->getInventoryItem(CONST_SLOT_HEAD));
    sendInventoryItem(CONST_SLOT_NECKLACE, player->getInventoryItem(CONST_SLOT_NECKLACE));
    sendInventoryItem(CONST_SLOT_BACKPACK, player->getInventoryItem(CONST_SLOT_BACKPACK));
    sendInventoryItem(CONST_SLOT_ARMOR, player->getInventoryItem(CONST_SLOT_ARMOR));
    sendInventoryItem(CONST_SLOT_RIGHT, player->getInventoryItem(CONST_SLOT_RIGHT));
    sendInventoryItem(CONST_SLOT_LEFT, player->getInventoryItem(CONST_SLOT_LEFT));
    sendInventoryItem(CONST_SLOT_LEGS, player->getInventoryItem(CONST_SLOT_LEGS));
    sendInventoryItem(CONST_SLOT_FEET, player->getInventoryItem(CONST_SLOT_FEET));
    sendInventoryItem(CONST_SLOT_RING, player->getInventoryItem(CONST_SLOT_RING));
    sendInventoryItem(CONST_SLOT_AMMO, player->getInventoryItem(CONST_SLOT_AMMO));
    sendInventoryItem(CONST_SLOT_RING2, player->getInventoryItem(CONST_SLOT_RING2));
    sendInventoryItem(CONST_SLOT_WING, player->getInventoryItem(CONST_SLOT_WING));
    sendInventoryItem(CONST_SLOT_STORE_INBOX, player->getInventoryItem(CONST_SLOT_STORE_INBOX));
and under this
C++:
        case CONST_SLOT_AMMO: {
            if (slotPosition & SLOTP_AMMO) {
                ret = RETURNVALUE_NOERROR;
            }
            break;
        }
i add
C++:
        case CONST_SLOT_RING2: {
            if (slotPosition & SLOTP_RING2) {
                ret = RETURNVALUE_NOERROR;
            }
            break;
        }

        case CONST_SLOT_WING: {
            if (slotPosition & SLOTP_WING) {
                ret = RETURNVALUE_NOERROR;
            }
            break;
        }
{
items.cpp

i change this

C++:
        } else if (tmpStrValue == "slottype") {
            tmpStrValue = asLowerCaseString(valueAttribute.as_string());
            if (tmpStrValue == "head") {
                it.slotPosition |= SLOTP_HEAD;
            } else if (tmpStrValue == "body") {
                it.slotPosition |= SLOTP_ARMOR;
            } else if (tmpStrValue == "legs") {
                it.slotPosition |= SLOTP_LEGS;
            } else if (tmpStrValue == "feet") {
                it.slotPosition |= SLOTP_FEET;
            } else if (tmpStrValue == "backpack") {
                it.slotPosition |= SLOTP_BACKPACK;
            } else if (tmpStrValue == "two-handed") {
                it.slotPosition |= SLOTP_TWO_HAND;
            } else if (tmpStrValue == "right-hand") {
                it.slotPosition &= ~SLOTP_LEFT;
            } else if (tmpStrValue == "left-hand") {
                it.slotPosition &= ~SLOTP_RIGHT;
            } else if (tmpStrValue == "necklace") {
                it.slotPosition |= SLOTP_NECKLACE;
            } else if (tmpStrValue == "ring") {
                it.slotPosition |= SLOTP_RING;
            } else if (tmpStrValue == "ammo") {
                it.slotPosition |= SLOTP_AMMO;
            } else if (tmpStrValue == "hand") {
                it.slotPosition |= SLOTP_HAND;
        } else {
                std::cout << "[Warning - Items::parseItemNode] Unknown slotType: " << valueAttribute.as_string() << std::endl;
            }
to this
C++:
        } else if (tmpStrValue == "slottype") {
            tmpStrValue = asLowerCaseString(valueAttribute.as_string());
            if (tmpStrValue == "head") {
                it.slotPosition |= SLOTP_HEAD;
            } else if (tmpStrValue == "body") {
                it.slotPosition |= SLOTP_ARMOR;
            } else if (tmpStrValue == "legs") {
                it.slotPosition |= SLOTP_LEGS;
            } else if (tmpStrValue == "feet") {
                it.slotPosition |= SLOTP_FEET;
            } else if (tmpStrValue == "backpack") {
                it.slotPosition |= SLOTP_BACKPACK;
            } else if (tmpStrValue == "two-handed") {
                it.slotPosition |= SLOTP_TWO_HAND;
            } else if (tmpStrValue == "right-hand") {
                it.slotPosition &= ~SLOTP_LEFT;
            } else if (tmpStrValue == "left-hand") {
                it.slotPosition &= ~SLOTP_RIGHT;
            } else if (tmpStrValue == "necklace") {
                it.slotPosition |= SLOTP_NECKLACE;
            } else if (tmpStrValue == "ring") {
                it.slotPosition |= SLOTP_RING;
            } else if (tmpStrValue == "ammo") {
                it.slotPosition |= SLOTP_AMMO;
            } else if (tmpStrValue == "hand") {
                it.slotPosition |= SLOTP_HAND;
            } else if (tmpStrValue == "ring2") {
                it.slotPosition |= SLOTP_RING2;
            } else if (tmpStrValue == "wing") {
                it.slotPosition |= SLOTP_WING;
        } else {
                std::cout << "[Warning - Items::parseItemNode] Unknown slotType: " << valueAttribute.as_string() << std::endl;
            }
items.h

i change this
C++:
enum SlotPositionBits : uint32_t {
    SLOTP_WHEREEVER = 0xFFFFFFFF,
    SLOTP_HEAD = 1 << 0,
    SLOTP_NECKLACE = 1 << 1,
    SLOTP_BACKPACK = 1 << 2,
    SLOTP_ARMOR = 1 << 3,
    SLOTP_RIGHT = 1 << 4,
    SLOTP_LEFT = 1 << 5,
    SLOTP_LEGS = 1 << 6,
    SLOTP_FEET = 1 << 7,
    SLOTP_RING = 1 << 8,
    SLOTP_AMMO = 1 << 9,
    SLOTP_DEPOT = 1 << 10,
    SLOTP_TWO_HAND = 1 << 11,
    SLOTP_HAND = (SLOTP_LEFT | SLOTP_RIGHT)
};
to
C++:
enum SlotPositionBits : uint32_t {
    SLOTP_WHEREEVER = 0xFFFFFFFF,
    SLOTP_HEAD = 1 << 0,
    SLOTP_NECKLACE = 1 << 1,
    SLOTP_BACKPACK = 1 << 2,
    SLOTP_ARMOR = 1 << 3,
    SLOTP_RIGHT = 1 << 4,
    SLOTP_LEFT = 1 << 5,
    SLOTP_LEGS = 1 << 6,
    SLOTP_FEET = 1 << 7,
    SLOTP_RING = 1 << 8,
    SLOTP_AMMO = 1 << 9,
    SLOTP_DEPOT = 1 << 10,
    SLOTP_TWO_HAND = 1 << 11,
    SLOTP_RING2 = 1 << 12,
    SLOTP_WING = 1 << 13,
    SLOTP_HAND = (SLOTP_LEFT | SLOTP_RIGHT)
};
iologindata.cpp

i change this
C++:
if (pid >= 1 && pid <= 11) {
to
C++:
if (pid >= 1 && pid <= 13) {
and this
C++:
for (int32_t slotId = 1; slotId <= 11; ++slotId) {
to
C++:
for (int32_t slotId = 1; slotId <= 13; ++slotId) 
{
in data/lib/core/itemtype.lua

i change this
Lua:
local slotBits = {
    [CONST_SLOT_HEAD] = SLOTP_HEAD,
    [CONST_SLOT_NECKLACE] = SLOTP_NECKLACE,
    [CONST_SLOT_BACKPACK] = SLOTP_BACKPACK,
    [CONST_SLOT_ARMOR] = SLOTP_ARMOR,
    [CONST_SLOT_RIGHT] = SLOTP_RIGHT,
    [CONST_SLOT_LEFT] = SLOTP_LEFT,
    [CONST_SLOT_LEGS] = SLOTP_LEGS,
    [CONST_SLOT_FEET] = SLOTP_FEET,
    [CONST_SLOT_RING] = SLOTP_RING,
    [CONST_SLOT_AMMO] = SLOTP_AMMO,
    }
to
Lua:
local slotBits = {
    [CONST_SLOT_HEAD] = SLOTP_HEAD,
    [CONST_SLOT_NECKLACE] = SLOTP_NECKLACE,
    [CONST_SLOT_BACKPACK] = SLOTP_BACKPACK,
    [CONST_SLOT_ARMOR] = SLOTP_ARMOR,
    [CONST_SLOT_RIGHT] = SLOTP_RIGHT,
    [CONST_SLOT_LEFT] = SLOTP_LEFT,
    [CONST_SLOT_LEGS] = SLOTP_LEGS,
    [CONST_SLOT_FEET] = SLOTP_FEET,
    [CONST_SLOT_RING] = SLOTP_RING,
    [CONST_SLOT_AMMO] = SLOTP_AMMO,
    [CONST_SLOT_RING2] = SLOTP_RING2,
    [CONST_SLOT_WING] = SLOTP_WING
    }
now i change otclient source

const.h

C++:
    enum InventorySlot {
        InventorySlotHead = 1,
        InventorySlotNecklace,
        InventorySlotBackpack,
        InventorySlotArmor,
        InventorySlotRight,
        InventorySlotLeft,
        InventorySlotLegs,
        InventorySlotFeet,
        InventorySlotRing,
        InventorySlotAmmo,
        InventorySlotPurse,
        InventorySlotExt1,
        InventorySlotExt2,
        InventorySlotExt3,
        InventorySlotExt4,
        LastInventorySlot
    };
with this
C++:
    enum InventorySlot {
        InventorySlotHead = 1,
        InventorySlotNecklace,
        InventorySlotBackpack,
        InventorySlotArmor,
        InventorySlotRight,
        InventorySlotLeft,
        InventorySlotLegs,
        InventorySlotFeet,
        InventorySlotRing,
        InventorySlotAmmo,
        InventorySlotPurse,
        InventorySlotRing2,
        InventorySlotWing,
        InventorySlotExt3,
        InventorySlotExt4,
        LastInventorySlot
    };
modules/game_inventory/inventory.otui

under this i add
Code:
AmmoSlot < InventoryItem
  id: slot10
  image-source: /images/game/slots/ammo
  &position: {x=65535, y=10, z=0}
  $on:
    image-source: /images/game/slots/ammo-blessed
this
Code:
Ring2Slot < InventoryItem
  id: slot12
  image-source: /images/game/slots/ring2
  &position: {x=65535, y=10, z=0}
  $on:
    image-source: /images/game/slots/ring2-blessed

WingSlot < InventoryItem
  id: slot13
  image-source: /images/game/slots/wing
  &position: {x=65535, y=1, z=0}
  $on:
    image-source: /images/game/slots/wing-blessed
under this
Code:
    FingerSlot
      anchors.top: prev.bottom
      anchors.horizontalCenter: prev.horizontalCenter
      margin-top: 3
i add
Code:
    Ring2Slot
      anchors.top: prev.bottom
      anchors.horizontalCenter: prev.horizontalCenter
      margin-top: 3

    WingSlot
      anchors.top: slot1.top
      anchors.left: slot1.right
      margin-left: 39
modules/game_inventory/inventory.lua

this
Code:
InventorySlotStyles = {
  [InventorySlotHead] = "HeadSlot",
  [InventorySlotNeck] = "NeckSlot",
  [InventorySlotBack] = "BackSlot",
  [InventorySlotBody] = "BodySlot",
  [InventorySlotRight] = "RightSlot",
  [InventorySlotLeft] = "LeftSlot",
  [InventorySlotLeg] = "LegSlot",
  [InventorySlotFeet] = "FeetSlot",
  [InventorySlotFinger] = "FingerSlot",
  [InventorySlotAmmo] = "AmmoSlot"
}
to
Code:
InventorySlotStyles = {
  [InventorySlotHead] = "HeadSlot",
  [InventorySlotNeck] = "NeckSlot",
  [InventorySlotBack] = "BackSlot",
  [InventorySlotBody] = "BodySlot",
  [InventorySlotRight] = "RightSlot",
  [InventorySlotLeft] = "LeftSlot",
  [InventorySlotLeg] = "LegSlot",
  [InventorySlotFeet] = "FeetSlot",
  [InventorySlotFinger] = "FingerSlot",
  [InventorySlotAmmo] = "AmmoSlot",
  [InventorySlotRing2] = "Ring2Slot",
  [InventorySlotWing] = "WingSlot"
}
and

modules/gamelib/player.lua
and this
Code:
InventorySlotOther = 0
InventorySlotHead = 1
InventorySlotNeck = 2
InventorySlotBack = 3
InventorySlotBody = 4
InventorySlotRight = 5
InventorySlotLeft = 6
InventorySlotLeg = 7
InventorySlotFeet = 8
InventorySlotFinger = 9
InventorySlotAmmo = 10
InventorySlotPurse = 11

InventorySlotFirst = 1
InventorySlotLast = 11
to
Code:
InventorySlotOther = 0
InventorySlotHead = 1
InventorySlotNeck = 2
InventorySlotBack = 3
InventorySlotBody = 4
InventorySlotRight = 5
InventorySlotLeft = 6
InventorySlotLeg = 7
InventorySlotFeet = 8
InventorySlotFinger = 9
InventorySlotAmmo = 10
InventorySlotPurse = 11
InventorySlotRing2 = 12
InventorySlotWing = 13

InventorySlotFirst = 1
InventorySlotLast = 13
data/movements/movements.xml

i add this
Code:
<movevent event="Equip" itemid="36256" slot="wing" function="onEquipItem" />
<movevent event="DeEquip" itemid="36256" slot="wing" function="onDeEquipItem" />

<movevent event="Equip" itemid="29003" slot="ring2" function="onEquipItem" />
<movevent event="DeEquip" itemid="29003" slot="ring2" function="onDeEquipItem" />
and
data/items/items.lua

i add slotType wing if i change slotType for necklace is working allows me to put it in the slot necklace,
the same thing happens with slotType ring2 to slotType ring.

Code:
    <item id="36256" article="a" name="wings">
        <attribute key="weight" value="3000"/>
        <attribute key="slotType" value="wing"/>
 --working with    <attribute key="slotType" value="necklace"/>
          <attribute key="armor" value="9" />   
          <attribute key="speed" value="10"/>
        <attribute key="showattributes" value="1"/>
    </item>
    <item id="29003"  article="a" name="butterfly ring" >
        <attribute key="slotType" value="ring2" />
--working with         <attribute key="slotType" value="ring" />
        <attribute key="armor" value="2" />
        <attribute key="absorbPercentDeath" value="3" />
        <attribute key="weight" value="120" />
    </item>



36389
 

Crypter

New Member
Joined
Aug 21, 2017
Messages
9
Reaction score
2
Lua:
Ring2Slot < InventoryItem
  id: slot12
  image-source: /images/game/slots/ring2
  &position: {x=65535, y=12, z=0}
  $on:
    image-source: /images/game/slots/ring2-blessed

WingSlot < InventoryItem
  id: slot13
  image-source: /images/game/slots/wing
  &position: {x=65535, y=13, z=0}
  $on:
    image-source: /images/game/slots/wing-blessed
 
OP
I

ijuchia

New Member
Joined
Dec 30, 2014
Messages
17
Reaction score
0
Lua:
Ring2Slot < InventoryItem
  id: slot12
  image-source: /images/game/slots/ring2
  &position: {x=65535, y=12, z=0}
  $on:
    image-source: /images/game/slots/ring2-blessed

WingSlot < InventoryItem
  id: slot13
  image-source: /images/game/slots/wing
  &position: {x=65535, y=13, z=0}
  $on:
    image-source: /images/game/slots/wing-blessed
thank you man , I don't know how I did not notice before
 
Last edited:
Top