up
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Problema ao adicionar novo slot no servidor
IV
[Encerrado] Problema ao adicionar novo slot no servidor
Por IvanAppel, 17 de dez. de 2017 em Tópicos Sem Resposta
sources
lua
c++
tfs 0.4
3
1.9k
2 semanas depois...
25 de dezembro de 2017 às 19:50
4 meses depois...
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

21 de abril de 2018 às 03:44
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.
+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.



info
Grupo: Conde
Registrado: 28/11/11
Posts: 801
Reputação: +87
Char no Tibia: Sei la
Bom, vou ser o mais direto possível:
Estou tentando adicionar um novo slot no servidor, de versão 8.54 e TFS 0.4, mudei nas sources e já as compilei com sucesso, segue abaixo no spoiler as alterações feitas na mesma:
items.h
#define ITEMS 13000 #define SLOTP_WHEREEVER 0xFFFFFFFF #define SLOTP_HEAD 1 << 0 #define SLOTP_NECKLACE 1 << 1 #define SLOTP_BACKPACK 1 << 2 #define SLOTP_ARMOR 1 << 3 #define SLOTP_RIGHT 1 << 4 #define SLOTP_LEFT 1 << 5 #define SLOTP_LEGS 1 << 6 #define SLOTP_FEET 1 << 7 #define SLOTP_RING 1 << 8 #define SLOTP_AMMO 1 << 9 #define SLOTP_DEPOT 1 << 10 #define SLOTP_TWO_HAND 1 << 11 #define SLOTP_EYE 1 << 15 #define SLOTP_HAND SLOTP_LEFT | SLOTP_RIGHTitems.cpp
else if(tmpStrValue == "eye") { it.slotPosition |= SLOTP_EYE; it.wieldPosition = SLOT_EYE; }movement.cpp
else if(tmpStrValue == "eye") slot = SLOTP_EYE;case SLOT_EYE: slotp = SLOTP_EYE; break;player.cpp
if((item->getSlotPosition() & SLOTP_HEAD) || (item->getSlotPosition() & SLOTP_NECKLACE) || (item->getSlotPosition() & SLOTP_BACKPACK) || (item->getSlotPosition() & SLOTP_ARMOR) || (item->getSlotPosition() & SLOTP_LEGS) || (item->getSlotPosition() & SLOTP_FEET) || (item->getSlotPosition() & SLOTP_RING) || (item->getSlotPosition() & SLOTP_EYE)) ret = RET_CANNOTBEDRESSED;case SLOT_EYE: if(item->getSlotPosition() & SLOTP_EYE) ret = RET_NOERROR; break;creature.h
enum slots_t { SLOT_PRE_FIRST = 0, SLOT_WHEREEVER = SLOT_PRE_FIRST, SLOT_FIRST = 1, SLOT_HEAD = SLOT_FIRST, SLOT_NECKLACE = 2, SLOT_BACKPACK = 3, SLOT_ARMOR = 4, SLOT_RIGHT = 5, SLOT_LEFT = 6, SLOT_LEGS = 7, SLOT_FEET = 8, SLOT_RING = 9, SLOT_AMMO = 10, SLOT_DEPOT = 11, SLOT_LAST = SLOT_DEPOT, SLOT_HAND = 12, SLOT_EYE = 15, SLOT_TWO_HAND = SLOT_HAND };enums.h
enum ConditionId_t { CONDITIONID_DEFAULT = -1, CONDITIONID_COMBAT = 0, CONDITIONID_HEAD, CONDITIONID_NECKLACE, CONDITIONID_BACKPACK, CONDITIONID_ARMOR, CONDITIONID_RIGHT, CONDITIONID_LEFT, CONDITIONID_LEGS, CONDITIONID_FEET, CONDITIONID_RING, CONDITIONID_EYE, CONDITIONID_AMMO, CONDITIONID_OUTFIT };Após as sources, o único local em que encontrei nos scripts em lua, foi no 'data/lib/000-constant.lua' e deixei assim:
Deixei um item no 'data/items/items.xml' com o slotType="eye" que foi criado, e fiz as seguintes alterações no OTClient:
modules/game_inventory/inventory.lua
modules/game_inventory/inventory.otui
EyeSlot < InventoryItem id: slot15 image-source: /images/game/slots/eye &position: {x=65535, y=14, z=0}e
MiniWindow id: inventoryWindow !text: tr('Inventory') icon: /images/topbuttons/inventory height: 175 @onClose: modules.game_inventory.onMiniWindowClose() &save: true MiniWindowContents HeadSlot anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter margin-top: 3 BodySlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 LegSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 FeetSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 NeckSlot anchors.top: slot1.top anchors.right: slot1.left margin-top: 10 margin-right: 5 LeftSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 FingerSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 BackSlot anchors.top: slot1.top anchors.left: slot1.right margin-top: 10 margin-left: 5 RightSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 AmmoSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 EyeSlot anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCenter margin-top: 3 PurseButton margin-top: 3 anchors.top: prev.bottom anchors.horizontalCenter: prev.horizontalCentermodules/gamelib/player.lua
Com todas estas alterações, o que foi feito:
Enfim, nas sources o tipo "eye" foi criado, mas ainda não é reconhecido verdadeiramente, espero que alguém possa me ajudar, segue em anexo as sources e todos os arquivos que citei ter editado:
help.rar