summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-29 19:18:18 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-29 19:18:18 +0000
commitab0a9edc2f5754c4f778c008caff1682d43d65eb (patch)
tree639e173ce8010bd59ddddb5460fdc56858a1ac1a
parente5bce970b13d3485cfa823aa4810787c2006181a (diff)
downloadhercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.tar.gz
hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.tar.bz2
hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.tar.xz
hercules-ab0a9edc2f5754c4f778c008caff1682d43d65eb.zip
cxx updates
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@861 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog.txt1
-rw-r--r--Makefile1
-rw-r--r--src/char/char.c26
-rw-r--r--src/char/int_guild.c8
-rw-r--r--src/char/int_pet.c6
-rw-r--r--src/char_sql/char.c10
-rw-r--r--src/char_sql/int_guild.c10
-rw-r--r--src/char_sql/int_pet.c8
-rw-r--r--src/common/db.c1
-rw-r--r--src/common/grfio.c36
-rw-r--r--src/common/grfio.h4
-rw-r--r--src/common/mmo.h6
-rw-r--r--src/common/socket.c12
-rw-r--r--src/common/socket.h1
-rw-r--r--src/common/strlib.c1
-rw-r--r--src/common/utils.h4
-rw-r--r--src/map/atcommand.c162
-rw-r--r--src/map/battle.c126
-rw-r--r--src/map/charcommand.c58
-rw-r--r--src/map/chrif.c6
-rw-r--r--src/map/clif.c194
-rw-r--r--src/map/guild.c6
-rw-r--r--src/map/itemdb.c6
-rw-r--r--src/map/itemdb.h2
-rw-r--r--src/map/map.h6
-rw-r--r--src/map/mob.c166
-rw-r--r--src/map/npc.c18
-rw-r--r--src/map/pc.c162
-rw-r--r--src/map/pet.c46
-rw-r--r--src/map/pet.h2
-rw-r--r--src/map/script.c14
-rw-r--r--src/map/skill.c30
32 files changed, 572 insertions, 567 deletions
diff --git a/Changelog.txt b/Changelog.txt
index 6441040a4..f7f3dddd7 100644
--- a/Changelog.txt
+++ b/Changelog.txt
@@ -1,5 +1,6 @@
Date Added
12/29
+ * Some code cleanup in prep for new debugging malloc (SVN 861) [MouseJstr]
* Updated Soul Breaker's damage calculation [celest]
* Updated Meteor Assault's cast delay to be not affected by dex [celest]
* Changed int_guild.c so it will calculate average guild level only if > 0
diff --git a/Makefile b/Makefile
index d9258179c..527693e4e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
# $Id: Makefile 158 2004-10-01 03:45:15Z PoW $
CC = gcc -pipe
+# CC = gcc -pipe -x c++
# CC = gcc -pipe -DGCOLLECT
# CC = /usr/local/bin/gcc -fbounds-checking -pipe -DBCHECK
diff --git a/src/char/char.c b/src/char/char.c
index 72d461865..e812e1de1 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -269,7 +269,7 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p) {
"\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\t",
p->char_id, p->account_id, p->char_num, p->name, //
- p->class, p->base_level, p->job_level,
+ p->class_, p->base_level, p->job_level,
p->base_exp, p->job_exp, p->zeny,
p->hp, p->max_hp, p->sp, p->max_sp,
p->str, p->agi, p->vit, p->int_, p->dex, p->luk,
@@ -397,7 +397,7 @@ int mmo_char_fromstr(char *str, struct mmo_charstatus *p) {
p->char_id = tmp_int[0];
p->account_id = tmp_int[1];
p->char_num = tmp_int[2];
- p->class = tmp_int[3];
+ p->class_ = tmp_int[3];
p->base_level = tmp_int[4];
p->job_level = tmp_int[5];
p->base_exp = tmp_int[6];
@@ -947,7 +947,7 @@ int make_new_char(int fd, unsigned char *dat) {
char_dat[i].account_id = sd->account_id;
char_dat[i].char_num = dat[30];
strcpy(char_dat[i].name, dat);
- char_dat[i].class = 0;
+ char_dat[i].class_ = 0;
char_dat[i].base_level = 1;
char_dat[i].job_level = 1;
char_dat[i].base_exp = 0;
@@ -1156,12 +1156,12 @@ void create_online_files(void) {
break;
case 4: // by job (and job level)
for(k = 0; k < players; k++)
- if (char_dat[j].class < char_dat[id[k]].class ||
+ if (char_dat[j].class_ < char_dat[id[k]].class_ ||
// if same job, we sort by job level.
- (char_dat[j].class == char_dat[id[k]].class &&
+ (char_dat[j].class_ == char_dat[id[k]].class_ &&
char_dat[j].job_level < char_dat[id[k]].job_level) ||
// if same job and job level, we sort by job exp.
- (char_dat[j].class == char_dat[id[k]].class &&
+ (char_dat[j].class_ == char_dat[id[k]].class_ &&
char_dat[j].job_level == char_dat[id[k]].job_level &&
char_dat[j].job_exp < char_dat[id[k]].job_exp)) {
for(l = players; l > k; l--)
@@ -1302,7 +1302,7 @@ void create_online_files(void) {
}
// displaying of the job
if (online_display_option & 6) {
- char * jobname = job_name(char_dat[j].class);
+ char * jobname = job_name(char_dat[j].class_);
if ((online_display_option & 6) == 6) {
fprintf(fp2, " <td>%s %d/%d</td>\n", jobname, char_dat[j].base_level, char_dat[j].job_level);
fprintf(fp, "%-18s %3d/%3d ", jobname, char_dat[j].base_level, char_dat[j].job_level);
@@ -1436,7 +1436,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
WFIFOW(fd,j+46) = (p->sp > 0x7fff) ? 0x7fff : p->sp;
WFIFOW(fd,j+48) = (p->max_sp > 0x7fff) ? 0x7fff : p->max_sp;
WFIFOW(fd,j+50) = DEFAULT_WALK_SPEED; // p->speed;
- WFIFOW(fd,j+52) = p->class;
+ WFIFOW(fd,j+52) = p->class_;
WFIFOW(fd,j+54) = p->hair;
WFIFOW(fd,j+56) = p->weapon;
WFIFOW(fd,j+58) = p->base_level;
@@ -1717,7 +1717,7 @@ int parse_tologin(int fd) {
if (acc > 0) {
for (i = 0; i < char_num; i++) {
if (char_dat[i].account_id == acc) {
- int jobclass = char_dat[i].class;
+ int jobclass = char_dat[i].class_;
char_dat[i].sex = sex;
auth_fifo[i].sex = sex;
if (jobclass == 19 || jobclass == 20 ||
@@ -1725,11 +1725,11 @@ int parse_tologin(int fd) {
jobclass == 4042 || jobclass == 4043) {
// job modification
if (jobclass == 19 || jobclass == 20) {
- char_dat[i].class = (sex) ? 19 : 20;
+ char_dat[i].class_ = (sex) ? 19 : 20;
} else if (jobclass == 4020 || jobclass == 4021) {
- char_dat[i].class = (sex) ? 4020 : 4021;
+ char_dat[i].class_ = (sex) ? 4020 : 4021;
} else if (jobclass == 4042 || jobclass == 4043) {
- char_dat[i].class = (sex) ? 4042 : 4043;
+ char_dat[i].class_ = (sex) ? 4042 : 4043;
}
// remove specifical skills of classes 19, 4020 and 4042
for(j = 315; j <= 322; j++) {
@@ -2730,7 +2730,7 @@ int parse_char(int fd) {
WFIFOW(fd,2+46) = (char_dat[i].sp > 0x7fff) ? 0x7fff : char_dat[i].sp;
WFIFOW(fd,2+48) = (char_dat[i].max_sp > 0x7fff) ? 0x7fff : char_dat[i].max_sp;
WFIFOW(fd,2+50) = DEFAULT_WALK_SPEED; // char_dat[i].speed;
- WFIFOW(fd,2+52) = char_dat[i].class;
+ WFIFOW(fd,2+52) = char_dat[i].class_;
WFIFOW(fd,2+54) = char_dat[i].hair;
WFIFOW(fd,2+58) = char_dat[i].base_level;
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 8577b2a66..0ee4476fc 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -45,7 +45,7 @@ int inter_guild_tostr(char *str, struct guild *g) {
len += sprintf(str + len, "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\t%s\t",
m->account_id, m->char_id,
m->hair, m->hair_color, m->gender,
- m->class, m->lv, m->exp, m->exp_payper, m->position,
+ m->class_, m->lv, m->exp, m->exp_payper, m->position,
((m->account_id > 0) ? m->name : "-"));
}
// 役職
@@ -138,7 +138,7 @@ int inter_guild_fromstr(char *str, struct guild *g) {
m->hair = tmp_int[2];
m->hair_color = tmp_int[3];
m->gender = tmp_int[4];
- m->class = tmp_int[5];
+ m->class_ = tmp_int[5];
m->lv = tmp_int[6];
m->exp = tmp_int[7];
m->exp_payper = tmp_int[8];
@@ -767,7 +767,7 @@ int mapif_guild_memberinfoshort(struct guild *g, int idx) {
WBUFL(buf,10) = g->member[idx].char_id;
WBUFB(buf,14) = g->member[idx].online;
WBUFW(buf,15) = g->member[idx].lv;
- WBUFW(buf,17) = g->member[idx].class;
+ WBUFW(buf,17) = g->member[idx].class_;
mapif_sendall(buf, 19);
return 0;
}
@@ -1101,7 +1101,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd, int guild_id, int account_id,
if (g->member[i].account_id == account_id && g->member[i].char_id == char_id) {
g->member[i].online = online;
g->member[i].lv = lv;
- g->member[i].class = class;
+ g->member[i].class_ = class;
mapif_guild_memberinfoshort(g, i);
}
if (g->member[i].account_id > 0) {
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index cff1e434f..c08c4ccf3 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -30,7 +30,7 @@ int inter_pet_tostr(char *str,struct s_pet *p)
p->intimate = 1000;
len=sprintf(str,"%d,%d,%s\t%d,%d,%d,%d,%d,%d,%d,%d,%d",
- p->pet_id,p->class,p->name,p->account_id,p->char_id,p->level,p->egg_id,
+ p->pet_id,p->class_,p->name,p->account_id,p->char_id,p->level,p->egg_id,
p->equip,p->intimate,p->hungry,p->rename_flag,p->incuvate);
return 0;
@@ -52,7 +52,7 @@ int inter_pet_fromstr(char *str,struct s_pet *p)
return 1;
p->pet_id = tmp_int[0];
- p->class = tmp_int[1];
+ p->class_ = tmp_int[1];
memcpy(p->name,tmp_str,24);
p->account_id = tmp_int[2];
p->char_id = tmp_int[3];
@@ -225,7 +225,7 @@ int mapif_create_pet(int fd,int account_id,int char_id,short pet_class,short pet
p->account_id = account_id;
p->char_id = char_id;
}
- p->class = pet_class;
+ p->class_ = pet_class;
p->level = pet_lv;
p->egg_id = pet_egg_id;
p->equip = pet_equip;
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index be8611889..6e982ac67 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -440,7 +440,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){
//=====================================================================================================
- if ((p->base_exp != cp->base_exp) || (p->class != cp->class) ||
+ if ((p->base_exp != cp->base_exp) || (p->class_ != cp->class_) ||
(p->base_level != cp->base_level) || (p->job_level != cp->job_level) ||
(p->job_exp != cp->job_exp) || (p->zeny != cp->zeny) ||
(p->last_point.x != cp->last_point.x) || (p->last_point.y != cp->last_point.y) ||
@@ -498,7 +498,7 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){
"`option`='%d',`karma`='%d',`manner`='%d',`party_id`='%d',`guild_id`='%d',`pet_id`='%d',"
"`hair`='%d',`hair_color`='%d',`clothes_color`='%d',`weapon`='%d',`shield`='%d',`head_top`='%d',`head_mid`='%d',`head_bottom`='%d',"
"`last_map`='%s',`last_x`='%d',`last_y`='%d',`save_map`='%s',`save_x`='%d',`save_y`='%d',`partner_id`='%d' WHERE `account_id`='%d' AND `char_id` = '%d'",
- char_db, p->class, p->base_level, p->job_level,
+ char_db, p->class_, p->base_level, p->job_level,
p->base_exp, p->job_exp, p->zeny,
p->max_hp, p->hp, p->max_sp, p->sp, p->status_point, p->skill_point,
p->str, p->agi, p->vit, p->int_, p->dex, p->luk,
@@ -913,7 +913,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus *p, int online){
p->account_id = atoi(sql_row[1]);
p->char_num = atoi(sql_row[2]);
strcpy(p->name, sql_row[3]);
- p->class = atoi(sql_row[4]);
+ p->class_ = atoi(sql_row[4]);
p->base_level = atoi(sql_row[5]);
p->job_level = atoi(sql_row[6]);
p->base_exp = atoi(sql_row[7]);
@@ -1429,7 +1429,7 @@ int mmo_char_send006b(int fd, struct char_session_data *sd) {
WFIFOW(fd,j+46) = (p->sp > 0x7fff) ? 0x7fff : p->sp;
WFIFOW(fd,j+48) = (p->max_sp > 0x7fff) ? 0x7fff : p->max_sp;
WFIFOW(fd,j+50) = DEFAULT_WALK_SPEED; // p->speed;
- WFIFOW(fd,j+52) = p->class;
+ WFIFOW(fd,j+52) = p->class_;
WFIFOW(fd,j+54) = p->hair;
WFIFOW(fd,j+56) = p->weapon;
WFIFOW(fd,j+58) = p->base_level;
@@ -2539,7 +2539,7 @@ int parse_char(int fd) {
WFIFOW(fd,2+46) = (char_dat[i].sp > 0x7fff) ? 0x7fff : char_dat[i].sp;
WFIFOW(fd,2+48) = (char_dat[i].max_sp > 0x7fff) ? 0x7fff : char_dat[i].max_sp;
WFIFOW(fd,2+50) = DEFAULT_WALK_SPEED; // char_dat[i].speed;
- WFIFOW(fd,2+52) = char_dat[i].class;
+ WFIFOW(fd,2+52) = char_dat[i].class_;
WFIFOW(fd,2+54) = char_dat[i].hair;
WFIFOW(fd,2+58) = char_dat[i].base_level;
diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c
index 5fee88511..258c173cf 100644
--- a/src/char_sql/int_guild.c
+++ b/src/char_sql/int_guild.c
@@ -229,7 +229,7 @@ int inter_guild_tosql(struct guild *g,int flag)
g->guild_id,
m->account_id,m->char_id,
m->hair,m->hair_color,m->gender,
- m->class,m->lv,m->exp,m->exp_payper,m->online,m->position,
+ m->class_,m->lv,m->exp,m->exp_payper,m->online,m->position,
0,0,
jstrescapecpy(t_member,m->name));
@@ -405,7 +405,7 @@ struct guild * inter_guild_fromsql(int guild_id)
m->hair=atoi(sql_row[3]);
m->hair_color=atoi(sql_row[4]);
m->gender=atoi(sql_row[5]);
- m->class=atoi(sql_row[6]);
+ m->class_=atoi(sql_row[6]);
m->lv=atoi(sql_row[7]);
m->exp=atoi(sql_row[8]);
m->exp_payper=atoi(sql_row[9]);
@@ -908,7 +908,7 @@ int mapif_guild_memberinfoshort(struct guild *g,int idx)
WBUFL(buf,10)=g->member[idx].char_id;
WBUFB(buf,14)=g->member[idx].online;
WBUFW(buf,15)=g->member[idx].lv;
- WBUFW(buf,17)=g->member[idx].class;
+ WBUFW(buf,17)=g->member[idx].class_;
mapif_sendall(buf,19);
return 0;
}
@@ -1283,7 +1283,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,
g->member[i].online=online;
g->member[i].lv=lv;
- g->member[i].class=class;
+ g->member[i].class_=class;
mapif_guild_memberinfoshort(g,i);
idx = i;
}
@@ -1303,7 +1303,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id,
if(mysql_query(&mysql_handle, tmp_sql) )
printf("DB server Error: %s - %s\n", tmp_sql, mysql_error(&mysql_handle) );
- sprintf(tmp_sql, "UPDATE `%s` SET `online`=%d,`lv`=%d,`class`=%d WHERE `char_id`=%d", guild_member_db, g->member[idx].online, g->member[idx].lv, g->member[idx].class, g->member[idx].char_id);
+ sprintf(tmp_sql, "UPDATE `%s` SET `online`=%d,`lv`=%d,`class`=%d WHERE `char_id`=%d", guild_member_db, g->member[idx].online, g->member[idx].lv, g->member[idx].class_, g->member[idx].char_id);
if(mysql_query(&mysql_handle, tmp_sql) )
printf("DB server Error: %s - %s\n", tmp_sql, mysql_error(&mysql_handle) );
diff --git a/src/char_sql/int_pet.c b/src/char_sql/int_pet.c
index 97548aeff..edad95f84 100644
--- a/src/char_sql/int_pet.c
+++ b/src/char_sql/int_pet.c
@@ -39,11 +39,11 @@ int inter_pet_tosql(int pet_id, struct s_pet *p) {
if (sql_res!=NULL && mysql_num_rows(sql_res)>0)
//row reside -> updating
sprintf(tmp_sql, "UPDATE `%s` SET `class`='%d',`name`='%s',`account_id`='%d',`char_id`='%d',`level`='%d',`egg_id`='%d',`equip`='%d',`intimate`='%d',`hungry`='%d',`rename_flag`='%d',`incuvate`='%d' WHERE `pet_id`='%d'",
- pet_db, p->class, t_name, p->account_id, p->char_id, p->level, p->egg_id,
+ pet_db, p->class_, t_name, p->account_id, p->char_id, p->level, p->egg_id,
p->equip, p->intimate, p->hungry, p->rename_flag, p->incuvate, p->pet_id);
else //no row -> insert
sprintf(tmp_sql,"INSERT INTO `%s` (`pet_id`, `class`,`name`,`account_id`,`char_id`,`level`,`egg_id`,`equip`,`intimate`,`hungry`,`rename_flag`,`incuvate`) VALUES ('%d', '%d', '%s', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
- pet_db, pet_id, p->class, t_name, p->account_id, p->char_id, p->level, p->egg_id,
+ pet_db, pet_id, p->class_, t_name, p->account_id, p->char_id, p->level, p->egg_id,
p->equip, p->intimate, p->hungry, p->rename_flag, p->incuvate);
mysql_free_result(sql_res) ; //resource free
if(mysql_query(&mysql_handle, tmp_sql) ) {
@@ -72,7 +72,7 @@ int inter_pet_fromsql(int pet_id, struct s_pet *p){
sql_row = mysql_fetch_row(sql_res);
p->pet_id = pet_id;
- p->class = atoi(sql_row[1]);
+ p->class_ = atoi(sql_row[1]);
memcpy(p->name, sql_row[2],24);
p->account_id = atoi(sql_row[3]);
p->char_id = atoi(sql_row[4]);
@@ -215,7 +215,7 @@ int mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short
pet_pt->account_id = account_id;
pet_pt->char_id = char_id;
}
- pet_pt->class = pet_class;
+ pet_pt->class_ = pet_class;
pet_pt->level = pet_lv;
pet_pt->egg_id = pet_egg_id;
pet_pt->equip = pet_equip;
diff --git a/src/common/db.c b/src/common/db.c
index 8996dda80..bc4e8451b 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -6,6 +6,7 @@
#include "db.h"
#include "mmo.h"
#include "utils.h"
+#include "malloc.h"
#ifdef MEMWATCH
#include "memwatch.h"
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 37cf2b9ee..440c3b2a3 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -284,7 +284,7 @@ static void decode_des_etc(BYTE *buf,int len,int type,int cycle)
* Grf data decode sub : zip
*------------------------------------------
*/
-int decode_zip(char *dest, unsigned long* destLen, const char* source, unsigned long sourceLen)
+int decode_zip(unsigned char *dest, unsigned long* destLen, const unsigned char* source, unsigned long sourceLen)
{
z_stream stream;
int err;
@@ -294,7 +294,7 @@ int decode_zip(char *dest, unsigned long* destLen, const char* source, unsigned
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
- stream.next_out = dest;
+ stream.next_out = (Bytef*) dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
@@ -315,7 +315,7 @@ int decode_zip(char *dest, unsigned long* destLen, const char* source, unsigned
return err;
}
-int encode_zip(char *dest, unsigned long* destLen, const char* source, unsigned long sourceLen) {
+int encode_zip(unsigned char *dest, unsigned long* destLen, const unsigned char* source, unsigned long sourceLen) {
z_stream stream;
int err;
@@ -324,7 +324,7 @@ int encode_zip(char *dest, unsigned long* destLen, const char* source, unsigned
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
- stream.next_out = dest;
+ stream.next_out = (Bytef*) dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
@@ -382,7 +382,7 @@ FILELIST *filelist_find(char *fname)
{
int hash;
- for(hash=filelist_hash[filehash(fname)];hash>=0;hash=filelist[hash].next) {
+ for(hash=filelist_hash[filehash((unsigned char *) fname)];hash>=0;hash=filelist[hash].next) {
if(strcmpi(filelist[hash].fn,fname)==0)
break;
}
@@ -421,7 +421,7 @@ static FILELIST* filelist_add(FILELIST *entry)
memcpy( &filelist[filelist_entrys], entry, sizeof(FILELIST) );
- hash = filehash(entry->fn);
+ hash = filehash((unsigned char *) entry->fn);
filelist[filelist_entrys].next = filelist_hash[hash];
filelist_hash[hash] = filelist_entrys;
@@ -576,7 +576,7 @@ void* grfio_reads(char *fname, int *size)
lentry.declen = ftell(in);
}
fseek(in,0,0); // SEEK_SET
- buf2 = calloc(lentry.declen+1024, 1);
+ buf2 = (unsigned char *) aCalloc(lentry.declen+1024, 1);
if (buf2==NULL) {
printf("file read memory allocate error : declen\n");
goto errret;
@@ -598,7 +598,7 @@ void* grfio_reads(char *fname, int *size)
}
}
if (entry!=NULL && entry->gentry>0) { // Archive[GRF] File Read
- buf = calloc(entry->srclen_aligned+1024, 1);
+ buf = (unsigned char *) aCalloc(entry->srclen_aligned+1024, 1);
if (buf==NULL) {
printf("file read memory allocate error : srclen_aligned\n");
goto errret;
@@ -614,7 +614,7 @@ void* grfio_reads(char *fname, int *size)
fseek(in,entry->srcpos,0);
fread(buf,1,entry->srclen_aligned,in);
fclose(in);
- buf2=calloc(entry->declen+1024, 1);
+ buf2 = (unsigned char *) aCalloc(entry->declen+1024, 1);
if (buf2==NULL) {
printf("file decode memory allocate error\n");
goto errret;
@@ -694,7 +694,7 @@ static int grfio_entryread(char *gfname,int gentry)
grf_size = ftell(fp);
fseek(fp,0,0); // SEEK_SET
fread(grf_header,1,0x2e,fp);
- if(strcmp(grf_header,"Master of Magic") || fseek(fp,getlong(grf_header+0x1e),1)){ // SEEK_CUR
+ if(strcmp((const char *) grf_header,"Master of Magic") || fseek(fp,getlong(grf_header+0x1e),1)){ // SEEK_CUR
fclose(fp);
printf("%s read error\n",gfname);
return 2; // 2:file format error
@@ -704,7 +704,7 @@ static int grfio_entryread(char *gfname,int gentry)
if (grf_version==0x01) { //****** Grf version 01xx ******
list_size = grf_size-ftell(fp);
- grf_filelist = calloc(list_size, 1);
+ grf_filelist = (unsigned char *) aCalloc(list_size, 1);
if(grf_filelist==NULL){
fclose(fp);
printf("out of memory : grf_filelist\n");
@@ -725,13 +725,13 @@ static int grfio_entryread(char *gfname,int gentry)
type = grf_filelist[ofs2+12];
if( type!=0 ){ // Directory Index ... skip
fname = decode_filename(grf_filelist+ofs+6,grf_filelist[ofs]-6);
- if(strlen(fname)>sizeof(aentry.fn)-1){
+ if(strlen((const char *) fname)>sizeof(aentry.fn)-1){
printf("file name too long : %s\n",fname);
free(grf_filelist);
exit(1);
}
srclen=0;
- if((period_ptr=strrchr(fname,'.'))!=NULL){
+ if((period_ptr=strrchr((const char *) fname,'.'))!=NULL){
for(lop=0;lop<4;lop++) {
if(strcmpi(period_ptr,".gnd\0.gat\0.act\0.str"+lop*5)==0)
break;
@@ -752,7 +752,7 @@ static int grfio_entryread(char *gfname,int gentry)
aentry.srcpos = getlong(grf_filelist+ofs2+13)+0x2e;
aentry.cycle = srccount;
aentry.type = type;
- strncpy(aentry.fn,fname,sizeof(aentry.fn)-1);
+ strncpy(aentry.fn, (const char *) fname,sizeof(aentry.fn)-1);
#ifdef GRFIO_LOCAL
aentry.gentry = -(gentry+1); // As Flag for making it a negative number carrying out the first time LocalFileCheck
#else
@@ -779,13 +779,13 @@ static int grfio_entryread(char *gfname,int gentry)
return 4;
}
- rBuf = calloc( rSize , 1); // Get a Read Size
+ rBuf = (unsigned char *) aCalloc( rSize , 1); // Get a Read Size
if (rBuf==NULL) {
fclose(fp);
printf("out of memory : grf compress entry table buffer\n");
return 3;
}
- grf_filelist = calloc( eSize , 1); // Get a Extend Size
+ grf_filelist = (unsigned char *) aCalloc( eSize , 1); // Get a Extend Size
if (grf_filelist==NULL) {
free(rBuf);
fclose(fp);
@@ -806,7 +806,7 @@ static int grfio_entryread(char *gfname,int gentry)
FILELIST aentry;
fname = grf_filelist+ofs;
- if (strlen(fname)>sizeof(aentry.fn)-1) {
+ if (strlen((const char *) fname)>sizeof(aentry.fn)-1) {
printf("grf : file name too long : %s\n",fname);
free(grf_filelist);
exit(1);
@@ -927,7 +927,7 @@ int grfio_add(char *fname)
}
}
len = strlen( fname );
- buf = calloc(len+1, 1);
+ buf = aCalloc(len+1, 1);
if (buf==NULL) {
printf("out of memory : gentry\n");
exit(1);
diff --git a/src/common/grfio.h b/src/common/grfio.h
index f39e9af1b..3fa257e2f 100644
--- a/src/common/grfio.h
+++ b/src/common/grfio.h
@@ -8,8 +8,8 @@ void* grfio_read(char*); // GRFIO data file read
void* grfio_reads(char*,int*); // GRFIO data file read & size get
int grfio_size(char*); // GRFIO data file size get
-int decode_zip(char *dest, unsigned long* destLen, const char* source, unsigned long sourceLen);
-int encode_zip(char *dest, unsigned long* destLen, const char* source, unsigned long sourceLen);
+int decode_zip(unsigned char *dest, unsigned long* destLen, const unsigned char* source, unsigned long sourceLen);
+int encode_zip(unsigned char *dest, unsigned long* destLen, const unsigned char* source, unsigned long sourceLen);
// Accessor to GRF filenames
char *grfio_setdatafile(const char *str);
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 617a870e9..41598509e 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -114,7 +114,7 @@ struct s_pet {
int account_id;
int char_id;
int pet_id;
- short class;
+ short class_;
short level;
short egg_id;//pet egg id
short equip;//pet equip name_id
@@ -132,7 +132,7 @@ struct mmo_charstatus {
int base_exp,job_exp,zeny;
- short class;
+ short class_;
short status_point,skill_point;
int hp,max_hp,sp,max_sp;
short option,karma,manner;
@@ -204,7 +204,7 @@ struct party {
struct guild_member {
int account_id, char_id;
- short hair,hair_color,gender,class,lv;
+ short hair,hair_color,gender,class_,lv;
int exp,exp_payper;
short online,position;
int rsv1,rsv2;
diff --git a/src/common/socket.c b/src/common/socket.c
index 729f2fdfe..5d7d0775e 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -200,8 +200,8 @@ static int connect_client(int listen_fd)
#endif
CREATE(session[fd], struct socket_data, 1);
- CREATE(session[fd]->rdata, char, rfifo_size);
- CREATE(session[fd]->wdata, char, wfifo_size);
+ CREATE(session[fd]->rdata, unsigned char, rfifo_size);
+ CREATE(session[fd]->wdata, unsigned char, wfifo_size);
session[fd]->max_rdata = rfifo_size;
session[fd]->max_wdata = wfifo_size;
@@ -339,8 +339,8 @@ int make_connection(long ip,int port)
FD_SET(fd,&readfds);
CREATE(session[fd], struct socket_data, 1);
- CREATE(session[fd]->rdata, char, rfifo_size);
- CREATE(session[fd]->wdata, char, wfifo_size);
+ CREATE(session[fd]->rdata, unsigned char, rfifo_size);
+ CREATE(session[fd]->wdata, unsigned char, wfifo_size);
session[fd]->max_rdata = rfifo_size;
session[fd]->max_wdata = wfifo_size;
@@ -374,11 +374,11 @@ int realloc_fifo(int fd,int rfifo_size,int wfifo_size)
{
struct socket_data *s=session[fd];
if( s->max_rdata != rfifo_size && s->rdata_size < rfifo_size){
- RECREATE(s->rdata, char, rfifo_size);
+ RECREATE(s->rdata, unsigned char, rfifo_size);
s->max_rdata = rfifo_size;
}
if( s->max_wdata != wfifo_size && s->wdata_size < wfifo_size){
- RECREATE(s->wdata, char, wfifo_size);
+ RECREATE(s->wdata, unsigned char, wfifo_size);
s->max_wdata = wfifo_size;
}
return 0;
diff --git a/src/common/socket.h b/src/common/socket.h
index 9b0c05013..e5e065f33 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -12,6 +12,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#endif
+#include "malloc.h"
// define declaration
diff --git a/src/common/strlib.c b/src/common/strlib.c
index b113d96f5..9114c3d03 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -4,6 +4,7 @@
#include "strlib.h"
#include "utils.h"
+#include "malloc.h"
//-----------------------------------------------
// string lib.
diff --git a/src/common/utils.h b/src/common/utils.h
index d234e9351..0ac880a50 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -27,11 +27,11 @@
#define CREATE(result, type, number) do {\
if ((number) * sizeof(type) <= 0) \
printf("SYSERR: Zero bytes or less requested at %s:%d.\n", __FILE__, __LINE__); \
- if (!((result) = (type *) calloc ((number), sizeof(type)))) \
+ if (!((result) = (type *) aCalloc ((number), sizeof(type)))) \
{ perror("SYSERR: malloc failure"); abort(); } } while(0)
#define RECREATE(result,type,number) do {\
- if (!((result) = (type *) realloc ((result), sizeof(type) * (number))))\
+ if (!((result) = (type *) aRealloc ((result), sizeof(type) * (number))))\
{ printf("SYSERR: realloc failure"); abort(); } } while(0)
struct StringBuf {
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 45b87a2f3..dc6c55777 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -831,7 +831,7 @@ static int atmobsearch_sub(struct block_list *bl,va_list ap)
md = (struct mob_data *)bl;
- if(md && fd && (mob_id==-1 || (md->class==mob_id))){
+ if(md && fd && (mob_id==-1 || (md->class_==mob_id))){
snprintf(output, sizeof output, "%2d[%3d:%3d] %s",
++number,bl->x, bl->y,md->name);
clif_displaymessage(fd, output);
@@ -1285,9 +1285,9 @@ int atcommand_who2(
player_name[j] = tolower(player_name[j]);
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
if (pl_GM_level > 0)
- sprintf(output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level);
+ sprintf(output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level);
else
- sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level);
+ sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level);
clif_displaymessage(fd, output);
count++;
}
@@ -1478,9 +1478,9 @@ int atcommand_whomap2(
if (!((battle_config.hide_GM_session || (pl_sd->status.option & OPTION_HIDE)) && (pl_GM_level > GM_level))) { // you can look only lower or same level
if (pl_sd->bl.m == map_id) {
if (pl_GM_level > 0)
- sprintf(output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level);
+ sprintf(output, "Name: %s (GM:%d) | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_GM_level, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level);
else
- sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level);
+ sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level);
clif_displaymessage(fd, output);
count++;
}
@@ -1621,7 +1621,7 @@ int atcommand_whogm(
if (strstr(player_name, match_text) != NULL) { // search with no case sensitive
sprintf(output, "Name: %s (GM:%d) | Location: %s %d %d", pl_sd->status.name, pl_GM_level, pl_sd->mapname, pl_sd->bl.x, pl_sd->bl.y);
clif_displaymessage(fd, output);
- sprintf(output, " BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level);
+ sprintf(output, " BLvl: %d | Job: %s (Lvl: %d)", pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level);
clif_displaymessage(fd, output);
g = guild_search(pl_sd->status.guild_id);
if (g == NULL)
@@ -1884,30 +1884,30 @@ int atcommand_option(
}
sd->status.option = param3;
// fix pecopeco display
- if (sd->status.class == 13 || sd->status.class == 21 || sd->status.class == 4014 || sd->status.class == 4022) {
+ if (sd->status.class_ == 13 || sd->status.class_ == 21 || sd->status.class_ == 4014 || sd->status.class_ == 4022) {
if (!pc_isriding(sd)) { // sd have the new value...
- if (sd->status.class == 13)
- sd->status.class = sd->view_class = 7;
- else if (sd->status.class == 21)
- sd->status.class = sd->view_class = 14;
- else if (sd->status.class == 4014)
- sd->status.class = sd->view_class = 4008;
- else if (sd->status.class == 4022)
- sd->status.class = sd->view_class = 4015;
+ if (sd->status.class_ == 13)
+ sd->status.class_ = sd->view_class = 7;
+ else if (sd->status.class_ == 21)
+ sd->status.class_ = sd->view_class = 14;
+ else if (sd->status.class_ == 4014)
+ sd->status.class_ = sd->view_class = 4008;
+ else if (sd->status.class_ == 4022)
+ sd->status.class_ = sd->view_class = 4015;
}
} else {
if (pc_isriding(sd)) { // sd have the new value...
if (sd->disguise > 0) { // temporary prevention of crash caused by peco + disguise, will look into a better solution [Valaris] (code added by [Yor])
sd->status.option &= ~0x0020;
} else {
- if (sd->status.class == 7)
- sd->status.class = sd->view_class = 13;
- else if (sd->status.class == 14)
- sd->status.class = sd->view_class = 21;
- else if (sd->status.class == 4008)
- sd->status.class = sd->view_class = 4014;
- else if (sd->status.class == 4015)
- sd->status.class = sd->view_class = 4022;
+ if (sd->status.class_ == 7)
+ sd->status.class_ = sd->view_class = 13;
+ else if (sd->status.class_ == 14)
+ sd->status.class_ = sd->view_class = 21;
+ else if (sd->status.class_ == 4008)
+ sd->status.class_ = sd->view_class = 4014;
+ else if (sd->status.class_ == 4015)
+ sd->status.class_ = sd->view_class = 4022;
else
sd->status.option &= ~0x0020;
}
@@ -2049,14 +2049,14 @@ int atcommand_jobchange(
// fix pecopeco display
if ((job != 13 && job != 21 && job != 4014 && job != 4022)) {
if (pc_isriding(sd)) {
- if (sd->status.class == 13)
- sd->status.class = sd->view_class = 7;
- if (sd->status.class == 21)
- sd->status.class = sd->view_class = 14;
- if (sd->status.class == 4014)
- sd->status.class = sd->view_class = 4008;
- if (sd->status.class == 4022)
- sd->status.class = sd->view_class = 4015;
+ if (sd->status.class_ == 13)
+ sd->status.class_ = sd->view_class = 7;
+ if (sd->status.class_ == 21)
+ sd->status.class_ = sd->view_class = 14;
+ if (sd->status.class_ == 4014)
+ sd->status.class_ = sd->view_class = 4008;
+ if (sd->status.class_ == 4022)
+ sd->status.class_ = sd->view_class = 4015;
sd->status.option &= ~0x0020;
clif_changeoption(&sd->bl);
pc_calcstatus(sd, 0);
@@ -2280,9 +2280,9 @@ int atcommand_item(
for (i = 0; i < number; i += get_count) {
// if pet egg
if (pet_id >= 0) {
- sd->catch_target_class = pet_db[pet_id].class;
+ sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(sd->status.account_id, sd->status.char_id,
- pet_db[pet_id].class, mob_db[pet_db[pet_id].class].lv,
+ pet_db[pet_id].class_, mob_db[pet_db[pet_id].class_].lv,
pet_db[pet_id].EggID, 0, pet_db[pet_id].intimate,
100, 0, 1, pet_db[pet_id].jname);
// if not pet egg
@@ -2480,7 +2480,7 @@ int atcommand_joblevelup(
int up_level = 50, level;
struct pc_base_job s_class;
nullpo_retr(-1, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
if (!message || !*message || (level = atoi(message)) == 0) {
clif_displaymessage(fd, "Please, enter a level adjustement (usage: @joblvup/@jlevel/@joblvlup <number of levels>).");
@@ -2492,7 +2492,7 @@ int atcommand_joblevelup(
// super novices can go up to 99 [celest]
else if (s_class.job == 23)
up_level += 49;
- else if (sd->status.class > 4007 && sd->status.class < 4023)
+ else if (sd->status.class_ > 4007 && sd->status.class_ < 4023)
up_level += 20;
if (level > 0) {
@@ -2748,7 +2748,7 @@ int atcommand_model(
hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR &&
cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) {
//服の色変更
- if (cloth_color != 0 && sd->status.sex == 1 && (sd->status.class == 12 || sd->status.class == 17)) {
+ if (cloth_color != 0 && sd->status.sex == 1 && (sd->status.class_ == 12 || sd->status.class_ == 17)) {
//服の色未実装職の判定
clif_displaymessage(fd, msg_table[35]); // You can't use this command with this class.
return -1;
@@ -2814,7 +2814,7 @@ int atcommand_hair_style(const int fd, struct map_session_data* sd, const char*
}
if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) {
- if (hair_style != 0 && sd->status.sex == 1 && (sd->status.class == 12 || sd->status.class == 17)) {
+ if (hair_style != 0 && sd->status.sex == 1 && (sd->status.class_ == 12 || sd->status.class_ == 17)) {
clif_displaymessage(fd, msg_table[35]); // You can't use this command with this class.
return -1;
} else {
@@ -2860,7 +2860,7 @@ int atcommand_hair_color(const int fd, struct map_session_data* sd, const char*
}
if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) {
- if (hair_color != 0 && sd->status.sex == 1 && (sd->status.class == 12 || sd->status.class == 17)) {
+ if (hair_color != 0 && sd->status.sex == 1 && (sd->status.class_ == 12 || sd->status.class_ == 17)) {
clif_displaymessage(fd, msg_table[35]); // You can't use this command with this class.
return -1;
} else {
@@ -3976,10 +3976,10 @@ int atcommand_makeegg(
if (pet_id < 0)
pet_id = search_petDB_index(id, PET_EGG);
if (pet_id >= 0) {
- sd->catch_target_class = pet_db[pet_id].class;
+ sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(
sd->status.account_id, sd->status.char_id,
- pet_db[pet_id].class, mob_db[pet_db[pet_id].class].lv,
+ pet_db[pet_id].class_, mob_db[pet_db[pet_id].class_].lv,
pet_db[pet_id].EggID, 0, pet_db[pet_id].intimate,
100, 0, 1, pet_db[pet_id].jname);
} else {
@@ -4711,14 +4711,14 @@ int atcommand_character_joblevel(
}
if ((pl_sd = map_nick2sd(character)) != NULL) {
- pl_s_class = pc_calc_base_job(pl_sd->status.class);
+ pl_s_class = pc_calc_base_job(pl_sd->status.class_);
if (pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can change job level only lower or same gm level
if (pl_s_class.job == 0)
max_level -= 40;
// super novices can go up to 99 [celest]
else if (pl_s_class.job == 23)
max_level += 49;
- else if (pl_sd->status.class > 4007 && pl_sd->status.class < 4023)
+ else if (pl_sd->status.class_ > 4007 && pl_sd->status.class_ < 4023)
max_level += 20;
if (level > 0) {
@@ -5316,7 +5316,7 @@ int atcommand_charmodel(
if (cloth_color != 0 &&
pl_sd->status.sex == 1 &&
- (pl_sd->status.class == 12 || pl_sd->status.class == 17)) {
+ (pl_sd->status.class_ == 12 || pl_sd->status.class_ == 17)) {
clif_displaymessage(fd, msg_table[35]); // You can't use this command with this class.
return -1;
} else {
@@ -5782,7 +5782,7 @@ int atcommand_mapinfo(
default: strcpy(direction, "Unknown"); break;
}
sprintf(output, "NPC %d: %s | Direction: %s | Sprite: %d | Location: %d %d",
- ++i, nd->name, direction, nd->class, nd->bl.x, nd->bl.y);
+ ++i, nd->name, direction, nd->class_, nd->bl.x, nd->bl.y);
clif_displaymessage(fd, output);
}
break;
@@ -5826,15 +5826,15 @@ int atcommand_mount_peco(
}
if (!pc_isriding(sd)) { // if actually no peco
- if (sd->status.class == 7 || sd->status.class == 14 || sd->status.class == 4008 || sd->status.class == 4015) {
- if (sd->status.class == 7)
- sd->status.class = sd->view_class = 13;
- else if (sd->status.class == 14)
- sd->status.class = sd->view_class = 21;
- else if (sd->status.class == 4008)
- sd->status.class = sd->view_class = 4014;
- else if (sd->status.class == 4015)
- sd->status.class = sd->view_class = 4022;
+ if (sd->status.class_ == 7 || sd->status.class_ == 14 || sd->status.class_ == 4008 || sd->status.class_ == 4015) {
+ if (sd->status.class_ == 7)
+ sd->status.class_ = sd->view_class = 13;
+ else if (sd->status.class_ == 14)
+ sd->status.class_ = sd->view_class = 21;
+ else if (sd->status.class_ == 4008)
+ sd->status.class_ = sd->view_class = 4014;
+ else if (sd->status.class_ == 4015)
+ sd->status.class_ = sd->view_class = 4022;
pc_setoption(sd, sd->status.option | 0x0020);
clif_displaymessage(fd, msg_table[102]); // Mounted Peco.
} else {
@@ -5842,14 +5842,14 @@ int atcommand_mount_peco(
return -1;
}
} else {
- if (sd->status.class == 13)
- sd->status.class = sd->view_class = 7;
- else if (sd->status.class == 21)
- sd->status.class = sd->view_class = 14;
- else if (sd->status.class == 4014)
- sd->status.class = sd->view_class = 4008;
- else if (sd->status.class == 4022)
- sd->status.class = sd->view_class = 4015;
+ if (sd->status.class_ == 13)
+ sd->status.class_ = sd->view_class = 7;
+ else if (sd->status.class_ == 21)
+ sd->status.class_ = sd->view_class = 14;
+ else if (sd->status.class_ == 4014)
+ sd->status.class_ = sd->view_class = 4008;
+ else if (sd->status.class_ == 4022)
+ sd->status.class_ = sd->view_class = 4015;
pc_setoption(sd, sd->status.option & ~0x0020);
clif_displaymessage(fd, msg_table[214]); // Unmounted Peco.
}
@@ -5883,15 +5883,15 @@ int atcommand_char_mount_peco(
}
if (!pc_isriding(pl_sd)) { // if actually no peco
- if (pl_sd->status.class == 7 || pl_sd->status.class == 14 || pl_sd->status.class == 4008 || pl_sd->status.class == 4015) {
- if (pl_sd->status.class == 7)
- pl_sd->status.class = pl_sd->view_class = 13;
- else if (pl_sd->status.class == 14)
- pl_sd->status.class = pl_sd->view_class = 21;
- else if (pl_sd->status.class == 4008)
- pl_sd->status.class = pl_sd->view_class = 4014;
- else if (pl_sd->status.class == 4015)
- pl_sd->status.class = pl_sd->view_class = 4022;
+ if (pl_sd->status.class_ == 7 || pl_sd->status.class_ == 14 || pl_sd->status.class_ == 4008 || pl_sd->status.class_ == 4015) {
+ if (pl_sd->status.class_ == 7)
+ pl_sd->status.class_ = pl_sd->view_class = 13;
+ else if (pl_sd->status.class_ == 14)
+ pl_sd->status.class_ = pl_sd->view_class = 21;
+ else if (pl_sd->status.class_ == 4008)
+ pl_sd->status.class_ = pl_sd->view_class = 4014;
+ else if (pl_sd->status.class_ == 4015)
+ pl_sd->status.class_ = pl_sd->view_class = 4022;
pc_setoption(pl_sd, pl_sd->status.option | 0x0020);
clif_displaymessage(fd, msg_table[216]); // Now, this player mounts a peco.
} else {
@@ -5899,14 +5899,14 @@ int atcommand_char_mount_peco(
return -1;
}
} else {
- if (pl_sd->status.class == 13)
- pl_sd->status.class = pl_sd->view_class = 7;
- else if (pl_sd->status.class == 21)
- pl_sd->status.class = pl_sd->view_class = 14;
- else if (pl_sd->status.class == 4014)
- pl_sd->status.class = pl_sd->view_class = 4008;
- else if (pl_sd->status.class == 4022)
- pl_sd->status.class = pl_sd->view_class = 4015;
+ if (pl_sd->status.class_ == 13)
+ pl_sd->status.class_ = pl_sd->view_class = 7;
+ else if (pl_sd->status.class_ == 21)
+ pl_sd->status.class_ = pl_sd->view_class = 14;
+ else if (pl_sd->status.class_ == 4014)
+ pl_sd->status.class_ = pl_sd->view_class = 4008;
+ else if (pl_sd->status.class_ == 4022)
+ pl_sd->status.class_ = pl_sd->view_class = 4015;
pc_setoption(pl_sd, pl_sd->status.option & ~0x0020);
clif_displaymessage(fd, msg_table[218]); // Now, this player has not more peco.
}
@@ -7175,7 +7175,7 @@ atcommand_skilltree(const int fd, struct map_session_data* sd,
if((pl_sd=map_nick2sd(target)) == NULL)
return -1;
- s_class = pc_calc_base_job(pl_sd->status.class);
+ s_class = pc_calc_base_job(pl_sd->status.class_);
c = s_class.job;
s = s_class.upper;
@@ -7620,7 +7620,7 @@ atcommand_summon(
if((md=(struct mob_data *)map_id2bl(id))){
md->master_id=sd->bl.id;
md->state.special_mob_ai=1;
- md->mode=mob_db[md->class].mode|0x04;
+ md->mode=mob_db[md->class_].mode|0x04;
md->deletetimer=add_timer(tick+60000,mob_timer_delete,id,0);
clif_misceffect2(&md->bl,344);
}
@@ -7894,7 +7894,7 @@ atcommand_petid(const int fd, struct map_session_data* sd,
strcpy(temp0,pet_db[i].jname);
strcpy(temp0, estr_lower(temp1));
if (strstr(temp1, searchtext) || strstr(temp0, searchtext) ) {
- snprintf(temp0, sizeof(temp0), "ID: %i -- Name: %s", pet_db[i].class,
+ snprintf(temp0, sizeof(temp0), "ID: %i -- Name: %s", pet_db[i].class_,
pet_db[i].jname);
if (cnt >= 100) { // Only if there are custom pets
clif_displaymessage(fd, "Be more specific, can't send more than"
diff --git a/src/map/battle.c b/src/map/battle.c
index 1d699bd10..f59c179b5 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -64,11 +64,11 @@ int battle_get_class(struct block_list *bl)
{
nullpo_retr(0, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return ((struct mob_data *)bl)->class;
+ return ((struct mob_data *)bl)->class_;
else if(bl->type==BL_PC && (struct map_session_data *)bl)
- return ((struct map_session_data *)bl)->status.class;
+ return ((struct map_session_data *)bl)->status.class_;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- return ((struct pet_data *)bl)->class;
+ return ((struct pet_data *)bl)->class_;
else
return 0;
}
@@ -115,11 +115,11 @@ int battle_get_range(struct block_list *bl)
{
nullpo_retr(0, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return mob_db[((struct mob_data *)bl)->class].range;
+ return mob_db[((struct mob_data *)bl)->class_].range;
else if(bl->type==BL_PC && (struct map_session_data *)bl)
return ((struct map_session_data *)bl)->attackrange;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- return mob_db[((struct pet_data *)bl)->class].range;
+ return mob_db[((struct pet_data *)bl)->class_].range;
else
return 0;
}
@@ -152,10 +152,10 @@ int battle_get_max_hp(struct block_list *bl)
struct status_change *sc_data=battle_get_sc_data(bl);
int max_hp=1;
if(bl->type==BL_MOB && ((struct mob_data*)bl)) {
- max_hp = mob_db[((struct mob_data*)bl)->class].max_hp;
+ max_hp = mob_db[((struct mob_data*)bl)->class_].max_hp;
if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris]
- max_hp+=(((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv)*battle_get_vit(bl);
- if(mob_db[((struct mob_data*)bl)->class].mexp > 0) {
+ max_hp+=(((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv)*battle_get_vit(bl);
+ if(mob_db[((struct mob_data*)bl)->class_].mexp > 0) {
if(battle_config.mvp_hp_rate != 100)
max_hp = (max_hp * battle_config.mvp_hp_rate)/100;
}
@@ -165,8 +165,8 @@ int battle_get_max_hp(struct block_list *bl)
}
}
else if(bl->type==BL_PET && ((struct pet_data*)bl)) {
- max_hp = mob_db[((struct pet_data*)bl)->class].max_hp;
- if(mob_db[((struct pet_data*)bl)->class].mexp > 0) {
+ max_hp = mob_db[((struct pet_data*)bl)->class_].max_hp;
+ if(mob_db[((struct pet_data*)bl)->class_].mexp > 0) {
if(battle_config.mvp_hp_rate != 100)
max_hp = (max_hp * battle_config.mvp_hp_rate)/100;
}
@@ -198,14 +198,14 @@ int battle_get_str(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_MOB && ((struct mob_data *)bl)) {
- str = mob_db[((struct mob_data *)bl)->class].str;
+ str = mob_db[((struct mob_data *)bl)->class_].str;
if(battle_config.mobs_level_up) // mobs leveling up increase [Valaris]
- str+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ str+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PC && ((struct map_session_data *)bl))
return ((struct map_session_data *)bl)->paramc[0];
else if(bl->type==BL_PET && ((struct pet_data *)bl))
- str = mob_db[((struct pet_data *)bl)->class].str;
+ str = mob_db[((struct pet_data *)bl)->class_].str;
if(sc_data) {
if(sc_data[SC_LOUD].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC)
@@ -235,14 +235,14 @@ int battle_get_agi(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_MOB && (struct mob_data *)bl) {
- agi=mob_db[((struct mob_data *)bl)->class].agi;
+ agi=mob_db[((struct mob_data *)bl)->class_].agi;
if(battle_config.mobs_level_up) // increase of mobs leveling up [Valaris]
- agi+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ agi+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PC && (struct map_session_data *)bl)
agi=((struct map_session_data *)bl)->paramc[1];
else if(bl->type==BL_PET && (struct pet_data *)bl)
- agi=mob_db[((struct pet_data *)bl)->class].agi;
+ agi=mob_db[((struct pet_data *)bl)->class_].agi;
if(sc_data) {
if( sc_data[SC_INCREASEAGI].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1 &&
@@ -280,14 +280,14 @@ int battle_get_vit(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_MOB && (struct mob_data *)bl) {
- vit=mob_db[((struct mob_data *)bl)->class].vit;
+ vit=mob_db[((struct mob_data *)bl)->class_].vit;
if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
- vit+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ vit+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PC && (struct map_session_data *)bl)
vit=((struct map_session_data *)bl)->paramc[2];
else if(bl->type==BL_PET && (struct pet_data *)bl)
- vit=mob_db[((struct pet_data *)bl)->class].vit;
+ vit=mob_db[((struct pet_data *)bl)->class_].vit;
if(sc_data) {
if(sc_data[SC_STRIPARMOR].timer != -1 && bl->type!=BL_PC)
vit = vit*60/100;
@@ -311,14 +311,14 @@ int battle_get_int(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_MOB && (struct mob_data *)bl){
- int_=mob_db[((struct mob_data *)bl)->class].int_;
+ int_=mob_db[((struct mob_data *)bl)->class_].int_;
if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
- int_+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ int_+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PC && (struct map_session_data *)bl)
int_=((struct map_session_data *)bl)->paramc[3];
else if(bl->type==BL_PET && (struct pet_data *)bl)
- int_=mob_db[((struct pet_data *)bl)->class].int_;
+ int_=mob_db[((struct pet_data *)bl)->class_].int_;
if(sc_data) {
if( sc_data[SC_BLESSING].timer != -1 && bl->type != BL_PC){ // ブレッシング
@@ -347,14 +347,14 @@ int battle_get_dex(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_MOB && (struct mob_data *)bl) {
- dex=mob_db[((struct mob_data *)bl)->class].dex;
+ dex=mob_db[((struct mob_data *)bl)->class_].dex;
if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
- dex+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ dex+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PC && (struct map_session_data *)bl)
dex=((struct map_session_data *)bl)->paramc[4];
else if(bl->type==BL_PET && (struct pet_data *)bl)
- dex=mob_db[((struct pet_data *)bl)->class].dex;
+ dex=mob_db[((struct pet_data *)bl)->class_].dex;
if(sc_data) {
if(sc_data[SC_CONCENTRATE].timer!=-1 && sc_data[SC_QUAGMIRE].timer == -1 && bl->type != BL_PC)
@@ -391,14 +391,14 @@ int battle_get_luk(struct block_list *bl)
nullpo_retr(0, bl);
sc_data=battle_get_sc_data(bl);
if(bl->type==BL_MOB && (struct mob_data *)bl) {
- luk=mob_db[((struct mob_data *)bl)->class].luk;
+ luk=mob_db[((struct mob_data *)bl)->class_].luk;
if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
- luk+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ luk+=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PC && (struct map_session_data *)bl)
luk=((struct map_session_data *)bl)->paramc[5];
else if(bl->type==BL_PET && (struct pet_data *)bl)
- luk=mob_db[((struct pet_data *)bl)->class].luk;
+ luk=mob_db[((struct pet_data *)bl)->class_].luk;
if(sc_data) {
if(sc_data[SC_GLORIA].timer!=-1 && bl->type != BL_PC) // グロリア(PCはpc.cで)
@@ -580,9 +580,9 @@ int battle_get_atk(struct block_list *bl)
if(bl->type==BL_PC && (struct map_session_data *)bl)
atk = ((struct map_session_data*)bl)->watk;
else if(bl->type==BL_MOB && (struct mob_data *)bl)
- atk = mob_db[((struct mob_data*)bl)->class].atk1;
+ atk = mob_db[((struct mob_data*)bl)->class_].atk1;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- atk = mob_db[((struct pet_data*)bl)->class].atk1;
+ atk = mob_db[((struct pet_data*)bl)->class_].atk1;
if(sc_data) {
if(sc_data[SC_PROVOKE].timer!=-1 && bl->type != BL_PC)
@@ -627,9 +627,9 @@ int battle_get_atk2(struct block_list *bl)
struct status_change *sc_data=battle_get_sc_data(bl);
int atk2=0;
if(bl->type==BL_MOB && (struct mob_data *)bl)
- atk2 = mob_db[((struct mob_data*)bl)->class].atk2;
+ atk2 = mob_db[((struct mob_data*)bl)->class_].atk2;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- atk2 = mob_db[((struct pet_data*)bl)->class].atk2;
+ atk2 = mob_db[((struct pet_data*)bl)->class_].atk2;
if(sc_data) {
if( sc_data[SC_IMPOSITIO].timer!=-1)
atk2 += sc_data[SC_IMPOSITIO].val1*5;
@@ -746,12 +746,12 @@ int battle_get_def(struct block_list *bl)
skillid = ((struct map_session_data *)bl)->skillid;
}
else if(bl->type==BL_MOB && (struct mob_data *)bl) {
- def = mob_db[((struct mob_data *)bl)->class].def;
+ def = mob_db[((struct mob_data *)bl)->class_].def;
skilltimer = ((struct mob_data *)bl)->skilltimer;
skillid = ((struct mob_data *)bl)->skillid;
}
else if(bl->type==BL_PET && (struct pet_data *)bl)
- def = mob_db[((struct pet_data *)bl)->class].def;
+ def = mob_db[((struct pet_data *)bl)->class_].def;
if(def < 1000000) {
if(sc_data) {
@@ -808,9 +808,9 @@ int battle_get_mdef(struct block_list *bl)
if(bl->type==BL_PC && (struct map_session_data *)bl)
mdef = ((struct map_session_data *)bl)->mdef;
else if(bl->type==BL_MOB && (struct mob_data *)bl)
- mdef = mob_db[((struct mob_data *)bl)->class].mdef;
+ mdef = mob_db[((struct mob_data *)bl)->class_].mdef;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- mdef = mob_db[((struct pet_data *)bl)->class].mdef;
+ mdef = mob_db[((struct pet_data *)bl)->class_].mdef;
if(mdef < 1000000) {
if(sc_data) {
@@ -842,9 +842,9 @@ int battle_get_def2(struct block_list *bl)
if(bl->type==BL_PC)
def2 = ((struct map_session_data *)bl)->def2;
else if(bl->type==BL_MOB)
- def2 = mob_db[((struct mob_data *)bl)->class].vit;
+ def2 = mob_db[((struct mob_data *)bl)->class_].vit;
else if(bl->type==BL_PET)
- def2 = mob_db[((struct pet_data *)bl)->class].vit;
+ def2 = mob_db[((struct pet_data *)bl)->class_].vit;
if(sc_data) {
if( sc_data[SC_ANGELUS].timer!=-1 && bl->type != BL_PC)
@@ -872,11 +872,11 @@ int battle_get_mdef2(struct block_list *bl)
nullpo_retr(0, bl);
if(bl->type==BL_MOB)
- mdef2 = mob_db[((struct mob_data *)bl)->class].int_ + (mob_db[((struct mob_data *)bl)->class].vit>>1);
+ mdef2 = mob_db[((struct mob_data *)bl)->class_].int_ + (mob_db[((struct mob_data *)bl)->class_].vit>>1);
else if(bl->type==BL_PC)
mdef2 = ((struct map_session_data *)bl)->mdef2 + (((struct map_session_data *)bl)->paramc[2]>>1);
else if(bl->type==BL_PET)
- mdef2 = mob_db[((struct pet_data *)bl)->class].int_ + (mob_db[((struct pet_data *)bl)->class].vit>>1);
+ mdef2 = mob_db[((struct pet_data *)bl)->class_].int_ + (mob_db[((struct pet_data *)bl)->class_].vit>>1);
if(sc_data) {
if( sc_data[SC_MINDBREAKER].timer!=-1 && bl->type != BL_PC)
mdef2 -= (mdef2*6*sc_data[SC_MINDBREAKER].val1)/100;
@@ -901,7 +901,7 @@ int battle_get_speed(struct block_list *bl)
if(bl->type==BL_MOB && (struct mob_data *)bl) {
speed = ((struct mob_data *)bl)->speed;
if(battle_config.mobs_level_up) // increase from mobs leveling up [Valaris]
- speed-=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class].lv;
+ speed-=((struct mob_data *)bl)->level - mob_db[((struct mob_data *)bl)->class_].lv;
}
else if(bl->type==BL_PET && (struct pet_data *)bl)
speed = ((struct pet_data *)bl)->msd->petDB->speed;
@@ -960,9 +960,9 @@ int battle_get_adelay(struct block_list *bl)
struct status_change *sc_data=battle_get_sc_data(bl);
int adelay=4000,aspd_rate = 100,i;
if(bl->type==BL_MOB && (struct mob_data *)bl)
- adelay = mob_db[((struct mob_data *)bl)->class].adelay;
+ adelay = mob_db[((struct mob_data *)bl)->class_].adelay;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- adelay = mob_db[((struct pet_data *)bl)->class].adelay;
+ adelay = mob_db[((struct pet_data *)bl)->class_].adelay;
if(sc_data) {
//ツーハンドクイッケン使用時でクァグマイアでも私を忘れないで…でもない時は3割減算
@@ -1016,9 +1016,9 @@ int battle_get_amotion(struct block_list *bl)
struct status_change *sc_data=battle_get_sc_data(bl);
int amotion=2000,aspd_rate = 100,i;
if(bl->type==BL_MOB && (struct mob_data *)bl)
- amotion = mob_db[((struct mob_data *)bl)->class].amotion;
+ amotion = mob_db[((struct mob_data *)bl)->class_].amotion;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- amotion = mob_db[((struct pet_data *)bl)->class].amotion;
+ amotion = mob_db[((struct pet_data *)bl)->class_].amotion;
if(sc_data) {
if(sc_data[SC_TWOHANDQUICKEN].timer != -1 && sc_data[SC_QUAGMIRE].timer == -1 && sc_data[SC_DONTFORGETME].timer == -1) // 2HQ
@@ -1061,7 +1061,7 @@ int battle_get_dmotion(struct block_list *bl)
nullpo_retr(0, bl);
sc_data = battle_get_sc_data(bl);
if(bl->type==BL_MOB && (struct mob_data *)bl){
- ret=mob_db[((struct mob_data *)bl)->class].dmotion;
+ ret=mob_db[((struct mob_data *)bl)->class_].dmotion;
if(battle_config.monster_damage_delay_rate != 100)
ret = ret*battle_config.monster_damage_delay_rate/400;
}
@@ -1071,7 +1071,7 @@ int battle_get_dmotion(struct block_list *bl)
ret = ret*battle_config.pc_damage_delay_rate/400;
}
else if(bl->type==BL_PET && (struct pet_data *)bl)
- ret=mob_db[((struct pet_data *)bl)->class].dmotion;
+ ret=mob_db[((struct pet_data *)bl)->class_].dmotion;
else
return 2000;
@@ -1093,7 +1093,7 @@ int battle_get_element(struct block_list *bl)
else if(bl->type==BL_PC && (struct map_session_data *)bl)
ret=20+((struct map_session_data *)bl)->def_ele; // 防御属性Lv1
else if(bl->type==BL_PET && (struct pet_data *)bl)
- ret = mob_db[((struct pet_data *)bl)->class].element;
+ ret = mob_db[((struct pet_data *)bl)->class_].element;
if(sc_data) {
if( sc_data[SC_BENEDICTIO].timer!=-1 ) // 聖体降福
@@ -1183,7 +1183,7 @@ int battle_get_guild_id(struct block_list *bl)
if(bl->type==BL_PC && (struct map_session_data *)bl)
return ((struct map_session_data *)bl)->status.guild_id;
else if(bl->type==BL_MOB && (struct mob_data *)bl)
- return ((struct mob_data *)bl)->class;
+ return ((struct mob_data *)bl)->class_;
else if(bl->type==BL_SKILL && (struct skill_unit *)bl)
return ((struct skill_unit *)bl)->group->guild_id;
else
@@ -1193,11 +1193,11 @@ int battle_get_race(struct block_list *bl)
{
nullpo_retr(0, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return mob_db[((struct mob_data *)bl)->class].race;
+ return mob_db[((struct mob_data *)bl)->class_].race;
else if(bl->type==BL_PC && (struct map_session_data *)bl)
return 7;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- return mob_db[((struct pet_data *)bl)->class].race;
+ return mob_db[((struct pet_data *)bl)->class_].race;
else
return 0;
}
@@ -1205,11 +1205,11 @@ int battle_get_size(struct block_list *bl)
{
nullpo_retr(1, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return mob_db[((struct mob_data *)bl)->class].size;
+ return mob_db[((struct mob_data *)bl)->class_].size;
else if(bl->type==BL_PC && (struct map_session_data *)bl)
return 1;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- return mob_db[((struct pet_data *)bl)->class].size;
+ return mob_db[((struct pet_data *)bl)->class_].size;
else
return 1;
}
@@ -1217,9 +1217,9 @@ int battle_get_mode(struct block_list *bl)
{
nullpo_retr(0x01, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return mob_db[((struct mob_data *)bl)->class].mode;
+ return mob_db[((struct mob_data *)bl)->class_].mode;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- return mob_db[((struct pet_data *)bl)->class].mode;
+ return mob_db[((struct pet_data *)bl)->class_].mode;
else
return 0x01; // とりあえず動くということで1
}
@@ -1228,9 +1228,9 @@ int battle_get_mexp(struct block_list *bl)
{
nullpo_retr(0, bl);
if(bl->type==BL_MOB && (struct mob_data *)bl)
- return mob_db[((struct mob_data *)bl)->class].mexp;
+ return mob_db[((struct mob_data *)bl)->class_].mexp;
else if(bl->type==BL_PET && (struct pet_data *)bl)
- return mob_db[((struct pet_data *)bl)->class].mexp;
+ return mob_db[((struct pet_data *)bl)->class_].mexp;
else
return 0;
}
@@ -1914,7 +1914,7 @@ static struct Damage battle_calc_pet_weapon_attack(
atkmin = battle_get_atk(src);
atkmax = battle_get_atk2(src);
}
- if(mob_db[pd->class].range>3 )
+ if(mob_db[pd->class_].range>3 )
flag=(flag&~BF_RANGEMASK)|BF_LONG;
if(atkmin > atkmax) atkmin = atkmax;
@@ -2375,7 +2375,7 @@ static struct Damage battle_calc_mob_weapon_attack(
atkmin = battle_get_atk(src);
atkmax = battle_get_atk2(src);
}
- if(mob_db[md->class].range>3 )
+ if(mob_db[md->class_].range>3 )
flag=(flag&~BF_RANGEMASK)|BF_LONG;
if(atkmin > atkmax) atkmin = atkmax;
@@ -2722,12 +2722,12 @@ static struct Damage battle_calc_mob_weapon_attack(
int cardfix=100,i;
cardfix=cardfix*(100-tsd->subele[s_ele])/100; // 属 性によるダメージ耐性
cardfix=cardfix*(100-tsd->subrace[s_race])/100; // 種族によるダメージ耐性
- if(mob_db[md->class].mode & 0x20)
+ if(mob_db[md->class_].mode & 0x20)
cardfix=cardfix*(100-tsd->subrace[10])/100;
else
cardfix=cardfix*(100-tsd->subrace[11])/100;
for(i=0;i<tsd->add_def_class_count;i++) {
- if(tsd->add_def_classid[i] == md->class) {
+ if(tsd->add_def_classid[i] == md->class_) {
cardfix=cardfix*(100-tsd->add_def_classrate[i])/100;
break;
}
@@ -3798,7 +3798,7 @@ static struct Damage battle_calc_pc_weapon_attack(
cardfix=cardfix*(100-tsd->subrace[11])/100; //ボス以外からの攻撃はダメージ減少
//特定Class用補正処理左手(少女の日記→ボンゴン用?)
for(i=0;i<tsd->add_def_class_count;i++) {
- if(tsd->add_def_classid[i] == sd->status.class) {
+ if(tsd->add_def_classid[i] == sd->status.class_) {
cardfix=cardfix*(100-tsd->add_def_classrate[i])/100;
break;
}
@@ -4984,7 +4984,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if(su && su->group->target_flag==BCT_NOENEMY)
return 1;
else if (battle_config.pk_mode &&
- (((struct map_session_data*)ss)->status.class==0 || ((struct map_session_data*)target)->status.class==0 ||
+ (((struct map_session_data*)ss)->status.class_==0 || ((struct map_session_data*)target)->status.class_==0 ||
((struct map_session_data*)ss)->status.base_level < battle_config.pk_min_level ||
((struct map_session_data*)target)->status.base_level < battle_config.pk_min_level))
return 1; // prevent novice engagement in pk_mode [Valaris]
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index f8e3be983..1ced08777 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -309,14 +309,14 @@ int charcommand_jobchange(
// fix pecopeco display
if ((job != 13 && job != 21 && job != 4014 && job != 4022)) {
if (pc_isriding(sd)) {
- if (pl_sd->status.class == 13)
- pl_sd->status.class = pl_sd->view_class = 7;
- if (pl_sd->status.class == 21)
- pl_sd->status.class = pl_sd->view_class = 14;
- if (pl_sd->status.class == 4014)
- pl_sd->status.class = pl_sd->view_class = 4008;
- if (pl_sd->status.class == 4022)
- pl_sd->status.class = pl_sd->view_class = 4015;
+ if (pl_sd->status.class_ == 13)
+ pl_sd->status.class_ = pl_sd->view_class = 7;
+ if (pl_sd->status.class_ == 21)
+ pl_sd->status.class_ = pl_sd->view_class = 14;
+ if (pl_sd->status.class_ == 4014)
+ pl_sd->status.class_ = pl_sd->view_class = 4008;
+ if (pl_sd->status.class_ == 4022)
+ pl_sd->status.class_ = pl_sd->view_class = 4015;
pl_sd->status.option &= ~0x0020;
clif_changeoption(&pl_sd->bl);
pc_calcstatus(pl_sd, 0);
@@ -502,7 +502,7 @@ int charcommand_stats(
{ "Zeny - %d", pl_sd->status.zeny },
{ NULL, 0 }
};
- sprintf(job_jobname, "Job - %s %s", job_name(pl_sd->status.class), "(level %d)");
+ sprintf(job_jobname, "Job - %s %s", job_name(pl_sd->status.class_), "(level %d)");
sprintf(output, msg_table[53], pl_sd->status.name); // '%s' stats:
clif_displaymessage(fd, output);
for (i = 0; output_table[i].format != NULL; i++) {
@@ -582,30 +582,30 @@ int charcommand_option(
pl_sd->opt2 = opt2;
pl_sd->status.option = opt3;
// fix pecopeco display
- if (pl_sd->status.class == 13 || pl_sd->status.class == 21 || pl_sd->status.class == 4014 || pl_sd->status.class == 4022) {
+ if (pl_sd->status.class_ == 13 || pl_sd->status.class_ == 21 || pl_sd->status.class_ == 4014 || pl_sd->status.class_ == 4022) {
if (!pc_isriding(pl_sd)) { // pl_sd have the new value...
- if (pl_sd->status.class == 13)
- pl_sd->status.class = pl_sd->view_class = 7;
- else if (pl_sd->status.class == 21)
- pl_sd->status.class = pl_sd->view_class = 14;
- else if (pl_sd->status.class == 4014)
- pl_sd->status.class = pl_sd->view_class = 4008;
- else if (pl_sd->status.class == 4022)
- pl_sd->status.class = pl_sd->view_class = 4015;
+ if (pl_sd->status.class_ == 13)
+ pl_sd->status.class_ = pl_sd->view_class = 7;
+ else if (pl_sd->status.class_ == 21)
+ pl_sd->status.class_ = pl_sd->view_class = 14;
+ else if (pl_sd->status.class_ == 4014)
+ pl_sd->status.class_ = pl_sd->view_class = 4008;
+ else if (pl_sd->status.class_ == 4022)
+ pl_sd->status.class_ = pl_sd->view_class = 4015;
}
} else {
if (pc_isriding(pl_sd)) { // pl_sd have the new value...
if (pl_sd->disguise > 0) { // temporary prevention of crash caused by peco + disguise, will look into a better solution [Valaris] (code added by [Yor])
pl_sd->status.option &= ~0x0020;
} else {
- if (pl_sd->status.class == 7)
- pl_sd->status.class = pl_sd->view_class = 13;
- else if (pl_sd->status.class == 14)
- pl_sd->status.class = pl_sd->view_class = 21;
- else if (pl_sd->status.class == 4008)
- pl_sd->status.class = pl_sd->view_class = 4014;
- else if (pl_sd->status.class == 4015)
- pl_sd->status.class = pl_sd->view_class = 4022;
+ if (pl_sd->status.class_ == 7)
+ pl_sd->status.class_ = pl_sd->view_class = 13;
+ else if (pl_sd->status.class_ == 14)
+ pl_sd->status.class_ = pl_sd->view_class = 21;
+ else if (pl_sd->status.class_ == 4008)
+ pl_sd->status.class_ = pl_sd->view_class = 4014;
+ else if (pl_sd->status.class_ == 4015)
+ pl_sd->status.class_ = pl_sd->view_class = 4022;
else
pl_sd->status.option &= ~0x0020;
}
@@ -701,7 +701,7 @@ int charcommand_stats_all(const int fd, struct map_session_data* sd, const char*
else
sprintf(gmlevel, " ");
- sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d) | HP: %d/%d | SP: %d/%d", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class), pl_sd->status.job_level, pl_sd->status.hp, pl_sd->status.max_hp, pl_sd->status.sp, pl_sd->status.max_sp);
+ sprintf(output, "Name: %s | BLvl: %d | Job: %s (Lvl: %d) | HP: %d/%d | SP: %d/%d", pl_sd->status.name, pl_sd->status.base_level, job_name(pl_sd->status.class_), pl_sd->status.job_level, pl_sd->status.hp, pl_sd->status.max_hp, pl_sd->status.sp, pl_sd->status.max_sp);
clif_displaymessage(fd, output);
sprintf(output, "STR: %d | AGI: %d | VIT: %d | INT: %d | DEX: %d | LUK: %d | Zeny: %d %s", pl_sd->status.str, pl_sd->status.agi, pl_sd->status.vit, pl_sd->status.int_, pl_sd->status.dex, pl_sd->status.luk, pl_sd->status.zeny, gmlevel);
clif_displaymessage(fd, output);
@@ -1061,9 +1061,9 @@ int charcommand_item(
for (i = 0; i < number; i += get_count) {
// if pet egg
if (pet_id >= 0) {
- sd->catch_target_class = pet_db[pet_id].class;
+ sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(sd->status.account_id, sd->status.char_id,
- pet_db[pet_id].class, mob_db[pet_db[pet_id].class].lv,
+ pet_db[pet_id].class_, mob_db[pet_db[pet_id].class_].lv,
pet_db[pet_id].EggID, 0, pet_db[pet_id].intimate,
100, 0, 1, pet_db[pet_id].jname);
// if not pet egg
diff --git a/src/map/chrif.c b/src/map/chrif.c
index 353533561..c04630300 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -606,7 +606,7 @@ int chrif_changedsex(int fd)
sd = map_id2sd(acc);
if (acc > 0) {
if (sd != NULL && sd->status.sex != sex) {
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
if (sd->status.sex == 0) {
sd->status.sex = 1;
sd->sex = 1;
@@ -641,9 +641,9 @@ int chrif_changedsex(int fd)
clif_updatestatus(sd, SP_SKILLPOINT);
// change job if necessary
if (s_class.job == 20 || s_class.job == 4021 || s_class.job == 4043)
- sd->status.class -= 1;
+ sd->status.class_ -= 1;
else if (s_class.job == 19 || s_class.job == 4020 || s_class.job == 4042)
- sd->status.class += 1;
+ sd->status.class_ += 1;
}
// save character
chrif_save(sd);
diff --git a/src/map/clif.c b/src/map/clif.c
index 28cc58fcf..0f4746251 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -973,21 +973,21 @@ static int clif_mob0078(struct mob_data *md, unsigned char *buf)
WBUFW(buf,8)=md->opt1;
WBUFW(buf,10)=md->opt2;
WBUFW(buf,12)=md->option;
- WBUFW(buf,14)=mob_get_viewclass(md->class);
- if((mob_get_viewclass(md->class) <= 23) || (mob_get_viewclass(md->class) == 812) || (mob_get_viewclass(md->class) >= 4001)) {
- WBUFW(buf,12)|=mob_db[md->class].option;
- WBUFW(buf,16)=mob_get_hair(md->class);
- WBUFW(buf,18)=mob_get_weapon(md->class);
- WBUFW(buf,20)=mob_get_head_buttom(md->class);
- WBUFW(buf,22)=mob_get_shield(md->class);
- WBUFW(buf,24)=mob_get_head_top(md->class);
- WBUFW(buf,26)=mob_get_head_mid(md->class);
- WBUFW(buf,28)=mob_get_hair_color(md->class);
- WBUFW(buf,30)=mob_get_clothes_color(md->class); //Add for player monster dye - Valaris
- WBUFB(buf,45)=mob_get_sex(md->class);
- }
-
- if (md->class >= 1285 && md->class <= 1287 && md->guild_id) { // Added guardian emblems [Valaris]
+ WBUFW(buf,14)=mob_get_viewclass(md->class_);
+ if((mob_get_viewclass(md->class_) <= 23) || (mob_get_viewclass(md->class_) == 812) || (mob_get_viewclass(md->class_) >= 4001)) {
+ WBUFW(buf,12)|=mob_db[md->class_].option;
+ WBUFW(buf,16)=mob_get_hair(md->class_);
+ WBUFW(buf,18)=mob_get_weapon(md->class_);
+ WBUFW(buf,20)=mob_get_head_buttom(md->class_);
+ WBUFW(buf,22)=mob_get_shield(md->class_);
+ WBUFW(buf,24)=mob_get_head_top(md->class_);
+ WBUFW(buf,26)=mob_get_head_mid(md->class_);
+ WBUFW(buf,28)=mob_get_hair_color(md->class_);
+ WBUFW(buf,30)=mob_get_clothes_color(md->class_); //Add for player monster dye - Valaris
+ WBUFB(buf,45)=mob_get_sex(md->class_);
+ }
+
+ if (md->class_ >= 1285 && md->class_ <= 1287 && md->guild_id) { // Added guardian emblems [Valaris]
struct guild *g;
struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name);
if (gc && gc->guild_id > 0) {
@@ -1025,23 +1025,23 @@ static int clif_mob007b(struct mob_data *md, unsigned char *buf) {
WBUFW(buf,8)=md->opt1;
WBUFW(buf,10)=md->opt2;
WBUFW(buf,12)=md->option;
- WBUFW(buf,14)=mob_get_viewclass(md->class);
- if ((mob_get_viewclass(md->class) < 24) || (mob_get_viewclass(md->class) > 4000)) {
- WBUFW(buf,12)|=mob_db[md->class].option;
- WBUFW(buf,16)=mob_get_hair(md->class);
- WBUFW(buf,18)=mob_get_weapon(md->class);
- WBUFW(buf,20)=mob_get_head_buttom(md->class);
+ WBUFW(buf,14)=mob_get_viewclass(md->class_);
+ if ((mob_get_viewclass(md->class_) < 24) || (mob_get_viewclass(md->class_) > 4000)) {
+ WBUFW(buf,12)|=mob_db[md->class_].option;
+ WBUFW(buf,16)=mob_get_hair(md->class_);
+ WBUFW(buf,18)=mob_get_weapon(md->class_);
+ WBUFW(buf,20)=mob_get_head_buttom(md->class_);
WBUFL(buf,22)=gettick();
- WBUFW(buf,26)=mob_get_shield(md->class);
- WBUFW(buf,28)=mob_get_head_top(md->class);
- WBUFW(buf,30)=mob_get_head_mid(md->class);
- WBUFW(buf,32)=mob_get_hair_color(md->class);
- WBUFW(buf,34)=mob_get_clothes_color(md->class); //Add for player monster dye - Valaris
- WBUFB(buf,49)=mob_get_sex(md->class);
+ WBUFW(buf,26)=mob_get_shield(md->class_);
+ WBUFW(buf,28)=mob_get_head_top(md->class_);
+ WBUFW(buf,30)=mob_get_head_mid(md->class_);
+ WBUFW(buf,32)=mob_get_hair_color(md->class_);
+ WBUFW(buf,34)=mob_get_clothes_color(md->class_); //Add for player monster dye - Valaris
+ WBUFB(buf,49)=mob_get_sex(md->class_);
} else
WBUFL(buf,22)=gettick();
- if(md->class >= 1285 && md->class <= 1287 && md->guild_id) { // Added guardian emblems [Valaris]
+ if(md->class_ >= 1285 && md->class_ <= 1287 && md->guild_id) { // Added guardian emblems [Valaris]
struct guild *g;
struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name);
if(gc && gc->guild_id > 0){
@@ -1075,8 +1075,8 @@ static int clif_npc0078(struct npc_data *nd, unsigned char *buf) {
WBUFW(buf,0)=0x78;
WBUFL(buf,2)=nd->bl.id;
WBUFW(buf,6)=nd->speed;
- WBUFW(buf,14)=nd->class;
- if ((nd->class == 722) && (nd->u.scr.guild_id > 0) && ((g=guild_search(nd->u.scr.guild_id)) != NULL)) {
+ WBUFW(buf,14)=nd->class_;
+ if ((nd->class_ == 722) && (nd->u.scr.guild_id > 0) && ((g=guild_search(nd->u.scr.guild_id)) != NULL)) {
WBUFL(buf,22)=g->emblem_id;
WBUFL(buf,26)=g->guild_id;
}
@@ -1099,8 +1099,8 @@ static int clif_npc007b(struct npc_data *nd, unsigned char *buf) {
WBUFW(buf,0)=0x7b;
WBUFL(buf,2)=nd->bl.id;
WBUFW(buf,6)=nd->speed;
- WBUFW(buf,14)=nd->class;
- if ((nd->class == 722) && (nd->u.scr.guild_id > 0) && ((g=guild_search(nd->u.scr.guild_id)) != NULL)) {
+ WBUFW(buf,14)=nd->class_;
+ if ((nd->class_ == 722) && (nd->u.scr.guild_id > 0) && ((g=guild_search(nd->u.scr.guild_id)) != NULL)) {
WBUFL(buf,22)=g->emblem_id;
WBUFL(buf,26)=g->guild_id;
}
@@ -1127,18 +1127,18 @@ static int clif_pet0078(struct pet_data *pd, unsigned char *buf) {
WBUFW(buf,0)=0x78;
WBUFL(buf,2)=pd->bl.id;
WBUFW(buf,6)=pd->speed;
- WBUFW(buf,14)=mob_get_viewclass(pd->class);
- if((mob_get_viewclass(pd->class) < 24) || (mob_get_viewclass(pd->class) > 4000)) {
- WBUFW(buf,12)=mob_db[pd->class].option;
- WBUFW(buf,16)=mob_get_hair(pd->class);
- WBUFW(buf,18)=mob_get_weapon(pd->class);
- WBUFW(buf,20)=mob_get_head_buttom(pd->class);
- WBUFW(buf,22)=mob_get_shield(pd->class);
- WBUFW(buf,24)=mob_get_head_top(pd->class);
- WBUFW(buf,26)=mob_get_head_mid(pd->class);
- WBUFW(buf,28)=mob_get_hair_color(pd->class);
- WBUFW(buf,30)=mob_get_clothes_color(pd->class); //Add for player pet dye - Valaris
- WBUFB(buf,45)=mob_get_sex(pd->class);
+ WBUFW(buf,14)=mob_get_viewclass(pd->class_);
+ if((mob_get_viewclass(pd->class_) < 24) || (mob_get_viewclass(pd->class_) > 4000)) {
+ WBUFW(buf,12)=mob_db[pd->class_].option;
+ WBUFW(buf,16)=mob_get_hair(pd->class_);
+ WBUFW(buf,18)=mob_get_weapon(pd->class_);
+ WBUFW(buf,20)=mob_get_head_buttom(pd->class_);
+ WBUFW(buf,22)=mob_get_shield(pd->class_);
+ WBUFW(buf,24)=mob_get_head_top(pd->class_);
+ WBUFW(buf,26)=mob_get_head_mid(pd->class_);
+ WBUFW(buf,28)=mob_get_hair_color(pd->class_);
+ WBUFW(buf,30)=mob_get_clothes_color(pd->class_); //Add for player pet dye - Valaris
+ WBUFB(buf,45)=mob_get_sex(pd->class_);
} else {
WBUFW(buf,16)=0x14;
if((view = itemdb_viewid(pd->equip)) > 0)
@@ -1169,19 +1169,19 @@ static int clif_pet007b(struct pet_data *pd, unsigned char *buf) {
WBUFW(buf,0)=0x7b;
WBUFL(buf,2)=pd->bl.id;
WBUFW(buf,6)=pd->speed;
- WBUFW(buf,14)=mob_get_viewclass(pd->class);
- if((mob_get_viewclass(pd->class) < 24) || (mob_get_viewclass(pd->class) > 4000)) {
- WBUFW(buf,12)=mob_db[pd->class].option;
- WBUFW(buf,16)=mob_get_hair(pd->class);
- WBUFW(buf,18)=mob_get_weapon(pd->class);
- WBUFW(buf,20)=mob_get_head_buttom(pd->class);
+ WBUFW(buf,14)=mob_get_viewclass(pd->class_);
+ if((mob_get_viewclass(pd->class_) < 24) || (mob_get_viewclass(pd->class_) > 4000)) {
+ WBUFW(buf,12)=mob_db[pd->class_].option;
+ WBUFW(buf,16)=mob_get_hair(pd->class_);
+ WBUFW(buf,18)=mob_get_weapon(pd->class_);
+ WBUFW(buf,20)=mob_get_head_buttom(pd->class_);
WBUFL(buf,22)=gettick();
- WBUFW(buf,26)=mob_get_shield(pd->class);
- WBUFW(buf,28)=mob_get_head_top(pd->class);
- WBUFW(buf,30)=mob_get_head_mid(pd->class);
- WBUFW(buf,32)=mob_get_hair_color(pd->class);
- WBUFW(buf,34)=mob_get_clothes_color(pd->class); //Add for player pet dye - Valaris
- WBUFB(buf,49)=mob_get_sex(pd->class);
+ WBUFW(buf,26)=mob_get_shield(pd->class_);
+ WBUFW(buf,28)=mob_get_head_top(pd->class_);
+ WBUFW(buf,30)=mob_get_head_mid(pd->class_);
+ WBUFW(buf,32)=mob_get_hair_color(pd->class_);
+ WBUFW(buf,34)=mob_get_clothes_color(pd->class_); //Add for player pet dye - Valaris
+ WBUFB(buf,49)=mob_get_sex(pd->class_);
} else {
WBUFW(buf,16)=0x14;
if ((view = itemdb_viewid(pd->equip)) > 0)
@@ -1285,11 +1285,11 @@ int clif_spawnpc(struct map_session_data *sd) {
clif_guild_emblem(sd,g);
} // end addition [Valaris]
- if (sd->status.class==13 || sd->status.class==21 || sd->status.class==4014 || sd->status.class==4022)
+ if (sd->status.class_==13 || sd->status.class_==21 || sd->status.class_==4014 || sd->status.class_==4022)
pc_setoption(sd,sd->status.option|0x0020); // [Valaris]
- if ((pc_isriding(sd) && pc_checkskill(sd,KN_RIDING)>0) && (sd->status.class==7 ||
- sd->status.class==14 || sd->status.class==4008 || sd->status.class==4015))
+ if ((pc_isriding(sd) && pc_checkskill(sd,KN_RIDING)>0) && (sd->status.class_==7 ||
+ sd->status.class_==14 || sd->status.class_==4008 || sd->status.class_==4015))
pc_setriding(sd); // update peco riders for people upgrading athena [Valaris]
@@ -1318,7 +1318,7 @@ int clif_spawnnpc(struct npc_data *nd)
nullpo_retr(0, nd);
- if(nd->class < 0 || nd->flag&1 || nd->class == INVISIBLE_CLASS)
+ if(nd->class_ < 0 || nd->flag&1 || nd->class_ == INVISIBLE_CLASS)
return 0;
memset(buf,0,packet_len_table[0x7c]);
@@ -1326,7 +1326,7 @@ int clif_spawnnpc(struct npc_data *nd)
WBUFW(buf,0)=0x7c;
WBUFL(buf,2)=nd->bl.id;
WBUFW(buf,6)=nd->speed;
- WBUFW(buf,20)=nd->class;
+ WBUFW(buf,20)=nd->class_;
WBUFPOS(buf,36,nd->bl.x,nd->bl.y);
clif_send(buf,packet_len_table[0x7c],&nd->bl,AREA);
@@ -1348,7 +1348,7 @@ int clif_spawnmob(struct mob_data *md)
nullpo_retr(0, md);
- if (mob_get_viewclass(md->class) > 23 ) {
+ if (mob_get_viewclass(md->class_) > 23 ) {
memset(buf,0,packet_len_table[0x7c]);
WBUFW(buf,0)=0x7c;
@@ -1357,7 +1357,7 @@ int clif_spawnmob(struct mob_data *md)
WBUFW(buf,8)=md->opt1;
WBUFW(buf,10)=md->opt2;
WBUFW(buf,12)=md->option;
- WBUFW(buf,20)=mob_get_viewclass(md->class);
+ WBUFW(buf,20)=mob_get_viewclass(md->class_);
WBUFPOS(buf,36,md->bl.x,md->bl.y);
clif_send(buf,packet_len_table[0x7c],&md->bl,AREA);
}
@@ -1365,8 +1365,8 @@ int clif_spawnmob(struct mob_data *md)
len = clif_mob0078(md,buf);
clif_send(buf,len,&md->bl,AREA);
- if (mob_get_equip(md->class) > 0) // mob equipment [Valaris]
- clif_mob_equip(md,mob_get_equip(md->class));
+ if (mob_get_equip(md->class_) > 0) // mob equipment [Valaris]
+ clif_mob_equip(md,mob_get_equip(md->class_));
if(md->size==2) // tiny/big mobs [Valaris]
clif_specialeffect(&md->bl,423,0);
@@ -1389,13 +1389,13 @@ int clif_spawnpet(struct pet_data *pd)
nullpo_retr(0, pd);
- if (mob_get_viewclass(pd->class) >= MAX_PC_CLASS) {
+ if (mob_get_viewclass(pd->class_) >= MAX_PC_CLASS) {
memset(buf,0,packet_len_table[0x7c]);
WBUFW(buf,0)=0x7c;
WBUFL(buf,2)=pd->bl.id;
WBUFW(buf,6)=pd->speed;
- WBUFW(buf,20)=mob_get_viewclass(pd->class);
+ WBUFW(buf,20)=mob_get_viewclass(pd->class_);
WBUFPOS(buf,36,pd->bl.x,pd->bl.y);
clif_send(buf,packet_len_table[0x7c],&pd->bl,AREA);
@@ -3552,7 +3552,7 @@ void clif_getareachar_npc(struct map_session_data* sd,struct npc_data* nd)
int len;
nullpo_retv(sd);
nullpo_retv(nd);
- if(nd->class < 0 || nd->flag&1 || nd->class == INVISIBLE_CLASS)
+ if(nd->class_ < 0 || nd->flag&1 || nd->class_ == INVISIBLE_CLASS)
return;
if(nd->state.state == MS_WALK){
len = clif_npc007b(nd,WFIFOP(sd->fd,0));
@@ -3580,8 +3580,8 @@ int clif_movemob(struct mob_data *md)
len = clif_mob007b(md,buf);
clif_send(buf,len,&md->bl,AREA);
- if(mob_get_equip(md->class) > 0) // mob equipment [Valaris]
- clif_mob_equip(md,mob_get_equip(md->class));
+ if(mob_get_equip(md->class_) > 0) // mob equipment [Valaris]
+ clif_mob_equip(md,mob_get_equip(md->class_));
if(md->size==2) // tiny/big mobs [Valaris]
clif_specialeffect(&md->bl,423,0);
@@ -3739,8 +3739,8 @@ void clif_getareachar_mob(struct map_session_data* sd,struct mob_data* md)
WFIFOSET(sd->fd,len);
}
- if(mob_get_equip(md->class) > 0) // mob equipment [Valaris]
- clif_mob_equip(md,mob_get_equip(md->class));
+ if(mob_get_equip(md->class_) > 0) // mob equipment [Valaris]
+ clif_mob_equip(md,mob_get_equip(md->class_));
if(md->size==2) // tiny/big mobs [Valaris]
clif_specialeffect(&md->bl,423,0);
@@ -3976,7 +3976,7 @@ int clif_pcoutsight(struct block_list *bl,va_list ap)
}
break;
case BL_NPC:
- if( ((struct npc_data *)bl)->class != INVISIBLE_CLASS )
+ if( ((struct npc_data *)bl)->class_ != INVISIBLE_CLASS )
clif_clearchar_id(bl->id,0,sd->fd);
break;
case BL_MOB:
@@ -4191,7 +4191,7 @@ int clif_skillinfo(struct map_session_data *sd,int skillid,int type,int range)
memset(WFIFOP(fd,14),0,24);
if(!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn == 1 || (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill) )
//WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_get_max(id) && sd->status.skill[skillid].flag ==0 )? 1:0;
- WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_tree_get_max(id, sd->status.class) && sd->status.skill[skillid].flag ==0 )? 1:0;
+ WFIFOB(fd,38)= (sd->status.skill[skillid].lv < skill_tree_get_max(id, sd->status.class_) && sd->status.skill[skillid].flag ==0 )? 1:0;
else
WFIFOB(fd,38) = 0;
WFIFOSET(fd,packet_len_table[0x147]);
@@ -4226,7 +4226,7 @@ int clif_skillinfoblock(struct map_session_data *sd)
memset(WFIFOP(fd,len+12),0,24);
if(!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn == 1 || (battle_config.gm_allskill > 0 && pc_isGM(sd) >= battle_config.gm_allskill) )
//WFIFOB(fd,len+36)= (sd->status.skill[i].lv < skill_get_max(id) && sd->status.skill[i].flag ==0 )? 1:0;
- WFIFOB(fd,len+36)= (sd->status.skill[i].lv < skill_tree_get_max(id, sd->status.class) && sd->status.skill[i].flag ==0 )? 1:0;
+ WFIFOB(fd,len+36)= (sd->status.skill[i].lv < skill_tree_get_max(id, sd->status.class_) && sd->status.skill[i].flag ==0 )? 1:0;
else
WFIFOB(fd,len+36) = 0;
len+=37;
@@ -4259,7 +4259,7 @@ int clif_skillup(struct map_session_data *sd,int skill_num)
range = battle_get_range(&sd->bl) - (range + 1);
WFIFOW(fd,8) = range;
//WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_get_max(sd->status.skill[skill_num].id)) ? 1 : 0;
- WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_tree_get_max(sd->status.skill[skill_num].id, sd->status.class)) ? 1 : 0;
+ WFIFOB(fd,10) = (sd->status.skill[skill_num].lv < skill_tree_get_max(sd->status.skill[skill_num].id, sd->status.class_)) ? 1 : 0;
WFIFOSET(fd,packet_len_table[0x10e]);
return 0;
@@ -4623,13 +4623,13 @@ int clif_skill_estimation(struct map_session_data *sd,struct block_list *dst)
return 0;
WBUFW(buf, 0)=0x18c;
- WBUFW(buf, 2)=mob_get_viewclass(md->class);
+ WBUFW(buf, 2)=mob_get_viewclass(md->class_);
WBUFW(buf, 4)=md->level;
- WBUFW(buf, 6)=mob_db[md->class].size;
+ WBUFW(buf, 6)=mob_db[md->class_].size;
WBUFL(buf, 8)=md->hp;
WBUFW(buf,12)=battle_get_def2(&md->bl);
- WBUFW(buf,14)=mob_db[md->class].race;
- WBUFW(buf,16)=battle_get_mdef2(&md->bl) - (mob_db[md->class].vit>>1);
+ WBUFW(buf,14)=mob_db[md->class_].race;
+ WBUFW(buf,16)=battle_get_mdef2(&md->bl) - (mob_db[md->class_].vit>>1);
WBUFW(buf,18)=battle_get_elem_type(&md->bl);
for(i=0;i<9;i++)
WBUFB(buf,20+i)= battle_attr_fix(100,i+1,md->def_ele);
@@ -5831,7 +5831,7 @@ int clif_update_mobhp(struct mob_data *md)
WBUFL(buf,2) = md->bl.id;
memcpy(WBUFP(buf,6), md->name, 24);
- sprintf(mobhp, "hp: %d/%d", md->hp, mob_db[md->class].max_hp);
+ sprintf(mobhp, "hp: %d/%d", md->hp, mob_db[md->class_].max_hp);
WBUFW(buf, 0) = 0x195;
memcpy(WBUFP(buf,30), mobhp, 24);
WBUFL(buf,54) = 0;
@@ -6023,7 +6023,7 @@ int clif_pet_emotion(struct pet_data *pd,int param)
if(sd->petDB->talk_convert_class < 0)
return 0;
else if(sd->petDB->talk_convert_class > 0) {
- param -= (pd->class - 100)*100;
+ param -= (pd->class_ - 100)*100;
param += (sd->petDB->talk_convert_class - 100)*100;
}
}
@@ -6501,7 +6501,7 @@ int clif_guild_memberlist(struct map_session_data *sd)
WFIFOW(fd,c*104+12)=m->hair;
WFIFOW(fd,c*104+14)=m->hair_color;
WFIFOW(fd,c*104+16)=m->gender;
- WFIFOW(fd,c*104+18)=m->class;
+ WFIFOW(fd,c*104+18)=m->class_;
WFIFOW(fd,c*104+20)=m->lv;
WFIFOL(fd,c*104+22)=m->exp;
WFIFOL(fd,c*104+26)=m->online;
@@ -7439,10 +7439,10 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
if(sd->state.connect_new) {
sd->state.connect_new = 0;
- if(sd->status.class != sd->view_class)
+ if(sd->status.class_ != sd->view_class)
clif_changelook(&sd->bl,LOOK_BASE,sd->view_class);
if(sd->status.pet_id > 0 && sd->pd && sd->pet.intimate > 900)
- clif_pet_emotion(sd->pd,(sd->pd->class - 100)*100 + 50 + pet_hungry_val(sd));
+ clif_pet_emotion(sd->pd,(sd->pd->class_ - 100)*100 + 50 + pet_hungry_val(sd));
/* Stop players from spawning inside castles [Valaris] */
@@ -7753,7 +7753,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
nullpo_retv(md);
memcpy(WFIFOP(fd,6), md->name, 24);
- if (md->class >= 1285 && md->class <= 1288 && md->guild_id) {
+ if (md->class_ >= 1285 && md->class_ <= 1288 && md->guild_id) {
struct guild *g;
struct guild_castle *gc = guild_mapname2gc(map[md->bl.m].name);
if (gc && gc->guild_id > 0 && (g = guild_search(gc->guild_id)) != NULL) {
@@ -7767,7 +7767,7 @@ void clif_parse_GetCharNameRequest(int fd, struct map_session_data *sd) {
}
} else if (battle_config.show_mob_hp == 1) {
char mobhp[50];
- sprintf(mobhp, "hp: %d/%d", md->hp, mob_db[md->class].max_hp);
+ sprintf(mobhp, "hp: %d/%d", md->hp, mob_db[md->class_].max_hp);
WFIFOW(fd, 0) = 0x195;
memcpy(WFIFOP(fd,30), mobhp, 24);
WFIFOB(fd,54) = 0;
@@ -7849,7 +7849,7 @@ void clif_parse_GlobalMessage(int fd, struct map_session_data *sd) { // S 008c <
WFIFOSET(fd, WFIFOW(fd,2));
// Celest
- if (pc_calc_base_job2 (sd->status.class) == 23 ) {
+ if (pc_calc_base_job2 (sd->status.class_) == 23 ) {
int next = pc_nextbaseexp(sd)>0 ? pc_nextbaseexp(sd) : sd->status.base_exp;
if ((sd->status.base_exp*100/next)%10 == 0) {
estr_lower(RFIFOP(fd,4));
@@ -8680,17 +8680,17 @@ void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd)
void clif_parse_RemoveOption(int fd,struct map_session_data *sd)
{
if(pc_isriding(sd)) { // jobchange when removing peco [Valaris]
- if(sd->status.class==13)
- sd->status.class=sd->view_class=7;
+ if(sd->status.class_==13)
+ sd->status.class_=sd->view_class=7;
- if(sd->status.class==21)
- sd->status.class=sd->view_class=14;
+ if(sd->status.class_==21)
+ sd->status.class_=sd->view_class=14;
- if(sd->status.class==4014)
- sd->status.class=sd->view_class=4008;
+ if(sd->status.class_==4014)
+ sd->status.class_=sd->view_class=4008;
- if(sd->status.class==4022)
- sd->status.class=sd->view_class=4015;
+ if(sd->status.class_==4022)
+ sd->status.class_=sd->view_class=4015;
}
pc_setoption(sd,0);
@@ -10011,7 +10011,7 @@ void clif_parse_sn_explosionspirits(int fd, struct map_session_data *sd)
{
if(sd){
int nextbaseexp=pc_nextbaseexp(sd);
- struct pc_base_job s_class = pc_calc_base_job(sd->status.class);
+ struct pc_base_job s_class = pc_calc_base_job(sd->status.class_);
if (battle_config.etc_log){
if(nextbaseexp != 0)
printf("SuperNovice explosionspirits!! %d %d %d %d\n",sd->bl.id,s_class.job,sd->status.base_exp,(int)((double)1000*sd->status.base_exp/nextbaseexp));
diff --git a/src/map/guild.c b/src/map/guild.c
index 7369757a7..ddaa05999 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -242,7 +242,7 @@ void guild_makemember(struct guild_member *m,struct map_session_data *sd)
m->hair =sd->status.hair;
m->hair_color =sd->status.hair_color;
m->gender =sd->sex;
- m->class =sd->status.class;
+ m->class_ =sd->status.class_;
m->lv =sd->status.base_level;
m->exp =0;
m->exp_payper =0;
@@ -722,7 +722,7 @@ int guild_send_memberinfoshort(struct map_session_data *sd,int online)
return 0;
intif_guild_memberinfoshort(g->guild_id,
- sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class);
+ sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class_);
if( !online ){ // ログアウトするならsdをクリアして終了
int i=guild_getindex(g,sd->status.account_id,sd->status.char_id);
@@ -762,7 +762,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
oldonline=m->online;
m->online=online;
m->lv=lv;
- m->class=class;
+ m->class_=class;
idx=i;
}
if(m->account_id>0){
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 815034d8c..e6a997976 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -158,7 +158,7 @@ struct item_data* itemdb_search(int nameid)
id->weight=10;
id->sex=2;
id->elv=0;
- id->class=0xffffffff;
+ id->class_=0xffffffff;
id->flag.available=0;
id->flag.value_notdc=0; //一応・・・
id->flag.value_notoc=0;
@@ -339,7 +339,7 @@ static int itemdb_readdb(void)
id->def=atoi(str[8]);
id->range=atoi(str[9]);
id->slot=atoi(str[10]);
- id->class=atoi(str[11]);
+ id->class_=atoi(str[11]);
id->sex=atoi(str[12]);
if(id->equip != atoi(str[13])){
id->equip=atoi(str[13]);
@@ -814,7 +814,7 @@ static int itemdb_read_sqldb(void)
id->def = (sql_row[8] != NULL) ? atoi(sql_row[8]) : 0;
id->range = (sql_row[9] != NULL) ? atoi(sql_row[9]) : 0;
id->slot = (sql_row[10] != NULL) ? atoi(sql_row[10]) : 0;
- id->class = (sql_row[11] != NULL) ? atoi(sql_row[11]) : 0;
+ id->class_ = (sql_row[11] != NULL) ? atoi(sql_row[11]) : 0;
id->sex = (sql_row[12] != NULL) ? atoi(sql_row[12]) : 0;
id->equip = (sql_row[13] != NULL) ? atoi(sql_row[13]) : 0;
id->wlv = (sql_row[14] != NULL) ? atoi(sql_row[14]) : 0;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 9ff3981a2..2ba6ae7f6 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -12,7 +12,7 @@ struct item_data {
int value_buy;
int value_sell;
int type;
- int class;
+ int class_;
int sex;
int equip;
int weight;
diff --git a/src/map/map.h b/src/map/map.h
index ccedaacaf..405c34d65 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -348,7 +348,7 @@ struct npc_item_list {
struct npc_data {
struct block_list bl;
short n;
- short class,dir;
+ short class_,dir;
short speed;
char name[24];
char exname[24];
@@ -395,7 +395,7 @@ struct npc_data {
struct mob_data {
struct block_list bl;
short n;
- short base_class,class,dir,mode,level;
+ short base_class,class_,dir,mode,level;
short m,x0,y0,xs,ys;
char name[24];
int spawndelay1,spawndelay2;
@@ -457,7 +457,7 @@ struct mob_data {
struct pet_data {
struct block_list bl;
short n;
- short class,dir;
+ short class_,dir;
short speed;
char name[24];
struct {
diff --git a/src/map/mob.c b/src/map/mob.c
index c6b772209..539a10c1a 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -99,7 +99,7 @@ int mob_spawn_dataset(struct mob_data *md,const char *mobname,int class)
memcpy(md->name,mobname,24);
md->n = 0;
- md->base_class = md->class = class;
+ md->base_class = md->class_ = class;
md->bl.id= npc_get_new_npc_id();
memset(&md->state,0,sizeof(md->state));
@@ -600,11 +600,11 @@ static int mob_attack(struct mob_data *md,unsigned int tick,int data)
if(!md->mode)
- mode=mob_db[md->class].mode;
+ mode=mob_db[md->class_].mode;
else
mode=md->mode;
- race=mob_db[md->class].race;
+ race=mob_db[md->class_].race;
if(!(mode&0x80)){
md->target_id=0;
md->state.targettype = NONE_ATTACKABLE;
@@ -617,7 +617,7 @@ static int mob_attack(struct mob_data *md,unsigned int tick,int data)
return 0;
}
- range = mob_db[md->class].range;
+ range = mob_db[md->class_].range;
if(mode&1)
range++;
if(distance(md->bl.x,md->bl.y,tbl->x,tbl->y) > range)
@@ -912,7 +912,7 @@ int mob_spawn(int id)
map_delblock(&md->bl);
}
else
- md->class = md->base_class;
+ md->class_ = md->base_class;
md->bl.m =md->m;
do {
@@ -946,11 +946,11 @@ int mob_spawn(int id)
md->move_fail_count = 0;
if(!md->speed)
- md->speed = mob_db[md->class].speed;
- md->def_ele = mob_db[md->class].element;
+ md->speed = mob_db[md->class_].speed;
+ md->def_ele = mob_db[md->class_].element;
if(!md->level) // [Valaris]
- md->level=mob_db[md->class].lv;
+ md->level=mob_db[md->class_].lv;
md->master_id=0;
md->master_dist=0;
@@ -964,7 +964,7 @@ int mob_spawn(int id)
md->canmove_tick = tick;
md->guild_id = 0;
- if (md->class >= 1285 && md->class <= 1288) {
+ if (md->class_ >= 1285 && md->class_ <= 1288) {
struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name);
if(gc)
md->guild_id = gc->guild_id;
@@ -998,7 +998,7 @@ int mob_spawn(int id)
md->hp = battle_get_max_hp(&md->bl);
if(md->hp<=0){
- mob_makedummymobdb(md->class);
+ mob_makedummymobdb(md->class_);
md->hp = battle_get_max_hp(&md->bl);
}
@@ -1094,7 +1094,7 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range)
//=========== guildcastle guardian no search start===========
//when players are the guild castle member not attack them !
- if(md->class >= 1285 && md->class <= 1287){
+ if(md->class_ >= 1285 && md->class_ <= 1287){
struct map_session_data *sd;
struct guild *g=NULL;
struct guild_castle *gc=guild_mapname2gc(map[bl->m].name);
@@ -1171,10 +1171,10 @@ int mob_target(struct mob_data *md,struct block_list *bl,int dist)
sc_data = battle_get_sc_data(bl);
option = battle_get_option(bl);
- race=mob_db[md->class].race;
+ race=mob_db[md->class_].race;
if(!md->mode)
- mode=mob_db[md->class].mode;
+ mode=mob_db[md->class_].mode;
else
mode=md->mode;
@@ -1236,13 +1236,13 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
return 0;
if(!smd->mode)
- mode=mob_db[smd->class].mode;
+ mode=mob_db[smd->class_].mode;
else
mode=smd->mode;
// アクティブでターゲット射程内にいるなら、ロックする
if( mode&0x04 ){
- race=mob_db[smd->class].race;
+ race=mob_db[smd->class_].race;
//対象がPCの場合
if(tsd &&
!pc_isdead(tsd) &&
@@ -1295,7 +1295,7 @@ static int mob_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
nullpo_retr(0, itc=va_arg(ap,int *));
if(!md->mode)
- mode=mob_db[md->class].mode;
+ mode=mob_db[md->class_].mode;
else
mode=md->mode;
@@ -1332,8 +1332,8 @@ static int mob_ai_sub_hard_linksearch(struct block_list *bl,va_list ap)
nullpo_retr(0, target=va_arg(ap,struct block_list *));
// same family free in a range at a link monster -- it will be made to lock if MOB is
-/* if( (md->target_id > 0 && md->state.targettype == ATTACKABLE) && mob_db[md->class].mode&0x08){
- if( tmd->class==md->class && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE) && tmd->bl.m == md->bl.m){
+/* if( (md->target_id > 0 && md->state.targettype == ATTACKABLE) && mob_db[md->class_].mode&0x08){
+ if( tmd->class_==md->class_ && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE) && tmd->bl.m == md->bl.m){
if( mob_can_reach(tmd,target,12) ){ // Reachability judging
tmd->target_id=md->target_id;
tmd->state.targettype = ATTACKABLE;
@@ -1341,8 +1341,8 @@ static int mob_ai_sub_hard_linksearch(struct block_list *bl,va_list ap)
}
}
}*/
- if( md->attacked_id > 0 && mob_db[md->class].mode&0x08){
- if( tmd->class==md->class && tmd->bl.m == md->bl.m && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE)){
+ if( md->attacked_id > 0 && mob_db[md->class_].mode&0x08){
+ if( tmd->class_==md->class_ && tmd->bl.m == md->bl.m && (!tmd->target_id || md->state.targettype == NONE_ATTACKABLE)){
if( mob_can_reach(tmd,target,12) ){ // Reachability judging
tmd->target_id=md->attacked_id;
tmd->state.targettype = ATTACKABLE;
@@ -1368,7 +1368,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
if((bl=map_id2bl(md->master_id)) != NULL )
mmd=(struct mob_data *)bl;
- mode=mob_db[md->class].mode;
+ mode=mob_db[md->class_].mode;
// It is not main monster/leader.
if(!mmd || mmd->bl.type!=BL_MOB || mmd->bl.id!=md->master_id)
@@ -1439,7 +1439,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
struct map_session_data *sd=map_id2sd(mmd->target_id);
if(sd!=NULL && !pc_isdead(sd) && sd->invincible_timer == -1 && !pc_isinvisible(sd)){
- race=mob_db[md->class].race;
+ race=mob_db[md->class_].race;
if(mode&0x20 ||
(sd->sc_data[SC_TRICKDEAD].timer == -1 && sd->sc_data[SC_BASILICA].timer == -1 &&
( (!pc_ishiding(sd) && !sd->state.gangsterparadise) || ((race == 4 || race == 6) && !sd->perfect_hiding) ) ) ){ // 妨害がないか判定
@@ -1457,7 +1457,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
struct map_session_data *sd=map_id2sd(md->target_id);
if(sd!=NULL && !pc_isdead(sd) && sd->invincible_timer == -1 && !pc_isinvisible(sd)){
- race=mob_db[mmd->class].race;
+ race=mob_db[mmd->class_].race;
if(mode&0x20 ||
(sd->sc_data[SC_TRICKDEAD].timer == -1 &&
(!(sd->status.option&0x06) || race==4 || race==6)
@@ -1525,7 +1525,7 @@ static int mob_randomwalk(struct mob_data *md,int tick)
md->target_dir = 0;
if(md->move_fail_count>1000){
if(battle_config.error_log)
- printf("MOB cant move. random spawn %d, class = %d\n",md->bl.id,md->class);
+ printf("MOB cant move. random spawn %d, class = %d\n",md->bl.id,md->class_);
md->move_fail_count=0;
mob_spawn(md->bl.id);
}
@@ -1577,11 +1577,11 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
}
if(!md->mode)
- mode=mob_db[md->class].mode;
+ mode=mob_db[md->class_].mode;
else
mode=md->mode;
- race=mob_db[md->class].race;
+ race=mob_db[md->class_].race;
// Abnormalities
if((md->opt1 > 0 && md->opt1 != 6) || md->state.state==MS_DELAY || md->sc_data[SC_BLADESTOP].timer != -1)
@@ -1674,7 +1674,7 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
((pc_ishiding(tsd) || tsd->state.gangsterparadise) &&
!((race == 4 || race == 6) && !tsd->perfect_hiding) )) )
mob_unlocktarget(md,tick); // スキルなどによる策敵妨害
- else if(!battle_check_range(&md->bl,tbl,mob_db[md->class].range)){
+ else if(!battle_check_range(&md->bl,tbl,mob_db[md->class_].range)){
// 攻撃範囲外なので移動
if(!(mode&1)){ // 移動しないモード
mob_unlocktarget(md,tick);
@@ -1889,7 +1889,7 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app)
}
if(DIFF_TICK(md->next_walktime,tick)<0 &&
- (mob_db[md->class].mode&1) && mob_can_move(md) ){
+ (mob_db[md->class_].mode&1) && mob_can_move(md) ){
if( map[md->bl.m].users>0 ){
// Since PC is in the same map, somewhat better negligent processing is carried out.
@@ -1900,7 +1900,7 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app)
// MOB which is not not the summons MOB but BOSS, either sometimes reboils.
else if( rand()%1000<MOB_LAZYWARPPERC && md->x0<=0 && md->master_id!=0 &&
- mob_db[md->class].mexp <= 0 && !(mob_db[md->class].mode & 0x20))
+ mob_db[md->class_].mexp <= 0 && !(mob_db[md->class_].mode & 0x20))
mob_spawn(md->bl.id);
}else{
@@ -1908,7 +1908,7 @@ static int mob_ai_sub_lazy(void * key,void * data,va_list app)
// MOB which is not BOSS which is not Summons MOB, either -- a case -- sometimes -- leaping
if( rand()%1000<MOB_LAZYWARPPERC && md->x0<=0 && md->master_id!=0 &&
- mob_db[md->class].mexp <= 0 && !(mob_db[md->class].mode & 0x20))
+ mob_db[md->class_].mexp <= 0 && !(mob_db[md->class_].mode & 0x20))
mob_warp(md,-1,-1,-1,-1);
}
@@ -2018,7 +2018,7 @@ int mob_delete(struct mob_data *md)
mob_changestate(md,MS_DEAD,0);
clif_clearchar_area(&md->bl,1);
map_delblock(&md->bl);
- if(mob_get_viewclass(md->class) <= 1000)
+ if(mob_get_viewclass(md->class_) <= 1000)
clif_clearchar_delay(gettick()+3000,&md->bl,0);
mob_deleteslave(md);
mob_setdelayspawn(md->bl.id);
@@ -2220,7 +2220,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
md->hp-=damage;
- if(md->class >= 1285 && md->class <=1287) { // guardian hp update [Valaris]
+ if(md->class_ >= 1285 && md->class_ <=1287) { // guardian hp update [Valaris]
struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name);
if(gc) {
@@ -2292,7 +2292,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(md->state.special_mob_ai == 2){//スフィアーマイン
int skillidx=0;
- if((skillidx=mob_skillid2skillidx(md->class,NPC_SELFDESTRUCTION2))>=0){
+ if((skillidx=mob_skillid2skillidx(md->class_,NPC_SELFDESTRUCTION2))>=0){
md->mode |= 0x1;
md->next_walktime=tick;
mobskill_use_id(md,&md->bl,skillidx);//自爆詠唱開始
@@ -2374,13 +2374,13 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
// jAthena's exp formula
// per = ((double)md->dmglog[i].dmg)*(9.+(double)((count > 6)? 6:count))/10./((double)max_hp) * dmg_rate;
per = ((double)md->dmglog[i].dmg)*(9.+(double)((count > 6)? 6:count))/10./tdmg;
- temp = (double)mob_db[md->class].base_exp * per;
+ temp = (double)mob_db[md->class_].base_exp * per;
base_exp = (temp > 2147483647.)? 0x7fffffff:(int)temp;
- if(mob_db[md->class].base_exp > 0 && base_exp < 1) base_exp = 1;
+ if(mob_db[md->class_].base_exp > 0 && base_exp < 1) base_exp = 1;
if(base_exp < 0) base_exp = 0;
- temp = (double)mob_db[md->class].job_exp * per;
+ temp = (double)mob_db[md->class_].job_exp * per;
job_exp = (temp > 2147483647.)? 0x7fffffff:(int)temp;
- if(mob_db[md->class].job_exp > 0 && job_exp < 1) job_exp = 1;
+ if(mob_db[md->class_].job_exp > 0 && job_exp < 1) job_exp = 1;
if(job_exp < 0) job_exp = 0;
}
else if (battle_config.exp_calc_type == 1) {
@@ -2388,9 +2388,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
per=(double)md->dmglog[i].dmg*256*(9+(double)((count > 6)? 6:count))/10/(double)max_hp;
if(per>512) per=512;
if(per<1) per=1;
- base_exp=mob_db[md->class].base_exp*per/256;
+ base_exp=mob_db[md->class_].base_exp*per/256;
if(base_exp < 1) base_exp = 1;
- job_exp=mob_db[md->class].job_exp*per/256;
+ job_exp=mob_db[md->class_].job_exp*per/256;
if(job_exp < 1) job_exp = 1;
}
else {
@@ -2398,16 +2398,16 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
per=(double)md->dmglog[i].dmg*256*(9+(double)((count > 6)? 6:count))/10/tdmg;
if(per>512) per=512;
if(per<1) per=1;
- base_exp=mob_db[md->class].base_exp*per/256;
+ base_exp=mob_db[md->class_].base_exp*per/256;
if(base_exp < 1) base_exp = 1;
- job_exp=mob_db[md->class].job_exp*per/256;
+ job_exp=mob_db[md->class_].job_exp*per/256;
if(job_exp < 1) job_exp = 1;
}
- if(sd && battle_config.pk_mode && (mob_db[md->class].lv - sd->status.base_level >= 20)) {
+ if(sd && battle_config.pk_mode && (mob_db[md->class_].lv - sd->status.base_level >= 20)) {
base_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris]
}
- if(sd && battle_config.pk_mode && (mob_db[md->class].lv - sd->status.base_level >= 20)) {
+ if(sd && battle_config.pk_mode && (mob_db[md->class_].lv - sd->status.base_level >= 20)) {
job_exp*=1.15; // pk_mode additional exp if monster >20 levels [Valaris]
}
if(md->master_id || (md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1)) { // for summoned creatures [Valaris]
@@ -2417,12 +2417,12 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
else {
if(battle_config.zeny_from_mobs) {
if(md->level > 0) zeny=(md->level+rand()%md->level)*per/256; // zeny calculation moblv + random moblv [Valaris]
- if(mob_db[md->class].mexp > 0)
+ if(mob_db[md->class_].mexp > 0)
zeny*=rand()%250;
}
- if(battle_config.mobs_level_up && md->level > mob_db[md->class].lv) { // [Valaris]
- job_exp+=((md->level-mob_db[md->class].lv)*mob_db[md->class].job_exp*.03)*per/256;
- base_exp+=((md->level-mob_db[md->class].lv)*mob_db[md->class].base_exp*.03)*per/256;
+ if(battle_config.mobs_level_up && md->level > mob_db[md->class_].lv) { // [Valaris]
+ job_exp+=((md->level-mob_db[md->class_].lv)*mob_db[md->class_].job_exp*.03)*per/256;
+ base_exp+=((md->level-mob_db[md->class_].lv)*mob_db[md->class_].base_exp*.03)*per/256;
}
}
@@ -2473,18 +2473,18 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(md->master_id || (md->state.special_mob_ai >= 1 && battle_config.alchemist_summon_reward != 1)) // Added [Valaris]
break; // End
- if(mob_db[md->class].dropitem[i].nameid <= 0)
+ if(mob_db[md->class_].dropitem[i].nameid <= 0)
continue;
- drop_rate = mob_db[md->class].dropitem[i].p;
+ drop_rate = mob_db[md->class_].dropitem[i].p;
if(drop_rate <= 0 && battle_config.drop_rate0item)
drop_rate = 1;
if(battle_config.drops_by_luk>0 && sd && md) drop_rate+=(sd->status.luk*battle_config.drops_by_luk)/100; // drops affected by luk [Valaris]
- if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class].lv - sd->status.base_level >= 20)) drop_rate*=1.25; // pk_mode increase drops if 20 level difference [Valaris]
+ if(sd && md && battle_config.pk_mode==1 && (mob_db[md->class_].lv - sd->status.base_level >= 20)) drop_rate*=1.25; // pk_mode increase drops if 20 level difference [Valaris]
if(drop_rate <= rand()%10000)
continue;
ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
- ditem->nameid = mob_db[md->class].dropitem[i].nameid;
+ ditem->nameid = mob_db[md->class_].dropitem[i].nameid;
log_item[i] = ditem->nameid;
ditem->amount = 1;
ditem->m = md->bl.m;
@@ -2498,7 +2498,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
#ifndef TXT_ONLY
if(log_config.drop > 0)
- log_drop(mvp_sd, md->class, log_item);
+ log_drop(mvp_sd, md->class_, log_item);
#endif
// Ore Discovery [Celest]
@@ -2520,7 +2520,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
#ifndef TXT_ONLY
if(log_config.drop > 0)
- log_drop(mvp_sd, md->class, log_item);
+ log_drop(mvp_sd, md->class_, log_item);
#endif
if(sd && sd->state.attack_type == BF_WEAPON) {
@@ -2530,8 +2530,8 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(sd->monster_drop_itemid[i] <= 0)
continue;
if(sd->monster_drop_race[i] & (1<<race) ||
- (mob_db[md->class].mode & 0x20 && sd->monster_drop_race[i] & 1<<10) ||
- (!(mob_db[md->class].mode & 0x20) && sd->monster_drop_race[i] & 1<<11) ) {
+ (mob_db[md->class_].mode & 0x20 && sd->monster_drop_race[i] & 1<<10) ||
+ (!(mob_db[md->class_].mode & 0x20) && sd->monster_drop_race[i] & 1<<11) ) {
if(sd->monster_drop_itemrate[i] <= rand()%10000)
continue;
@@ -2548,7 +2548,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
}
}
if(sd->get_zeny_num > 0)
- pc_getzeny(sd,mob_db[md->class].lv*10 + rand()%(sd->get_zeny_num+1));
+ pc_getzeny(sd,mob_db[md->class_].lv*10 + rand()%(sd->get_zeny_num+1));
}
if(md->lootitem) {
for(i=0;i<md->lootitem_count;i++) {
@@ -2568,11 +2568,11 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
}
// mvp処理
- if(mvp_sd && mob_db[md->class].mexp > 0 ){
+ if(mvp_sd && mob_db[md->class_].mexp > 0 ){
int log_mvp[2] = {0};
int j;
int mexp;
- temp = ((double)mob_db[md->class].mexp * (9.+(double)count)/10.); //[Gengar]
+ temp = ((double)mob_db[md->class_].mexp * (9.+(double)count)/10.); //[Gengar]
mexp = (temp > 2147483647.)? 0x7fffffff:(int)temp;
if(mexp < 1) mexp = 1;
clif_mvp_effect(mvp_sd); // エフェクト
@@ -2581,9 +2581,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
log_mvp[1] = mexp;
for(j=0;j<3;j++){
i = rand() % 3;
- if(mob_db[md->class].mvpitem[i].nameid <= 0)
+ if(mob_db[md->class_].mvpitem[i].nameid <= 0)
continue;
- drop_rate = mob_db[md->class].mvpitem[i].p;
+ drop_rate = mob_db[md->class_].mvpitem[i].p;
if(drop_rate <= 0 && battle_config.drop_rate0item)
drop_rate = 1;
if(drop_rate < battle_config.item_drop_mvp_min)
@@ -2593,7 +2593,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(drop_rate <= rand()%10000)
continue;
memset(&item,0,sizeof(item));
- item.nameid=mob_db[md->class].mvpitem[i].nameid;
+ item.nameid=mob_db[md->class_].mvpitem[i].nameid;
item.identify=!itemdb_isequip3(item.nameid);
clif_mvp_item(mvp_sd,item.nameid);
log_mvp[0] = item.nameid;
@@ -2607,7 +2607,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
}
#ifndef TXT_ONLY
if(log_config.mvpdrop > 0)
- log_mvpdrop(mvp_sd, md->class, log_mvp);
+ log_mvpdrop(mvp_sd, md->class_, log_mvp);
#endif
}
@@ -2649,7 +2649,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
clif_clearchar_area(&md->bl,1);
if(md->level) md->level=0;
map_delblock(&md->bl);
- if(mob_get_viewclass(md->class) <= 1000)
+ if(mob_get_viewclass(md->class_) <= 1000)
clif_clearchar_delay(tick+3000,&md->bl,0);
mob_deleteslave(md);
mob_setdelayspawn(md->bl.id);
@@ -2683,7 +2683,7 @@ int mob_class_change(struct mob_data *md,int *value)
max_hp = battle_get_max_hp(&md->bl);
hp_rate = md->hp*100/max_hp;
clif_mob_class_change(md,class);
- md->class = class;
+ md->class_ = class;
max_hp = battle_get_max_hp(&md->bl);
if(battle_config.monster_class_change_full_recover==1) {
md->hp = max_hp;
@@ -2700,8 +2700,8 @@ int mob_class_change(struct mob_data *md,int *value)
md->target_id = 0;
md->move_fail_count = 0;
- md->speed = mob_db[md->class].speed;
- md->def_ele = mob_db[md->class].element;
+ md->speed = mob_db[md->class_].speed;
+ md->def_ele = mob_db[md->class_].element;
mob_changestate(md,MS_IDLE,0);
skill_castcancel(&md->bl,0);
@@ -2742,7 +2742,7 @@ int mob_heal(struct mob_data *md,int heal)
if( max_hp < md->hp )
md->hp = max_hp;
- if(md->class >= 1285 && md->class <=1287) { // guardian hp update [Valaris]
+ if(md->class_ >= 1285 && md->class_ <=1287) { // guardian hp update [Valaris]
struct guild_castle *gc=guild_mapname2gc(map[md->bl.m].name);
if(gc) {
if(md->bl.id==gc->GID0) gc->Ghp0=md->hp;
@@ -2835,7 +2835,7 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type)
}else {
m=md->bl.m;
if(battle_config.error_log==1)
- printf("MOB %d warp failed, class = %d\n",md->bl.id,md->class);
+ printf("MOB %d warp failed, class = %d\n",md->bl.id,md->class_);
}
md->target_id=0; // タゲを解除する
@@ -2846,7 +2846,7 @@ int mob_warp(struct mob_data *md,int m,int x,int y,int type)
if(type>0 && i==1000) {
if(battle_config.battle_log)
- printf("MOB %d warp to (%d,%d), class = %d\n",md->bl.id,x,y,md->class);
+ printf("MOB %d warp to (%d,%d), class = %d\n",md->bl.id,x,y,md->class_);
}
map_addblock(&md->bl);
@@ -3107,7 +3107,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data )
md->skilldelay[md->skillidx]=tick;
if(battle_config.mob_skill_log)
- printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class);
+ printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class_);
// mob_stop_walking(md,0);
switch( skill_get_nk(md->skillid) )
@@ -3117,7 +3117,7 @@ int mobskill_castend_id( int tid, unsigned int tick, int id,int data )
skill_castend_damage_id(&md->bl,bl,md->skillid,md->skilllv,tick,0);
break;
case 1:// 支援系
- if(!mob_db[md->class].skill[md->skillidx].val[0] &&
+ if(!mob_db[md->class_].skill[md->skillidx].val[0] &&
(md->skillid==AL_HEAL || (md->skillid==ALL_RESURRECTION && bl->type != BL_PC)) && battle_check_undead(battle_get_race(bl),battle_get_elem_type(bl)) )
skill_castend_damage_id(&md->bl,bl,md->skillid,md->skilllv,tick,0);
else
@@ -3238,7 +3238,7 @@ int mobskill_castend_pos( int tid, unsigned int tick, int id,int data )
md->skilldelay[md->skillidx]=tick;
if(battle_config.mob_skill_log)
- printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class);
+ printf("MOB skill castend skill=%d, class = %d\n",md->skillid,md->class_);
// mob_stop_walking(md,0);
skill_castend_pos2(&md->bl,md->skillx,md->skilly,md->skillid,md->skilllv,tick,0);
@@ -3258,7 +3258,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx)
int skill_id, skill_lv, forcecast = 0;
nullpo_retr(0, md);
- nullpo_retr(0, ms=&mob_db[md->class].skill[skill_idx]);
+ nullpo_retr(0, ms=&mob_db[md->class_].skill[skill_idx]);
if( target==NULL && (target=map_id2bl(md->target_id))==NULL )
return 0;
@@ -3326,7 +3326,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx)
}
if(battle_config.mob_skill_log)
- printf("MOB skill use target_id=%d skill=%d lv=%d cast=%d, class = %d\n",target->id,skill_id,skill_lv,casttime,md->class);
+ printf("MOB skill use target_id=%d skill=%d lv=%d cast=%d, class = %d\n",target->id,skill_id,skill_lv,casttime,md->class_);
if(casttime>0 || forcecast){ // 詠唱が必要
// struct mob_data *md2;
@@ -3335,7 +3335,7 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx)
md->bl.id, target->id, 0,0, skill_id,casttime);
// 詠唱反応モンスター
-/* if( target->type==BL_MOB && mob_db[(md2=(struct mob_data *)target)->class].mode&0x10 &&
+/* if( target->type==BL_MOB && mob_db[(md2=(struct mob_data *)target)->class_].mode&0x10 &&
md2->state.state!=MS_ATTACK){
md2->target_id=md->bl.id;
md->state.targettype = ATTACKABLE;
@@ -3379,7 +3379,7 @@ int mobskill_use_pos( struct mob_data *md,
int skill_id, skill_lv;
nullpo_retr(0, md);
- nullpo_retr(0, ms=&mob_db[md->class].skill[skill_idx]);
+ nullpo_retr(0, ms=&mob_db[md->class_].skill[skill_idx]);
if( md->bl.prev==NULL )
return 0;
@@ -3424,7 +3424,7 @@ int mobskill_use_pos( struct mob_data *md,
if(battle_config.mob_skill_log)
printf("MOB skill use target_pos=(%d,%d) skill=%d lv=%d cast=%d, class = %d\n",
- skill_x,skill_y,skill_id,skill_lv,casttime,md->class);
+ skill_x,skill_y,skill_id,skill_lv,casttime,md->class_);
if( casttime>0 ) { // A cast time is required.
mob_stop_walking(md,0); // 歩行停止
@@ -3475,7 +3475,7 @@ int mob_getfriendhpltmaxrate_sub(struct block_list *bl,va_list ap)
return 0;
rate=va_arg(ap,int);
fr=va_arg(ap,struct mob_data **);
- if( md->hp < mob_db[md->class].max_hp*rate/100 )
+ if( md->hp < mob_db[md->class_].max_hp*rate/100 )
(*fr)=md;
return 0;
}
@@ -3547,7 +3547,7 @@ int mobskill_use(struct mob_data *md,unsigned int tick,int event)
int i,max_hp;
nullpo_retr(0, md);
- nullpo_retr(0, ms = mob_db[md->class].skill);
+ nullpo_retr(0, ms = mob_db[md->class_].skill);
max_hp = battle_get_max_hp(&md->bl);
@@ -3560,7 +3560,7 @@ int mobskill_use(struct mob_data *md,unsigned int tick,int event)
if(md->sc_data[SC_SELFDESTRUCTION].timer!=-1) //自爆中はスキルを使わない
return 0;
- for(i=0;i<mob_db[md->class].maxskill;i++){
+ for(i=0;i<mob_db[md->class_].maxskill;i++){
int c2=ms[i].cond2,flag=0;
struct mob_data *fmd=NULL;
@@ -3697,18 +3697,18 @@ int mob_gvmobcheck(struct map_session_data *sd, struct block_list *bl)
nullpo_retr(0,bl);
if(bl->type==BL_MOB && (md=(struct mob_data *)bl) &&
- (md->class == 1288 || md->class == 1287 || md->class == 1286 || md->class == 1285))
+ (md->class_ == 1288 || md->class_ == 1287 || md->class_ == 1286 || md->class_ == 1285))
{
struct guild_castle *gc=guild_mapname2gc(map[sd->bl.m].name);
struct guild *g=guild_search(sd->status.guild_id);
- if(g == NULL && md->class == 1288)
+ if(g == NULL && md->class_ == 1288)
return 0;//ギルド未加入ならダメージ無し
else if(gc != NULL && !map[sd->bl.m].flag.gvg)
return 0;//砦内でGvじゃないときはダメージなし
else if(g && gc != NULL && g->guild_id == gc->guild_id)
return 0;//自占領ギルドのエンペならダメージ無し
- else if(g && guild_checkskill(g,GD_APPROVAL) <= 0 && md->class == 1288)
+ else if(g && guild_checkskill(g,GD_APPROVAL) <= 0 && md->class_ == 1288)
return 0;//正規ギルド承認がないとダメージ無し
}
diff --git a/src/map/npc.c b/src/map/npc.c
index 4f6fa42ad..4ef38ff52 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -853,7 +853,7 @@ int npc_checknear(struct map_session_data *sd,int id)
return 1;
}
- if (nd->class<0) // イベント系は常にOK
+ if (nd->class_<0) // イベント系は常にOK
return 0;
// エリア判定
@@ -1022,7 +1022,7 @@ int npc_buylist(struct map_session_data *sd,int n,unsigned short *item_list)
}
//商人経験値
-/* if ((sd->status.class == 5) || (sd->status.class == 10) || (sd->status.class == 18)) {
+/* if ((sd->status.class_ == 5) || (sd->status.class_ == 10) || (sd->status.class_ == 18)) {
z = z * pc_checkskill(sd,MC_DISCOUNT) / ((1 + 300 / itemamount) * 4000) * battle_config.shop_exp;
pc_gainexp(sd,0,z);
}*/
@@ -1082,7 +1082,7 @@ int npc_selllist(struct map_session_data *sd,int n,unsigned short *item_list)
}
//商人経験値
-/* if ((sd->status.class == 5) || (sd->status.class == 10) || (sd->status.class == 18)) {
+/* if ((sd->status.class_ == 5) || (sd->status.class_ == 10) || (sd->status.class_ == 18)) {
z = z * pc_checkskill(sd,MC_OVERCHARGE) / ((1 + 500 / itemamount) * 4000) * battle_config.shop_exp ;
pc_gainexp(sd,0,z);
}*/
@@ -1449,9 +1449,9 @@ int npc_parse_warp(char *w1,char *w2,char *w3,char *w4)
nd->chat_id=0;
if (!battle_config.warp_point_debug)
- nd->class=WARP_CLASS;
+ nd->class_=WARP_CLASS;
else
- nd->class=WARP_DEBUG_CLASS;
+ nd->class_=WARP_DEBUG_CLASS;
nd->speed=200;
nd->option = 0;
nd->opt1 = 0;
@@ -1535,7 +1535,7 @@ static int npc_parse_shop(char *w1,char *w2,char *w3,char *w4)
nd->dir = dir;
nd->flag = 0;
memcpy(nd->name, w3, 24);
- nd->class = atoi(w4);
+ nd->class_ = atoi(w4);
nd->speed = 200;
nd->chat_id = 0;
nd->option = 0;
@@ -1732,7 +1732,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
nd->bl.id=npc_get_new_npc_id();
nd->dir = dir;
nd->flag=0;
- nd->class=class;
+ nd->class_=class;
nd->speed=200;
nd->u.scr.script=script;
nd->u.scr.src_id=src_id;
@@ -1743,7 +1743,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
nd->opt3 = 0;
nd->walktimer=-1;
- //printf("script npc %s %d %d read done\n",mapname,nd->bl.id,nd->class);
+ //printf("script npc %s %d %d read done\n",mapname,nd->bl.id,nd->class_);
npc_script++;
nd->bl.type=BL_NPC;
nd->bl.subtype=SCRIPT;
@@ -1965,7 +1965,7 @@ int npc_parse_mob(char *w1,char *w2,char *w3,char *w4)
memcpy(md->name,w3,24);
md->n = i;
- md->base_class = md->class = class;
+ md->base_class = md->class_ = class;
md->bl.id=npc_get_new_npc_id();
md->m =m;
md->x0=x;
diff --git a/src/map/pc.c b/src/map/pc.c
index e42122665..3288dd1bc 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -269,7 +269,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) {
nullpo_retr(0, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
//-----------------------
// 死亡した
@@ -308,7 +308,7 @@ int pc_setrestartvalue(struct map_session_data *sd,int type) {
/* removed exp penalty on spawn [Valaris] */
- if(type&2 && sd->status.class != 0 && battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty) {
+ if(type&2 && sd->status.class_ != 0 && battle_config.zeny_penalty > 0 && !map[sd->bl.m].flag.nozenypenalty) {
int zeny = (int)((double)sd->status.zeny * (double)battle_config.zeny_penalty / 10000.);
if(zeny < 1) zeny = 1;
sd->status.zeny -= zeny;
@@ -447,7 +447,7 @@ int pc_equippoint(struct map_session_data *sd,int n)
nullpo_retr(0, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
if(sd->inventory_data[n]) {
ep = sd->inventory_data[n]->equip;
@@ -569,14 +569,14 @@ int pc_isequip(struct map_session_data *sd,int n)
// as it allows all advanced classes to equip items their normal versions
// could equip)
//
- if(((sd->status.class==13 || sd->status.class==4014) && ((1<<7)&item->class) == 0) || // have mounted classes use unmounted equipment [Valaris]
- ((sd->status.class==21 || sd->status.class==4022) && ((1<<14)&item->class) == 0))
+ if(((sd->status.class_==13 || sd->status.class_==4014) && ((1<<7)&item->class_) == 0) || // have mounted classes use unmounted equipment [Valaris]
+ ((sd->status.class_==21 || sd->status.class_==4022) && ((1<<14)&item->class_) == 0))
return 0;
- if(sd->status.class!=13 && sd->status.class!=4014 && sd->status.class!=21 && sd->status.class!=4022)
- if((sd->status.class<=4000 && ((1<<sd->status.class)&item->class) == 0) || (sd->status.class>4000 && sd->status.class<4023 && ((1<<(sd->status.class-4001))&item->class) == 0) ||
- (sd->status.class>=4023 && ((1<<(sd->status.class-4023))&item->class) == 0))
+ if(sd->status.class_!=13 && sd->status.class_!=4014 && sd->status.class_!=21 && sd->status.class_!=4022)
+ if((sd->status.class_<=4000 && ((1<<sd->status.class_)&item->class_) == 0) || (sd->status.class_>4000 && sd->status.class_<4023 && ((1<<(sd->status.class_-4001))&item->class_) == 0) ||
+ (sd->status.class_>=4023 && ((1<<(sd->status.class_-4023))&item->class_) == 0))
return 0;
-// if(((1<<sd->status.class)&item->class) == 0)
+// if(((1<<sd->status.class_)&item->class_) == 0)
// return 0;
if(map[sd->bl.m].flag.pvp && (item->flag.no_equip==1 || item->flag.no_equip==3))
return 0;
@@ -735,7 +735,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars
sd->bl.prev = sd->bl.next = NULL;
sd->weapontype1 = sd->weapontype2 = 0;
- sd->view_class = sd->status.class;
+ sd->view_class = sd->status.class_;
sd->speed = DEFAULT_WALK_SPEED;
sd->state.dead_sit = 0;
sd->dir = 0;
@@ -984,7 +984,7 @@ int pc_calc_skilltree(struct map_session_data *sd)
nullpo_retr(0, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
c = s_class.job;
//s = (s_class.upper==1) ? 1 : 0 ; //?生以外は通常のスキル?
s = s_class.upper;
@@ -1193,7 +1193,7 @@ int pc_calcstatus(struct map_session_data* sd,int first)
nullpo_retr(0, sd);
//?生や養子の場合の元の職業を算出する
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
b_speed = sd->speed;
b_max_hp = sd->status.max_hp;
@@ -1220,7 +1220,7 @@ int pc_calcstatus(struct map_session_data* sd,int first)
b_mdef = sd->mdef;
b_mdef2 = sd->mdef2;
b_class = sd->view_class;
- sd->view_class = sd->status.class;
+ sd->view_class = sd->status.class_;
b_base_atk = sd->base_atk;
pc_calc_skilltree(sd); // スキルツリ?の計算
@@ -1847,12 +1847,12 @@ int pc_calcstatus(struct map_session_data* sd,int first)
//Flee上昇
if( (skill=pc_checkskill(sd,TF_MISS))>0 ){ // 回避率?加
- if(sd->status.class==6||sd->status.class==4007 || sd->status.class==23){
+ if(sd->status.class_==6||sd->status.class_==4007 || sd->status.class_==23){
sd->flee += skill*3;
}
- if(sd->status.class==12||sd->status.class==17||sd->status.class==4013||sd->status.class==4018)
+ if(sd->status.class_==12||sd->status.class_==17||sd->status.class_==4013||sd->status.class_==4018)
sd->flee += skill*4;
- if(sd->status.class==12||sd->status.class==4013)
+ if(sd->status.class_==12||sd->status.class_==4013)
sd->speed -= sd->speed *(skill*1.5)/100;
}
if( (skill=pc_checkskill(sd,MO_DODGE))>0 ) // 見切り
@@ -2211,7 +2211,7 @@ int pc_calcspeed (struct map_session_data *sd)
nullpo_retr(0, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
b_speed = sd->speed;
sd->speed = DEFAULT_WALK_SPEED ;
@@ -3371,12 +3371,12 @@ int pc_isUseitem(struct map_session_data *sd,int n)
return 0;
if(item->elv > 0 && sd->status.base_level < item->elv)
return 0;
- if(((sd->status.class==13 || sd->status.class==4014) && ((1<<7)&item->class) == 0) || // have mounted classes use unmounted items [Valaris]
- ((sd->status.class==21 || sd->status.class==4022) && ((1<<14)&item->class) == 0))
+ if(((sd->status.class_==13 || sd->status.class_==4014) && ((1<<7)&item->class_) == 0) || // have mounted classes use unmounted items [Valaris]
+ ((sd->status.class_==21 || sd->status.class_==4022) && ((1<<14)&item->class_) == 0))
return 0;
- if(sd->status.class!=13 && sd->status.class!=4014 && sd->status.class!=21 && sd->status.class!=4022)
- if((sd->status.class<=4000 && ((1<<sd->status.class)&item->class) == 0) || (sd->status.class>4000 && sd->status.class<4023 && ((1<<(sd->status.class-4001))&item->class) == 0) ||
- (sd->status.class>=4023 && ((1<<(sd->status.class-4023))&item->class) == 0))
+ if(sd->status.class_!=13 && sd->status.class_!=4014 && sd->status.class_!=21 && sd->status.class_!=4022)
+ if((sd->status.class_<=4000 && ((1<<sd->status.class_)&item->class_) == 0) || (sd->status.class_>4000 && sd->status.class_<4023 && ((1<<(sd->status.class_-4001))&item->class_) == 0) ||
+ (sd->status.class_>=4023 && ((1<<(sd->status.class_-4023))&item->class_) == 0))
return 0;
#ifndef TXT_ONLY
@@ -3730,25 +3730,25 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
int i,skill,rate,itemid,flag, count;
struct mob_data *md;
md=(struct mob_data *)bl;
- if(!md->state.steal_flag && mob_db[md->class].mexp <= 0 && !(mob_db[md->class].mode&0x20) &&
- (!(md->class>1324 && md->class<1364))) // prevent stealing from treasure boxes [Valaris]
+ if(!md->state.steal_flag && mob_db[md->class_].mexp <= 0 && !(mob_db[md->class_].mode&0x20) &&
+ (!(md->class_>1324 && md->class_<1364))) // prevent stealing from treasure boxes [Valaris]
{
if (md->sc_data && (md->sc_data[SC_STONE].timer != -1 || md->sc_data[SC_FREEZE].timer != -1))
return 0;
skill = battle_config.skill_steal_type == 1
- ? (sd->paramc[4] - mob_db[md->class].dex)/2 + pc_checkskill(sd,TF_STEAL)*6 + 10
- : sd->paramc[4] - mob_db[md->class].dex + pc_checkskill(sd,TF_STEAL)*3 + 10;
+ ? (sd->paramc[4] - mob_db[md->class_].dex)/2 + pc_checkskill(sd,TF_STEAL)*6 + 10
+ : sd->paramc[4] - mob_db[md->class_].dex + pc_checkskill(sd,TF_STEAL)*3 + 10;
if(0 < skill)
{
for(count = 8; count <= 8 && count != 0; count--)
{
i = rand()%8;
- itemid = mob_db[md->class].dropitem[i].nameid;
+ itemid = mob_db[md->class_].dropitem[i].nameid;
if(itemid > 0 && itemdb_type(itemid) != 6)
{
- rate = (mob_db[md->class].dropitem[i].p / battle_config.item_rate_common * 100 * skill)/100;
+ rate = (mob_db[md->class_].dropitem[i].p / battle_config.item_rate_common * 100 * skill)/100;
if(rand()%10000 < rate)
{
@@ -3796,9 +3796,9 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *bl)
if (md->sc_data && (md->sc_data[SC_STONE].timer != -1 || md->sc_data[SC_FREEZE].timer != -1))
return 0;
skill = pc_checkskill(sd,RG_STEALCOIN)*10;
- rate = skill + (sd->status.base_level - mob_db[md->class].lv)*3 + sd->paramc[4]*2 + sd->paramc[5]*2;
+ rate = skill + (sd->status.base_level - mob_db[md->class_].lv)*3 + sd->paramc[4]*2 + sd->paramc[5]*2;
if(rand()%1000 < rate) {
- pc_getzeny(sd,mob_db[md->class].lv*10 + rand()%100);
+ pc_getzeny(sd,mob_db[md->class_].lv*10 + rand()%100);
md->state.steal_coin_flag = 1;
return 1;
}
@@ -4859,7 +4859,7 @@ int pc_checkbaselevelup(struct map_session_data *sd)
nullpo_retr(0, sd);
if(sd->status.base_exp >= next && next > 0){
- struct pc_base_job s_class = pc_calc_base_job(sd->status.class);
+ struct pc_base_job s_class = pc_calc_base_job(sd->status.class_);
// base側レベルアップ?理
sd->status.base_exp -= next;
@@ -4989,12 +4989,12 @@ int pc_nextbaseexp(struct map_session_data *sd)
if(sd->status.base_level>=MAX_LEVEL || sd->status.base_level<=0)
return 0;
- if(sd->status.class==0) i=0;
- else if(sd->status.class<=6) i=1;
- else if(sd->status.class<=22) i=2;
- else if(sd->status.class==23) i=3;
- else if(sd->status.class==4001) i=4;
- else if(sd->status.class<=4007) i=5;
+ if(sd->status.class_==0) i=0;
+ else if(sd->status.class_<=6) i=1;
+ else if(sd->status.class_<=22) i=2;
+ else if(sd->status.class_==23) i=3;
+ else if(sd->status.class_==4001) i=4;
+ else if(sd->status.class_<=4007) i=5;
else i=6;
return exp_table[i][sd->status.base_level-1];
@@ -5013,12 +5013,12 @@ int pc_nextjobexp(struct map_session_data *sd)
if(sd->status.job_level>=MAX_LEVEL || sd->status.job_level<=0)
return 0;
- if(sd->status.class==0) i=7;
- else if(sd->status.class<=6) i=8;
- else if(sd->status.class<=22) i=9;
- else if(sd->status.class==23) i=10;
- else if(sd->status.class==4001) i=11;
- else if(sd->status.class<=4007) i=12;
+ if(sd->status.class_==0) i=7;
+ else if(sd->status.class_<=6) i=8;
+ else if(sd->status.class_<=22) i=9;
+ else if(sd->status.class_==23) i=10;
+ else if(sd->status.class_==4001) i=11;
+ else if(sd->status.class_<=4007) i=12;
else i=13;
return exp_table[i][sd->status.job_level-1];
@@ -5037,12 +5037,12 @@ int pc_nextbaseafter(struct map_session_data *sd)
if(sd->status.base_level>=MAX_LEVEL || sd->status.base_level<=0)
return 0;
- if(sd->status.class==0) i=0;
- else if(sd->status.class<=6) i=1;
- else if(sd->status.class<=22) i=2;
- else if(sd->status.class==23) i=3;
- else if(sd->status.class==4001) i=4;
- else if(sd->status.class<=4007) i=5;
+ if(sd->status.class_==0) i=0;
+ else if(sd->status.class_<=6) i=1;
+ else if(sd->status.class_<=22) i=2;
+ else if(sd->status.class_==23) i=3;
+ else if(sd->status.class_==4001) i=4;
+ else if(sd->status.class_<=4007) i=5;
else i=6;
return exp_table[i][sd->status.base_level];
@@ -5061,12 +5061,12 @@ int pc_nextjobafter(struct map_session_data *sd)
if(sd->status.job_level>=MAX_LEVEL || sd->status.job_level<=0)
return 0;
- if(sd->status.class==0) i=7;
- else if(sd->status.class<=6) i=8;
- else if(sd->status.class<=22) i=9;
- else if(sd->status.class==23) i=10;
- else if(sd->status.class==4001) i=11;
- else if(sd->status.class<=4007) i=12;
+ if(sd->status.class_==0) i=7;
+ else if(sd->status.class_<=6) i=8;
+ else if(sd->status.class_<=22) i=9;
+ else if(sd->status.class_==23) i=10;
+ else if(sd->status.class_==4001) i=11;
+ else if(sd->status.class_<=4007) i=12;
else i=13;
return exp_table[i][sd->status.job_level];
@@ -5104,7 +5104,7 @@ int pc_statusup(struct map_session_data *sd,int type)
nullpo_retr(0, sd);
- max = (pc_calc_upper(sd->status.class)==2) ? 80 : battle_config.max_parameter;
+ max = (pc_calc_upper(sd->status.class_)==2) ? 80 : battle_config.max_parameter;
need=pc_need_status_point(sd,type);
if(type<SP_STR || type>SP_LUK || need<0 || need>sd->status.status_point){
@@ -5259,7 +5259,7 @@ int pc_skillup(struct map_session_data *sd,int skill_num)
if( sd->status.skill_point>0 &&
sd->status.skill[skill_num].id!=0 &&
//sd->status.skill[skill_num].lv < skill_get_max(skill_num) ) - celest
- sd->status.skill[skill_num].lv < skill_tree_get_max(skill_num, sd->status.class) )
+ sd->status.skill[skill_num].lv < skill_tree_get_max(skill_num, sd->status.class_) )
{
sd->status.skill[skill_num].lv++;
sd->status.skill_point--;
@@ -5285,7 +5285,7 @@ int pc_allskillup(struct map_session_data *sd)
nullpo_retr(0, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
c = s_class.job;
s = (s_class.upper==1) ? 1 : 0 ; //?生以外は通常のスキル?
@@ -5313,7 +5313,7 @@ int pc_allskillup(struct map_session_data *sd)
if(sd->status.skill[id].id==0 && (!(skill_get_inf2(id)&0x01) || battle_config.quest_skill_learn) ) {
sd->status.skill[id].id = id; // celest
// sd->status.skill[id].lv=skill_get_max(id);
- sd->status.skill[id].lv = skill_tree_get_max(id, sd->status.class); // celest
+ sd->status.skill[id].lv = skill_tree_get_max(id, sd->status.class_); // celest
}
}
}
@@ -5351,7 +5351,7 @@ int pc_resetlvl(struct map_session_data* sd,int type)
sd->status.int_=1;
sd->status.dex=1;
sd->status.luk=1;
- if(sd->status.class == 4001)
+ if(sd->status.class_ == 4001)
sd->status.status_point=88;
}
@@ -5416,7 +5416,7 @@ int pc_resetstate(struct map_session_data* sd)
// New statpoint table used here - Dexity
sd->status.status_point = atoi (statp[sd->status.base_level - 1]);
- if(sd->status.class >= 4001 && sd->status.class <= 4024)
+ if(sd->status.class_ >= 4001 && sd->status.class_ <= 4024)
sd->status.status_point+=40;
// End addition
@@ -5504,7 +5504,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
nullpo_retr(0, sd);
//?生や養子の場合の元の職業を算出する
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
// ?に死んでいたら無?
if(pc_isdead(sd))
return 0;
@@ -5612,7 +5612,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage)
}
if(battle_config.death_penalty_type>0) { // changed penalty options, added death by player if pk_mode [Valaris]
- if(sd->status.class != 0 && !map[sd->bl.m].flag.nopenalty && !map[sd->bl.m].flag.gvg){ // only novices will recieve no penalty
+ if(sd->status.class_ != 0 && !map[sd->bl.m].flag.nopenalty && !map[sd->bl.m].flag.gvg){ // only novices will recieve no penalty
if(battle_config.death_penalty_type==1 && battle_config.death_penalty_base > 0)
sd->status.base_exp -= (double)pc_nextbaseexp(sd) * (double)battle_config.death_penalty_base/10000;
if(battle_config.pk_mode && src && src->type==BL_PC)
@@ -5748,7 +5748,7 @@ int pc_readparam(struct map_session_data *sd,int type)
int val=0;
struct pc_base_job s_class;
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
nullpo_retr(0, sd);
@@ -5772,7 +5772,7 @@ int pc_readparam(struct map_session_data *sd,int type)
if(val>=24 && val < 45)
val+=3978;
else
- val= sd->status.class;
+ val= sd->status.class_;
break;
case SP_BASEJOB:
val= s_class.job;
@@ -5850,7 +5850,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
nullpo_retr(0, sd);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
switch(type){
case SP_BASELEVEL:
@@ -5873,7 +5873,7 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
// super novices can go up to 99 [celest]
else if (s_class.job == 23)
up_level += 49;
- else if (sd->status.class >= 4008 && sd->status.class <= 4022)
+ else if (sd->status.class_ >= 4008 && sd->status.class_ <= 4022)
up_level += 20;
if (val >= sd->status.job_level) {
if (val > up_level)val = up_level;
@@ -6160,7 +6160,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
int i;
int b_class = 0;
//?生や養子の場合の元の職業を算出する
- struct pc_base_job s_class = pc_calc_base_job(sd->status.class);
+ struct pc_base_job s_class = pc_calc_base_job(sd->status.class_);
nullpo_retr(0, sd);
@@ -6188,7 +6188,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
if((sd->status.sex == 0 && job == 19) || (sd->status.sex == 1 && job == 20) ||
// not needed [celest]
//(sd->status.sex == 0 && job == 4020) || (sd->status.sex == 1 && job == 4021) ||
- job == 22 || sd->status.class == b_class) //♀はバ?ドになれない、♂はダンサ?になれない、結婚衣裳もお?り
+ job == 22 || sd->status.class_ == b_class) //♀はバ?ドになれない、♂はダンサ?になれない、結婚衣裳もお?り
return 1;
// check if we are changing from 1st to 2nd job
@@ -6203,7 +6203,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
pc_setglobalreg (sd, "jobchange_level", sd->change_level);
- sd->status.class = sd->view_class = b_class;
+ sd->status.class_ = sd->view_class = b_class;
sd->status.job_level=1;
sd->status.job_exp=0;
@@ -6369,17 +6369,17 @@ int pc_setriding(struct map_session_data *sd)
if((pc_checkskill(sd,KN_RIDING)>0)){ // ライディングスキル所持
pc_setoption(sd,sd->status.option|0x0020);
- if(sd->status.class==7)
- sd->status.class=sd->view_class=13;
+ if(sd->status.class_==7)
+ sd->status.class_=sd->view_class=13;
- if(sd->status.class==14)
- sd->status.class=sd->view_class=21;
+ if(sd->status.class_==14)
+ sd->status.class_=sd->view_class=21;
- if(sd->status.class==4008)
- sd->status.class=sd->view_class=4014;
+ if(sd->status.class_==4008)
+ sd->status.class_=sd->view_class=4014;
- if(sd->status.class==4015)
- sd->status.class=sd->view_class=4022;
+ if(sd->status.class_==4015)
+ sd->status.class_=sd->view_class=4022;
}
return 0;
@@ -6857,7 +6857,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos)
// 二刀流?理
if ((pos==0x22) // 一?、?備要求箇所が二刀流武器かチェックする
&& (id->equip==2) // ? 手武器
- && (pc_checkskill(sd, AS_LEFT) > 0 || pc_calc_base_job2(sd->status.class) == 12) ) // 左手修?有
+ && (pc_checkskill(sd, AS_LEFT) > 0 || pc_calc_base_job2(sd->status.class_) == 12) ) // 左手修?有
{
int tpos=0;
if(sd->equip_index[8] >= 0)
@@ -7234,7 +7234,7 @@ int pc_ismarried(struct map_session_data *sd)
*/
int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
{
- if(sd == NULL || dstsd == NULL || sd->status.partner_id > 0 || dstsd->status.partner_id > 0 || pc_calc_upper(sd->status.class)==2)
+ if(sd == NULL || dstsd == NULL || sd->status.partner_id > 0 || dstsd->status.partner_id > 0 || pc_calc_upper(sd->status.class_)==2)
return -1;
sd->status.partner_id=dstsd->status.char_id;
dstsd->status.partner_id=sd->status.char_id;
@@ -7503,7 +7503,7 @@ static int pc_natural_heal_sp(struct map_session_data *sd)
if(sd->nshealsp > 0) {
if(sd->inchealsptick >= battle_config.natural_heal_skill_interval && sd->status.sp < sd->status.max_sp) {
- struct pc_base_job s_class = pc_calc_base_job(sd->status.class);
+ struct pc_base_job s_class = pc_calc_base_job(sd->status.class_);
if(sd->doridori_counter && s_class.job == 23)
bonus = sd->nshealsp*2;
else
diff --git a/src/map/pet.c b/src/map/pet.c
index 80331bd0f..3c87a91e5 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -183,14 +183,14 @@ static int pet_attack(struct pet_data *pd,unsigned int tick,int data)
return 0;
}
- mode=mob_db[pd->class].mode;
- race=mob_db[pd->class].race;
- if(mob_db[pd->class].mexp <= 0 && !(mode&0x20) && (md->option & 0x06 && race != 4 && race != 6) ) {
+ mode=mob_db[pd->class_].mode;
+ race=mob_db[pd->class_].race;
+ if(mob_db[pd->class_].mexp <= 0 && !(mode&0x20) && (md->option & 0x06 && race != 4 && race != 6) ) {
pd->target_id=0;
return 0;
}
- range = mob_db[pd->class].range + 1;
+ range = mob_db[pd->class_].range + 1;
if(distance(pd->bl.x,pd->bl.y,md->bl.x,md->bl.y) > range)
return 0;
if(battle_config.monster_attack_direction_change)
@@ -308,15 +308,15 @@ int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type)
Assert((pd->msd == 0) || (pd->msd->pd == pd));
- if(bl && pd && bl->type == BL_MOB && sd->pet.intimate > 900 && sd->pet.hungry > 0 && pd->class != battle_get_class(bl)
+ if(bl && pd && bl->type == BL_MOB && sd->pet.intimate > 900 && sd->pet.hungry > 0 && pd->class_ != battle_get_class(bl)
&& pd->state.state != MS_DELAY) {
- mode=mob_db[pd->class].mode;
- race=mob_db[pd->class].race;
+ mode=mob_db[pd->class_].mode;
+ race=mob_db[pd->class_].race;
md=(struct mob_data *)bl;
if(md->bl.type != BL_MOB || pd->bl.m != md->bl.m || md->bl.prev == NULL ||
distance(pd->bl.x,pd->bl.y,md->bl.x,md->bl.y) > 13)
return 0;
- if(mob_db[pd->class].mexp <= 0 && !(mode&0x20) && (md->option & 0x06 && race!=4 && race!=6) )
+ if(mob_db[pd->class_].mexp <= 0 && !(mode&0x20) && (md->option & 0x06 && race!=4 && race!=6) )
return 0;
if(!type) {
rate = sd->petDB->attack_rate;
@@ -541,11 +541,11 @@ int search_petDB_index(int key,int type)
int i;
for(i=0;i<MAX_PET_DB;i++) {
- if(pet_db[i].class <= 0)
+ if(pet_db[i].class_ <= 0)
continue;
switch(type) {
case PET_CLASS:
- if(pet_db[i].class == key)
+ if(pet_db[i].class_ == key)
return i;
break;
case PET_CATCH:
@@ -703,7 +703,7 @@ int pet_data_init(struct map_session_data *sd)
return 1;
}
- i = search_petDB_index(sd->pet.class,PET_CLASS);
+ i = search_petDB_index(sd->pet.class_,PET_CLASS);
if(i < 0) {
sd->status.pet_id = 0;
return 1;
@@ -720,7 +720,7 @@ int pet_data_init(struct map_session_data *sd)
pd->bl.y = pd->to_y;
pd->bl.id = npc_get_new_npc_id();
memcpy(pd->name,sd->pet.name,24);
- pd->class = sd->pet.class;
+ pd->class_ = sd->pet.class_;
pd->equip = sd->pet.equip;
pd->dir = sd->dir;
pd->speed = sd->petDB->speed;
@@ -865,17 +865,17 @@ int pet_catch_process2(struct map_session_data *sd,int target_id)
return 1;
}
- i = search_petDB_index(md->class,PET_CLASS);
- if(md == NULL || md->bl.type != BL_MOB || md->bl.prev == NULL || i < 0 || sd->catch_target_class != md->class) {
+ i = search_petDB_index(md->class_,PET_CLASS);
+ if(md == NULL || md->bl.type != BL_MOB || md->bl.prev == NULL || i < 0 || sd->catch_target_class != md->class_) {
clif_pet_rulet(sd,0);
return 1;
}
//target_idによる敵→卵判定
// if(battle_config.etc_log)
-// printf("mob_id = %d, mob_class = %d\n",md->bl.id,md->class);
+// printf("mob_id = %d, mob_class = %d\n",md->bl.id,md->class_);
//成功の場合
- pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - mob_db[md->class].lv)*30 + sd->paramc[5]*20)*(200 - md->hp*100/mob_db[md->class].max_hp)/100;
+ pet_catch_rate = (pet_db[i].capture + (sd->status.base_level - mob_db[md->class_].lv)*30 + sd->paramc[5]*20)*(200 - md->hp*100/mob_db[md->class_].max_hp)/100;
if(pet_catch_rate < 1) pet_catch_rate = 1;
if(battle_config.pet_catch_rate != 100)
pet_catch_rate = (pet_catch_rate*battle_config.pet_catch_rate)/100;
@@ -885,7 +885,7 @@ int pet_catch_process2(struct map_session_data *sd,int target_id)
clif_pet_rulet(sd,1);
// if(battle_config.etc_log)
// printf("rulet success %d\n",target_id);
- intif_create_pet(sd->status.account_id,sd->status.char_id,pet_db[i].class,mob_db[pet_db[i].class].lv,
+ intif_create_pet(sd->status.account_id,sd->status.char_id,pet_db[i].class_,mob_db[pet_db[i].class_].lv,
pet_db[i].EggID,0,pet_db[i].intimate,100,0,1,pet_db[i].jname);
}
else
@@ -1111,7 +1111,7 @@ static int pet_randomwalk(struct pet_data *pd,int tick)
pd->move_fail_count++;
if(pd->move_fail_count>1000){
if(battle_config.error_log)
- printf("PET cant move. hold position %d, class = %d\n",pd->bl.id,pd->class);
+ printf("PET cant move. hold position %d, class = %d\n",pd->bl.id,pd->class_);
pd->move_fail_count=0;
pet_changestate(pd,MS_DELAY,60000);
return 0;
@@ -1184,15 +1184,15 @@ static int pet_ai_sub_hard(struct pet_data *pd,unsigned int tick)
pet_randomwalk(pd,tick);
}
else if(pd->target_id - MAX_FLOORITEM > 0) {
- mode=mob_db[pd->class].mode;
- race=mob_db[pd->class].race;
+ mode=mob_db[pd->class_].mode;
+ race=mob_db[pd->class_].race;
md=(struct mob_data *)map_id2bl(pd->target_id);
if(md == NULL || md->bl.type != BL_MOB || pd->bl.m != md->bl.m || md->bl.prev == NULL ||
distance(pd->bl.x,pd->bl.y,md->bl.x,md->bl.y) > 13)
pet_unlocktarget(pd);
- else if(mob_db[pd->class].mexp <= 0 && !(mode&0x20) && (md->option & 0x06 && race!=4 && race!=6) )
+ else if(mob_db[pd->class_].mexp <= 0 && !(mode&0x20) && (md->option & 0x06 && race!=4 && race!=6) )
pet_unlocktarget(pd);
- else if(!battle_check_range(&pd->bl,&md->bl,mob_db[pd->class].range)){
+ else if(!battle_check_range(&pd->bl,&md->bl,mob_db[pd->class_].range)){
if(pd->timer != -1 && pd->state.state == MS_WALK && distance(pd->to_x,pd->to_y,md->bl.x,md->bl.y) < 2)
return 0;
if( !pet_can_reach(pd,md->bl.x,md->bl.y))
@@ -1641,7 +1641,7 @@ int read_petdb()
continue;
//MobID,Name,JName,ItemID,EggID,AcceID,FoodID,"Fullness (1回の餌での満腹度増加率%)","HungryDeray (/min)","R_Hungry (空腹時餌やり親密度増加率%)","R_Full (とても満腹時餌やり親密度減少率%)","Intimate (捕獲時親密度%)","Die (死亡時親密度減少率%)","Capture (捕獲率%)",(Name)
- pet_db[j].class = nameid;
+ pet_db[j].class_ = nameid;
memcpy(pet_db[j].name,str[1],24);
memcpy(pet_db[j].jname,str[2],24);
pet_db[j].itemID=atoi(str[3]);
diff --git a/src/map/pet.h b/src/map/pet.h
index b811735b1..1664f42d5 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -6,7 +6,7 @@
#define PETLOOT_SIZE 20 // [Valaris]
struct pet_db {
- int class;
+ int class_;
char name[24],jname[24];
int itemID;
int EggID;
diff --git a/src/map/script.c b/src/map/script.c
index 788c755e5..7730c2ed9 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -3666,10 +3666,10 @@ int buildin_makepet(struct script_state *st)
if (pet_id < 0)
pet_id = search_petDB_index(id, PET_EGG);
if (pet_id >= 0 && sd) {
- sd->catch_target_class = pet_db[pet_id].class;
+ sd->catch_target_class = pet_db[pet_id].class_;
intif_create_pet(
sd->status.account_id, sd->status.char_id,
- pet_db[pet_id].class, mob_db[pet_db[pet_id].class].lv,
+ pet_db[pet_id].class_, mob_db[pet_db[pet_id].class_].lv,
pet_db[pet_id].EggID, 0, pet_db[pet_id].intimate,
100, 0, 1, pet_db[pet_id].jname);
}
@@ -4426,13 +4426,13 @@ int buildin_changesex(struct script_state *st) {
if (sd->status.sex == 0) {
sd->status.sex = 1;
sd->sex = 1;
- if (sd->status.class == 20 || sd->status.class == 4021)
- sd->status.class -= 1;
+ if (sd->status.class_ == 20 || sd->status.class_ == 4021)
+ sd->status.class_ -= 1;
} else if (sd->status.sex == 1) {
sd->status.sex = 0;
sd->sex = 0;
- if(sd->status.class == 19 || sd->status.class == 4020)
- sd->status.class += 1;
+ if(sd->status.class_ == 19 || sd->status.class_ == 4020)
+ sd->status.class_ += 1;
}
chrif_char_ask_name(-1, sd->status.name, 5, 0, 0, 0, 0, 0, 0); // type: 5 - changesex
chrif_save(sd);
@@ -4978,7 +4978,7 @@ int buildin_maprespawnguildid_sub(struct block_list *bl,va_list ap)
pc_setpos(sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,3); // end addition [Valaris]
}
if(md && flag&4){
- if(md->class < 1285 || md->class > 1288)
+ if(md->class_ < 1285 || md->class_ > 1288)
mob_delete(md);
}
return 0;
diff --git a/src/map/skill.c b/src/map/skill.c
index af8db17cc..55b531fd7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -2969,7 +2969,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
if( dstsd && dstsd->special_state.no_magic_damage )
heal=0; /* ?金蟲カ?ド(ヒ?ル量0) */
if (sd){
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
if((skill=pc_checkskill(sd,HP_MEDITATIO))>0) // メディテイティオ
heal += heal*skill*2/100;
if(sd && dstsd && sd->status.partner_id == dstsd->status.char_id && s_class.job == 23 && sd->status.sex == 0) //自分も?象もPC、?象が自分のパ?トナ?、自分がスパノビ、自分が♀なら
@@ -3157,8 +3157,8 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
clif_skill_nodamage(src,bl,skillid,skilllv,1);
if (dstmd){
for(i=0;i<MAX_PET_DB;i++){
- if(dstmd->class == pet_db[i].class){
- pet_catch_process1(sd,dstmd->class);
+ if(dstmd->class_ == pet_db[i].class_){
+ pet_catch_process1(sd,dstmd->class_);
break;
}
}
@@ -3391,7 +3391,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case CR_DEVOTION: /* ディボ?ション */
if(sd && dstsd){
//?生や養子の場合の元の職業を算出する
- struct pc_base_job dst_s_class = pc_calc_base_job(dstsd->status.class);
+ struct pc_base_job dst_s_class = pc_calc_base_job(dstsd->status.class_);
int lv = sd->status.base_level-dstsd->status.base_level;
lv = (lv<0)?-lv:lv;
@@ -3457,7 +3457,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
}else if(sd && dstmd){ //?象がモンスタ?の場合
//20%の確率で?象のLv*2のSPを回復する。成功したときはタ?ゲット(σ?Д?)σ????!!
if(rand()%100<20){
- i=2*mob_db[dstmd->class].lv;
+ i=2*mob_db[dstmd->class_].lv;
mob_target(dstmd,src,0);
}
}
@@ -4303,7 +4303,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case NPC_PROVOCATION:
clif_skill_nodamage(src,bl,skillid,skilllv,1);
if(md)
- clif_pet_performance(src,mob_db[md->class].skill[md->skillidx].val[0]);
+ clif_pet_performance(src,mob_db[md->class_].skill[md->skillidx].val[0]);
break;
case NPC_HALLUCINATION:
@@ -4372,18 +4372,18 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int
case NPC_SUMMONSLAVE: /* 手下召喚 */
case NPC_SUMMONMONSTER: /* MOB召喚 */
if(md)
- mob_summonslave(md,mob_db[md->class].skill[md->skillidx].val,skilllv,(skillid==NPC_SUMMONSLAVE)?1:0);
+ mob_summonslave(md,mob_db[md->class_].skill[md->skillidx].val,skilllv,(skillid==NPC_SUMMONSLAVE)?1:0);
break;
case NPC_TRANSFORMATION:
case NPC_METAMORPHOSIS:
if(md)
- mob_class_change(md,mob_db[md->class].skill[md->skillidx].val);
+ mob_class_change(md,mob_db[md->class_].skill[md->skillidx].val);
break;
case NPC_EMOTION: /* エモ?ション */
if(md)
- clif_emotion(&md->bl,mob_db[md->class].skill[md->skillidx].val[0]);
+ clif_emotion(&md->bl,mob_db[md->class_].skill[md->skillidx].val[0]);
break;
case NPC_DEFENDER:
@@ -6837,14 +6837,14 @@ static int skill_check_condition_char_sub(struct block_list *bl,va_list ap)
nullpo_retr(0, c=va_arg(ap,int *));
nullpo_retr(0, ssd=(struct map_session_data*)src);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
//チェックしない設定ならcにありえない大きな?字を返して終了
if(!battle_config.player_skill_partner_check){ //本?はforeachの前にやりたいけど設定適用箇所をまとめるためにここへ
(*c)=99;
return 0;
}
- ss_class = pc_calc_base_job(ssd->status.class);
+ ss_class = pc_calc_base_job(ssd->status.class_);
switch(ssd->skillid){
case PR_BENEDICTIO: /* 聖?降福 */
@@ -6898,7 +6898,7 @@ static int skill_check_condition_use_sub(struct block_list *bl,va_list ap)
nullpo_retr(0, c=va_arg(ap,int *));
nullpo_retr(0, ssd=(struct map_session_data*)src);
- s_class = pc_calc_base_job(sd->status.class);
+ s_class = pc_calc_base_job(sd->status.class_);
//チェックしない設定ならcにありえない大きな?字を返して終了
if(!battle_config.player_skill_partner_check){ //本?はforeachの前にやりたいけど設定適用箇所をまとめるためにここへ
@@ -6906,7 +6906,7 @@ static int skill_check_condition_use_sub(struct block_list *bl,va_list ap)
return 0;
}
- ss_class = pc_calc_base_job(ssd->status.class);
+ ss_class = pc_calc_base_job(ssd->status.class_);
skillid=ssd->skillid;
skilllv=ssd->skilllv;
//if(skilllv <= 0) return 0;
@@ -6967,7 +6967,7 @@ static int skill_check_condition_mob_master_sub(struct block_list *bl,va_list ap
nullpo_retr(0, mob_class=va_arg(ap,int));
nullpo_retr(0, c=va_arg(ap,int *));
- if(md->class==mob_class && md->master_id==src_id)
+ if(md->class_==mob_class && md->master_id==src_id)
(*c)++;
return 0;
}
@@ -7782,7 +7782,7 @@ int skill_use_id( struct map_session_data *sd, int target_id,
clif_skillcasting( &sd->bl, sd->bl.id, target_id, 0,0, skill_num,casttime);
/* 詠唱反?モンスタ? */
- if( bl->type==BL_MOB && (md=(struct mob_data *)bl) && mob_db[md->class].mode&0x10 &&
+ if( bl->type==BL_MOB && (md=(struct mob_data *)bl) && mob_db[md->class_].mode&0x10 &&
md->state.state!=MS_ATTACK && sd->invincible_timer == -1){
md->target_id=sd->bl.id;
md->state.targettype = ATTACKABLE;