Jump to content
  • 0

About Zeny account based


klaw

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  08/24/13
  • Last Seen:  

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).

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

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;
}
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

@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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  341
  • Reputation:   43
  • Joined:  01/10/12
  • Last Seen:  

I think something like this should work:

 

-	script	ZenyAccBased	-1,{
OnPCLoginEvent:
	Zeny = #Zeny;
	end;

OnPCLogoutEvent:
	#Zeny = Zeny;
	Zeny = 0;
	end;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  185
  • Reputation:   53
  • Joined:  01/04/12
  • Last Seen:  

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

Link to comment
Share on other sites

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.

×
×
  • Create New...