- Fixed the char servers to store correctly exp as uints. They are also capped to LONG_MAX before being sent to the client.
- TK_DODGE now dodges all ranged attacks, when used with SPURT, dodges everything. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5289 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
00bbc7673b
commit
e0fb2a113f
@ -4,6 +4,10 @@ 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. EVERYTHING ELSE
|
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE
|
||||||
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
|
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
|
||||||
2006/02/15
|
2006/02/15
|
||||||
|
* Fixed the char servers to store correctly exp as uints. They are also
|
||||||
|
capped to LONG_MAX before being sent to the client. [Skotlex]
|
||||||
|
* TK_DODGE now dodges all ranged attacks, when used with SPURT, dodges
|
||||||
|
everything. [Skotlex]
|
||||||
* The autospell loop now cancels after one successful cast. This means if
|
* The autospell loop now cancels after one successful cast. This means if
|
||||||
you have 10 autospells with 100% casting rate, only one will come off with
|
you have 10 autospells with 100% casting rate, only one will come off with
|
||||||
each hit instead of all of them. [Skotlex]
|
each hit instead of all of them. [Skotlex]
|
||||||
|
@ -23,6 +23,7 @@ typedef long in_addr_t;
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "../common/strlib.h"
|
#include "../common/strlib.h"
|
||||||
#include "../common/core.h"
|
#include "../common/core.h"
|
||||||
@ -360,7 +361,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
|
|||||||
p->last_point.y = 354;
|
p->last_point.y = 354;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
str_p += sprintf(str_p, "%d\t%d,%d\t%s\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
str_p += sprintf(str_p, "%d\t%d,%d\t%s\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
||||||
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
||||||
"\t%s,%d,%d\t%s,%d,%d,%d,%d,%d,%d,%d\t",
|
"\t%s,%d,%d\t%s,%d,%d,%d,%d,%d,%d,%d\t",
|
||||||
p->char_id, p->account_id, p->char_num, p->name, //
|
p->char_id, p->account_id, p->char_num, p->name, //
|
||||||
@ -425,18 +426,19 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg,
|
|||||||
int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg, int *reg_num) {
|
int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg, int *reg_num) {
|
||||||
char tmp_str[3][128]; //To avoid deleting chars with too long names.
|
char tmp_str[3][128]; //To avoid deleting chars with too long names.
|
||||||
int tmp_int[256];
|
int tmp_int[256];
|
||||||
|
unsigned int tmp_uint[2]; //To read exp....
|
||||||
int set, next, len, i, j;
|
int set, next, len, i, j;
|
||||||
|
|
||||||
// initilialise character
|
// initilialise character
|
||||||
memset(p, '\0', sizeof(struct mmo_charstatus));
|
memset(p, '\0', sizeof(struct mmo_charstatus));
|
||||||
|
|
||||||
// If it's not char structure of version 1488 and after
|
// If it's not char structure of version 1488 and after
|
||||||
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
||||||
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
||||||
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d,%d%n",
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d,%d%n",
|
||||||
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0],
|
||||||
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
||||||
&tmp_int[6], &tmp_int[7], &tmp_int[8],
|
&tmp_uint[0], &tmp_uint[1], &tmp_int[8],
|
||||||
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
||||||
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
||||||
&tmp_int[19], &tmp_int[20],
|
&tmp_int[19], &tmp_int[20],
|
||||||
@ -450,12 +452,12 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|||||||
{
|
{
|
||||||
tmp_int[43] = 0;
|
tmp_int[43] = 0;
|
||||||
// If it's not char structure of version 1363 and after
|
// If it's not char structure of version 1363 and after
|
||||||
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
||||||
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
||||||
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d%n",
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d,%d,%d,%d%n",
|
||||||
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
||||||
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
||||||
&tmp_int[6], &tmp_int[7], &tmp_int[8],
|
&tmp_uint[0], &tmp_uint[1], &tmp_int[8],
|
||||||
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
||||||
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
||||||
&tmp_int[19], &tmp_int[20],
|
&tmp_int[19], &tmp_int[20],
|
||||||
@ -471,12 +473,12 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|||||||
tmp_int[41] = 0; // mother
|
tmp_int[41] = 0; // mother
|
||||||
tmp_int[42] = 0; // child
|
tmp_int[42] = 0; // child
|
||||||
// If it's not char structure of version 1008 and before 1363
|
// If it's not char structure of version 1008 and before 1363
|
||||||
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
||||||
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
||||||
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d%n",
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d,%d%n",
|
||||||
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
||||||
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
||||||
&tmp_int[6], &tmp_int[7], &tmp_int[8],
|
&tmp_uint[0], &tmp_uint[1], &tmp_int[8],
|
||||||
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
||||||
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
||||||
&tmp_int[19], &tmp_int[20],
|
&tmp_int[19], &tmp_int[20],
|
||||||
@ -489,12 +491,12 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|||||||
{
|
{
|
||||||
tmp_int[39] = 0; // partner id
|
tmp_int[39] = 0; // partner id
|
||||||
// If not char structure from version 384 to 1007
|
// If not char structure from version 384 to 1007
|
||||||
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
if ((set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
||||||
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
"\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
||||||
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
||||||
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
||||||
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
||||||
&tmp_int[6], &tmp_int[7], &tmp_int[8],
|
&tmp_uint[0], &tmp_uint[1], &tmp_int[8],
|
||||||
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
||||||
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
||||||
&tmp_int[19], &tmp_int[20],
|
&tmp_int[19], &tmp_int[20],
|
||||||
@ -507,12 +509,12 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|||||||
{
|
{
|
||||||
// It's char structure of a version before 384
|
// It's char structure of a version before 384
|
||||||
tmp_int[26] = 0; // pet id
|
tmp_int[26] = 0; // pet id
|
||||||
set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%d,%d,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
set = sscanf(str, "%d\t%d,%d\t%127[^\t]\t%d,%d,%d\t%u,%u,%d\t%d,%d,%d,%d\t%d,%d,%d,%d,%d,%d\t%d,%d"
|
||||||
"\t%d,%d,%d\t%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
"\t%d,%d,%d\t%d,%d\t%d,%d,%d\t%d,%d,%d,%d,%d"
|
||||||
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
"\t%127[^,],%d,%d\t%127[^,],%d,%d%n",
|
||||||
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
&tmp_int[0], &tmp_int[1], &tmp_int[2], tmp_str[0], //
|
||||||
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
&tmp_int[3], &tmp_int[4], &tmp_int[5],
|
||||||
&tmp_int[6], &tmp_int[7], &tmp_int[8],
|
&tmp_uint[0], &tmp_uint[1], &tmp_int[8],
|
||||||
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
&tmp_int[9], &tmp_int[10], &tmp_int[11], &tmp_int[12],
|
||||||
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
&tmp_int[13], &tmp_int[14], &tmp_int[15], &tmp_int[16], &tmp_int[17], &tmp_int[18],
|
||||||
&tmp_int[19], &tmp_int[20],
|
&tmp_int[19], &tmp_int[20],
|
||||||
@ -553,8 +555,8 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p, struct global_reg *reg
|
|||||||
p->class_ = tmp_int[3];
|
p->class_ = tmp_int[3];
|
||||||
p->base_level = tmp_int[4];
|
p->base_level = tmp_int[4];
|
||||||
p->job_level = tmp_int[5];
|
p->job_level = tmp_int[5];
|
||||||
p->base_exp = tmp_int[6];
|
p->base_exp = tmp_uint[0];
|
||||||
p->job_exp = tmp_int[7];
|
p->job_exp = tmp_uint[1];
|
||||||
p->zeny = tmp_int[8];
|
p->zeny = tmp_int[8];
|
||||||
p->hp = tmp_int[9];
|
p->hp = tmp_int[9];
|
||||||
p->max_hp = tmp_int[10];
|
p->max_hp = tmp_int[10];
|
||||||
@ -1611,9 +1613,9 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
|
|||||||
j = offset + (i * 106); // increase speed of code
|
j = offset + (i * 106); // increase speed of code
|
||||||
|
|
||||||
WFIFOL(fd,j) = p->char_id;
|
WFIFOL(fd,j) = p->char_id;
|
||||||
WFIFOL(fd,j+4) = p->base_exp;
|
WFIFOL(fd,j+4) = p->base_exp>LONG_MAX?LONG_MAX:p->base_exp;
|
||||||
WFIFOL(fd,j+8) = p->zeny;
|
WFIFOL(fd,j+8) = p->zeny;
|
||||||
WFIFOL(fd,j+12) = p->job_exp;
|
WFIFOL(fd,j+12) = p->job_exp>LONG_MAX?LONG_MAX:p->job_exp;
|
||||||
WFIFOL(fd,j+16) = p->job_level;
|
WFIFOL(fd,j+16) = p->job_level;
|
||||||
|
|
||||||
WFIFOL(fd,j+20) = 0;
|
WFIFOL(fd,j+20) = 0;
|
||||||
@ -3355,9 +3357,9 @@ int parse_char(int fd) {
|
|||||||
memset(WFIFOP(fd,2), 0, 106);
|
memset(WFIFOP(fd,2), 0, 106);
|
||||||
|
|
||||||
WFIFOL(fd,2) = char_dat[i].status.char_id;
|
WFIFOL(fd,2) = char_dat[i].status.char_id;
|
||||||
WFIFOL(fd,2+4) = char_dat[i].status.base_exp;
|
WFIFOL(fd,2+4) = char_dat[i].status.base_exp>LONG_MAX?LONG_MAX:char_dat[i].status.base_exp;
|
||||||
WFIFOL(fd,2+8) = char_dat[i].status.zeny;
|
WFIFOL(fd,2+8) = char_dat[i].status.zeny;
|
||||||
WFIFOL(fd,2+12) = char_dat[i].status.job_exp;
|
WFIFOL(fd,2+12) = char_dat[i].status.job_exp>LONG_MAX?LONG_MAX:char_dat[i].status.job_exp;
|
||||||
WFIFOL(fd,2+16) = char_dat[i].status.job_level;
|
WFIFOL(fd,2+16) = char_dat[i].status.job_level;
|
||||||
|
|
||||||
WFIFOL(fd,2+28) = char_dat[i].status.karma;
|
WFIFOL(fd,2+28) = char_dat[i].status.karma;
|
||||||
|
@ -27,6 +27,7 @@ typedef long in_addr_t;
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "char.h"
|
#include "char.h"
|
||||||
#include "../common/utils.h"
|
#include "../common/utils.h"
|
||||||
@ -463,7 +464,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){
|
|||||||
|
|
||||||
//query
|
//query
|
||||||
sprintf(tmp_sql ,"UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
|
sprintf(tmp_sql ,"UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
|
||||||
"`base_exp`='%d', `job_exp`='%d', `zeny`='%d',"
|
"`base_exp`='%u', `job_exp`='%u', `zeny`='%d',"
|
||||||
"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d',"
|
"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%d',`skill_point`='%d',"
|
||||||
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d',"
|
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d',"
|
||||||
"`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',"
|
"`option`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',"
|
||||||
@ -862,6 +863,7 @@ int memitemdata_to_sql(struct itemtmp mapitem[], int count, int char_id, int tab
|
|||||||
//=====================================================================================================
|
//=====================================================================================================
|
||||||
int mmo_char_fromsql(int char_id, struct mmo_charstatus *p){
|
int mmo_char_fromsql(int char_id, struct mmo_charstatus *p){
|
||||||
int i,j, n;
|
int i,j, n;
|
||||||
|
double exp;
|
||||||
char t_msg[128];
|
char t_msg[128];
|
||||||
char *str_p = tmp_sql;
|
char *str_p = tmp_sql;
|
||||||
struct mmo_charstatus *cp;
|
struct mmo_charstatus *cp;
|
||||||
@ -905,8 +907,10 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus *p){
|
|||||||
p->class_ = atoi(sql_row[4]);
|
p->class_ = atoi(sql_row[4]);
|
||||||
p->base_level = atoi(sql_row[5]);
|
p->base_level = atoi(sql_row[5]);
|
||||||
p->job_level = atoi(sql_row[6]);
|
p->job_level = atoi(sql_row[6]);
|
||||||
p->base_exp = atoi(sql_row[7]);
|
exp = atof(sql_row[7]);
|
||||||
p->job_exp = atoi(sql_row[8]);
|
p->base_exp = exp<0?0:(exp>UINT_MAX?UINT_MAX:(unsigned int)exp);
|
||||||
|
exp = atof(sql_row[8]);
|
||||||
|
p->job_exp = exp<0?0:(exp>UINT_MAX?UINT_MAX:(unsigned int)exp);
|
||||||
p->zeny = atoi(sql_row[9]);
|
p->zeny = atoi(sql_row[9]);
|
||||||
p->str = atoi(sql_row[10]);
|
p->str = atoi(sql_row[10]);
|
||||||
p->agi = atoi(sql_row[11]);
|
p->agi = atoi(sql_row[11]);
|
||||||
@ -1118,7 +1122,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus *p){
|
|||||||
//
|
//
|
||||||
int mmo_char_fromsql_short(int char_id, struct mmo_charstatus *p){
|
int mmo_char_fromsql_short(int char_id, struct mmo_charstatus *p){
|
||||||
char t_msg[128];
|
char t_msg[128];
|
||||||
|
double exp;
|
||||||
memset(p, 0, sizeof(struct mmo_charstatus));
|
memset(p, 0, sizeof(struct mmo_charstatus));
|
||||||
t_msg[0]= '\0';
|
t_msg[0]= '\0';
|
||||||
|
|
||||||
@ -1156,8 +1160,10 @@ int mmo_char_fromsql_short(int char_id, struct mmo_charstatus *p){
|
|||||||
p->class_ = atoi(sql_row[4]);
|
p->class_ = atoi(sql_row[4]);
|
||||||
p->base_level = atoi(sql_row[5]);
|
p->base_level = atoi(sql_row[5]);
|
||||||
p->job_level = atoi(sql_row[6]);
|
p->job_level = atoi(sql_row[6]);
|
||||||
p->base_exp = atoi(sql_row[7]);
|
exp = atof(sql_row[7]);
|
||||||
p->job_exp = atoi(sql_row[8]);
|
p->base_exp = exp<0?0:(exp>UINT_MAX?UINT_MAX:(unsigned int)exp);
|
||||||
|
exp = atof(sql_row[8]);
|
||||||
|
p->job_exp = exp<0?0:(exp>UINT_MAX?UINT_MAX:(unsigned int)exp);
|
||||||
p->zeny = atoi(sql_row[9]);
|
p->zeny = atoi(sql_row[9]);
|
||||||
p->str = atoi(sql_row[10]);
|
p->str = atoi(sql_row[10]);
|
||||||
p->agi = atoi(sql_row[11]);
|
p->agi = atoi(sql_row[11]);
|
||||||
@ -1796,9 +1802,9 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
|
|||||||
j = offset + (i * 106); // increase speed of code
|
j = offset + (i * 106); // increase speed of code
|
||||||
|
|
||||||
WFIFOL(fd,j) = p->char_id;
|
WFIFOL(fd,j) = p->char_id;
|
||||||
WFIFOL(fd,j+4) = p->base_exp;
|
WFIFOL(fd,j+4) = p->base_exp>LONG_MAX?LONG_MAX:p->base_exp;
|
||||||
WFIFOL(fd,j+8) = p->zeny;
|
WFIFOL(fd,j+8) = p->zeny;
|
||||||
WFIFOL(fd,j+12) = p->job_exp;
|
WFIFOL(fd,j+12) = p->job_exp>LONG_MAX?LONG_MAX:p->job_exp;
|
||||||
WFIFOL(fd,j+16) = p->job_level;
|
WFIFOL(fd,j+16) = p->job_level;
|
||||||
|
|
||||||
WFIFOL(fd,j+20) = 0;
|
WFIFOL(fd,j+20) = 0;
|
||||||
@ -3324,9 +3330,9 @@ int parse_char(int fd) {
|
|||||||
//mmo_char_fromsql(i, char_dat);
|
//mmo_char_fromsql(i, char_dat);
|
||||||
i = 0;
|
i = 0;
|
||||||
WFIFOL(fd, 2) = char_dat[i].char_id;
|
WFIFOL(fd, 2) = char_dat[i].char_id;
|
||||||
WFIFOL(fd,2+4) = char_dat[i].base_exp;
|
WFIFOL(fd,2+4) = char_dat[i].base_exp>LONG_MAX?LONG_MAX:char_dat[i].base_exp;
|
||||||
WFIFOL(fd,2+8) = char_dat[i].zeny;
|
WFIFOL(fd,2+8) = char_dat[i].zeny;
|
||||||
WFIFOL(fd,2+12) = char_dat[i].job_exp;
|
WFIFOL(fd,2+12) = char_dat[i].job_exp>LONG_MAX?LONG_MAX:char_dat[i].job_exp;
|
||||||
WFIFOL(fd,2+16) = char_dat[i].job_level;
|
WFIFOL(fd,2+16) = char_dat[i].job_level;
|
||||||
|
|
||||||
WFIFOL(fd,2+28) = char_dat[i].karma;
|
WFIFOL(fd,2+28) = char_dat[i].karma;
|
||||||
|
@ -610,7 +610,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,i
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(sc->data[SC_DODGE].timer != -1 && !sc->opt1 &&
|
if(sc->data[SC_DODGE].timer != -1 && !sc->opt1 &&
|
||||||
((flag&BF_LONG && flag&BF_WEAPON) || sc->data[SC_SPURT].timer != -1)
|
(flag&BF_LONG || sc->data[SC_SPURT].timer != -1)
|
||||||
&& rand()%100 < 20) {
|
&& rand()%100 < 20) {
|
||||||
if (sd && pc_issit(sd)) pc_setstand(sd); //Stand it to dodge.
|
if (sd && pc_issit(sd)) pc_setstand(sd); //Stand it to dodge.
|
||||||
clif_skill_nodamage(bl,bl,TK_DODGE,1,1);
|
clif_skill_nodamage(bl,bl,TK_DODGE,1,1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user