Jump to content

[CHANGE] MAX GOLD


Recommended Posts

I tried this today , didn't succed. Seems to complicate.

y4JN1SJ.jpg

 

PythonPlayerModule.cpp - UnsignedLongLong

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return PyLong_FromUnsignedLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));
} 

lenght.h - GOLD_MAX = 999990000000ULL,

tables.h - long long gold;

 

 

Edit: I removed it completely , a complete tutorial on this would be helpful.

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

FOR syron


 

This is correct :

Lenght.h =    999990000000ULL
tables.h = unsigned long long gold;

In PythonPlayerModule.cpp you have  ( ULL = Unsigned long long)

 

 

 

In PythonPlayerModule.cpp :

Change this :

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("i", CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

With this

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("ULL", CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

I don't know what's so hard. 

Link to comment
Share on other sites

FOR syron

 

This is correct :

Lenght.h =    999990000000ULL
tables.h = unsigned long long gold;

In PythonPlayerModule.cpp you have  ( ULL = Unsigned long long)

 

 

 

In PythonPlayerModule.cpp :

Change this :

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("i", CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

With this

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("ULL", CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

I don't know what's so hard. 

ClientManagerBoot.cpp:1216: warning: format '%d' excepts type 'int', but argument 37 has type 'long int'
ClinetManagerPlayer.cpp:887: warning: format '%d' excepts type 'int', but argument 26 has type 'long long unsigned int'

When compiling DB , don't know where i didn't edited. ( probably common folder because i compiled game succesfully. ) 

Link to comment
Share on other sites

  • Active Member

 

FOR syron

 

This is correct :

Lenght.h =    999990000000ULL
tables.h = unsigned long long gold;

In PythonPlayerModule.cpp you have  ( ULL = Unsigned long long)

 

 

 

In PythonPlayerModule.cpp :

Change this :

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("i", CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

With this

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return Py_BuildValue("ULL", CPythonPlayer::Instance().GetStatus(POINT_GOLD));
}

I don't know what's so hard. 

ClientManagerBoot.cpp:1216: warning: format '%d' excepts type 'int', but argument 37 has type 'long int'
ClinetManagerPlayer.cpp:887: warning: format '%d' excepts type 'int', but argument 26 has type 'long long unsigned int'

When compiling DB , don't know where i didn't edited. ( probably common folder because i compiled game succesfully. ) 

 

Change %d with %llu

Link to comment
Share on other sites

 

I'm back to this again... ( Unsigned Long Long in Binary ) 

After yang exceeds 2kkk:

5dLVNyJ.png

Same problem, i dont knouw if we are doing something wrong or reboot do not fully understand the problem. 

 

T.T

 

After an update of DB , in "gold" column it turns in "9223372036854775807" which is maximum value of unsigned long long ( 922.337.036.854.775.807 Yang / 922kkkkk ) 

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

  • Premium

 

I tried this today , didn't succed. Seems to complicate.

y4JN1SJ.jpg

 

PythonPlayerModule.cpp - UnsignedLongLong

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
return PyLong_FromUnsignedLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));
} 

lenght.h - GOLD_MAX = 999990000000ULL,

tables.h - long long gold;

 

 

Edit: I removed it completely , a complete tutorial on this would be helpful.

 

BUMP same

 

In navicat i have a negative value -1193967296

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

  • 2 weeks later...

Hello
I successfully increased the max gold in serverside, but in client it doesnt want to show the correct value of gold :
https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

i tried this codes:

return PyLong_FromUnsignedLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));

return PyLong_FromLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));

Py_BuildValue("l", CPythonPlayer::Instance().GetStatus(POINT_GOLD));

Py_BuildValue("ll", CPythonPlayer::Instance().GetStatus(POINT_GOLD));

Py_BuildValue("K", CPythonPlayer::Instance().GetStatus(POINT_GOLD));

these codes shows that value whic is on the picture

with Py_BuildValue("ull", CPythonPlayer::Instance().GetStatus(POINT_GOLD)); it shows the max value of ULL :

dows somebody know the code which shows the correct value?

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

  • 2 weeks later...

Hello

I successfully increased the max gold in serverside, but in client it doesnt want to show the correct value of gold :

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

i tried this codes:

return PyLong_FromUnsignedLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));

return PyLong_FromLongLong(CPythonPlayer::Instance().GetStatus(POINT_GOLD));

Py_BuildValue("l", CPythonPlayer::Instance().GetStatus(POINT_GOLD));

Py_BuildValue("ll", CPythonPlayer::Instance().GetStatus(POINT_GOLD));

Py_BuildValue("K", CPythonPlayer::Instance().GetStatus(POINT_GOLD));

these codes shows that value whic is on the picture

with Py_BuildValue("ull", CPythonPlayer::Instance().GetStatus(POINT_GOLD)); it shows the max value of ULL :

dows somebody know the code which shows the correct value?

I have the same problem.

 

i have a positive vaule in my db but client show = 247.872.648.810.861.568.

in db is 66.000.000.000

 

And when the value in DB = 0 in client show = 250.405.922.025.766.912

What is wrong ?

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

DWORD dash = CPythonPlayer::Instance().GetStatus(POINT_GOLD);

Return Py_BuildValue("l",dash);

For 4.000.000.000

Try with long long dash and "L"

Thx Dash but dont work...

 

I have only change PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs) in client source

have forget what?

 

but the vaule in client is now 352.289.280 Yang and DB value = 300000000000

 

Here my Changes game and Client:

 

Game:

 

char.cpp

		case POINT_GOLD:
			{
				long long GoldAmount = 0;
				const int64_t nTotalMoney = GetGold() + GoldAmount;

				if (GOLD_MAX <= nTotalMoney)
				{
					sys_err("[OVERFLOW_GOLD] OriGold %d AddedGold %d id %u Name %s ", GetGold(), GoldAmount, GetPlayerID(), GetName());
					//LogManager::instance().CharLog(this, GetGold() + amount, "OVERFLOW_GOLD", "");
					return;
				}

				SetGold(GetGold() + GoldAmount);
				goldval = GetGold();
			}
			break;

 

char.h

typedef struct character_point
{
	long			points[POINT_MAX_NUM];

	BYTE			job;
	BYTE			voice;

	BYTE			level;
	DWORD			exp;
	long long		gold;

	int				hp;
	int				sp;

	int				iRandomHP;
	int				iRandomSP;

	int				stamina;

	BYTE			skill_group;
} CHARACTER_POINT;

		// Money related
		long long		GetGold() const		{ return m_points.gold;	}
		void			SetGold(long long gold)	{ m_points.gold = gold;	}
		bool			DropGold(INT gold);
		INT				GetAllowedGold() const;
		void			GiveGold(INT iAmount);	// ÆÄƼ°¡ ÀÖÀ¸¸é ÆÄƼ ºÐ¹è, ·Î±× µîÀÇ Ã³¸®
		// End of Money



 

config.cpp

long long GOLD_MAX = 1000000000000000000LL;

 

tables.h

typedef struct SPlayerTable
{
	DWORD	id;

	char	name[CHARACTER_NAME_MAX_LEN + 1];
	char	ip[IP_ADDRESS_LENGTH + 1];

	WORD	job;
	BYTE	voice;

	BYTE	level;
	BYTE	level_step;
	short	st, ht, dx, iq;

	DWORD	exp;
	long long	gold;

	BYTE	dir;
	INT		x, y, z;
	INT		lMapIndex;

	long	lExitX, lExitY;
	long	lExitMapIndex;

	long       hp;
	long       sp;

	short	sRandomHP;
	short	sRandomSP;

	int         playtime;

	short	stat_point;
	short	skill_point;
	short	sub_skill_point;
	short	horse_skill_point;

	TPlayerSkill skills[SKILL_MAX_NUM];

	TQuickslot  quickslot[QUICKSLOT_MAX_NUM];

	BYTE	part_base;
	WORD	parts[PART_MAX_NUM];

	short	stamina;

	BYTE	skill_group;
	long	lAlignment;
	char	szMobile[MOBILE_MAX_LEN + 1];

	short	stat_reset_count;

	THorseInfo	horse;

	DWORD	logoff_interval;

	int		aiPremiumTimes[PREMIUM_MAX_NUM];
} TPlayerTable;

 

Client:

 

PythonPlayerModule.cpp

 

PyObject * playerGetElk(PyObject* poSelf, PyObject* poArgs)
{
	__int64 GoldVal = CPythonPlayer::Instance().GetStatus(POINT_GOLD);
	return Py_BuildValue("L", GoldVal);
}

Link to comment
Share on other sites

  • 3 months later...

any one can help me i have the problem the money when i buy or drop or trade yang it's auto coming 0 yang when i reload then i have the correct money on inventory any one waht i need to make ? 

the money it's work but when buy any thing or drop it's coming 0 and need too reload on client for show again the real money.

 

j28PJjU.jpg

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

any one can help me i have the problem the money when i buy or drop or trade yang it's auto coming 0 yang when i reload then i have the correct money on inventory any one waht i need to make ? 

the money it's work but when buy any thing or drop it's coming 0 and need too reload on client for show again the real money.

 

j28PJjU.jpg

I have the same problem.. Somebody know how to fix it?

If my yang value is > max int value (2,1kkk), yangs in inventory after update set 0, if i logout and login yang value is again correct...

 

And my next problem:

Items from my inventory disappeared.

If i give item to my inventory, after relog missing...

 

Edited by Metin2 Dev
Core X - External 2 Internal
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.