Jump to content

Recommended Posts

  • Management

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

raw

raw

Link to comment
https://metin2.dev/topic/13438-6-slots-using-item/
Share on other sites

  • Management
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?

raw

raw

Link to comment
https://metin2.dev/topic/13438-6-slots-using-item/#findComment-77684
Share on other sites

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

  • Love 1
Link to comment
https://metin2.dev/topic/13438-6-slots-using-item/#findComment-77688
Share on other sites

  • Management
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?

raw

raw

Link to comment
https://metin2.dev/topic/13438-6-slots-using-item/#findComment-77689
Share on other sites

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

raw

raw

Link to comment
https://metin2.dev/topic/13438-6-slots-using-item/#findComment-77692
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.