Jump to content

Recommended Posts

I wanted to make the gold bars could be replaced to gold in char_item.cpp

I've written this code

				if (item->GetVnum() > 80002 && item->GetVnum() <= 80008)
				{
					LPCHARACTER ch;
					int gold_value = item->GetValue(1);
					int mygold = ch->GetGold();
					if (gold_value + mygold > 1999999999)
					{
						ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cant have more gold."));
						return false;
					}
					ChatPacket(CHAT_TYPE_INFO, LC_TEXT("you have got %d gold"), gold_value); //et nessecery
					PointChange(POINT_GOLD, gold_value);
					item->SetCount(item->GetCount() - 1);
                }

under Case ITEM_USE (I've changed the gold bars item types to item use)

and I compile, but when I use the item ingame, the game just disconnects, but when I comment the checking part if you have more than 1.999.999.999 gold, it works fine, So my problem is in the checking part, but I can't find the issue myself.

 

PS: noting in any of the syserrs

Link to comment
https://metin2.dev/topic/17706-help-with-use-case/
Share on other sites

  • Bot
				if (item->GetVnum() > 80002 && item->GetVnum() <= 80008)
				{
					if (item->GetValue(1) + GetGold() > 1999999999)
					{
						ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cant have more gold."));
						return false;
					}
                  
					//ChatPacket(CHAT_TYPE_INFO, LC_TEXT("you have got %d gold"), item->GetValue(1));
                  	//Already is in python
                  
					PointChange(POINT_GOLD, item->GetValue(1));
					item->SetCount(item->GetCount() - 1);
                }

 

  • Love 1

english_banner.gif

Link to comment
https://metin2.dev/topic/17706-help-with-use-case/#findComment-96827
Share on other sites

8 hours ago, Abel(Tiger) said:

				if (item->GetVnum() > 80002 && item->GetVnum() <= 80008)
				{
					if (item->GetValue(1) + GetGold() > 1999999999)
					{
						ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cant have more gold."));
						return false;
					}
                  
					//ChatPacket(CHAT_TYPE_INFO, LC_TEXT("you have got %d gold"), item->GetValue(1));
                  	//Already is in python
                  
					PointChange(POINT_GOLD, item->GetValue(1));
					item->SetCount(item->GetCount() - 1);
                }

 

doesn't work

If i'm going to have more than 1.999.999.999, doesn't say anything and the item disappears

Link to comment
https://metin2.dev/topic/17706-help-with-use-case/#findComment-96846
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.