Management Karbust 4913 Posted September 18, 2016 Management Share Posted September 18, 2016 Hello, I added recently 6 slots of stones on armors and weapons, since I'm in tests a friend of mine said, "why you don't create a item for the item shop to add more slots?" The idea, is having the default 3 slots and then with the item add more, like the diamond on the necklace, earring, etc... Anyone can help me with this? Thanks Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted September 21, 2016 Author Management Share Posted September 21, 2016 BUMP Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted September 23, 2016 Author Management Share Posted September 23, 2016 BUMP Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted September 25, 2016 Author Management Share Posted September 25, 2016 BUMP Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted September 27, 2016 Author Management Share Posted September 27, 2016 BUMP Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted September 29, 2016 Author Management Share Posted September 29, 2016 BUMP Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted October 3, 2016 Author Management Share Posted October 3, 2016 BUMP Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted October 8, 2016 Author Management Share Posted October 8, 2016 BUMP Link to comment Share on other sites More sharing options...
myenglishisbad 0 Posted October 8, 2016 Share Posted October 8, 2016 Try verifi in SOurce yu maybe do something wrong off topic Olha o Mano karbust Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted October 8, 2016 Author Management Share Posted October 8, 2016 30 minutes ago, myenglishisbad said: Try verifi in SOurce yu maybe do something wrong off topic Olha o Mano karbust I'm not with a problem, I'm searching for a method to add more slots, like the diamond on the earrings, necklace, etc... Offtopic: E tu és :O? Link to comment Share on other sites More sharing options...
Premium ahynoa 15 Posted October 8, 2016 Premium Share Posted October 8, 2016 item->Socket(X, -1); 1 Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted October 8, 2016 Author Management Share Posted October 8, 2016 34 minutes ago, ahynoa said: item->Socket(X, -1); What is that? Can you explain a little what do you mean please? Thanks Link to comment Share on other sites More sharing options...
Premium ahynoa 15 Posted October 8, 2016 Premium Share Posted October 8, 2016 Spoiler case ITEM_VNUM: { LPITEM item2; if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell))) { return false; } if (item2->IsEquipped()) { BuffOnAttr_RemoveBuffsFromItem(item2); } if (item2->IsExchanging()) { return false; } if (item2->IsEquipped()) { return false; } if(item2->GetSubType() == ARMOR_BODY || item2-> GetType() == ITEM_WEAPON) { item2->SetSocket(X, -1); item2->UpdatePacket(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Socket Abierto Sastifactoriamente.")); item->SetCount(item->GetCount() - 1); return false; } } break; ITEM_VNUM = Vnum item X = Socket I have not proven I'm not home 1 Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted October 8, 2016 Author Management Share Posted October 8, 2016 12 minutes ago, ahynoa said: Hide contents case ITEM_VNUM: { LPITEM item2; if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell))) { return false; } if (item2->IsEquipped()) { BuffOnAttr_RemoveBuffsFromItem(item2); } if (item2->IsExchanging()) { return false; } if (item2->IsEquipped()) { return false; } if(item2->GetSubType() == ARMOR_BODY || item2-> GetType() == ITEM_WEAPON) { item2->SetSocket(X, -1); item2->UpdatePacket(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Socket Abierto Sastifactoriamente.")); item->SetCount(item->GetCount() - 1); return false; } } break; ITEM_VNUM = Vnum item X = Socket I have not proven I'm not home And socket, is what? Is how many sockets do I want to open? Link to comment Share on other sites More sharing options...
Premium ahynoa 15 Posted October 8, 2016 Premium Share Posted October 8, 2016 X change the socket you want to open if you already have 3 stones and want to put 4, change the X 3 0= Socket 0 stone 1 1= Socket 1 stone 2 2= Socket 2 stone 3 3= Socket 3 stone 4 1 Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted October 8, 2016 Author Management Share Posted October 8, 2016 9 hours ago, ahynoa said: X change the socket you want to open if you already have 3 stones and want to put 4, change the X 3 0= Socket 0 stone 1 1= Socket 1 stone 2 2= Socket 2 stone 3 3= Socket 3 stone 4 Thanks But how do I do to get the next free slot? The max slot is 6, the weapon/armor can use 3 by default, how to get the 4th slot? And if the 4th is already occupied, how to get the 5th? EDIT: I'm using this code, item type 3, subtype 10, (using this code above case 71051) but when I drag and drop on an item, nothing happens... In comment is another part I tried, but with no success... case 3520 : { LPITEM item2; if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell))) { return false; } if (item2->IsEquipped() || item2->IsExchanging() || item2->IsEquipped()) { return false; } if(item2->GetSubType() == ARMOR_BODY || item2-> GetType() == ITEM_WEAPON) { int count = item2->GetSocketCount(); if (count == ITEM_SOCKET_MAX_NUM) return false; item2->SetSocket(count, -1, true); item2->UpdatePacket(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Abris-te um socket com sucesso!")); item->SetCount(item->GetCount() - 1); return false; } } break; EDIT2: Working, but with a slight problem, when I open a slot it doesn't save on the database, it's just open while I don't teleport or reboot the server, is there any way to save it when the slot is open and maintain it open "forever"? Code used: case 3520 : { LPITEM item2; if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell))) { return false; } if (item2->IsEquipped() || item2->IsExchanging() || item2->IsEquipped()) { return false; } if(item2->GetSubType() != ARMOR_BODY || item2-> GetType() != ITEM_WEAPON) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Só podes usar este item em armas e armaduras!")); } if(item2->GetSocketCount() == ITEM_SOCKET_MAX_NUM) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Só podes abrir até 6 sockets!")); return false; } /*int count = item2->GetSocketCount(); if (count == ITEM_SOCKET_MAX_NUM) ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Só podes abrir até 6 sockets!")); return false;*/ //item2->SetSocket(count, -1, true); item2->AddSocket(); item2->UpdatePacket(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Abris-te um socket com sucesso!")); item->SetCount(item->GetCount() - 1); } break; EDIT3: Problem from EDIT2 solved, just needed to add item2->UpdatePacket() and item2->Save() or edit the AddSocket() function and add UpdatePacket() and Save()... I think there's no more problems, thanks @ahynoa for the help! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now