Jump to content
  • 0

About Zeny account based


Question

Posted

I looked around, and couldn't really find anything that was substantial enough for me to give this a try.

It should be a relatively simple edit, but I want to make zeny account based instead of character based.

After doing a bit of thinking, it should be 1-2 lines in the source to change the zeny to being account based rather than character based, and then of course an edit to make the sql account based as well.

Just wondering if anyone has poked around with this before, or where to start (i don't know which src file I would edit, been poking around for a while).

6 answers to this question

Recommended Posts

Posted

you can do the trick with a script npc

-	script	qsdfgh	-1,{
OnPCLoginEvent:
	query_sql "select max(`zeny`) from `char` where `account_id` = "+ getcharid(3), Zeny;// get and set the max zeny in my account
	end;
}
Posted

i think it should be

SELECT SUM(`zeny`) FROM `char` WHERE `account_id` = "+getcharid(3)

 

anyway..this trick doesnt really work in RO ....since the zeny is limited to 2.1b only...you will get tons of error about zeny overflow in the future ...

 

same topic that made by peopleperson49 and has been discussed last time.

Posted

@Emistry

if you use sum it sure will overflow

 

2 characters, 3000 zeny each

log in -> sum -> 3000 + 3000 zeny -> log out

log in -> sum -> 6000 + 3000 zeny -> log out /hmm

Posted

src/char/char.c
 
function mmo_char_tosql
find

			(unsigned long)p->delete_date,  // FIXME: platform-dependent size
			p->robe,p->character_moves,
			p->account_id, p->char_id) )
		{
			Sql_ShowDebug(sql_handle);
			errors++;
		} else
			strcat(save_status, " status");
	}

add after
 

	if (p->zeny != cp->zeny)
	{	//Save zeny
		if( SQL_ERROR == Sql_Query(sql_handle, "UPDATE `%s` SET `zeny`='%d' WHERE `account_id`='%d'", char_db, p->zeny, p->account_id) )
		{
			Sql_ShowDebug(sql_handle);
			errors++;
		} else
			strcat(save_status, " zeny");
	}

all chars on account will have same zeny amount

!!!IT WILL UPDATE ALL CHARS IN ACCOUNT ON FIRST LOGIN AFTER ADDING THIS CODE!!!

and other characters will have zeny like first logged, then zeny will be synchronized

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...