Jump to content

Change vnum 71151 to all equipments


Recommended Posts

Hey guys,

I come ask if someone can help me to change this item ( vnum: 71151) https://metin2.download/picture/OF7YXH938GoBYcQ0xWc4H1M8atrHihD4/.png in c++ or in another way

The item is only works for weapon and armor, buf if i can I want this item be released for all equipment up to lvl 40. 

Thanks guys...

 

Edited by Metin2 Dev International
Core X - External 2 Internal
  • Metin2 Dev 1
Link to comment
Share on other sites

Thx for helping me, i am new at c++ i am learning 

Print: https://files.fm/u/vfcrdvpbm

Code:

Spoiler

                                        if (item->GetVnum() == 71151 || item->GetVnum() == 76023)
                                        {
                                            if ((item2->GetType() == ITEM_WEAPON)
                                                || (item2->GetType() == ITEM_ARMOR && item2->GetSubType() == ARMOR_BODY))
                                            {
                                                bool bCanUse = true;
                                                for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
                                                {
                                                    if (item2->GetLimitType(i) == LIMIT_LEVEL && item2->GetLimitValue(i) > 40)
                                                    {
                                                        bCanUse = false;
                                                        break;
                                                    }
                                                }
                                                if (false == bCanUse)
                                                {
                                                    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Àû¿ë ·¹º§º¸´Ù ³ô¾Æ »ç¿ëÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù."));
                                                    break;
                                                }
                                            }
                                            else
                                            {
                                                ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¹«±â¿Í °©¿Ê¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù."));
                                                break;
                                            }
                                        }
                                        item2->ChangeAttribute();

P.s: ( I can´t insert the image link on post)

Edited by portoswat69
  • Metin2 Dev 1
Link to comment
Share on other sites

  • Active+ Member
On 4/1/2023 at 2:07 AM, Klaus said:

look for the code in game/src/char_item.cpp and, make a comment like it is in the photo

spacer.png

I think that's not the right way to do it, we need this checks, so don't do this !

On 4/1/2023 at 3:13 AM, portoswat69 said:

Thx for helping me, i am new at c++ i am learning 

Print: https://files.fm/u/vfcrdvpbm

Code:

  Hide contents

                                        if (item->GetVnum() == 71151 || item->GetVnum() == 76023)
                                        {
                                            if ((item2->GetType() == ITEM_WEAPON)
                                                || (item2->GetType() == ITEM_ARMOR && item2->GetSubType() == ARMOR_BODY))
                                            {
                                                bool bCanUse = true;
                                                for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
                                                {
                                                    if (item2->GetLimitType(i) == LIMIT_LEVEL && item2->GetLimitValue(i) > 40)
                                                    {
                                                        bCanUse = false;
                                                        break;
                                                    }
                                                }
                                                if (false == bCanUse)
                                                {
                                                    ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Àû¿ë ·¹º§º¸´Ù ³ô¾Æ »ç¿ëÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù."));
                                                    break;
                                                }
                                            }
                                            else
                                            {
                                                ChatPacket(CHAT_TYPE_INFO, LC_TEXT("¹«±â¿Í °©¿Ê¿¡¸¸ »ç¿ë °¡´ÉÇÕ´Ï´Ù."));
                                                break;
                                            }
                                        }
                                        item2->ChangeAttribute();

P.s: ( I can´t insert the image link on post)

This is the correct place, change it like this;

 

								if (item->GetVnum() == 71151 || item->GetVnum() == 76023)
								{
									if ((item2->GetType() == ITEM_WEAPON) || (item2->GetType() == ITEM_ARMOR) || (item2->GetType() == ITEM_BELT))
									{
										bool bCanUse = true;
										for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
										{
											if (item2->GetLimitType (i) == LIMIT_LEVEL && item2->GetLimitValue (i) > 40)
											{
												bCanUse = false;
												break;
											}
										}
										if (false == bCanUse)
										{
											ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("Àû¿ë ·¹º§º¸´Ù ³ô¾Æ »ç¿ëÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù."));
											break;
										}
									}
									else
									{
										break;
									}
								}
								item2->ChangeAttribute();

 

Best Regards, MT2Dev.

  • Love 1

spacer.png

 

MT2Dev ©

Link to comment
Share on other sites

On 4/9/2023 at 12:37 AM, MT2Dev said:

I think that's not the right way to do it, we need this checks, so don't do this !

This is the correct place, change it like this;

 

								if (item->GetVnum() == 71151 || item->GetVnum() == 76023)
								{
									if ((item2->GetType() == ITEM_WEAPON) || (item2->GetType() == ITEM_ARMOR) || (item2->GetType() == ITEM_BELT))
									{
										bool bCanUse = true;
										for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i)
										{
											if (item2->GetLimitType (i) == LIMIT_LEVEL && item2->GetLimitValue (i) > 40)
											{
												bCanUse = false;
												break;
											}
										}
										if (false == bCanUse)
										{
											ChatPacket (CHAT_TYPE_INFO, LC_TEXT ("Àû¿ë ·¹º§º¸´Ù ³ô¾Æ »ç¿ëÀÌ ºÒ°¡´ÉÇÕ´Ï´Ù."));
											break;
										}
									}
									else
									{
										break;
									}
								}
								item2->ChangeAttribute();

 

Best Regards, MT2Dev.

Very thanks for helping me !! sorry I've been on a trip, that´s why i answer today ! thanks one more time

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.