- Added support for the new "make new char" packet that has the rename button data. Thanks to Sara-chan for the format change update.
- Fixed itemdb.c sql compilation - Now when you specify a max level beyond what the exp table has, the last entry of the exp table will be duplicated to fill in the remaining levels. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9558 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
e75a8eca56
commit
2208728178
@ -4,6 +4,9 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
|
||||
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
|
||||
|
||||
2006/12/22
|
||||
* Now when you specify a max level beyond what the exp table has, the last
|
||||
entry of the exp table will be duplicated to fill in the remaining levels.
|
||||
[Skotlex]
|
||||
* Change strncpy to memcpy when parsing switches in the script engine
|
||||
since it's guaranteed to be a word of that size (skip_word).
|
||||
* Made scriptlabel_db duplicate the key. When str_buf is reallocated, the
|
||||
|
@ -3631,9 +3631,9 @@ int parse_char(int fd) {
|
||||
break;
|
||||
}
|
||||
{ //Send to player.
|
||||
WFIFOHEAD(fd, 108);
|
||||
WFIFOHEAD(fd, 110);
|
||||
WFIFOW(fd,0) = 0x6d;
|
||||
memset(WFIFOP(fd,2), 0, 106);
|
||||
memset(WFIFOP(fd,2), 0, 108);
|
||||
|
||||
WFIFOL(fd,2) = char_dat[i].status.char_id;
|
||||
WFIFOL(fd,2+4) = char_dat[i].status.base_exp>LONG_MAX?LONG_MAX:char_dat[i].status.base_exp;
|
||||
@ -3649,7 +3649,7 @@ int parse_char(int fd) {
|
||||
WFIFOW(fd,2+44) = (char_dat[i].status.max_hp > SHRT_MAX) ? SHRT_MAX : char_dat[i].status.max_hp;
|
||||
WFIFOW(fd,2+46) = (char_dat[i].status.sp > SHRT_MAX) ? SHRT_MAX : char_dat[i].status.sp;
|
||||
WFIFOW(fd,2+48) = (char_dat[i].status.max_sp > SHRT_MAX) ? SHRT_MAX : char_dat[i].status.max_sp;
|
||||
WFIFOW(fd,2+50) = DEFAULT_WALK_SPEED; // char_dat[i].status.speed;
|
||||
WFIFOW(fd,2+50) = DEFAULT_WALK_SPEED;
|
||||
WFIFOW(fd,2+52) = char_dat[i].status.class_;
|
||||
WFIFOW(fd,2+54) = char_dat[i].status.hair;
|
||||
|
||||
@ -3669,9 +3669,15 @@ int parse_char(int fd) {
|
||||
WFIFOB(fd,2+101) = (char_dat[i].status.int_ > UCHAR_MAX) ? UCHAR_MAX : char_dat[i].status.int_;
|
||||
WFIFOB(fd,2+102) = (char_dat[i].status.dex > UCHAR_MAX) ? UCHAR_MAX : char_dat[i].status.dex;
|
||||
WFIFOB(fd,2+103) = (char_dat[i].status.luk > UCHAR_MAX) ? UCHAR_MAX : char_dat[i].status.luk;
|
||||
#if PACKETVER > 7
|
||||
//Updated packet structure with rename-button included. Credits to Sara-chan
|
||||
WFIFOW(fd,2+104) = char_dat[i].status.char_num;
|
||||
WFIFOB(fd,2+106) = 1; //Rename bit.
|
||||
WFIFOSET(fd,110);
|
||||
#else
|
||||
WFIFOB(fd,2+104) = char_dat[i].status.char_num;
|
||||
|
||||
WFIFOSET(fd,108);
|
||||
#endif
|
||||
RFIFOSKIP(fd,37);
|
||||
}
|
||||
for(ch = 0; ch < 9; ch++) {
|
||||
|
@ -1680,11 +1680,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
|
||||
int i, j, found_num = 0;
|
||||
struct mmo_charstatus *p = NULL;
|
||||
const int offset = 24;
|
||||
#if PACKETVER > 7
|
||||
WFIFOHEAD(fd, offset +9*108);
|
||||
#else
|
||||
WFIFOHEAD(fd, offset +9*106);
|
||||
#endif
|
||||
|
||||
set_char_online(-1, 99,sd->account_id);
|
||||
|
||||
@ -1712,6 +1708,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
|
||||
WFIFOW(fd, 0) = 0x6b;
|
||||
|
||||
#if PACKETVER > 7
|
||||
//Updated packet structure with rename-button included. Credits to Sara-chan
|
||||
memset(WFIFOP(fd, 0), 0, offset + found_num * 108);
|
||||
WFIFOW(fd, 2) = offset + found_num * 108;
|
||||
#else
|
||||
@ -1773,6 +1770,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
|
||||
WFIFOB(fd,j+102) = (p->dex > UCHAR_MAX) ? UCHAR_MAX : p->dex;
|
||||
WFIFOB(fd,j+103) = (p->luk > UCHAR_MAX) ? UCHAR_MAX : p->luk;
|
||||
#if PACKETVER > 7
|
||||
//Updated packet structure with rename-button included. Credits to Sara-chan
|
||||
WFIFOW(fd,j+104) = p->char_num;
|
||||
WFIFOB(fd,j+106) = 1; //TODO: Handle this rename bit: 0 to enable renaming
|
||||
#else
|
||||
@ -3435,9 +3433,9 @@ int parse_char(int fd) {
|
||||
break;
|
||||
}
|
||||
{ //Send data.
|
||||
WFIFOHEAD(fd, 108);
|
||||
WFIFOHEAD(fd, 110);
|
||||
WFIFOW(fd, 0) = 0x6d;
|
||||
memset(WFIFOP(fd, 2), 0x00, 106);
|
||||
memset(WFIFOP(fd, 2), 0x00, 108);
|
||||
|
||||
mmo_char_fromsql_short(i, &char_dat); //Only the short data is needed.
|
||||
WFIFOL(fd,2) = char_dat.char_id;
|
||||
@ -3474,9 +3472,15 @@ int parse_char(int fd) {
|
||||
WFIFOB(fd,2+101) = char_dat.int_>UCHAR_MAX?UCHAR_MAX:char_dat.int_;
|
||||
WFIFOB(fd,2+102) = char_dat.dex>UCHAR_MAX?UCHAR_MAX:char_dat.dex;
|
||||
WFIFOB(fd,2+103) = char_dat.luk>UCHAR_MAX?UCHAR_MAX:char_dat.luk;
|
||||
#if PACKETVER > 7
|
||||
//Updated packet structure with rename-button included. Credits to Sara-chan
|
||||
WFIFOW(fd,2+104) = char_dat.char_num;
|
||||
WFIFOB(fd,2+106) = 1; //Rename bit.
|
||||
WFIFOSET(fd, 110);
|
||||
#else
|
||||
WFIFOB(fd,2+104) = char_dat.char_num;
|
||||
|
||||
WFIFOSET(fd, 108);
|
||||
#endif
|
||||
RFIFOSKIP(fd, 37);
|
||||
}
|
||||
//to do
|
||||
|
@ -954,10 +954,10 @@ static int itemdb_read_sqldb(void)
|
||||
script_free_code(id->script);
|
||||
if (sql_row[19] != NULL) {
|
||||
if (sql_row[19][0] == '{')
|
||||
id->script = parse_script((unsigned char *) sql_row[19],item_db_name[i], 0);
|
||||
id->script = parse_script((unsigned char *) sql_row[19],item_db_name[i], ln, 0);
|
||||
else {
|
||||
sprintf(script, "{%s}", sql_row[19]);
|
||||
id->script = parse_script((unsigned char *) script, item_db_name[i], 0);
|
||||
id->script = parse_script((unsigned char *) script, item_db_name[i], ln, 0);
|
||||
}
|
||||
} else id->script = NULL;
|
||||
|
||||
@ -965,10 +965,10 @@ static int itemdb_read_sqldb(void)
|
||||
script_free_code(id->equip_script);
|
||||
if (sql_row[20] != NULL) {
|
||||
if (sql_row[20][0] == '{')
|
||||
id->equip_script = parse_script((unsigned char *) sql_row[20], item_db_name[i], 0);
|
||||
id->equip_script = parse_script((unsigned char *) sql_row[20], item_db_name[i], ln, 0);
|
||||
else {
|
||||
sprintf(script, "{%s}", sql_row[20]);
|
||||
id->equip_script = parse_script((unsigned char *) script, item_db_name[i], 0);
|
||||
id->equip_script = parse_script((unsigned char *) script, item_db_name[i], ln, 0);
|
||||
}
|
||||
} else id->equip_script = NULL;
|
||||
|
||||
@ -976,10 +976,10 @@ static int itemdb_read_sqldb(void)
|
||||
script_free_code(id->unequip_script);
|
||||
if (sql_row[21] != NULL) {
|
||||
if (sql_row[21][0] == '{')
|
||||
id->unequip_script = parse_script((unsigned char *) sql_row[21],item_db_name[i], 0);
|
||||
id->unequip_script = parse_script((unsigned char *) sql_row[21],item_db_name[i], ln, 0);
|
||||
else {
|
||||
sprintf(script, "{%s}", sql_row[21]);
|
||||
id->unequip_script = parse_script((unsigned char *) script, item_db_name[i], 0);
|
||||
id->unequip_script = parse_script((unsigned char *) script, item_db_name[i], ln, 0);
|
||||
}
|
||||
} else id->unequip_script = NULL;
|
||||
|
||||
|
@ -7314,7 +7314,12 @@ int pc_readdb(void)
|
||||
max_level[job][type]--;
|
||||
if (max_level[job][type] < max) {
|
||||
ShowWarning("pc_readdb: Specified max %d for job %d, but that job's exp table only goes up to level %d.\n", max, job, max_level[job][type]);
|
||||
ShowNotice("(You may still reach lv %d through scripts/gm-commands)\n", max);
|
||||
ShowInfo("Filling the missing values with the last exp entry.\n");
|
||||
//Fill the requested values with the last entry.
|
||||
i = max_level[job][type]-2;
|
||||
if (i < 0) i = 0;
|
||||
for (; i < max-2; i++)
|
||||
exp_table[job][type][i] = exp_table[job][type][i-1];
|
||||
max_level[job][type] = max;
|
||||
}
|
||||
// ShowDebug("%s - Class %d: %d\n", type?"Job":"Base", job, max_level[job][type]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user