bizao030188
Member
- Joined
- Jun 4, 2012
- Messages
- 50
- Solutions
- 2
- Reaction score
- 7
I've created a new slot that is working properly (I can put items marked with xml tag slotType value "order" on it) but when I logout id doesn't save the item I put there.
I will put down the code I inserted on tfs sources and on otclient lua scripts. I will appreciate if you help me figure out what I am missing.
movement.cpp:
After
I inserted
After
I inserted
items.h:
After
I added
items.cpp:
After
I added
enums.h:
After
I added
creature.h:
After
Added
and changed to:
player.cpp:
After
Added
After
Added
protocalgame.cpp
After
Added
luascript.cpp
After
Added
After
Added
After
Added
TFS data/lib/core/itemtype.lua:
After
Added
otclient modules/gameinventory/inventory.lua:
After
Added
modules/game_inventory/inventory.otui
Added
modules/gamelib/player.lua
After
Added
Thanks in advance!
I will put down the code I inserted on tfs sources and on otclient lua scripts. I will appreciate if you help me figure out what I am missing.
movement.cpp:
After
C++:
case CONST_SLOT_RING: slotp = SLOTP_RING; break;
C++:
case CONST_SLOT_ORDER: slotp = SLOTP_ORDER; break;
C++:
} else if (tmpStr == "ammo") {
slot = SLOTP_AMMO;
C++:
} else if (tmpStr == "order") {
slot = SLOTP_ORDER;
items.h:
After
C++:
SLOTP_TWO_HAND = 1 << 11,
C++:
SLOTP_ORDER = 1 << 12,
items.cpp:
After
C++:
} else if (tmpStrValue == "hand") {
it.slotPosition |= SLOTP_HAND;
C++:
} else if (tmpStrValue == "order") {
it.slotPosition |= SLOTP_ORDER;
enums.h:
After
C++:
CONDITIONID_AMMO,
C++:
CONDITIONID_ORDER,
creature.h:
After
C++:
CONST_SLOT_AMMO = 10,
C++:
CONST_SLOT_ORDER = 11,
C++:
CONST_SLOT_LAST = CONST_SLOT_ORDER,
player.cpp:
After
C++:
(slotPosition & SLOTP_FEET) ||
C++:
(slotPosition & SLOTP_ORDER) ||
After
C++:
case CONST_SLOT_AMMO: {
if ((slotPosition & SLOTP_AMMO) || g_config.getBoolean(ConfigManager::CLASSIC_EQUIPMENT_SLOTS)) {
ret = RETURNVALUE_NOERROR;
}
break;
}
C++:
case CONST_SLOT_ORDER: {
if (slotPosition & SLOTP_ORDER) {
ret = RETURNVALUE_NOERROR;
}
break;
}
protocalgame.cpp
After
C++:
sendInventoryItem(CONST_SLOT_AMMO, player->getInventoryItem(CONST_SLOT_AMMO));
C++:
sendInventoryItem(CONST_SLOT_ORDER, player->getInventoryItem(CONST_SLOT_ORDER));
luascript.cpp
After
C++:
registerEnum(SLOTP_TWO_HAND)
C++:
registerEnum(SLOTP_ORDER)
After
C++:
registerEnum(CONDITIONID_AMMO)
C++:
registerEnum(CONDITIONID_ORDER)
After
C++:
registerEnum(CONST_SLOT_AMMO)
C++:
registerEnum(CONST_SLOT_ORDER)
TFS data/lib/core/itemtype.lua:
After
C++:
[CONST_SLOT_AMMO] = SLOTP_AMMO,
C++:
[CONST_SLOT_ORDER] = SLOTP_ORDER
otclient modules/gameinventory/inventory.lua:
After
C++:
[InventorySlotAmmo] = "AmmoSlot",
C++:
[InventorySlotOrder] = "OrderSlot",
modules/game_inventory/inventory.otui
Added
C++:
OrderSlot < InventoryItem
id: slot11
image-source: /images/game/slots/right-hand
&position: {x=65535, y=11, z=0}
$on:
image-source: /images/game/slots/right-hand-blessed
OrderSlot
anchors.top: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
margin-top: 3
modules/gamelib/player.lua
After
C++:
InventorySlotAmmo = 10
C++:
InventorySlotOrder = 11
Thanks in advance!