Jump to content
  • 0

Max Refine, Homunculus Level and 1 char gm account


Question

Posted

Hi.

Anyone has the instruction on :

How to edit max refine ?

I would like reach max refine of +20, currently it is saying +10

How to edit max level for homunculus ?

I already updated the exp table for homunculus but it is still saying 99. I want it to be 255.

How to limit max char for GM accounts ?

I would like to limit any GM accounts to only have 1 char.

Sad to say but I am unable to reach the other forum.

HELP!

3 answers to this question

Recommended Posts

Posted

How to limit max char for GM accounts ?

I would like to limit any GM accounts to only have 1 char.

If you don't mind using a script for it, someone requested one before so I wrote it.

- script GMLimiter -1,{
OnPCLoginEvent:
if ( getcharid(3) == AccountIDHere && strcharinfo(0) != "GM Name Here" ) { atcommand "@kick "+strcharinfo(0); }
end;
} 

Just duplicate this line for each account/character

if ( getcharid(3) == AccountIDHere && strcharinfo(0) != "GM Name Here" ) { atcommand "@kick "+strcharinfo(0); }

And don't forget to put the proper tabs in the first line.

Posted (edited)

For the max characters on a GM account, the script method would work, but I think (I can't test it right now), that if you do this it should work:

Going into srccharchar.c

Find the function:

int make_new_char(struct char_session_data* sd, char* name_, int str, int agi, int vit, int int_, int dex, int luk, int slot, int hair_color, int hair_style)

Within it (below it) you should see:

if( char_per_account != 0 ) {
ARR_FIND( 0, MAX_CHARS, i, sd->found_char[i] == -1 );

if( i >= char_per_account )
return -2; // character account limit exceeded
}

Change that to:

if( char_per_account != 0 || sd->gmlevel ) { //Even if there are unlimited characters per account, if the character has a GM level...
  ARR_FIND( 0, MAX_CHARS, i, sd->found_char[i] == -1 );
  if((i >= char_per_account && char_per_account != 0) || (sd->gmlevel && i)) //...and a character, deny them!
return -2; // character account limit exceeded
}

Right, SQL too.

So in srcchar_sqlchar.c, find:

if( char_per_account != 0 ) {
 if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `account_id` = '%d'", char_db, sd->account_id) )
  Sql_ShowDebug(sql_handle);
 if( Sql_NumRows(sql_handle) >= char_per_account )
  return -2; // character account limit exceeded
}

Change that to...

if( char_per_account != 0 || sd->gmlevel ) {
 if( SQL_ERROR == Sql_Query(sql_handle, "SELECT 1 FROM `%s` WHERE `account_id` = '%d'", char_db, sd->account_id) )
  Sql_ShowDebug(sql_handle);
 if( (Sql_NumRows(sql_handle)  >= char_per_account && char_per_account != 0)  || (sd->gmlevel && Sql_NumRows(sql_handle)) ) //If it returns one or more, deny them!
  return -2; // character account limit exceeded
}

Hopefully my logic is correct. I was able to compile and make sure they didn't give any warnings (rAthena rev. 15399), but I can't really test them in game, so please please make a backup! (though I only changed like 2 lines in each file), oh and if you want to change it to a certain level, just find wherever I put sd->gmlevel and change it to sd->gmlevel >= XX, where XX is whatever GM level you want to use.

Edit:

Forgot to account for when char_per_account == 0 and the person is a GM, preventing them from ever making a character, haha, woops. Fixed.

Edited by Variant

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