From 6a079edada5a1abdbba3be15d0a8ac5f72fda0a9 Mon Sep 17 00:00:00 2001 From: wizputer Date: Sun, 28 Nov 2004 00:01:39 +0000 Subject: Fixed online system, online column works and prevent double login at the login server git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@392 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/chrif.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'src/map/chrif.c') diff --git a/src/map/chrif.c b/src/map/chrif.c index adb26868d..a0706f594 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -904,11 +904,45 @@ int chrif_char_offline(struct map_session_data *sd) WFIFOW(char_fd,0) = 0x2b17; WFIFOL(char_fd,2) = sd->status.char_id; - WFIFOSET(char_fd,6); + WFIFOL(char_fd,6) = sd->status.account_id; + WFIFOSET(char_fd,10); + + return 0; +} + +/*========================================= + * Tell char-server to reset all chars offline [Wizputer] + *----------------------------------------- + */ +int chrif_char_reset_offline(void) { + if (char_fd < 0) + return -1; + + WFIFOW(char_fd,0) = 0x2b18; + WFIFOSET(char_fd,2); return 0; } +/*========================================= + * Tell char-server charcter is online [Wizputer] + *----------------------------------------- + */ + +int chrif_char_online(struct map_session_data *sd) +{ + if (char_fd < 0) + return -1; + + WFIFOW(char_fd,0) = 0x2b19; + WFIFOL(char_fd,2) = sd->status.char_id; + WFIFOL(char_fd,6) = sd->status.account_id; + WFIFOSET(char_fd,10); + + return 0; +} + + /*========================================== * *------------------------------------------ -- cgit v1.2.3-70-g09d2 From bd6e84abfbb76a56b93597761fd5158a3aa265d5 Mon Sep 17 00:00:00 2001 From: wizputer Date: Sun, 28 Nov 2004 04:42:06 +0000 Subject: * Fixed a few map crashes when char-server crashes [Wizputer] * Added fix of 0x2aff and 0x2af8 flooding [Wizputer - thanks Toster] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@395 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 2 ++ src/map/chrif.c | 51 +++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 39 insertions(+), 14 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index e30a15ec9..029e7c355 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,7 @@ Date Added 11/27 + * Fixed a few map crashes when char-server crashes [Wizputer] + * Added fix of 0x2aff and 0x2af8 flooding [Wizputer - thanks Toster] * Fixed Map crash when person uses global message hacks [Wizputer] * Fixed online system, online column works and prevent double login at the login server [Wizputer] * Fixed some compile time errors associated with showmsg [MouseJstr] diff --git a/src/map/chrif.c b/src/map/chrif.c index a0706f594..479b328f5 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -98,7 +98,7 @@ int chrif_save(struct map_session_data *sd) { nullpo_retr(-1, sd); - if (char_fd < 0) + if (char_fd < 1) return -1; pc_makesavestatus(sd); @@ -184,7 +184,10 @@ int chrif_changemapserver(struct map_session_data *sd, char *name, int x, int y, int i, s_ip; nullpo_retr(-1, sd); - + + if (!sd || char_fd < 1 ) + return -1; + s_ip = 0; for(i = 0; i < fd_max; i++) if (session[i] && session[i]->session_data == sd) { @@ -283,7 +286,7 @@ int chrif_authreq(struct map_session_data *sd) nullpo_retr(-1, sd); - if (!sd || !char_fd || !sd->bl.id || !sd->login_id1) + if (!sd || char_fd < 1 || !sd->bl.id || !sd->login_id1) return -1; for(i = 0; i < fd_max; i++) @@ -311,7 +314,7 @@ int chrif_charselectreq(struct map_session_data *sd) nullpo_retr(-1, sd); - if(!sd || !char_fd || !sd->bl.id || !sd->login_id1) + if(!sd || char_fd < 1 || !sd->bl.id || !sd->login_id1) return -1; s_ip = 0; @@ -337,7 +340,7 @@ int chrif_charselectreq(struct map_session_data *sd) */ int chrif_searchcharid(int char_id) { - if (!char_id) + if (!char_id || char_fd < 1) return -1; WFIFOW(char_fd,0) = 0x2b08; @@ -355,6 +358,9 @@ int chrif_changegm(int id, const char *pass, int len) { if (battle_config.etc_log) printf("chrif_changegm: account: %d, password: '%s'.\n", id, pass); + + if (char_fd < 1 ) + return -1; WFIFOW(char_fd,0) = 0x2b0a; WFIFOW(char_fd,2) = len + 8; @@ -373,7 +379,10 @@ int chrif_changeemail(int id, const char *actual_email, const char *new_email) { if (battle_config.etc_log) printf("chrif_changeemail: account: %d, actual_email: '%s', new_email: '%s'.\n", id, actual_email, new_email); - + + if (char_fd < 1 ) + return -1; + WFIFOW(char_fd,0) = 0x2b0c; WFIFOL(char_fd,2) = id; memcpy(WFIFOP(char_fd,6), actual_email, 40); @@ -396,6 +405,9 @@ int chrif_changeemail(int id, const char *actual_email, const char *new_email) */ int chrif_char_ask_name(int id, char * character_name, short operation_type, int year, int month, int day, int hour, int minute, int second) { + if (char_fd < 1 ) + return -1; + WFIFOW(char_fd, 0) = 0x2b0e; WFIFOL(char_fd, 2) = id; // account_id of who ask (for answer) -1 if nobody memcpy(WFIFOP(char_fd,6), character_name, 24); @@ -419,6 +431,9 @@ int chrif_char_ask_name(int id, char * character_name, short operation_type, int *------------------------------------------ */ int chrif_changesex(int id, int sex) { + if (char_fd < 1 ) + return -1; + WFIFOW(char_fd,0) = 0x3000; WFIFOW(char_fd,2) = 9; WFIFOL(char_fd,4) = id; @@ -649,7 +664,10 @@ int chrif_saveaccountreg2(struct map_session_data *sd) { int p, j; nullpo_retr(-1, sd); - + + if (char_fd < 1 ) + return -1; + p = 8; for(j = 0; j < sd->status.account_reg2_num; j++) { struct global_reg *reg = &sd->status.account_reg2[j]; @@ -820,7 +838,7 @@ int chrif_chardisconnect(struct map_session_data *sd) { nullpo_retr(-1, sd); - if(char_fd<=0) + if(char_fd < 1) return -1; WFIFOW(char_fd,0)=0x2b18; @@ -849,7 +867,9 @@ int chrif_recvgmaccounts(int fd) */ int chrif_reloadGMdb(void) { - + if (char_fd < 1 ) + return -1; + WFIFOW(char_fd,0) = 0x2af7; WFIFOSET(char_fd, 2); @@ -865,7 +885,10 @@ int chrif_reloadGMdb(void) char buf[256]; FILE *fp; int i; - + + if (char_fd < 1 ) + return -1; + WFIFOW(char_fd,0) = 0x2b16; WFIFOW(char_fd,2) = base_rate; WFIFOW(char_fd,4) = job_rate; @@ -899,7 +922,7 @@ int chrif_reloadGMdb(void) int chrif_char_offline(struct map_session_data *sd) { - if (char_fd < 0) + if (char_fd < 1) return -1; WFIFOW(char_fd,0) = 0x2b17; @@ -915,7 +938,7 @@ int chrif_char_offline(struct map_session_data *sd) *----------------------------------------- */ int chrif_char_reset_offline(void) { - if (char_fd < 0) + if (char_fd < 1) return -1; WFIFOW(char_fd,0) = 0x2b18; @@ -931,7 +954,7 @@ int chrif_char_reset_offline(void) { int chrif_char_online(struct map_session_data *sd) { - if (char_fd < 0) + if (char_fd < 1) return -1; WFIFOW(char_fd,0) = 0x2b19; @@ -1025,7 +1048,7 @@ int send_users_tochar(int tid, unsigned int tick, int id, int data) { int users = 0, i; struct map_session_data *sd; - if (char_fd <= 0 || session[char_fd] == NULL) + if (char_fd < 1 || session[char_fd] == NULL || !chrif_isconnect()) // Thanks to Toster return 0; WFIFOW(char_fd,0) = 0x2aff; -- cgit v1.2.3-70-g09d2 From 2cd926a568df59089d202fd4bbf80a4100a8f891 Mon Sep 17 00:00:00 2001 From: amber Date: Sun, 5 Dec 2004 03:46:19 +0000 Subject: More updates git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@447 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 6 ++++++ src/map/battle.c | 2 +- src/map/chrif.c | 11 +++++++++++ src/map/chrif.h | 1 + src/map/clif.c | 6 ++++++ src/map/pc.c | 10 ++++++++-- src/map/skill.c | 13 +++++++------ 7 files changed, 40 insertions(+), 9 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index 9c7e10008..1919f715e 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,10 @@ Date Added +12/4 + * Fixed a change associated with NPC_BARRIER [MouseJstr] + * Renamed flush_fifos_at_exit to flush_fifos [MouseJstr] + * call check_connect_char_server() on char_server disconnect [MouseJstr] + * stale skill groups were crashing server [MouseJstr] + * Fixed crash in SC_LULLABY [MouseJstr] 12/3 * hacked the frozen mob issue [MouseJstr] * Fixed a battle_range crash [MouseJstr] diff --git a/src/map/battle.c b/src/map/battle.c index 6b1d68625..b6ef4146d 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4964,7 +4964,7 @@ int battle_check_range(struct block_list *src,struct block_list *bl,int range) // be lenient if the skill was cast before we have moved to the correct position [Celest] if (src->type != BL_PC) return 0; - else if (src->type == BL_PC) { + else if (bl->type == BL_PC) { struct map_session_data *sd; nullpo_retr(0, (sd=(struct map_session_data *)bl)); if (sd->walktimer != -1 && !((arange-=battle_config.skill_range_leniency)<=range)) diff --git a/src/map/chrif.c b/src/map/chrif.c index 479b328f5..d11604bc3 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -980,6 +980,17 @@ int chrif_parse(int fd) if (fd == char_fd) { printf("Map-server can't connect to char-server (connection #%d).\n", fd); char_fd = -1; + check_connect_char_server(0, 0, 0, 0); + while (char_fd <= 0 || session[char_fd] == NULL) { + struct map_session_data *sd; + int idx; + for (idx = 0; idx session_data) && sd && sd->state.auth) + clif_displaymessage(idx, "Map server is paused waiting for char server to return.."); + flush_fifos(); + sleep(10); + check_connect_char_server(0, 0, 0, 0); + } } close(fd); delete_session(fd); diff --git a/src/map/chrif.h b/src/map/chrif.h index ab4f9580b..5f43120cc 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -27,6 +27,7 @@ int chrif_char_reset_offline(void); int chrif_char_online(struct map_session_data *sd); int chrif_changesex(int id, int sex); int chrif_chardisconnect(struct map_session_data *sd); +int check_connect_char_server(int tid, unsigned int tick, int id, int data); int do_init_chrif(void); diff --git a/src/map/clif.c b/src/map/clif.c index 34ee7aaea..79ca0e227 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -4845,6 +4845,8 @@ int clif_refine(int fd,struct map_session_data *sd,int fail,int index,int val) */ int clif_wis_message(int fd, char *nick, char *mes, int mes_len) // R 0097 .w .24B .?B { +// printf("clif_wis_message(%d, %s, %s)\n", fd, nick, mes); + WFIFOW(fd,0) = 0x97; WFIFOW(fd,2) = mes_len + 24 + 4; memcpy(WFIFOP(fd,4), nick, 24); @@ -5535,6 +5537,8 @@ int clif_party_created(struct map_session_data *sd,int flag) { int fd; + // printf("clif_party_message(%s, %d, %s)\n", p->name, account_id, mes); + nullpo_retr(0, sd); fd=sd->fd; @@ -6247,6 +6251,8 @@ int clif_guild_memberlogin_notice(struct guild *g,int idx,int flag) nullpo_retr(0, g); + // printf("clif_guild_message(%s, %d, %s)\n", g->name, account_id, mes); + WBUFW(buf, 0)=0x16d; WBUFL(buf, 2)=g->member[idx].account_id; WBUFL(buf, 6)=g->member[idx].char_id; diff --git a/src/map/pc.c b/src/map/pc.c index f0e2a719f..0c8c32b9a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -981,7 +981,9 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) { else if ((sd->status.skill_point >= sd->status.job_level && skill_point < sd->change_level+8) && (c > 6 && c < 23)) { switch(c) { case 7: + case 13: case 14: + case 21: c = 1; break; case 8: @@ -1005,8 +1007,10 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) { case 17: c = 6; break; - /*case 4008: + case 4008: + case 4014: case 4015: + case 4022: c = 4002; break; case 4009: @@ -1031,7 +1035,9 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) { c = 4007; break; case 4030: + case 4036: case 4037: + case 4044: c = 4024; break; case 4031: @@ -1054,7 +1060,7 @@ int pc_calc_skilltree_normalize_job(int c, struct map_session_data *sd) { case 4035: case 4043: c = 4029; - break;*/ + break; } } } diff --git a/src/map/skill.c b/src/map/skill.c index 8f711fd57..19e84d791 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -4264,9 +4264,9 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int int skill_time = skill_get_time(skillid,skilllv); clif_skill_nodamage(src,bl,skillid,skilllv,1); skill_status_change_start(bl,SkillStatusChangeTable[skillid],skilllv,0,0,0,skill_time,0 ); - if (bl->type == BL_MOB) + if (src->type == BL_MOB) mob_changestate((struct mob_data *)src,MS_DELAY,skill_time); - else if (bl->type == BL_PC) + else if (src->type == BL_PC) sd->attackabletime = sd->canmove_tick = tick + skill_time; } break; @@ -6023,7 +6023,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int if (sc_data[type].timer==-1) skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); else if((unit2=(struct skill_unit *)sc_data[type].val2) && unit2 != src ){ - if( DIFF_TICK(sg->tick,unit2->group->tick)>0 ) + if( unit2->group != 0 && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) skill_status_change_start(bl,type,sg->skill_lv,(int)src,0,0,skill_get_time2(sg->skill_id,sg->skill_lv),0); ts->tick-=sg->interval; } @@ -6080,7 +6080,7 @@ int skill_unit_onplace(struct skill_unit *src,struct block_list *bl,unsigned int skill_status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); else if((unit2=(struct skill_unit *)sc_data[type].val4) && unit2 != src ){ - if( DIFF_TICK(sg->tick,unit2->group->tick)>0 ) + if( unit2->group != 0 && DIFF_TICK(sg->tick,unit2->group->tick)>0 ) skill_status_change_start(bl,type,sg->skill_lv,(sg->val1)>>16,(sg->val1)&0xffff, (int)src,skill_get_time2(sg->skill_id,sg->skill_lv),0); ts->tick-=sg->interval; @@ -8926,8 +8926,9 @@ int skill_status_change_timer(int tid, unsigned int tick, int id, int data) if(!unit || !unit->group || unit->group->src_id==bl->id) break; skill_additional_effect(bl,bl,unit->group->skill_id,sc_data[type].val1,BF_LONG|BF_SKILL|BF_MISC,tick); - sc_data[type].timer=add_timer(skill_get_time(unit->group->skill_id,unit->group->skill_lv)/10+tick, - skill_status_change_timer, bl->id, data ); + if (unit->group != 0) + sc_data[type].timer=add_timer(skill_get_time(unit->group->skill_id,unit->group->skill_lv)/10+tick, + skill_status_change_timer, bl->id, data ); return 0; } break; -- cgit v1.2.3-70-g09d2 From ad9f039b3071a3ee648f425f69f7132db7208f2e Mon Sep 17 00:00:00 2001 From: amber Date: Sun, 5 Dec 2004 06:30:50 +0000 Subject: fix crash git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@455 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/chrif.c | 2 +- src/map/map.c | 34 +++++++++++++++++----------------- src/map/map.h | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/map/chrif.c') diff --git a/src/map/chrif.c b/src/map/chrif.c index d11604bc3..bc5392b22 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -140,7 +140,7 @@ int chrif_sendmap(int fd) WFIFOW(fd,0) = 0x2afa; for(i = 0; i < map_num; i++) - if (map[i].alias[0] != '\0') // [MouseJstr] map aliasing + if (map[i].alias != '\0') // [MouseJstr] map aliasing memcpy(WFIFOP(fd,4+i*16), map[i].alias, 16); else memcpy(WFIFOP(fd,4+i*16), map[i].name, 16); diff --git a/src/map/map.c b/src/map/map.c index ebdc2a8c5..fe949013c 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1582,7 +1582,8 @@ static int map_readmap(int m,char *fn, char *alias) { map[m].npc_num=0; map[m].users=0; memset(&map[m].flag,0,sizeof(map[m].flag)); - if(battle_config.pk_mode) map[m].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris] + if(battle_config.pk_mode) + map[m].flag.pvp = 1; // make all maps pvp for pk_mode [Valaris] wh=map_waterheight(map[m].name); for(y=0;y"); // [MouseJstr] + char *p = strstr(map[i].name, "<"); // [MouseJstr] if (p != NULL) { - char alias[64]; - *p = '\0'; - strcpy(alias, map[i].name); - strcpy(map[i].name, p + 1); - sprintf(fn,"data\\%s",map[i].name); - if(map_readmap(i,fn, alias) == -1) { - map_delmap(map[i].name); - maps_removed++; - } - } else { - sprintf(fn,"data\\%s",map[i].name); - if(map_readmap(i,fn, NULL) == -1) { - map_delmap(map[i].name); - maps_removed++; - } + char buf[64]; + *p++ = '\0'; + sprintf(buf,"data\\%s", p); + map[i].alias = strdup(buf); + } else + map[i].alias = NULL; + + sprintf(fn,"data\\%s",map[i].name); + if(map_readmap(i,fn, p) == -1) { + map_delmap(map[i].name); + maps_removed++; } } } diff --git a/src/map/map.h b/src/map/map.h index 60f4ce9d6..6684250e5 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -482,7 +482,7 @@ enum { ATK_LUCKY=1,ATK_FLEE,ATK_DEF}; // struct map_data { char name[24]; - char alias[24]; // [MouseJstr] + char *alias; // [MouseJstr] unsigned char *gat; // NULLなら下のmap_data_other_serverとして扱う struct block_list **block; struct block_list **block_mob; -- cgit v1.2.3-70-g09d2 From 27fd5bb209c45a6e16465a659b4f8638fa967a3c Mon Sep 17 00:00:00 2001 From: wizputer Date: Tue, 7 Dec 2004 05:56:35 +0000 Subject: Fixed global message not working on txt [Wizputer] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@482 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 1 + src/char/char.c | 15 --------------- src/map/atcommand.c | 2 +- src/map/chrif.c | 2 +- 4 files changed, 3 insertions(+), 17 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index 3943c1d9e..4be44ca5b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,6 @@ Date Added 12/6 + * Fixed global message not working on txt [Wizputer] * fixed a server crash in mobinsite [MouseJstr] * fixed a server crash in party sharing exp [MouseJstr] * fixed a server crash in BS_FINDINGORE [MouseJstr] diff --git a/src/char/char.c b/src/char/char.c index e0dcdfbd8..2dc2242d9 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2412,21 +2412,6 @@ int parse_frommap(int fd) { // printf("char: save_account_reg (from map)\n"); break; } - // Map server send information to change an email of an account -> login-server - case 0x3000: - if (RFIFOREST(fd) < 4 || RFIFOREST(fd) < RFIFOW(fd,2)) - return 0; - if (login_fd > 0) { // don't send request if no login-server - WFIFOW(login_fd,0) = 0x3000; - WFIFOW(login_fd,2) = RFIFOW(fd,2); - WFIFOL(login_fd,4) = RFIFOL(fd,4); - WFIFOB(login_fd,8) = RFIFOB(fd,8); - WFIFOSET(login_fd, RFIFOW(fd,2)); - printf("char : change sex -> login %d %d %d \n", RFIFOL(fd,4), RFIFOB(fd,8), RFIFOW(fd,2)); - } - RFIFOSKIP(fd, RFIFOW(fd,2)); - break; - default: // inter server処理に渡す { diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 7c54336f2..1e0139286 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -7728,7 +7728,7 @@ atcommand_changesex( const char* command, const char* message) { nullpo_retr(-1, sd); - chrif_changesex(sd->status.account_id, ((sd->status.sex+1)%2)); + chrif_char_ask_name(sd->status.account_id,sd->status.name, 5,0,0,0,0,0,0); return 0; } diff --git a/src/map/chrif.c b/src/map/chrif.c index bc5392b22..62e6e8953 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -434,7 +434,7 @@ int chrif_changesex(int id, int sex) { if (char_fd < 1 ) return -1; - WFIFOW(char_fd,0) = 0x3000; + WFIFOW(char_fd,0) = 0x2b11; WFIFOW(char_fd,2) = 9; WFIFOL(char_fd,4) = id; WFIFOB(char_fd,8) = sex; -- cgit v1.2.3-70-g09d2 From 5c0f510e8e7b0fb9cdf269f0408d1686c7f405d9 Mon Sep 17 00:00:00 2001 From: amber Date: Wed, 8 Dec 2004 22:53:15 +0000 Subject: file props git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@516 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Dev/scripting.txt | 18 +++---- npc/other/mc_cameri/heal.txt | 58 ++++++++++---------- npc/quests/newgears/fox_mask.txt | 114 +++++++++++++++++++-------------------- sql-files/database.sql | 5 +- src/map/battle.c | 11 ++++ src/map/chrif.c | 12 +---- src/map/intif.c | 84 +++++++++++++++++++++++++++++ src/map/map.c | 6 ++- 8 files changed, 200 insertions(+), 108 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Dev/scripting.txt b/Dev/scripting.txt index 5aa35e713..5a143f29d 100644 --- a/Dev/scripting.txt +++ b/Dev/scripting.txt @@ -1,10 +1,10 @@ -Post any NPCs/DBs that need to be done or Fixed Here. -Format is: - -Description - A description of the task -Type - Whether DB, NPC or Both -Status - The status of the task. The possible values are Pending and Completed -Assignee - The nickname of the person whom is assigned the task -Notes - Miscellaneous notes concerning the task - +Post any NPCs/DBs that need to be done or Fixed Here. +Format is: + +Description - A description of the task +Type - Whether DB, NPC or Both +Status - The status of the task. The possible values are Pending and Completed +Assignee - The nickname of the person whom is assigned the task +Notes - Miscellaneous notes concerning the task + -------------------------- \ No newline at end of file diff --git a/npc/other/mc_cameri/heal.txt b/npc/other/mc_cameri/heal.txt index b99eb03e2..a3135f855 100644 --- a/npc/other/mc_cameri/heal.txt +++ b/npc/other/mc_cameri/heal.txt @@ -1,30 +1,30 @@ -//===== eAthena Script ======================================= -//= Heal Npc -//===== By: ================================================== -//= MC Cameri -//===== Current Version: ===================================== -//= 1.0 -//===== Compatible With: ===================================== -//= eAthena 0.1+; -//===== Description: ========================================= -//= Poring Which Heals For Free -//===== Additional Comments: ================================= -//= You can use this one if you want simple one-click healing -//============================================================ - -prontera.gat,150,184,5 script Healring::Healring0 1002,{ - npctalk "Booing!"; - emotion 21; - percentheal 100,100; -} - -morocc.gat,159,96,5 duplicate(Healring0) Healring 1002 -geffen.gat,121,61,5 duplicate(Healring0) Healring 1002 -payon.gat,180,105,5 duplicate(Healring0) Healring 1002 -alberta.gat,185,144,5 duplicate(Healring0) Healring 1002 -aldebaran.gat,134,123,5 duplicate(Healring0) Healring 1002 -izlude.gat,125,118,5 duplicate(Healring0) Healring 1002 -xmas.gat,149,136,5 duplicate(Healring0) Healring 1002 -comodo.gat,188,162,5 duplicate(Healring0) Healring 1002 -amatsu.gat,200,80,5 duplicate(Healring0) Healring 1002 +//===== eAthena Script ======================================= +//= Heal Npc +//===== By: ================================================== +//= MC Cameri +//===== Current Version: ===================================== +//= 1.0 +//===== Compatible With: ===================================== +//= eAthena 0.1+; +//===== Description: ========================================= +//= Poring Which Heals For Free +//===== Additional Comments: ================================= +//= You can use this one if you want simple one-click healing +//============================================================ + +prontera.gat,150,184,5 script Healring::Healring0 1002,{ + npctalk "Booing!"; + emotion 21; + percentheal 100,100; +} + +morocc.gat,159,96,5 duplicate(Healring0) Healring 1002 +geffen.gat,121,61,5 duplicate(Healring0) Healring 1002 +payon.gat,180,105,5 duplicate(Healring0) Healring 1002 +alberta.gat,185,144,5 duplicate(Healring0) Healring 1002 +aldebaran.gat,134,123,5 duplicate(Healring0) Healring 1002 +izlude.gat,125,118,5 duplicate(Healring0) Healring 1002 +xmas.gat,149,136,5 duplicate(Healring0) Healring 1002 +comodo.gat,188,162,5 duplicate(Healring0) Healring 1002 +amatsu.gat,200,80,5 duplicate(Healring0) Healring 1002 gonryun.gat,164,130,5 duplicate(Healring0) Healring 1002 \ No newline at end of file diff --git a/npc/quests/newgears/fox_mask.txt b/npc/quests/newgears/fox_mask.txt index 8d8a2474e..7f6a5eb89 100644 --- a/npc/quests/newgears/fox_mask.txt +++ b/npc/quests/newgears/fox_mask.txt @@ -1,57 +1,57 @@ -//===== eAthena Script ======================================= -//= Fox Mask Quest -//===== By: ================================================== -//= KitsuneStarWind (1.0) -//= Mass Zero (1.1) -//===== Current Version: ===================================== -//= 1.2 -//===== Compatible With: ===================================== -//= Any eAthena version. -//===== Description: ========================================= -// Seperate quest for the Fox Mask. -//===== Additional Comments: ================================= -// 1.2 optimized [Lupus] -//============================================================ - -pay_dun04.gat,204,152,2 script Nine Tail 1180,{ - mes "[Nine Tail]"; - mes "What do you want?"; - next; - mes "[Nine Tail]"; - mes "Have you come here for a ^FF3300 Fox Mask^000000?"; - next; - menu "Yeah, Sure.",-,"No",M_EXIT; - - mes "[Nine Tail]"; - mes "Fine then. If I make one for you, will you go away?"; - mes "You realize that it requires 999 Nine Tails to make, do you?"; - next; - menu "Sure.",M_MAKE,"Nah.",-; - - mes "[Nine Tail]"; - mes "Grrrr... I'll make one anyway but I hope my master gets you."; - next; -M_MAKE: - mes "[Nine Tail]"; - mes "Ok then, I shall make one for you."; - next; - - if (countitem(1022) < 999) goto L_NOITEM;//Items: Nine Tails, - delitem 1022,999;//Items: Nine Tails, - getitem 5069,1;//Items: Fox Mask, - next; - mes "[Nine Tails]"; - mes "Have fun."; - close; - -L_NOITEM: - mes "[Nine Tail]"; - mes "You do not have have enough Nine Tails."; - mes "You need 999 of them."; - close; - -M_EXIT: - mes "[Nine Tail]"; - mes "Then leave me alone... I am waiting for my master."; - close; -} +//===== eAthena Script ======================================= +//= Fox Mask Quest +//===== By: ================================================== +//= KitsuneStarWind (1.0) +//= Mass Zero (1.1) +//===== Current Version: ===================================== +//= 1.2 +//===== Compatible With: ===================================== +//= Any eAthena version. +//===== Description: ========================================= +// Seperate quest for the Fox Mask. +//===== Additional Comments: ================================= +// 1.2 optimized [Lupus] +//============================================================ + +pay_dun04.gat,204,152,2 script Nine Tail 1180,{ + mes "[Nine Tail]"; + mes "What do you want?"; + next; + mes "[Nine Tail]"; + mes "Have you come here for a ^FF3300 Fox Mask^000000?"; + next; + menu "Yeah, Sure.",-,"No",M_EXIT; + + mes "[Nine Tail]"; + mes "Fine then. If I make one for you, will you go away?"; + mes "You realize that it requires 999 Nine Tails to make, do you?"; + next; + menu "Sure.",M_MAKE,"Nah.",-; + + mes "[Nine Tail]"; + mes "Grrrr... I'll make one anyway but I hope my master gets you."; + next; +M_MAKE: + mes "[Nine Tail]"; + mes "Ok then, I shall make one for you."; + next; + + if (countitem(1022) < 999) goto L_NOITEM;//Items: Nine Tails, + delitem 1022,999;//Items: Nine Tails, + getitem 5069,1;//Items: Fox Mask, + next; + mes "[Nine Tails]"; + mes "Have fun."; + close; + +L_NOITEM: + mes "[Nine Tail]"; + mes "You do not have have enough Nine Tails."; + mes "You need 999 of them."; + close; + +M_EXIT: + mes "[Nine Tail]"; + mes "Then leave me alone... I am waiting for my master."; + close; +} diff --git a/sql-files/database.sql b/sql-files/database.sql index e774125cf..9700ddb3a 100644 --- a/sql-files/database.sql +++ b/sql-files/database.sql @@ -1,3 +1,6 @@ +DROP DATABASE erag; +CREATE DATABASE erag; +USE erag; CREATE TABLE `item_db` ( `id` smallint(5) unsigned NOT NULL default '0', `name_english` varchar(24) NOT NULL default '', @@ -1515,7 +1518,7 @@ INSERT INTO `item_db` VALUES (7252, 'Unknown_Item', '???', 3, NULL, NULL, 10, NU INSERT INTO `item_db` VALUES (7253, 'Unknown_Item', '??????', 3, NULL, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO `item_db` VALUES (7254, 'Unknown_Item', '???????', 3, NULL, NULL, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO `item_db` VALUES (7262, 'Grave_Lump', 'Grave Lump', 3, 233, 10, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); -INSERT INTO `item_db` VALUES (7263, 'Cat's_Eye', 'Cat's-Eye', 3, NULL, 477, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `item_db` VALUES (7263, 'Cats_Eye', 'Cats-Eye', 3, NULL, 477, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO `item_db` VALUES (7264, 'Dried_Sand', 'Dried Sand', 3, NULL, 161, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO `item_db` VALUES (7265, 'Dragon_Horn', 'Dragon Horn', 3, NULL, 272, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); INSERT INTO `item_db` VALUES (7266, 'Dragon_Teeth', 'Dragon Teeth', 3, 218, 10, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); diff --git a/src/map/battle.c b/src/map/battle.c index d152a5e31..7ff7e5348 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3426,9 +3426,20 @@ static struct Damage battle_calc_pc_weapon_attack( damage2 += damage2*(30*skill_lv)/100; break; case CG_ARROWVULCAN: /* アローバルカン */ + if(!sd->state.arrow_atk && sd->arrow_atk > 0) { + int arr = rand()%(sd->arrow_atk+1); + damage += arr; + damage2 += arr; + } damage = damage*(200+100*skill_lv)/100; damage2 = damage2*(200+100*skill_lv)/100; div_=9; + if(sd->arrow_ele > 0) { + s_ele = sd->arrow_ele; + s_ele_ = sd->arrow_ele; + } + flag=(flag&~BF_RANGEMASK)|BF_LONG; + sd->state.arrow_atk = 1; break; case AS_SPLASHER: /* ベナムスプラッシャー */ damage = damage*(200+20*skill_lv+20*pc_checkskill(sd,AS_POISONREACT))/100; diff --git a/src/map/chrif.c b/src/map/chrif.c index 62e6e8953..59e8adb48 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -980,17 +980,7 @@ int chrif_parse(int fd) if (fd == char_fd) { printf("Map-server can't connect to char-server (connection #%d).\n", fd); char_fd = -1; - check_connect_char_server(0, 0, 0, 0); - while (char_fd <= 0 || session[char_fd] == NULL) { - struct map_session_data *sd; - int idx; - for (idx = 0; idx session_data) && sd && sd->state.auth) - clif_displaymessage(idx, "Map server is paused waiting for char server to return.."); - flush_fifos(); - sleep(10); - check_connect_char_server(0, 0, 0, 0); - } +// check_connect_char_server(0, 0, 0, 0); } close(fd); delete_session(fd); diff --git a/src/map/intif.c b/src/map/intif.c index fc79e5148..66428d13d 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -54,10 +54,16 @@ extern int char_fd; // inter server //----------------------------------------------------------------- // inter serverへの送信 +int CheckForCharServer() { + return ((char_fd == -1) || session[char_fd] == NULL || session[char_fd]->wdata == NULL); +} + // pet int intif_create_pet(int account_id,int char_id,short pet_class,short pet_lv,short pet_egg_id, short pet_equip,short intimate,short hungry,char rename_flag,char incuvate,char *pet_name) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3080; WFIFOL(inter_fd,2) = account_id; WFIFOL(inter_fd,6) = char_id; @@ -77,6 +83,8 @@ int intif_create_pet(int account_id,int char_id,short pet_class,short pet_lv,sho int intif_request_petdata(int account_id,int char_id,int pet_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3081; WFIFOL(inter_fd,2) = account_id; WFIFOL(inter_fd,6) = char_id; @@ -88,6 +96,8 @@ int intif_request_petdata(int account_id,int char_id,int pet_id) int intif_save_petdata(int account_id,struct s_pet *p) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3082; WFIFOW(inter_fd,2) = sizeof(struct s_pet) + 8; WFIFOL(inter_fd,4) = account_id; @@ -99,6 +109,8 @@ int intif_save_petdata(int account_id,struct s_pet *p) int intif_delete_petdata(int pet_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3083; WFIFOL(inter_fd,2) = pet_id; WFIFOSET(inter_fd,6); @@ -110,6 +122,8 @@ int intif_delete_petdata(int pet_id) int intif_GMmessage(char* mes,int len,int flag) { int lp = (flag&0x10) ? 8 : 4; + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3000; WFIFOW(inter_fd,2) = lp + len; WFIFOL(inter_fd,4) = 0x65756c62; @@ -122,6 +136,8 @@ int intif_GMmessage(char* mes,int len,int flag) // The transmission of Wisp/Page to inter-server (player not found on this server) int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int mes_len) { nullpo_retr(0, sd); + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3001; WFIFOW(inter_fd,2) = mes_len + 52; @@ -138,6 +154,8 @@ int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int me // The reply of Wisp/page int intif_wis_replay(int id, int flag) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3002; WFIFOL(inter_fd,2) = id; WFIFOB(inter_fd,6) = flag; // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target @@ -151,6 +169,8 @@ int intif_wis_replay(int id, int flag) { // The transmission of GM only Wisp/Page from server to inter-server int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes, int mes_len) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3003; WFIFOW(inter_fd,2) = mes_len + 30; memcpy(WFIFOP(inter_fd,4), Wisp_name, 24); @@ -167,6 +187,8 @@ int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes, int me // アカウント変数送信 int intif_saveaccountreg(struct map_session_data *sd) { int j,p; + if (CheckForCharServer()) + return 0; nullpo_retr(0, sd); @@ -184,6 +206,8 @@ int intif_saveaccountreg(struct map_session_data *sd) { int intif_request_accountreg(struct map_session_data *sd) { nullpo_retr(0, sd); + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3005; WFIFOL(inter_fd,2) = sd->bl.id; @@ -194,6 +218,8 @@ int intif_request_accountreg(struct map_session_data *sd) // 倉庫データ要求 int intif_request_storage(int account_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3010; WFIFOL(inter_fd,2) = account_id; WFIFOSET(inter_fd,6); @@ -202,6 +228,8 @@ int intif_request_storage(int account_id) // 倉庫データ送信 int intif_send_storage(struct storage *stor) { + if (CheckForCharServer()) + return 0; nullpo_retr(0, stor); WFIFOW(inter_fd,0) = 0x3011; WFIFOW(inter_fd,2) = sizeof(struct storage)+8; @@ -213,6 +241,8 @@ int intif_send_storage(struct storage *stor) int intif_request_guild_storage(int account_id,int guild_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3018; WFIFOL(inter_fd,2) = account_id; WFIFOL(inter_fd,6) = guild_id; @@ -221,6 +251,8 @@ int intif_request_guild_storage(int account_id,int guild_id) } int intif_send_guild_storage(int account_id,struct guild_storage *gstor) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3019; WFIFOW(inter_fd,2) = sizeof(struct guild_storage)+12; WFIFOL(inter_fd,4) = account_id; @@ -233,6 +265,8 @@ int intif_send_guild_storage(int account_id,struct guild_storage *gstor) // パーティ作成要求 int intif_create_party(struct map_session_data *sd,char *name) { + if (CheckForCharServer()) + return 0; nullpo_retr(0, sd); WFIFOW(inter_fd,0) = 0x3020; @@ -249,6 +283,8 @@ int intif_create_party(struct map_session_data *sd,char *name) // パーティ情報要求 int intif_request_partyinfo(int party_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3021; WFIFOL(inter_fd,2) = party_id; WFIFOSET(inter_fd,6); @@ -260,6 +296,8 @@ int intif_request_partyinfo(int party_id) int intif_party_addmember(int party_id,int account_id) { struct map_session_data *sd; + if (CheckForCharServer()) + return 0; sd=map_id2sd(account_id); // if(battle_config.etc_log) // printf("intif: party add member %d %d\n",party_id,account_id); @@ -277,6 +315,8 @@ int intif_party_addmember(int party_id,int account_id) // パーティ設定変更 int intif_party_changeoption(int party_id,int account_id,int exp,int item) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3023; WFIFOL(inter_fd,2)=party_id; WFIFOL(inter_fd,6)=account_id; @@ -288,6 +328,8 @@ int intif_party_changeoption(int party_id,int account_id,int exp,int item) // パーティ脱退要求 int intif_party_leave(int party_id,int account_id) { + if (CheckForCharServer()) + return 0; // if(battle_config.etc_log) // printf("intif: party leave %d %d\n",party_id,account_id); WFIFOW(inter_fd,0)=0x3024; @@ -299,6 +341,8 @@ int intif_party_leave(int party_id,int account_id) // パーティ移動要求 int intif_party_changemap(struct map_session_data *sd,int online) { + if (CheckForCharServer()) + return 0; if(sd!=NULL){ WFIFOW(inter_fd,0)=0x3025; WFIFOL(inter_fd,2)=sd->status.party_id; @@ -315,6 +359,8 @@ int intif_party_changemap(struct map_session_data *sd,int online) // パーティー解散要求 int intif_break_party(int party_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3026; WFIFOL(inter_fd,2)=party_id; WFIFOSET(inter_fd,6); @@ -323,6 +369,8 @@ int intif_break_party(int party_id) // パーティ会話送信 int intif_party_message(int party_id,int account_id,char *mes,int len) { + if (CheckForCharServer()) + return 0; // if(battle_config.etc_log) // printf("intif_party_message: %s\n",mes); WFIFOW(inter_fd,0)=0x3027; @@ -336,6 +384,8 @@ int intif_party_message(int party_id,int account_id,char *mes,int len) // パーティ競合チェック要求 int intif_party_checkconflict(int party_id,int account_id,char *nick) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3028; WFIFOL(inter_fd,2)=party_id; WFIFOL(inter_fd,6)=account_id; @@ -347,6 +397,8 @@ int intif_party_checkconflict(int party_id,int account_id,char *nick) // ギルド作成要求 int intif_guild_create(const char *name,const struct guild_member *master) { + if (CheckForCharServer()) + return 0; nullpo_retr(0, master); WFIFOW(inter_fd,0)=0x3030; @@ -360,6 +412,8 @@ int intif_guild_create(const char *name,const struct guild_member *master) // ギルド情報要求 int intif_guild_request_info(int guild_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3031; WFIFOL(inter_fd,2) = guild_id; WFIFOSET(inter_fd,6); @@ -368,6 +422,8 @@ int intif_guild_request_info(int guild_id) // ギルドメンバ追加要求 int intif_guild_addmember(int guild_id,struct guild_member *m) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0) = 0x3032; WFIFOW(inter_fd,2) = sizeof(struct guild_member)+8; WFIFOL(inter_fd,4) = guild_id; @@ -378,6 +434,8 @@ int intif_guild_addmember(int guild_id,struct guild_member *m) // ギルドメンバ脱退/追放要求 int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0) = 0x3034; WFIFOL(inter_fd, 2) = guild_id; WFIFOL(inter_fd, 6) = account_id; @@ -391,6 +449,8 @@ int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const cha int intif_guild_memberinfoshort(int guild_id, int account_id,int char_id,int online,int lv,int class) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0) = 0x3035; WFIFOL(inter_fd, 2) = guild_id; WFIFOL(inter_fd, 6) = account_id; @@ -404,6 +464,8 @@ int intif_guild_memberinfoshort(int guild_id, // ギルド解散通知 int intif_guild_break(int guild_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0) = 0x3036; WFIFOL(inter_fd, 2) = guild_id; WFIFOSET(inter_fd,6); @@ -412,6 +474,8 @@ int intif_guild_break(int guild_id) // ギルド会話送信 int intif_guild_message(int guild_id,int account_id,char *mes,int len) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3037; WFIFOW(inter_fd,2)=len+12; WFIFOL(inter_fd,4)=guild_id; @@ -423,6 +487,8 @@ int intif_guild_message(int guild_id,int account_id,char *mes,int len) // ギルド競合チェック要求 int intif_guild_checkconflict(int guild_id,int account_id,int char_id) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0)=0x3038; WFIFOL(inter_fd, 2)=guild_id; WFIFOL(inter_fd, 6)=account_id; @@ -433,6 +499,8 @@ int intif_guild_checkconflict(int guild_id,int account_id,int char_id) // ギルド基本情報変更要求 int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3039; WFIFOW(inter_fd,2)=len+10; WFIFOL(inter_fd,4)=guild_id; @@ -445,6 +513,8 @@ int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len) int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id, int type,const void *data,int len) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0)=0x303a; WFIFOW(inter_fd, 2)=len+18; WFIFOL(inter_fd, 4)=guild_id; @@ -458,6 +528,8 @@ int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id, // ギルド役職変更要求 int intif_guild_position(int guild_id,int idx,struct guild_position *p) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x303b; WFIFOW(inter_fd,2)=sizeof(struct guild_position)+12; WFIFOL(inter_fd,4)=guild_id; @@ -469,6 +541,8 @@ int intif_guild_position(int guild_id,int idx,struct guild_position *p) // ギルドスキルアップ要求 int intif_guild_skillup(int guild_id,int skill_num,int account_id,int flag) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0)=0x303c; WFIFOL(inter_fd, 2)=guild_id; WFIFOL(inter_fd, 6)=skill_num; @@ -480,6 +554,8 @@ int intif_guild_skillup(int guild_id,int skill_num,int account_id,int flag) // ギルド同盟/敵対要求 int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd, 0)=0x303d; WFIFOL(inter_fd, 2)=guild_id1; WFIFOL(inter_fd, 6)=guild_id2; @@ -492,6 +568,8 @@ int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account // ギルド告知変更要求 int intif_guild_notice(int guild_id,const char *mes1,const char *mes2) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x303e; WFIFOL(inter_fd,2)=guild_id; memcpy(WFIFOP(inter_fd,6),mes1,60); @@ -502,6 +580,8 @@ int intif_guild_notice(int guild_id,const char *mes1,const char *mes2) // ギルドエンブレム変更要求 int intif_guild_emblem(int guild_id,int len,const char *data) { + if (CheckForCharServer()) + return 0; if(guild_id<=0 || len<0 || len>2000) return 0; WFIFOW(inter_fd,0)=0x303f; @@ -515,6 +595,8 @@ int intif_guild_emblem(int guild_id,int len,const char *data) //現在のギルド城占領ギルドを調べる int intif_guild_castle_dataload(int castle_id,int index) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3040; WFIFOW(inter_fd,2)=castle_id; WFIFOB(inter_fd,4)=index; @@ -525,6 +607,8 @@ int intif_guild_castle_dataload(int castle_id,int index) //ギルド城占領ギルド変更要求 int intif_guild_castle_datasave(int castle_id,int index, int value) { + if (CheckForCharServer()) + return 0; WFIFOW(inter_fd,0)=0x3041; WFIFOW(inter_fd,2)=castle_id; WFIFOB(inter_fd,4)=index; diff --git a/src/map/map.c b/src/map/map.c index 9f0ac1dde..9eb46ed88 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -547,8 +547,12 @@ void map_foreachinmovearea(int (*func)(struct block_list*,va_list),int m,int x0, map_freeblock_lock(); // メモリからの解放を禁止する for(i=blockcount;iprev) // 有効かどうかチェック + if(bl_list[i]->prev) { // 有効かどうかチェック + if (bl_list[i]->type == BL_PC + && session[((struct map_session_data *) bl_list[i])->fd] == NULL) + continue; func(bl_list[i],ap); + } map_freeblock_unlock(); // 解放を許可する -- cgit v1.2.3-70-g09d2 From 7fae29dea80ba1c6b005b195dc65e5e4df73ae21 Mon Sep 17 00:00:00 2001 From: celest Date: Mon, 13 Dec 2004 13:54:56 +0000 Subject: * Added 'Throw Tomahawk' * Added some new monster skills - still not complete. * Adjusted Palm Strike, Tiger Fist and Chain Crush * Removed redundant 'sg_count' * Save both persons' data after trading * Removed 'type' paramater from pc_unequipitem * Moved unequip checking code from clif.c to pc.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@554 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 9 +++++++++ db/item_db.txt | 2 +- db/skill_db.txt | 15 ++++++++++----- db/skill_require_db.txt | 9 ++++----- src/map/atcommand.c | 10 +++++----- src/map/battle.c | 15 +++++++++------ src/map/chrif.c | 6 +++--- src/map/clif.c | 13 +++++++------ src/map/map.h | 5 +---- src/map/mob.c | 9 ++++++--- src/map/pc.c | 48 ++++++++++++++++++++++++++++-------------------- src/map/pc.h | 2 +- src/map/script.c | 6 +++--- src/map/skill.c | 49 +++++++++++++++++++++++++++++++++++++++++++------ src/map/skill.h | 9 +++++++++ src/map/trade.c | 4 ++++ 16 files changed, 143 insertions(+), 68 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index a6810b769..414f3c095 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,14 @@ Date Added 12/13 + * Skill Updates [celest] + - Added the new 'Throw Tomahawk' skill (Requires Sakexe1129 or newer) + - Added some new monster skills - but still not complete. + - Adjusted Palm Strike, Tiger Fist and Chain Crush based on 11/14's patch + * Removed redundant 'sg_count' for map_session_data and mob_data [celest] + * Save both persons' data after trading in case a crash causes them to + rollback - fix by Freya [celest] + * Removed 'type' paramater from pc_unequipitem to use 'flag' instead[celest] + * Moved unequip checking code from clif.c to pc.c [celest] * Replaced many printf's in map-server with _ShowMessage(). [MC Cameri] * Skill timers for skills with id's higher then 450 were corrupting memory [MouseJstr] diff --git a/db/item_db.txt b/db/item_db.txt index 96be1587c..f248cf7d9 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -558,7 +558,7 @@ 1365,Sabbath,Sabbath,4,20,0,2300,120,,1,0,279714,2,34,4,44,7,{},{ bonus2 bWeaponComaRace,6,50; bonus bAtkEle,7; }, 1366,Light_Epsilon,Light Epsilon,4,20,0,2300,180,,1,0,279714,2,34,4,44,7,{},{ bonus bAtkEle,6; skill 28,3; bonus2 bAddRace,6,3; } 1367,Slaughter,Slaughter,4,20,0,2500,120,,1,0,279714,2,34,4,44,7,{},{ bonus bIgnoreDefRace,2; bonus2 bWeaponComaRace,2,50; }, -1368,Tomahawk,Tomahawk,4,20,0,2500,165,,1,0,279714,2,34,4,44,7,{},{ bonus bAtkEle,4; },,, +1368,Tomahawk,Tomahawk,4,20,0,2500,165,,1,0,279714,2,34,4,44,7,{},{ bonus bAtkEle,4; skill 337,1; },,, 1369,Guillotine,Guillotine,4,20,0,3000,215,,1,0,279714,2,34,4,44,7,{},{ bonus2 bWeaponComaRace,7,30; bonus2 bSPDrainRate,5,2; },, // Spears 1401,Javelin,Javelin,4,150,0,700,28,,3,3,16514,2,2,1,4,4,{},{},,, diff --git a/db/skill_db.txt b/db/skill_db.txt index cfdc9ac1b..50623f3e3 100644 --- a/db/skill_db.txt +++ b/db/skill_db.txt @@ -386,11 +386,19 @@ 334,8,6,4,0,1,1,1,yes,0,0,0,magic,0 //WE_MALE#君だけは護るよ# 335,8,6,4,0,1,1,1,yes,0,0,0,magic,0 //WE_FEMALE#あなたに尽くします# 336,8,6,4,0,1,1,1,yes,0,0,1,magic,0 //WE_CALLPARTNER#あなたに逢いたい# +337,9,6,1,0,0,1,1,no,0,0,0,weapon,0 //ITM_TOMAHAWK#ォネォ゙ォロ?ォッ皙イ# //338 //NPC_DARKCROSS#ダーククロス# 339,0,6,4,7,0,10,1,no,33,256,0,magic,0 //NPC_DARKGRANDCROSS#闇グランドクロス# -340,8,8,1,7,0,10,1:1:2:2:3:3:4:4:5:5,yes,0,0,0,magic,0 //NPC_DARKSOULSTRIKE#闇ソウルストライク# -341,8,8,1,7,0,10,3:4:5:6:7:8:9:10:11:12,yes,0,0,0,magic,2:3:3:4:4:5:5:6:6:7//NPC_DARKJUPITEL#闇ユピテル# +340,8,8,1,7,0,10,1:1:2:2:3:3:4:4:5:5,yes,0,2,0,magic,0 //NPC_DARKSOULSTRIKE#闇ソウルストライク# +341,8,8,1,7,0,10,3:4:5:6:7:8:9:10:11:12,yes,0,2,0,magic,2:3:3:4:4:5:5:6:6:7 //NPC_DARKJUPITEL#闇ユピテル# + +343,1,6,1,0,1,10,1,yes,0,2,0,weapon,0 //NPC_BREAKWEAPON +344,1,6,1,0,1,10,1,yes,0,2,0,weapon,0 //NPC_BREAKARMOR +345,1,6,1,0,1,10,1,yes,0,2,0,weapon,0 //NPC_BREAKHELM +346,1,6,1,0,1,10,1,yes,0,2,0,weapon,0 //NPC_BREAKSHIELD +347,-1,6,1,9,0,10,1,no,0,2,0,weapon,0 //NPC_UNDEADATTACK + //342束縛 //343武器壊し //344鎧壊し @@ -546,6 +554,3 @@ 10012,0,0,4,0,1,1,0,no,0,0,0,none,0 //GD_RESTORE## 10013,0,0,4,0,1,1,0,no,0,0,0,none,0 //GD_EMERGENCYCALL## 10014,0,0,0,0,0,1,0,no,0,0,0,none,0 //GD_DEVELOPMENT## - - -// ITM_TOMAHAWK#ナ荳カネ」ナゥ_エチア# 337 \ No newline at end of file diff --git a/db/skill_require_db.txt b/db/skill_require_db.txt index 014f24a68..18d7a63c2 100644 --- a/db/skill_require_db.txt +++ b/db/skill_require_db.txt @@ -220,7 +220,7 @@ 312,0,0,10,0,0,0,13:14,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BD_INTOABYSS#深淵の中に# 313,0,0,20,0,0,0,13:14,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BD_SIEGFRIED#不死身のジ?クフリ?ド# -316,0,0,8,0,0,0,13,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_MUSICALSTRIKE#ミュ?ジカルストライク# +316,0,0,1:3:5:7:9,0,0,0,13,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_MUSICALSTRIKE#ミュ?ジカルストライク# 317,0,0,18:21:24:27:30,0,0,0,13,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_DISSONANCE#不協和音# 318,0,0,12:14:16:18:20,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_FROSTJOKE#寒いジョ?ク# 319,0,0,24:28:32:36:40:44:48:52:56:60,0,0,0,13,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_WHISTLE#口笛# @@ -228,7 +228,7 @@ 321,0,0,40:45:50:55:60:65:70:75:80:85,0,0,0,13,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_POEMBRAGI#ブラギの詩# 322,0,0,40:45:50:55:60:65:70:75:80:85,0,0,0,13,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //BA_APPLEIDUN#イドゥンの林檎# -324,0,0,8,0,0,0,14,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //DC_THROWARROW#矢?ち# +324,0,0,1:3:5:7:9,0,0,0,14,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //DC_THROWARROW#矢?ち# 325,0,0,23:26:29:32:35,0,0,0,14,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //DC_UGLYDANCE#自分勝手なダンス# 326,0,0,12:14:16:18:20,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //DC_SCREAM#スクリ?ム# 327,0,0,22:24:26:28:30:32:34:36:38:40,0,0,0,14,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //DC_HUMMING#ハミング# @@ -239,8 +239,7 @@ 334,0,0,1,15,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WE_MALE#君だけは護るよ# 335,0,0,1,0,15,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WE_FEMALE#あなたに?くします# 336,0,0,1,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //WE_CALLPARTNER#あなたに逢いたい# - - +337,0,0,1,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //ITM_TOMAHAWK## 355,0,0,18:26:34:42:50,0,0,0,1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //LK_AURABLADE#オ?ラブレ?ド# 356,0,0,50,0,0,0,3,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //LK_PARRYING#パリイング# @@ -258,7 +257,7 @@ 369,0,0,80:80:80:80:80:100:100:100:100:100,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //PA_GOSPEL#ゴスペル# 370,0,0,12:14:16:18:20,0,0,0,99,explosionspirits,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //CH_PALMSTRIKE#猛虎硬派山# 371,0,0,12:14:16:18:20,0,0,0,99,none,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //CH_TIGERFIST#伏虎拳# -372,0,0,12:14:16:18:20:22:24:26:28:30,0,0,0,99,none,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //CH_CHAINCRUSH#連柱崩?# +372,0,0,12:14:16:18:20:22:24:26:28:30,0,0,0,99,none,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //CH_CHAINCRUSH#連柱崩?# 373,0,0,1:2:3:4:5,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //PF_HPCONVERSION#???????# 374,0,0,5,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //PF_SOULCHANGE#ソウルチェンジ# 375,0,0,80:90:100:110:120,0,0,0,99,none,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 //PF_SOULBURN#?ウルバ?ン# diff --git a/src/map/atcommand.c b/src/map/atcommand.c index d5a4d0807..d460bfa2d 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -3464,7 +3464,7 @@ int atcommand_refine( if (sd->status.inventory[i].refine != final_refine) { sd->status.inventory[i].refine = final_refine; current_position = sd->status.inventory[i].equip; - pc_unequipitem(sd, i, 0, BF_NORMAL); + pc_unequipitem(sd, i, 3); clif_refine(fd, sd, 0, i, sd->status.inventory[i].refine); clif_delitem(sd, i, 1); clif_additem(sd, i, 1, 0); @@ -7231,7 +7231,7 @@ atcommand_dropall(const int fd, struct map_session_data* sd, for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].amount) { if(sd->status.inventory[i].equip != 0) - pc_unequipitem(sd, i, 0, BF_NORMAL); + pc_unequipitem(sd, i, 3); pc_dropitem(sd, i, sd->status.inventory[i].amount); } } @@ -7259,7 +7259,7 @@ atcommand_chardropall(const int fd, struct map_session_data* sd, for (i = 0; i < MAX_INVENTORY; i++) { if (pl_sd->status.inventory[i].amount) { if(pl_sd->status.inventory[i].equip != 0) - pc_unequipitem(pl_sd, i, 0, BF_NORMAL); + pc_unequipitem(pl_sd, i, 3); pc_dropitem(pl_sd, i, pl_sd->status.inventory[i].amount); } } @@ -7290,7 +7290,7 @@ atcommand_storeall(const int fd, struct map_session_data* sd, for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].amount) { if(sd->status.inventory[i].equip != 0) - pc_unequipitem(sd, i, 0, BF_NORMAL); + pc_unequipitem(sd, i, 3); storage_storageadd(sd, i, sd->status.inventory[i].amount); } } @@ -7326,7 +7326,7 @@ atcommand_charstoreall(const int fd, struct map_session_data* sd, for (i = 0; i < MAX_INVENTORY; i++) { if (pl_sd->status.inventory[i].amount) { if(pl_sd->status.inventory[i].equip != 0) - pc_unequipitem(pl_sd, i, 0, BF_NORMAL); + pc_unequipitem(pl_sd, i, 3); storage_storageadd(pl_sd, i, sd->status.inventory[i].amount); } } diff --git a/src/map/battle.c b/src/map/battle.c index d039ce032..9c6b313cf 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1993,6 +1993,7 @@ static struct Damage battle_calc_pet_weapon_attack( case NPC_POISONATTACK: case NPC_HOLYATTACK: case NPC_DARKNESSATTACK: + case NPC_UNDEADATTACK: case NPC_TELEKINESISATTACK: div_= pd->skillduration; // [Valaris] break; @@ -2072,14 +2073,14 @@ static struct Damage battle_calc_pet_weapon_attack( flag=(flag&~BF_RANGEMASK)|BF_LONG; break; case CH_TIGERFIST: // 伏虎拳 - damage = damage*(100+ 60*skill_lv)/100; + damage = damage*(40+ 100*skill_lv)/100; break; case CH_CHAINCRUSH: // 連柱崩撃 - damage = damage*(100+ 60*skill_lv)/100; + damage = damage*(400+ 100*skill_lv)/100; div_=skill_get_num(skill_num,skill_lv); break; case CH_PALMSTRIKE: // 猛虎硬派山 - damage = damage*(50+ 100*skill_lv)/100; + damage = damage*(200+ 100*skill_lv)/100; break; case LK_SPIRALPIERCE: /* スパイラルピアース */ damage = damage*(100+ 50*skill_lv)/100; //増加量が分からないので適当に @@ -2486,6 +2487,7 @@ static struct Damage battle_calc_mob_weapon_attack( case NPC_POISONATTACK: case NPC_HOLYATTACK: case NPC_DARKNESSATTACK: + case NPC_UNDEADATTACK: case NPC_TELEKINESISATTACK: damage = damage*(100+25*(skill_lv-1))/100; break; @@ -2565,14 +2567,14 @@ static struct Damage battle_calc_mob_weapon_attack( damage = damage*(240+ 60*skill_lv)/100; break; case CH_TIGERFIST: // 伏虎拳 - damage = damage*(100+ 20*skill_lv)/100; + damage = damage*(40+ 100*skill_lv)/100; break; case CH_CHAINCRUSH: // 連柱崩撃 - damage = damage*(100+ 60*skill_lv)/100; + damage = damage*(400+ 100*skill_lv)/100; div_=skill_get_num(skill_num,skill_lv); break; case CH_PALMSTRIKE: // 猛虎硬派山 - damage = damage*(50+ 100*skill_lv)/100; + damage = damage*(200+ 100*skill_lv)/100; break; case LK_SPIRALPIERCE: /* スパイラルピアース */ damage = damage*(100+ 50*skill_lv)/100; //増加量が分からないので適当に @@ -3254,6 +3256,7 @@ static struct Damage battle_calc_pc_weapon_attack( case NPC_POISONATTACK: case NPC_HOLYATTACK: case NPC_DARKNESSATTACK: + case NPC_UNDEADATTACK: case NPC_TELEKINESISATTACK: damage = damage*(100+25*skill_lv)/100; damage2 = damage2*(100+25*skill_lv)/100; diff --git a/src/map/chrif.c b/src/map/chrif.c index 59e8adb48..3d3f7d233 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -612,7 +612,7 @@ int chrif_changedsex(int fd) // to avoid any problem with equipment and invalid sex, equipment is unequiped. for (i = 0; i < MAX_INVENTORY; i++) { if (sd->status.inventory[i].nameid && sd->status.inventory[i].equip) - pc_unequipitem((struct map_session_data*)sd, i, 0, BF_NORMAL); + pc_unequipitem((struct map_session_data*)sd, i, 2); } // reset skill of some job if (s_class.job == 19 || s_class.job == 4020 || s_class.job == 4042 || @@ -644,7 +644,7 @@ int chrif_changedsex(int fd) chrif_save(sd); sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters // do same modify in login-server for the account, but no in char-server (it ask again login_id1 to login, and don't remember it) - clif_displaymessage(sd->fd, "Your sex has been changed (need disconexion by the server)..."); + clif_displaymessage(sd->fd, "Your sex has been changed (need disconnection by the server)..."); clif_setwaitclose(sd->fd); // forced to disconnect for the change } } else { @@ -749,7 +749,7 @@ int chrif_accountdeletion(int fd) if (acc > 0) { if (sd != NULL) { sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters - clif_displaymessage(sd->fd, "Your account has been deleted (disconnexion)..."); + clif_displaymessage(sd->fd, "Your account has been deleted (disconnection)..."); clif_setwaitclose(sd->fd); // forced to disconnect for the change } } else { diff --git a/src/map/clif.c b/src/map/clif.c index 0d2370890..7e4605807 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8306,17 +8306,18 @@ void clif_parse_UnequipItem(int fd,struct map_session_data *sd) clif_clearchar_area(&sd->bl,1); return; } + if(sd->npc_id!=0 || sd->vender_id != 0 || sd->opt1 > 0) + return; index = RFIFOW(fd,2)-2; - if(sd->status.inventory[index].attribute == 1 && sd->sc_data && sd->sc_data[SC_BROKNWEAPON].timer!=-1) + + /*if(sd->status.inventory[index].attribute == 1 && sd->sc_data && sd->sc_data[SC_BROKNWEAPON].timer!=-1) skill_status_change_end(&sd->bl,SC_BROKNWEAPON,-1); if(sd->status.inventory[index].attribute == 1 && sd->sc_data && sd->sc_data[SC_BROKNARMOR].timer!=-1) skill_status_change_end(&sd->bl,SC_BROKNARMOR,-1); - if(sd->sc_data && ( sd->sc_data[SC_BLADESTOP].timer!=-1 || sd->sc_data[SC_BERSERK].timer!=-1 )) - return; + if(sd->sc_count && ( sd->sc_data[SC_BLADESTOP].timer!=-1 || sd->sc_data[SC_BERSERK].timer!=-1 )) + return;*/ - if(sd->npc_id!=0 || sd->vender_id != 0 || sd->opt1 > 0) - return; - pc_unequipitem(sd,index,0,BF_NORMAL); + pc_unequipitem(sd,index,1); } /*========================================== diff --git a/src/map/map.h b/src/map/map.h index e05b6d125..3ad6105ad 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -271,7 +271,6 @@ struct map_session_data { int unbreakable; int classchange; // [Valaris] - int die_counter; short doridori_counter; @@ -315,8 +314,7 @@ struct map_session_data { int eventtimer[MAX_EVENTTIMER]; int last_skillid,last_skilllv; // Added by RoVeRT - short sg_count; - + unsigned char change_level; // [celest] #ifndef TXT_ONLY @@ -425,7 +423,6 @@ struct mob_data { short sc_count; short opt1,opt2,opt3,option; short min_chase; - short sg_count; int guild_id; int deletetimer; diff --git a/src/map/mob.c b/src/map/mob.c index 0c9bbc734..d773de1ec 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -961,7 +961,6 @@ int mob_spawn(int id) md->guild_id = gc->guild_id; } - md->sg_count=0; md->deletetimer=-1; md->skilltimer=-1; @@ -2672,8 +2671,7 @@ int mob_class_change(struct mob_data *md,int *value) md->next_walktime = tick+rand()%50+5000; md->attackabletime = tick; md->canmove_tick = tick; - md->sg_count=0; - + for(i=0,c=tick-1000*3600*10;iskilldelay[i] = c; md->skillid=0; @@ -3281,6 +3279,11 @@ int mobskill_use_id(struct mob_data *md,struct block_list *target,int skill_idx) case SA_SPELLBREAKER: forcecast=1; break; + case NPC_SUMMONSLAVE: + case NPC_SUMMONMONSTER: + if(md->master_id!=0) + return 0; + break; } if(battle_config.mob_skill_log) diff --git a/src/map/pc.c b/src/map/pc.c index 7f6b2cb1f..b7c540e1d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1,4 +1,4 @@ -// $Id: pc.c 101 2004-12-2 12:58:29 AM Celestia $ +// $Id: pc.c 101 2004-12-13 7:23:07 PM Celestia $ #include #include #include @@ -609,7 +609,7 @@ int pc_breakweapon(struct map_session_data *sd) if(sd->status.inventory[i].equip && sd->status.inventory[i].equip & 0x0002 && !sd->status.inventory[i].attribute==1){ item=sd->inventory_data[i]; sd->status.inventory[i].attribute=1; - pc_unequipitem(sd,i,0,BF_NORMAL); + pc_unequipitem(sd,i,3); sprintf(output, "%s has broken.",item->jname); clif_emotion(&sd->bl,23); clif_displaymessage(sd->fd, output); @@ -641,7 +641,7 @@ int pc_breakarmor(struct map_session_data *sd) if(sd->status.inventory[i].equip && sd->status.inventory[i].equip & 0x0010 && !sd->status.inventory[i].attribute==1){ item=sd->inventory_data[i]; sd->status.inventory[i].attribute=1; - pc_unequipitem(sd,i,0,BF_NORMAL); + pc_unequipitem(sd,i,3); sprintf(output, "%s has broken.",item->jname); clif_emotion(&sd->bl,23); clif_displaymessage(sd->fd, output); @@ -697,8 +697,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars sd->skillitem = -1; sd->skillitemlv = -1; sd->invincible_timer = -1; - sd->sg_count = 0; - + sd->deal_locked = 0; sd->trade_partner = 0; @@ -3146,7 +3145,7 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type) sd->weight -= sd->inventory_data[n]->weight*amount ; if(sd->status.inventory[n].amount<=0){ if(sd->status.inventory[n].equip) - pc_unequipitem(sd,n,0,BF_NORMAL); + pc_unequipitem(sd,n,3); memset(&sd->status.inventory[n],0,sizeof(sd->status.inventory[0])); sd->inventory_data[n] = NULL; } @@ -3556,7 +3555,7 @@ int pc_item_refine(struct map_session_data *sd,int idx) pc_delitem(sd, i, 1, 0); if(item->equip) { ep = item->equip; - pc_unequipitem(sd,idx,0, BF_NORMAL); + pc_unequipitem(sd,idx,3); } clif_refine(sd->fd,sd,0,idx,item->refine); clif_delitem(sd,idx,1); @@ -3569,7 +3568,7 @@ int pc_item_refine(struct map_session_data *sd,int idx) pc_delitem(sd, i, 1, 0); item->refine = 0; if(item->equip) - pc_unequipitem(sd,idx,0, BF_NORMAL); + pc_unequipitem(sd,idx,3); clif_refine(sd->fd,sd,1,idx,item->refine); pc_delitem(sd,idx,1,0); clif_misceffect(&sd->bl,2); @@ -5253,7 +5252,7 @@ int pc_resetlvl(struct map_session_data* sd,int type) for(i=0;i<11;i++) { // unequip items that can't be equipped by base 1 [Valaris] if(sd->equip_index[i] >= 0) if(!pc_isequip(sd,sd->equip_index[i])) - pc_unequipitem(sd,sd->equip_index[i],1,BF_NORMAL); + pc_unequipitem(sd,sd->equip_index[i],2); } clif_skillinfoblock(sd); @@ -5532,7 +5531,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) int n = eq_n[rand()%eq_num];//該?アイテムの中からランダム if(rand()%10000 < per){ if(sd->status.inventory[n].equip) - pc_unequipitem(sd,n,0,BF_NORMAL); + pc_unequipitem(sd,n,3); pc_dropitem(sd,n,1); } } @@ -5545,7 +5544,7 @@ int pc_damage(struct block_list *src,struct map_session_data *sd,int damage) || (type == 2 && sd->status.inventory[i].equip) || type == 3) ){ if(sd->status.inventory[i].equip) - pc_unequipitem(sd,i,0,BF_NORMAL); + pc_unequipitem(sd,i,3); pc_dropitem(sd,i,1); break; } @@ -6056,7 +6055,7 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) for(i=0;i<11;i++) { if(sd->equip_index[i] >= 0) if(!pc_isequip(sd,sd->equip_index[i])) - pc_unequipitem(sd,sd->equip_index[i],1,BF_NORMAL); // ?備外し + pc_unequipitem(sd,sd->equip_index[i],2); // ?備外し } clif_changelook(&sd->bl,LOOK_BASE,sd->view_class); // move sprite update to prevent client crashes with incompatible equipment [Valaris] @@ -6693,7 +6692,7 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos) arrow=pc_search_inventory(sd,pc_checkequip(sd,9)); // Added by RoVeRT for(i=0;i<11;i++) { if(sd->equip_index[i] >= 0 && sd->status.inventory[sd->equip_index[i]].equip&pos) { - pc_unequipitem(sd,sd->equip_index[i],1,BF_NORMAL); + pc_unequipitem(sd,sd->equip_index[i],2); } } // 弓矢?備 @@ -6789,15 +6788,19 @@ int pc_equipitem(struct map_session_data *sd,int n,int pos) /*========================================== * ? 備した物を外す + * type: + * 0 - only unequip + * 1 - calculate status after unequipping + * 2 - force unequip *------------------------------------------ */ -int pc_unequipitem(struct map_session_data *sd,int n,int type, int flag) +int pc_unequipitem(struct map_session_data *sd,int n,int flag) { nullpo_retr(0, sd); // -- moonsoul (if player is berserk then cannot unequip) // - if(!flag && sd->sc_count && sd->sc_data[SC_BERSERK].timer!=-1){ + if(flag<2 && sd->sc_count && (sd->sc_data[SC_BLADESTOP].timer!=-1 || sd->sc_data[SC_BERSERK].timer!=-1)){ clif_unequipitemack(sd,n,0,0); return 0; } @@ -6836,20 +6839,25 @@ int pc_unequipitem(struct map_session_data *sd,int n,int type, int flag) if(sd->status.inventory[n].equip & 0x0040) clif_changelook(&sd->bl,LOOK_SHOES,0); - if(sd->sc_count && sd->sc_data[SC_BROKNWEAPON].timer != -1 && sd->status.inventory[n].equip & 0x0002 && - sd->status.inventory[i].attribute==1) - skill_status_change_end(&sd->bl,SC_BROKNWEAPON,-1); + if(sd->sc_count) { + if (sd->sc_data[SC_BROKNWEAPON].timer != -1 && sd->status.inventory[n].equip & 0x0002 && + sd->status.inventory[n].attribute == 1) + skill_status_change_end(&sd->bl,SC_BROKNWEAPON,-1); + if(sd->sc_data[SC_BROKNARMOR].timer != -1 && sd->status.inventory[n].equip & 0x0010 && + sd->status.inventory[n].attribute == 1) + skill_status_change_end(&sd->bl,SC_BROKNARMOR,-1); + } clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1); sd->status.inventory[n].equip=0; - if(!type) + if(flag&1) pc_checkallowskill(sd); if(sd->weapontype1 == 0 && sd->weapontype2 == 0) skill_encchant_eremental_end(&sd->bl,-1); //武器持ち誓えは無?件で?性付?解除 } else { clif_unequipitemack(sd,n,0,0); } - if(!type) { + if(flag&1) { pc_calcstatus(sd,0); if(sd->sc_count && sd->sc_data[SC_SIGNUMCRUCIS].timer != -1 && !battle_check_undead(7,sd->def_ele)) skill_status_change_end(&sd->bl,SC_SIGNUMCRUCIS,-1); diff --git a/src/map/pc.h b/src/map/pc.h index 3a4352aa6..5e6ff280d 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -118,7 +118,7 @@ int pc_resetlvl(struct map_session_data*,int type); int pc_resetstate(struct map_session_data*); int pc_resetskill(struct map_session_data*); int pc_equipitem(struct map_session_data*,int,int); -int pc_unequipitem(struct map_session_data*,int,int,int); +int pc_unequipitem(struct map_session_data*,int,int); int pc_checkitem(struct map_session_data*); int pc_useitem(struct map_session_data*,int); diff --git a/src/map/script.c b/src/map/script.c index 750ef4d0c..bf6c577cb 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3035,7 +3035,7 @@ int buildin_successrefitem(struct script_state *st) #endif //USE_SQL sd->status.inventory[i].refine++; - pc_unequipitem(sd,i,0, BF_NORMAL); + pc_unequipitem(sd,i,2); clif_refine(sd->fd,sd,0,i,sd->status.inventory[i].refine); clif_delitem(sd,i,1); clif_additem(sd,i,1,0); @@ -3065,7 +3065,7 @@ int buildin_failedrefitem(struct script_state *st) #endif //USE_SQL sd->status.inventory[i].refine = 0; - pc_unequipitem(sd,i,0, BF_NORMAL); + pc_unequipitem(sd,i,3); // 精錬失敗エフェクトのパケット clif_refine(sd->fd,sd,1,i,sd->status.inventory[i].refine); pc_delitem(sd,i,1,0); @@ -5885,7 +5885,7 @@ int buildin_nude(struct script_state *st) for(i=0;i<11;i++) if(sd->equip_index[i] >= 0) - pc_unequipitem(sd,sd->equip_index[i],1, BF_NORMAL); + pc_unequipitem(sd,sd->equip_index[i],2); return 0; } diff --git a/src/map/skill.c b/src/map/skill.c index 83382ef70..be23b2234 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1,4 +1,4 @@ -// $Id: skill.c,v 1.8 2004/12/9 8:14:18 PM Celestia Exp $ +// $Id: skill.c,v 1.8 2004/12/13 7:22:51 PM Celestia $ /* スキル?係 */ #include @@ -2323,6 +2323,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case NPC_HOLYATTACK: case NPC_DARKNESSATTACK: case NPC_TELEKINESISATTACK: + case NPC_UNDEADATTACK: case LK_AURABLADE: /* オ?ラブレ?ド */ case LK_SPIRALPIERCE: /* スパイラルピア?ス */ case LK_HEADCRUSH: /* ヘッドクラッシュ */ @@ -2333,6 +2334,7 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s case CG_ARROWVULCAN: /* アロ?バルカン */ case ASC_BREAKER: /* ソウルブレ?カ? */ case HW_MAGICCRASHER: /* マジッククラッシャ? */ + case ITM_TOMAHAWK: skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); break; case NPC_DARKBREATH: @@ -2789,6 +2791,14 @@ int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int s } } break; + + // unknown skills [Celest] + case NPC_BIND: + case NPC_EXPLOSIONSPIRITS: + case NPC_INCAGI: + clif_skill_nodamage(src,bl,skillid,skilllv,1); + break; + case 0: if(sd) { if(flag&3){ @@ -3877,7 +3887,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(dstsd){ for(i=0;istatus.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0002){ - pc_unequipitem(dstsd,i,0,BF_SKILL); + pc_unequipitem(dstsd,i,3); break; } } @@ -3900,7 +3910,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(dstsd){ for(i=0;istatus.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0020){ - pc_unequipitem(dstsd,i,0,BF_SKILL); + pc_unequipitem(dstsd,i,3); break; } } @@ -3923,7 +3933,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(dstsd){ for(i=0;istatus.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0010){ - pc_unequipitem(dstsd,i,0,BF_SKILL); + pc_unequipitem(dstsd,i,3); break; } } @@ -3946,7 +3956,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(dstsd){ for(i=0;istatus.inventory[i].equip && dstsd->status.inventory[i].equip & 0x0100){ - pc_unequipitem(dstsd,i,0,BF_SKILL); + pc_unequipitem(dstsd,i,3); break; } } @@ -3982,7 +3992,7 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int if(dstsd){ for(i=0;istatus.inventory[i].equip && dstsd->status.inventory[i].equip & striplist[1][j]){ - pc_unequipitem(dstsd,i,0,BF_SKILL); + pc_unequipitem(dstsd,i,3); --c; break; } @@ -4353,6 +4363,33 @@ int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int clif_skill_nodamage(src,bl,skillid,skilllv,1); break; + // Equipment breaking monster skills [Celest] + case NPC_BREAKWEAPON: + clif_skill_nodamage(src,bl,skillid,skilllv,1); + if(bl->type == BL_PC && rand()%100 < skilllv && battle_config.equipment_breaking) + pc_breakweapon((struct map_session_data *)bl); + break; + + case NPC_BREAKARMOR: + clif_skill_nodamage(src,bl,skillid,skilllv,1); + if(bl->type == BL_PC && rand()%100 < skilllv && battle_config.equipment_breaking) + pc_breakarmor((struct map_session_data *)bl); + break; + + case NPC_BREAKHELM: + clif_skill_nodamage(src,bl,skillid,skilllv,1); + if(bl->type == BL_PC && rand()%100 < skilllv && battle_config.equipment_breaking) + // since we don't have any code for helm breaking yet... + pc_breakweapon((struct map_session_data *)bl); + break; + + case NPC_BREAKSHIELD: + clif_skill_nodamage(src,bl,skillid,skilllv,1); + if(bl->type == BL_PC && rand()%100 < skilllv && battle_config.equipment_breaking) + // since we don't have any code for helm breaking yet... + pc_breakweapon((struct map_session_data *)bl); + break; + case WE_MALE: /* 君だけは護るよ */ if(sd && dstsd){ int hp_rate=(skilllv <= 0)? 0:skill_db[skillid].hp_rate[skilllv-1]; diff --git a/src/map/skill.h b/src/map/skill.h index 57cc1f084..b5081de49 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -741,6 +741,15 @@ enum { NPC_DARKGRANDCROSS, NPC_DARKSOULSTRIKE, NPC_DARKJUPITEL, + // temporary names for mob skills [Celest] + NPC_BIND, + NPC_BREAKWEAPON, + NPC_BREAKARMOR, + NPC_BREAKHELM, + NPC_BREAKSHIELD, + NPC_UNDEADATTACK, + NPC_EXPLOSIONSPIRITS = 349, + NPC_INCAGI, LK_AURABLADE = 355, LK_PARRYING, diff --git a/src/map/trade.c b/src/map/trade.c index ddb45a73b..33b061a46 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -10,6 +10,7 @@ #include "battle.h" #include "nullpo.h" #include "log.h" +#include "chrif.h" /*========================================== * 取引要請を相手に送る @@ -288,6 +289,9 @@ void trade_tradecommit(struct map_session_data *sd) target_sd->trade_partner=0; clif_tradecompleted(sd,0); clif_tradecompleted(target_sd,0); + // save both player to avoid crash: they always have no advantage/disadvantage between the 2 players [Yor] + chrif_save(sd); // do pc_makesavestatus and save storage too + chrif_save(target_sd); // do pc_makesavestatus and save storage too } } } -- cgit v1.2.3-70-g09d2 From 4aee20b0e1fdfb23d9336cea77a0985e463ea081 Mon Sep 17 00:00:00 2001 From: mc_cameri Date: Tue, 14 Dec 2004 00:33:01 +0000 Subject: git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@566 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 5 +++++ src/common/grfio.c | 8 +++++--- src/common/showmsg.c | 16 ++++++++-------- src/common/showmsg.h | 12 ++++++++++++ src/map/chrif.c | 14 +++++++++----- src/map/clif.c | 8 +++++--- src/map/guild.c | 4 +++- src/map/itemdb.c | 9 ++++++--- src/map/map.c | 44 ++++++++++++++++++++++++++++++++++++-------- src/map/mob.c | 3 ++- src/map/npc.c | 9 ++++++++- src/map/pc.c | 17 ++++++++++------- src/map/skill.c | 6 ++++-- 13 files changed, 113 insertions(+), 42 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index a7c1f33c1..af2df756c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,9 @@ Date Added 12/14 + * Replaced the way map loading was displayed into a progress-like way [MC Cameri] + * Fixed some typos in _ShowMessage() [MC Cameri] + * Replaced lots of more printf's in map-server with _ShowMessage() [MC Cameri] + * Added constants for console colors in showmsg.h [MC Cameri] * src/char_sql/int_guild.c:56 - t_mes2 was not big enough causing stack overrun's, corruptions, and crashes [MouseJstr] * common/mmo.h: changed base_level and job_level to unsigned int to increase max levels [Codemaster] @@ -28,6 +32,7 @@ Date Added rollback - fix by Freya [celest] * Removed 'type' paramater from pc_unequipitem to use 'flag' instead[celest] * Moved unequip checking code from clif.c to pc.c [celest] +>>>>>>> .r565 * Replaced many printf's in map-server with _ShowMessage(). [MC Cameri] * Skill timers for skills with id's higher then 450 were corrupting memory [MouseJstr] diff --git a/src/common/grfio.c b/src/common/grfio.c index 2ba701632..d3d39c106 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -614,7 +614,8 @@ static int grfio_entryread(char *gfname,int gentry) fp = fopen(gfname,"rb"); if(fp==NULL) { - printf("%s not found (grfio_entryread)\n",gfname); + sprintf(tmp_output,"GRF Data File not found: '\033[1;29m%s\033[0;0m'.\n",gfname); + ShowWarning(tmp_output); return 1; // 1:not found error } @@ -837,7 +838,8 @@ int grfio_add(char *fname) exit(1); } - printf("%s file reading...\n",fname); +// sprintf(tmp_output,"Reading GRF File: '%s'.\n",fname); +// ShowStatus(tmp_output); if (gentry_entrys>=gentry_maxentry) { char **new_gentry = (char**)realloc( @@ -924,7 +926,7 @@ void grfio_init(char *fname) } fclose(data_conf); - sprintf(tmp_output,"Done reading GRF File: '\033[1;29m%s\033[0;0m'.\n",fname); + sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n",fname); ShowStatus(tmp_output); } // end of reading grf-files.txt diff --git a/src/common/showmsg.c b/src/common/showmsg.c index e96f97e22..32b9dd22c 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -14,12 +14,12 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri char prefix[40]; char *output; if (strlen(string) <= 0) { - ShowError("Empty string passed to ShowMessage().\n"); + ShowError("Empty string passed to _ShowMessage().\n"); return 1; } switch (flag) { case MSG_STATUS: //Bright Green (To inform about good things) - strcpy(prefix,"\033[1;32m[Status]\033[0;0m:"); + strcpy(prefix,CL_GREEN"[Status]"CL_RESET":"); break; /* //Do we really need this now? [MC Cameri] case MSG_SQL: //Bright Violet (For dumping out anything related with SQL) @@ -27,19 +27,19 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri break; */ case MSG_INFORMATION: //Bright White (Variable information) - strcpy(prefix,"\033[1;29m[Info]\033[0;0m:"); + strcpy(prefix,CL_WHITE"[Info]"CL_RESET":"); break; case MSG_NOTICE: //Bright White (Less than a warning) - strcpy(prefix,"\033[1;29m[Notice]\033[0;0m:"); + strcpy(prefix,CL_WHITE"[Notice]"CL_RESET":"); break; case MSG_WARNING: //Bright Yellow - strcpy(prefix,"\033[1;33m[Warning]\033[0;0m:"); + strcpy(prefix,CL_YELLOW"[Warning]"CL_RESET":"); break; case MSG_ERROR: //Bright Red (Regular errors) - strcpy(prefix,"\033[1;31m[Error]\033[0;0m:"); + strcpy(prefix,CL_RED"[Error]"CL_RESET":"); break; case MSG_FATALERROR: //Bright Red (Fatal errors, abort(); if possible) - strcpy(prefix,"\033[1;31m[Fatal Error]\033[0;0m:"); + strcpy(prefix,CL_RED"[Fatal Error]"CL_RESET":"); break; default: ShowError("In function _ShowMessage() -> Invalid flag passed.\n"); @@ -48,7 +48,7 @@ int _ShowMessage(const char *string, enum msg_type flag){ // by MC Cameri output = (char*)malloc(sizeof(char)*(strlen(prefix)+strlen(string)+2)); // +2: space and a \0 if (output == NULL) { return 1; -// abort(); // Kill server? Deadly +// exit(1); // Kill server? Deadly } strcpy(output,prefix); strcat(output," "); diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 03ffe310b..59bd6a090 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -1,6 +1,18 @@ #ifndef _SHOWMSG_H_ #define _SHOWMSG_H_ +#define CL_RESET "\033[0;0m" +#define CL_NORMAL CL_RESET +#define CL_NONE CL_RESET +#define CL_WHITE "\033[1;29m" +#define CL_GRAY "\033[1;30m" +#define CL_RED "\033[1;31m" +#define CL_GREEN "\033[1;32m" +#define CL_YELLOW "\033[1;33m" +#define CL_BLUE "\033[1;34m" +#define CL_MAGENTA "\033[1;35m" +#define CL_CYAN "\033[1;36m" + extern char tmp_output[1024]; enum msg_type {MSG_STATUS,/* MSG_SQL, */MSG_INFORMATION,MSG_NOTICE,MSG_WARNING,MSG_ERROR,MSG_FATALERROR}; diff --git a/src/map/chrif.c b/src/map/chrif.c index 3d3f7d233..81c6744c2 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -23,6 +23,7 @@ #include "npc.h" #include "pc.h" #include "nullpo.h" +#include "showmsg.h" #ifdef MEMWATCH #include "memwatch.h" @@ -244,13 +245,16 @@ int chrif_connectack(int fd) printf("Connected to char-server failed %d.\n", RFIFOB(fd,2)); exit(1); } - printf("Connected to char-server (connection #%d).\n", fd); + sprintf(tmp_output,"Successfully connected to Char-Server (Connection #%d).\n",fd); + ShowStatus(tmp_output); chrif_state = 1; chrif_sendmap(fd); - printf("chrif: OnCharIfInit event done. (%d events)\n", npc_event_doall("OnCharIfInit")); - printf("chrif: OnInterIfInit event done. (%d events)\n", npc_event_doall("OnInterIfInit")); + sprintf(tmp_output,"Event '"CL_WHITE"OnCharIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnCharIfInit")); + ShowStatus(tmp_output); + sprintf(tmp_output,"Event '"CL_WHITE"OnInterIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInit")); + ShowStatus(tmp_output); // Run Event [AgitInit] // printf("NPC_Event:[OnAgitInit] do (%d) events (Agit Initialize).\n", npc_event_doall("OnAgitInit")); @@ -856,8 +860,8 @@ int chrif_chardisconnect(struct map_session_data *sd) */ int chrif_recvgmaccounts(int fd) { - printf("From login-server: receiving of %d GM accounts information.\n", pc_read_gm_account(fd)); - + sprintf(tmp_output,"From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", pc_read_gm_account(fd)); + ShowInfo(tmp_output); return 0; } diff --git a/src/map/clif.c b/src/map/clif.c index 7e4605807..1f7130676 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -24,6 +24,7 @@ #include "../common/malloc.h" #include "../common/version.h" #include "../common/nullpo.h" +#include "../common/showmsg.h" #include "map.h" #include "chrif.h" @@ -10107,15 +10108,16 @@ static int clif_parse(int fd) { if (chrif_isconnect()) clif_quitsave(fd, sd); if (sd->status.name != NULL) - printf("Player [%s] has logged off your server.\n", sd->status.name); // Player logout display [Valaris] + sprintf(tmp_output,"%sCharacter '"CL_WHITE"%s"CL_RESET"' logged off.\n", (pc_isGM(sd))?"GM ":"",sd->status.name); // Player logout display [Valaris] else - printf("Player with account [%d] has logged off your server.\n", sd->bl.id); // Player logout display [Yor] + sprintf(tmp_output,"%sCharacter with Account ID '"CL_WHITE"%d"CL_RESET"' logged off.\n", (pc_isGM(sd))?"GM ":"", sd->bl.id); // Player logout display [Yor] } else if (sd) { // not authentified! (refused by char-server or disconnect before to be authentified) - printf("Player with account [%d] has logged off your server (not auth account).\n", sd->bl.id); // Player logout display [Yor] + sprintf(tmp_output,"Player not authenticated with Account ID '"CL_WHITE"%d"CL_RESET"' logged off.\n", sd->bl.id); // Player logout display [Yor] if (chrif_isconnect()) clif_quitsave(fd, sd); sd = 0; } + ShowInfo(tmp_output); close(fd); if (sd) // 追加 map_deliddb(&sd->bl); // 追加 diff --git a/src/map/guild.c b/src/map/guild.c index 2937940c3..ec2a636b9 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -18,6 +18,7 @@ #include "intif.h" #include "clif.h" #include "skill.h" +#include "showmsg.h" #ifdef MEMWATCH #include "memwatch.h" @@ -127,7 +128,8 @@ static int guild_read_castledb(void) ln++; } fclose(fp); - printf("read db/castle_db.txt done (count=%d)\n",ln); + sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",ln,"db/castle_db.txt"); + ShowStatus(tmp_output); return 0; } diff --git a/src/map/itemdb.c b/src/map/itemdb.c index cd915b92e..38795547e 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -552,7 +552,8 @@ static int itemdb_read_itemnametable(void) p++; } free(buf); - printf("read data\\idnum2itemdisplaynametable.txt done.\n"); + sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","data\\idnum2itemdisplaynametable.txt"); + ShowStatus(tmp_output); return 0; } @@ -587,7 +588,8 @@ static int itemdb_read_cardillustnametable(void) p++; } free(buf); - printf("read data\\num2cardillustnametable.txt done.\n"); + sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","data\\num2cardillustnametable.txt"); + ShowStatus(tmp_output); return 0; } @@ -631,7 +633,8 @@ static int itemdb_read_noequip(void) } fclose(fp); - printf("read db/item_noequip.txt done (count=%d)\n",ln); + sprintf(tmp_output,"Done reading '\033[1;29m%d\033[0;0m' entries in '\033[1;29m%s\033[0;0m'.\n",ln,"db/item_noequip.txt"); + ShowStatus(tmp_output); return 0; } #ifndef TXT_ONLY diff --git a/src/map/map.c b/src/map/map.c index 282d2795b..c00845158 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -104,6 +104,8 @@ static int online_timer(int,unsigned int,int,int); int CHECK_INTERVAL = 3600000; // [Valaris] int check_online_timer=0; // [Valaris] +static int pos = 0; + #endif /* not TXT_ONLY */ #define USE_AFM @@ -1588,16 +1590,26 @@ static int map_readmap(int m,char *fn, char *alias) { int x,y,xs,ys; struct gat_1cell {float high[4]; int type;} *p=NULL; int wh; + int i; + int e = 0; + size_t size; - + char progress[21] = " "; // read & convert fn gat=grfio_read(fn); if(gat==NULL) return -1; - - printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn); - fflush(stdout); - + //printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn); + if (map_num) { //avoid map-server crashing if there are 0 maps + printf("\r"); + ShowStatus("Progress: "); + i=m*20/420; + printf("["); + for (e=0;ename); // fflush(stdout); } - printf("\rNPCs Loaded: %d [Warps:%d Shops:%d Scripts:%d Mobs:%d]\n", + printf("\r"); + sprintf(tmp_output,"Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:\n\t-'" + CL_WHITE"%d"CL_RESET"' Warps\n\t-'" + CL_WHITE"%d"CL_RESET"' Shops\n\t-'" + CL_WHITE"%d"CL_RESET"' Scripts\n\t-'" + CL_WHITE"%d"CL_RESET"' Mobs\n", npc_id-START_NPC_NUM,npc_warp,npc_shop,npc_script,npc_mob); + ShowInfo(tmp_output); add_timer_func_list(npc_walktimer,"npc_walktimer"); // [Valaris] add_timer_func_list(npc_event_timer,"npc_event_timer"); diff --git a/src/map/pc.c b/src/map/pc.c index 3cb78e65a..7c5a8c077 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -826,13 +826,15 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars pc_calcstatus(sd,1); if (pc_isGM(sd)) - printf("Connection accepted: character '%s' (account: %d; GM level %d).\n", sd->status.name, sd->status.account_id, pc_isGM(sd)); + sprintf(tmp_output,"GM Character '"CL_WHITE"%s"CL_RESET"' logged in. (Acc. ID: '"CL_WHITE"%d"CL_RESET"', GM Level '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id, pc_isGM(sd)); else - printf("Connection accepted: Character '%s' (account: %d).\n", sd->status.name, sd->status.account_id); - + sprintf(tmp_output,"Character '"CL_WHITE"%s"CL_RESET"' logged in. (Account ID: '"CL_WHITE"%d"CL_RESET"').\n", sd->status.name, sd->status.account_id); + ShowInfo(tmp_output); //printf("pc: OnPCLogin event done. (%d events)\n", npc_event_doall("OnPCLogin") ); - if (npc_name2id("PCLoginEvent")) + if (npc_name2id("PCLoginEvent")) { run_script(npc_name2id("PCLoginEvent")->u.scr.script,0,sd->bl.id,npc_name2id("PCLoginEvent")->bl.id); // PCLoginNPC + ShowStatus("Event '\033[1;29mPCLoginEvent\033[0;0m' executed.\n"); + } // Send friends list clif_friends_list_send(sd); @@ -857,8 +859,8 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, struct mmo_chars fclose(fp); } else if(battle_config.error_log) { - sprintf(buf, "%s not found\n", motd_txt); - ShowWarning (buf); + sprintf(tmp_output, "In function pc_atuhok() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt); + ShowWarning(tmp_output); } } @@ -7808,7 +7810,8 @@ int pc_readdb(void) break; } fclose(fp); - printf("read db/job_db2-2.txt done\n"); + sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/job_db2-2.txt"); + ShowStatus(tmp_output); // スキルツリ? memset(skill_tree,0,sizeof(skill_tree)); diff --git a/src/map/skill.c b/src/map/skill.c index 3cdc4a8f4..3a0d02c8d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -11531,7 +11531,8 @@ int skill_readdb(void) skill_db[i].blewcount[k]=(split2[k])? atoi(split2[k]):atoi(split2[0]); } fclose(fp); - printf("read db/skill_db.txt done\n"); + sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_db.txt"); + ShowStatus(tmp_output); fp=fopen("db/skill_require_db.txt","r"); if(fp==NULL){ @@ -11670,7 +11671,8 @@ int skill_readdb(void) skill_db[i].amount[9]=atoi(split[29]); } fclose(fp); - printf("read db/skill_require_db.txt done\n"); + sprintf(tmp_output,"Done reading '\033[1;29m%s\033[0;0m'.\n","db/skill_cast_db.txt"); + ShowStatus(tmp_output); /* キャスティングデ?タベ?ス */ fp=fopen("db/skill_cast_db.txt","r"); -- cgit v1.2.3-70-g09d2 From db4d0797f6bb0a54e0955b330a3ccd7675b7b95c Mon Sep 17 00:00:00 2001 From: mc_cameri Date: Wed, 15 Dec 2004 00:06:02 +0000 Subject: git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@569 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 2 ++ src/common/core.c | 2 +- src/common/socket.c | 4 ++-- src/map/chrif.c | 20 +++++++++++++++----- src/map/chrif.h | 2 ++ src/map/map.c | 10 +++++++--- src/map/npc.c | 4 ++-- 7 files changed, 31 insertions(+), 13 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index 2143dd182..6d354f0ea 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,7 @@ Date Added 12/14 + * Changed "Map-server can't connect to char-server" message to reduce output spamming and set it to + display only once [MC Cameri] * Added a busy animation for npc loading [MC Cameri] * Replaced the way map loading was displayed into a progress-like way [MC Cameri] * Fixed some typos in _ShowMessage() [MC Cameri] diff --git a/src/common/core.c b/src/common/core.c index 167b38efb..2e0029ea1 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -104,7 +104,7 @@ static void display_title(void) printf("\033[37;44m (=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=)\033[K\033[0m\n\n"); // reset color if ((revision = get_svn_revision(".svn\\entries"))>0) { - snprintf(tmp_output,sizeof(tmp_output),"SVN Revision: %d.\n",revision); + snprintf(tmp_output,sizeof(tmp_output),"SVN Revision: '"CL_WHITE"%d"CL_RESET"'.\n",revision); ShowInfo(tmp_output); } } diff --git a/src/common/socket.c b/src/common/socket.c index 415a011a4..611d73902 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -115,7 +115,7 @@ static int recv_to_fifo(int fd) // printf("%s has logged off your server.\n",RFIFOP(fd,6)); // Removed [Valaris] // else if (fd != 8) // [Valaris] - printf("set eof : connection #%d\n", fd); +// printf("set eof : connection #%d\n", fd); session[fd]->eof=1; } return 0; @@ -149,7 +149,7 @@ static int send_from_fifo(int fd) session[fd]->wdata_size=0; } } else if (errno != EAGAIN) { - printf("set eof :%d\n",fd); +// printf("set eof :%d\n",fd); session[fd]->eof=1; } return 0; diff --git a/src/map/chrif.c b/src/map/chrif.c index 81c6744c2..236590ff3 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -245,9 +245,10 @@ int chrif_connectack(int fd) printf("Connected to char-server failed %d.\n", RFIFOB(fd,2)); exit(1); } - sprintf(tmp_output,"Successfully connected to Char-Server (Connection #%d).\n",fd); + sprintf(tmp_output,"Successfully connected to Char Server (Connection: '"CL_WHITE"%d"CL_RESET"').\n",fd); ShowStatus(tmp_output); chrif_state = 1; + chrif_connected=1; chrif_sendmap(fd); @@ -862,6 +863,7 @@ int chrif_recvgmaccounts(int fd) { sprintf(tmp_output,"From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", pc_read_gm_account(fd)); ShowInfo(tmp_output); + memset(tmp_output,'\0',sizeof(tmp_output)); return 0; } @@ -977,12 +979,15 @@ int chrif_char_online(struct map_session_data *sd) int chrif_parse(int fd) { int packet_len, cmd; - // only char-server can have an access to here. // so, if it isn't the char-server, we disconnect the session (fd != char_fd). if (fd != char_fd || session[fd]->eof) { if (fd == char_fd) { - printf("Map-server can't connect to char-server (connection #%d).\n", fd); + if (chrif_connected == 1) { + sprintf(tmp_output,"Map Server disconnected from Char Server.\n\n"); + ShowWarning(tmp_output); + chrif_connected=0; + } char_fd = -1; // check_connect_char_server(0, 0, 0, 0); } @@ -1077,14 +1082,19 @@ int send_users_tochar(int tid, unsigned int tick, int id, int data) { *------------------------------------------ */ int check_connect_char_server(int tid, unsigned int tick, int id, int data) { + static int displayed = 0; if (char_fd <= 0 || session[char_fd] == NULL) { - printf("Attempt to connect to char-server...\n"); + if (!displayed) { + ShowStatus("Attempting to connect to Char Server. Please wait.\n"); + displayed = 1; + } chrif_state = 0; char_fd = make_connection(char_ip, char_port); session[char_fd]->func_parse = chrif_parse; realloc_fifo(char_fd, FIFOSIZE_SERVERLINK, FIFOSIZE_SERVERLINK); chrif_connect(char_fd); + chrif_connected = chrif_isconnect(); #ifndef TXT_ONLY srvinfo = 0; } else { @@ -1094,7 +1104,7 @@ int check_connect_char_server(int tid, unsigned int tick, int id, int data) { } #endif /* not TXT_ONLY */ } - + if (chrif_isconnect()) displayed = 0; return 0; } diff --git a/src/map/chrif.h b/src/map/chrif.h index 5f43120cc..d53631e25 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -9,6 +9,8 @@ void chrif_setport(int); int chrif_isconnect(void); +int chrif_connected; + int chrif_authreq(struct map_session_data *); int chrif_save(struct map_session_data*); int chrif_charselectreq(struct map_session_data *); diff --git a/src/map/map.c b/src/map/map.c index 6013f5751..84164ff95 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1880,7 +1880,7 @@ int map_config_read(char *cfgName) { char_ip_set_ = 1; h = gethostbyname (w2); if(h != NULL) { - snprintf(tmp_output,sizeof(tmp_output),"Character server IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); + snprintf(tmp_output,sizeof(tmp_output),"Char Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'.\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); ShowInfo(tmp_output); sprintf(w2,"%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); } @@ -1891,7 +1891,8 @@ int map_config_read(char *cfgName) { map_ip_set_ = 1; h = gethostbyname (w2); if (h != NULL) { - printf("Map server IP address : %s -> %d.%d.%d.%d\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); + snprintf(tmp_output,sizeof(tmp_output),"Map Server IP Address : '"CL_WHITE"%s"CL_RESET"' -> '"CL_WHITE"%d.%d.%d.%d"CL_RESET"'.\n", w2, (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); + ShowInfo(tmp_output); sprintf(w2, "%d.%d.%d.%d", (unsigned char)h->h_addr[0], (unsigned char)h->h_addr[1], (unsigned char)h->h_addr[2], (unsigned char)h->h_addr[3]); } clif_setip(w2); @@ -1927,8 +1928,10 @@ int map_config_read(char *cfgName) { } else if (strcmpi(w1, "import") == 0) { map_config_read(w2); } else if (strcmpi(w1, "console") == 0) { - if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 ) + if(strcmpi(w2,"on") == 0 || strcmpi(w2,"yes") == 0 ) { console = 1; + ShowNotice("Console Commands is enabled.\n"); + } } else if(strcmpi(w1,"imalive_on")==0){ //Added by Mugendai for I'm Alive mod imalive_on = atoi(w2); //Added by Mugendai for I'm Alive mod } else if(strcmpi(w1,"imalive_time")==0){ //Added by Mugendai for I'm Alive mod @@ -2286,6 +2289,7 @@ void map_versionscreen(int flag) { *------------------------------------------------------ */ int do_init(int argc, char *argv[]) { + chrif_connected = 0; int i; FILE *data_conf; char line[1024], w1[1024], w2[1024]; diff --git a/src/map/npc.c b/src/map/npc.c index d760099ef..70bb4aa12 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2314,12 +2314,12 @@ int do_init_npc(void) // fflush(stdout); } printf("\r"); - sprintf(tmp_output,"Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:\n\t-'" + sprintf(tmp_output,"Done loading '"CL_WHITE"%d"CL_RESET"' NPCs:%30s\n\t-'" CL_WHITE"%d"CL_RESET"' Warps\n\t-'" CL_WHITE"%d"CL_RESET"' Shops\n\t-'" CL_WHITE"%d"CL_RESET"' Scripts\n\t-'" CL_WHITE"%d"CL_RESET"' Mobs\n", - npc_id-START_NPC_NUM,npc_warp,npc_shop,npc_script,npc_mob); + npc_id-START_NPC_NUM,"",npc_warp,npc_shop,npc_script,npc_mob); ShowInfo(tmp_output); add_timer_func_list(npc_walktimer,"npc_walktimer"); // [Valaris] -- cgit v1.2.3-70-g09d2 From d73cbd4c778f408ce3e06c57ad6418b99e2b9c51 Mon Sep 17 00:00:00 2001 From: amber Date: Sun, 26 Dec 2004 19:44:00 +0000 Subject: updates git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@793 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 21 +++++++++++++++++++ src/char_sql/char.c | 2 +- src/char_sql/int_guild.c | 54 ++++++++++++++++++++++++++++++++++-------------- src/common/socket.c | 6 +++++- src/common/socket.h | 1 + src/map/chrif.c | 15 ++++++++++++++ src/map/chrif.h | 2 ++ src/map/map.c | 6 +++++- src/map/pc.c | 31 ++++++++++++--------------- 9 files changed, 101 insertions(+), 37 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index 9c70a25f2..bffbac0f2 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,26 @@ Date Added 12/26 + * @mapexit (and do_final) now persist all data to the + char server before exiting to eliminate storage/inventory + inconsistancies.. [MouseJstr] (SVN 793) + * Some cleanup of spiritball memory management [MouseJstr] + * Dramatic performance work for exp updates to sql. Previously, [MouseJstr] + when u killed a mob (in party share), it would cause the char_server to + + 1) Delete all guilds for all members of your party + 2) Re-create all guilds for all members of your party with the new exp + values. + + Now it just generates 2 sql statements per party member, + + 1) update the guild exp, + 2) update the guild_member exp. + + + src/common/socket.c src/common/socket.h src/char_sql/char.c + src/char_sql/int_guild.c src/map/chrif.h src/map/pc.c + src/map/map.c src/map/chrif.c + * Disabled import charcommand_conf.txt by default [celest] * Added Bitmap File system from jA 1086 - automatically generates a cache from maps in the GRF to speed up loading. You can enable/disable it with diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 7eb9a1929..82c8e2a34 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -3338,7 +3338,7 @@ int do_init(int argc, char **argv){ #undef mysql_query int debug_mysql_query(char *file, int line, void *mysql, const char *q) { - // printf("sql: %s:%d# %s\n", file, line, q); + printf("sql: %s:%d# %s\n", file, line, q); return mysql_query((MYSQL *) mysql, q); } diff --git a/src/char_sql/int_guild.c b/src/char_sql/int_guild.c index df3ec4d81..dedabfab7 100644 --- a/src/char_sql/int_guild.c +++ b/src/char_sql/int_guild.c @@ -1235,12 +1235,14 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id, { // Could speed up by manipulating only guild_member struct guild * g= inter_guild_fromsql(guild_id); - int i,alv,c; + int i,alv,c, idx; if(g==NULL||g->guild_id<=0) return 0; g->connect_member=0; + + idx = -1; for(i=0,alv=0,c=0;imax_member;i++){ if( g->member[i].account_id==account_id && @@ -1250,6 +1252,7 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id, g->member[i].lv=lv; g->member[i].class=class; mapif_guild_memberinfoshort(g,i); + idx = i; } if( g->member[i].account_id>0 ){ alv+=g->member[i].lv; @@ -1260,8 +1263,14 @@ int mapif_parse_GuildChangeMemberInfoShort(int fd,int guild_id, } // 平均レベル g->average_lv=alv/c; - - inter_guild_tosql(g,3); // Change guild & guild_member + + sprintf(tmp_sql, "UPDATE `%s` SET `connect_member`=%d,`average_lv`=%d WHERE `guild_id`='%d'", guild_db, g->connect_member, g->average_lv, g->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); + if(mysql_query(&mysql_handle, tmp_sql) ) + printf("DB server Error: %s - %s\n", tmp_sql, mysql_error(&mysql_handle) ); return 0; } @@ -1385,21 +1394,34 @@ int mapif_parse_GuildMemberInfoChange(int fd,int guild_id,int account_id,int cha } switch(type){ case GMI_POSITION: // 役職 - g->member[i].position=*((int *)data); - break; - case GMI_EXP: { // EXP - int exp,oldexp=g->member[i].exp; - exp=g->member[i].exp=*((unsigned int *)data); - g->exp+=(exp-oldexp); - guild_calcinfo(g); // Lvアップ判断 - mapif_guild_basicinfochanged(guild_id,GBI_EXP,&g->exp,4); - }break; + { + g->member[i].position=*((int *)data); + mapif_guild_memberinfochanged(guild_id,account_id,char_id,type,data,len); + inter_guild_tosql(g,3); // Change guild & guild_member + break; + } + case GMI_EXP: + { // EXP + int exp,oldexp=g->member[i].exp; + exp=g->member[i].exp=*((unsigned int *)data); + g->exp+=(exp-oldexp); + guild_calcinfo(g); // Lvアップ判断 + mapif_guild_basicinfochanged(guild_id,GBI_EXP,&g->exp,4); + mapif_guild_memberinfochanged(guild_id,account_id,char_id,type,data,len); + + sprintf(tmp_sql, "UPDATE `%s` SET `guild_lv`=%d,`connect_member`=%d,`max_member`=%d,`average_lv`=%d,`exp`=%d,`next_exp`=%d,`skill_point`=%d WHERE `guild_id`='%d'", guild_db, g->guild_lv, g->connect_member, g->max_member, g->average_lv, g->exp, g->next_exp, g->skill_point, g->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 `exp`=%d WHERE `char_id`=%d", guild_member_db, g->member[i].exp, g->member[i].char_id); + if(mysql_query(&mysql_handle, tmp_sql) ) + printf("DB server Error: %s - %s\n", tmp_sql, mysql_error(&mysql_handle) ); + break; + } default: - printf("int_guild: GuildMemberInfoChange: Unknown type %d\n",type); - break; + printf("int_guild: GuildMemberInfoChange: Unknown type %d\n",type); + break; } - mapif_guild_memberinfochanged(guild_id,account_id,char_id,type,data,len); - inter_guild_tosql(g,3); // Change guild & guild_member return 0; } diff --git a/src/common/socket.c b/src/common/socket.c index 0f5b53550..729f2fdfe 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -62,6 +62,10 @@ void set_defaultparse(int (*defaultparse)(int)) default_func_parse = defaultparse; } +void set_nonblocking(int fd, int yes) { + setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes); +} + static void setsocketopts(int fd) { int yes = 1; // reuse fix @@ -70,7 +74,7 @@ static void setsocketopts(int fd) #ifdef SO_REUSEPORT setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof yes); #endif - setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes); + set_nonblocking(fd, yes); setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &wfifo_size , sizeof(rfifo_size )); setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rfifo_size , sizeof(rfifo_size )); diff --git a/src/common/socket.h b/src/common/socket.h index 43acd6941..9b0c05013 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -91,6 +91,7 @@ int do_parsepacket(void); void do_socket(void); extern void flush_fifos(); +extern void set_nonblocking(int fd, int yes); int start_console(void); diff --git a/src/map/chrif.c b/src/map/chrif.c index 236590ff3..353533561 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -939,6 +939,21 @@ int chrif_char_offline(struct map_session_data *sd) return 0; } +/*========================================= + * Tell char-server to reset all chars offline [Wizputer] + *----------------------------------------- + */ +int chrif_flush_fifo(void) { + if (char_fd < 1) + return -1; + + set_nonblocking(char_fd, 0); + flush_fifos(); + set_nonblocking(char_fd, 1); + + return 0; +} + /*========================================= * Tell char-server to reset all chars offline [Wizputer] *----------------------------------------- diff --git a/src/map/chrif.h b/src/map/chrif.h index d53631e25..7f55d23d6 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -33,4 +33,6 @@ int check_connect_char_server(int tid, unsigned int tick, int id, int data); int do_init_chrif(void); +int chrif_flush_fifo(void); + #endif diff --git a/src/map/map.c b/src/map/map.c index 46705dc8d..4e7223d11 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2489,7 +2489,7 @@ static int cleanup_sub(struct block_list *bl, va_list ap) { switch(bl->type) { case BL_PC: - map_delblock(bl); // There is something better... + map_quit((struct map_session_data *) bl); break; case BL_NPC: npc_delete((struct npc_data *)bl); @@ -2522,9 +2522,13 @@ void do_final(void) { if(map[map_id].m) map_foreachinarea(cleanup_sub, map_id, 0, 0, map[map_id].xs, map[map_id].ys, 0, 0); } + #ifndef TXT_ONLY chrif_char_reset_offline(); #endif + + chrif_flush_fifo(); + for (i = 0; i < fd_max; i++) delete_session(i); diff --git a/src/map/pc.c b/src/map/pc.c index d314d2e30..881d302c5 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -183,7 +183,6 @@ int pc_delinvincibletimer(struct map_session_data *sd) { static int pc_spiritball_timer(int tid,unsigned int tick,int id,int data) { struct map_session_data *sd; - int i; if( (sd=(struct map_session_data *)map_id2sd(id)) == NULL || sd->bl.type!=BL_PC ) return 1; @@ -193,22 +192,24 @@ static int pc_spiritball_timer(int tid,unsigned int tick,int id,int data) { printf("spirit_timer %d != %d\n",sd->spirit_timer[0],tid); return 0; } - sd->spirit_timer[0]=-1; - for(i=1;ispiritball;i++) { - sd->spirit_timer[i-1] = sd->spirit_timer[i]; - sd->spirit_timer[i] = -1; + + if(sd->spiritball <= 0) { + if(battle_config.error_log) + printf("Spiritballs are already 0 when pc_spiritball_timer gets called"); + sd->spiritball = 0; + return 0; } + sd->spiritball--; - if(sd->spiritball < 0) - sd->spiritball = 0; + memcpy( &sd->spirit_timer[0], &sd->spirit_timer[1], sizeof(sd->spirit_timer[0]) * sd->spiritball ); + sd->spirit_timer[sd->spiritball]=-1; + clif_spiritball(sd); return 0; } int pc_addspiritball(struct map_session_data *sd,int interval,int max) { - int i; - nullpo_retr(0, sd); if(max > MAX_SKILL_LEVEL) @@ -217,16 +218,10 @@ int pc_addspiritball(struct map_session_data *sd,int interval,int max) { sd->spiritball = 0; if(sd->spiritball >= max) { - if(sd->spirit_timer[0] != -1) { + if(sd->spirit_timer[0] != -1) delete_timer(sd->spirit_timer[0],pc_spiritball_timer); - sd->spirit_timer[0] = -1; - } - for(i=1;ispirit_timer[i-1] = sd->spirit_timer[i]; - sd->spirit_timer[i] = -1; - } - } - else + memcpy( &sd->spirit_timer[0], &sd->spirit_timer[1], sizeof(sd->spirit_timer[0]) * (sd->spiritball - 1)); + } else sd->spiritball++; sd->spirit_timer[sd->spiritball-1] = add_timer(gettick()+interval,pc_spiritball_timer,sd->bl.id,0); -- cgit v1.2.3-70-g09d2 From ab0a9edc2f5754c4f778c008caff1682d43d65eb Mon Sep 17 00:00:00 2001 From: amber Date: Wed, 29 Dec 2004 19:18:18 +0000 Subject: cxx updates git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@861 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 1 + Makefile | 1 + src/char/char.c | 26 +++---- src/char/int_guild.c | 8 +- src/char/int_pet.c | 6 +- src/char_sql/char.c | 10 +-- src/char_sql/int_guild.c | 10 +-- src/char_sql/int_pet.c | 8 +- src/common/db.c | 1 + src/common/grfio.c | 36 ++++----- src/common/grfio.h | 4 +- src/common/mmo.h | 6 +- src/common/socket.c | 12 +-- src/common/socket.h | 1 + src/common/strlib.c | 1 + src/common/utils.h | 4 +- src/map/atcommand.c | 162 +++++++++++++++++++-------------------- src/map/battle.c | 126 +++++++++++++++--------------- src/map/charcommand.c | 58 +++++++------- src/map/chrif.c | 6 +- src/map/clif.c | 194 +++++++++++++++++++++++------------------------ src/map/guild.c | 6 +- src/map/itemdb.c | 6 +- src/map/itemdb.h | 2 +- src/map/map.h | 6 +- src/map/mob.c | 166 ++++++++++++++++++++-------------------- src/map/npc.c | 18 ++--- src/map/pc.c | 162 +++++++++++++++++++-------------------- src/map/pet.c | 46 +++++------ src/map/pet.h | 2 +- src/map/script.c | 14 ++-- src/map/skill.c | 30 ++++---- 32 files changed, 572 insertions(+), 567 deletions(-) (limited to 'src/map/chrif.c') 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, " %s %d/%d\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 #include #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 )."); @@ -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;iadd_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;iadd_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()%1000x0<=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()%1000x0<=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<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;ilootitem_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;iclass].maxskill;i++){ + for(i=0;iclass_].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<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<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<status.class)&item->class) == 0) +// if(((1<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<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<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(typeSP_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;ipet.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;iclass == 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; -- cgit v1.2.3-70-g09d2 From 31840066c4795124a887cd12996cf7dc13fcef25 Mon Sep 17 00:00:00 2001 From: codemaster Date: Sun, 9 Jan 2005 23:34:57 +0000 Subject: * Added 'OnInterIfInitOnce' for WoE scripts & modified the WoE scripts as well [Ajarn & Codemaster] [Thanks to FREYA] [SVN 943] git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@943 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 3 ++- npc/Changelog.txt | 2 ++ npc/guild/aldeg/aldeg_ev_agit.txt | 10 +++++----- npc/guild/gefg/gefg_ev_agit.txt | 10 +++++----- npc/guild/nguild/nguild_ev_agit.txt | 8 ++++---- npc/guild/payg/payg_ev_agit.txt | 10 +++++----- npc/guild/prtg/prtg_ev_agit.txt | 10 +++++----- src/map/chrif.c | 10 ++++++++-- 8 files changed, 36 insertions(+), 27 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index f895cac36..ac9cb0c5a 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,5 +1,6 @@ Date Added -01/09 +01/0 + * Added 'OnInterIfInitOnce' for WoE scripts & modified the WoE scripts as well [Ajarn & Codemaster] [Thanks to FREYA] [SVN 943] * Added the @sound command and the NPC command of soundeffectall - works just like soundeffect, but plays for everyone in the area [Codemaster] [SVN 942] * Don't allow Pets to attack Guardians outside of WoE [Codemaster] [SVN 940] diff --git a/npc/Changelog.txt b/npc/Changelog.txt index 56da03a80..a8f61beae 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -34,6 +34,8 @@ Other Ppl Date Added ====== +01/09/05 + * Modified guild war scripts to fix a bug for duplicate guild storages. [Codemaster & Ajarn] 8/1 * Added the new Yuno field warps by Sara-chan [celest] diff --git a/npc/guild/aldeg/aldeg_ev_agit.txt b/npc/guild/aldeg/aldeg_ev_agit.txt index 8287ad417..942e479b7 100644 --- a/npc/guild/aldeg/aldeg_ev_agit.txt +++ b/npc/guild/aldeg/aldeg_ev_agit.txt @@ -16,7 +16,7 @@ // Castle 1 ================================================================ aldeg_cas01.gat,216,24,0 script Agit_A01 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "aldeg_cas01.gat",0,"::OnRecvCastleA01"; end; OnRecvCastleA01: @@ -39,7 +39,7 @@ OnAgitEnd: // Castle 2 ================================================================ aldeg_cas02.gat,214,24,0 script Agit_A02 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "aldeg_cas02.gat",0,"::OnRecvCastleA02"; end; OnRecvCastleA02: @@ -62,7 +62,7 @@ OnAgitEnd: // Castle 3 ================================================================ aldeg_cas03.gat,206,32,0 script Agit_A03 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "aldeg_cas03.gat",0,"::OnRecvCastleA03"; end; OnRecvCastleA03: @@ -85,7 +85,7 @@ OnAgitEnd: // Castle 4 ================================================================ aldeg_cas04.gat,36,218,0 script Agit_A04 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "aldeg_cas04.gat",0,"::OnRecvCastleA04"; end; OnRecvCastleA04: @@ -108,7 +108,7 @@ OnAgitEnd: // Castle 5 ================================================================ aldeg_cas05.gat,28,102,0 script Agit_A05 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "aldeg_cas05.gat",0,"::OnRecvCastleA05"; end; OnRecvCastleA05: diff --git a/npc/guild/gefg/gefg_ev_agit.txt b/npc/guild/gefg/gefg_ev_agit.txt index 5be223f03..3ac4c7432 100644 --- a/npc/guild/gefg/gefg_ev_agit.txt +++ b/npc/guild/gefg/gefg_ev_agit.txt @@ -16,7 +16,7 @@ // Castle 1 ================================================================ gefg_cas01.gat,198,182,0 script Agit_G01 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "gefg_cas01.gat",0,"::OnRecvCastleG01"; end; OnRecvCastleG01: @@ -39,7 +39,7 @@ OnAgitEnd: // Castle 2 ================================================================ gefg_cas02.gat,176,178,0 script Agit_G02 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "gefg_cas02.gat",0,"::OnRecvCastleG02"; end; OnRecvCastleG02: @@ -62,7 +62,7 @@ OnAgitEnd: // Castle 3 ================================================================ gefg_cas03.gat,245,167,0 script Agit_G03 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "gefg_cas03.gat",0,"::OnRecvCastleG03"; end; OnRecvCastleG03: @@ -85,7 +85,7 @@ OnAgitEnd: // Castle 4 ================================================================ gefg_cas04.gat,174,178,0 script Agit_G04 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "gefg_cas04.gat",0,"::OnRecvCastleG04"; end; OnRecvCastleG04: @@ -108,7 +108,7 @@ OnAgitEnd: // Castle 5 ================================================================ gefg_cas05.gat,194,184,0 script Agit_G05 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "gefg_cas05.gat",0,"::OnRecvCastleG05"; end; OnRecvCastleG05: diff --git a/npc/guild/nguild/nguild_ev_agit.txt b/npc/guild/nguild/nguild_ev_agit.txt index d690fb348..84074a72b 100644 --- a/npc/guild/nguild/nguild_ev_agit.txt +++ b/npc/guild/nguild/nguild_ev_agit.txt @@ -15,7 +15,7 @@ // Castle 1 ================================================================ nguild_alde.gat,0,0,0 script Agit_N01 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "nguild_alde.gat",0,"::OnRecvCastleN01"; end; OnRecvCastleN01: @@ -38,7 +38,7 @@ OnAgitEnd: // Castle 2 ================================================================ nguild_gef.gat,0,0,0 script Agit_N02 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "nguild_gef.gat",0,"::OnRecvCastleN02"; end; OnRecvCastleN02: @@ -61,7 +61,7 @@ OnAgitEnd: // Castle 3 ================================================================ nguild_pay.gat,0,0,0 script Agit_N03 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "nguild_pay.gat",0,"::OnRecvCastleN03"; end; OnRecvCastleN03: @@ -84,7 +84,7 @@ OnAgitEnd: // Castle 4 ================================================================ nguild_prt.gat,0,0,0 script Agit_N04 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "nguild_prt.gat",0,"::OnRecvCastleN04"; end; OnRecvCastleN04: diff --git a/npc/guild/payg/payg_ev_agit.txt b/npc/guild/payg/payg_ev_agit.txt index a873f9bea..95b735ed9 100644 --- a/npc/guild/payg/payg_ev_agit.txt +++ b/npc/guild/payg/payg_ev_agit.txt @@ -16,7 +16,7 @@ // Castle 1 ================================================================ payg_cas01.gat,139,139,0 script Agit_Py01 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "payg_cas01.gat",0,"::OnRecvCastlePy01"; end; OnRecvCastlePy01: @@ -39,7 +39,7 @@ OnAgitEnd: // Castle 2 ================================================================ payg_cas02.gat,39,25,0 script Agit_Py02 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "payg_cas02.gat",0,"::OnRecvCastlePy02"; end; OnRecvCastlePy02: @@ -62,7 +62,7 @@ OnAgitEnd: // Castle 3 ================================================================ payg_cas03.gat,269,265,0 script Agit_Py03 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "payg_cas03.gat",0,"::OnRecvCastlePy03"; end; OnRecvCastlePy03: @@ -85,7 +85,7 @@ OnAgitEnd: // Castle 4 ================================================================ payg_cas04.gat,271,29,0 script Agit_Py04 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "payg_cas04.gat",0,"::OnRecvCastlePy04"; end; OnRecvCastlePy04: @@ -108,7 +108,7 @@ OnAgitEnd: // Castle 5 ================================================================ payg_cas05.gat,30,30,0 script Agit_Py05 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "payg_cas05.gat",0,"::OnRecvCastlePy05"; end; OnRecvCastlePy05: diff --git a/npc/guild/prtg/prtg_ev_agit.txt b/npc/guild/prtg/prtg_ev_agit.txt index 6c83ad390..b654aa037 100644 --- a/npc/guild/prtg/prtg_ev_agit.txt +++ b/npc/guild/prtg/prtg_ev_agit.txt @@ -16,7 +16,7 @@ // Castle 1 ================================================================ prtg_cas01.gat,197,197,0 script Agit_Pt01 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "prtg_cas01.gat",0,"::OnRecvCastlePt01"; end; OnRecvCastlePt01: @@ -39,7 +39,7 @@ OnAgitEnd: // Castle 2 ================================================================ prtg_cas02.gat,158,174,0 script Agit_Pt02 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "prtg_cas02.gat",0,"::OnRecvCastlePt02"; end; OnRecvCastlePt02: @@ -62,7 +62,7 @@ OnAgitEnd: // Castle 3 ================================================================ prtg_cas03.gat,17,221,0 script Agit_Pt03 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "prtg_cas03.gat",0,"::OnRecvCastlePt03"; end; OnRecvCastlePt03: @@ -85,7 +85,7 @@ OnAgitEnd: // Castle 4 ================================================================ prtg_cas04.gat,292,14,0 script Agit_Pt04 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "prtg_cas04.gat",0,"::OnRecvCastlePt04"; end; OnRecvCastlePt04: @@ -108,7 +108,7 @@ OnAgitEnd: // Castle 5 ================================================================ prtg_cas05.gat,266,266,0 script Agit_Pt05 -1,{ -OnInterIfInit: +OnInterIfInitOnce: GetCastleData "prtg_cas05.gat",0,"::OnRecvCastlePt05"; end; OnRecvCastlePt05: diff --git a/src/map/chrif.c b/src/map/chrif.c index c04630300..f7e6781d6 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -36,13 +36,14 @@ static const int packet_len_table[0x20] = { -1,-1,10, 6,11,-1, 0, 0, // 2b10-2b17 }; -int char_fd; +int char_fd = -1; int srvinfo; static char char_ip_str[16]; static int char_ip; static int char_port = 6121; static char userid[24], passwd[24]; -static int chrif_state; +static int chrif_state = 0; +static int char_init_done = 0; // 設定ファイル読み込み関係 /*========================================== @@ -256,6 +257,11 @@ int chrif_connectack(int fd) ShowStatus(tmp_output); sprintf(tmp_output,"Event '"CL_WHITE"OnInterIfInit"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInit")); ShowStatus(tmp_output); + if(!char_init_done) { + char_init_done = 1; + sprintf(tmp_output,"Event '"CL_WHITE"OnInterIfInitOnce"CL_RESET"' executed with '"CL_WHITE"%d"CL_RESET"' NPCs.\n", npc_event_doall("OnInterIfInitOnce")); + ShowStatus(tmp_output); + } // Run Event [AgitInit] // printf("NPC_Event:[OnAgitInit] do (%d) events (Agit Initialize).\n", npc_event_doall("OnAgitInit")); -- cgit v1.2.3-70-g09d2 From 60c5d7f50c39c55f1ac7121fb1391e4c49966824 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Mon, 24 Jan 2005 00:15:41 +0000 Subject: Some more changes for g++ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@972 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 3 +- src/char/char.c | 8 ++--- src/char/char.h | 6 ++-- src/char_sql/char.c | 12 +++---- src/char_sql/char.h | 6 ++-- src/common/db.c | 12 ++++--- src/common/grfio.c | 23 +++++++------ src/ladmin/ladmin.c | 8 ++--- src/login/login.c | 20 +++++------ src/login_sql/login.c | 10 +++--- src/map/chrif.c | 94 +++++++++++++++++++++++++-------------------------- src/map/map.c | 18 +++++----- 12 files changed, 113 insertions(+), 107 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index e424cf83c..02ef7b0b3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,7 +1,8 @@ Date Added 01/23 - * Reverted back some of the char* changes [SVN 970] [Ajarn] + * Fixed the sizeof errors in g++ [SVN 972] [Ajarn] + * Reverted back some of the char* changes [SVN 972] [Ajarn] * Changed parse_script to now return char* [SVN 969] [Ajarn] * Converted run_script and run_script_main from unsigned char* to char* [SVN 969] [Ajarn] diff --git a/src/char/char.c b/src/char/char.c index 56d070e5d..fb154c51c 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -152,7 +152,7 @@ int char_log(char *fmt, ...) { fprintf(logfp, RETCODE); else { gettimeofday(&tv, NULL); - strftime(tmpstr, 24, "%d-%m-%Y %H:%M:%S", localtime(&(tv.tv_sec))); + strftime(tmpstr, 24, "%d-%m-%Y %H:%M:%S", localtime((const time_t*)&(tv.tv_sec))); sprintf(tmpstr + 19, ".%03d: %s", (int)tv.tv_usec / 1000, fmt); vfprintf(logfp, tmpstr, ap); } @@ -2971,7 +2971,7 @@ int parse_console(char *buf) { } // 全てのMAPサーバーにデータ送信(送信したmap鯖の数を返す) -int mapif_sendall(char *buf, unsigned int len) { +int mapif_sendall(unsigned char *buf, unsigned int len) { int i, c; c = 0; @@ -2987,7 +2987,7 @@ int mapif_sendall(char *buf, unsigned int len) { } // 自分以外の全てのMAPサーバーにデータ送信(送信したmap鯖の数を返す) -int mapif_sendallwos(int sfd, char *buf, unsigned int len) { +int mapif_sendallwos(int sfd, unsigned char *buf, unsigned int len) { int i, c; c = 0; @@ -3002,7 +3002,7 @@ int mapif_sendallwos(int sfd, char *buf, unsigned int len) { return c; } // MAPサーバーにデータ送信(map鯖生存確認有り) -int mapif_send(int fd, char *buf, unsigned int len) { +int mapif_send(int fd, unsigned char *buf, unsigned int len) { int i; if (fd >= 0) { diff --git a/src/char/char.h b/src/char/char.h index c70facba1..3ee2f9f6d 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -20,9 +20,9 @@ struct mmo_map_server{ int search_character_index(char* character_name); char * search_character_name(int index); -int mapif_sendall(char *buf, unsigned int len); -int mapif_sendallwos(int fd,char *buf, unsigned int len); -int mapif_send(int fd,char *buf, unsigned int len); +int mapif_sendall(unsigned char *buf, unsigned int len); +int mapif_sendallwos(int fd,unsigned char *buf, unsigned int len); +int mapif_send(int fd,unsigned char *buf, unsigned int len); int char_log(char *fmt, ...); diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 876ea991d..7c0f75737 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -1219,11 +1219,11 @@ int make_new_char_sql(int fd, unsigned char *dat) { // Check Authorised letters/symbols in the name of the character if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised - for (i = 0; i < strlen(dat); i++) + for (i = 0; i < strlen(const char*dat); i++) if (strchr(char_name_letters, dat[i]) == NULL) return -1; } else if (char_name_option == 2) { // letters/symbols in char_name_letters are forbidden - for (i = 0; i < strlen(dat); i++) + for (i = 0; i < strlen(const char*)dat); i++) if (strchr(char_name_letters, dat[i]) != NULL) return -1; } // else, all letters/symbols are authorised (except control char removed before) @@ -2763,7 +2763,7 @@ int parse_char(int fd) { if (server_fd[i] < 0) break; } - if (i == MAX_MAP_SERVERS || strcmp(RFIFOP(fd,2), userid) || strcmp(RFIFOP(fd,26), passwd)) { + if (i == MAX_MAP_SERVERS || strcmp((const char*)RFIFOP(fd,2), userid) || strcmp((const char*)RFIFOP(fd,26), passwd)) { WFIFOB(fd,2) = 3; WFIFOSET(fd, 3); } else { @@ -2851,7 +2851,7 @@ int parse_console(char *buf) { } // MAP send all -int mapif_sendall(char *buf, unsigned int len) { +int mapif_sendall(unsigned char *buf, unsigned int len) { int i, c; int fd; @@ -2867,7 +2867,7 @@ int mapif_sendall(char *buf, unsigned int len) { return c; } -int mapif_sendallwos(int sfd, char *buf, unsigned int len) { +int mapif_sendallwos(int sfd, unsigned char *buf, unsigned int len) { int i, c; int fd; @@ -2883,7 +2883,7 @@ int mapif_sendallwos(int sfd, char *buf, unsigned int len) { return c; } -int mapif_send(int fd, char *buf, unsigned int len) { +int mapif_send(int fd, unsigned char *buf, unsigned int len) { int i; if (fd >= 0) { diff --git a/src/char_sql/char.h b/src/char_sql/char.h index 17a938780..c7261650b 100644 --- a/src/char_sql/char.h +++ b/src/char_sql/char.h @@ -41,9 +41,9 @@ struct itemtemp{ struct itemtmp equip[MAX_GUILD_STORAGE],notequip[MAX_GUILD_STORAGE]; }; int memitemdata_to_sql(struct itemtemp mapitem, int eqcount, int noteqcount, int char_id,int tableswitch); -int mapif_sendall(char *buf,unsigned int len); -int mapif_sendallwos(int fd,char *buf,unsigned int len); -int mapif_send(int fd,char *buf,unsigned int len); +int mapif_sendall(unsigned char *buf,unsigned int len); +int mapif_sendallwos(int fd,unsigned char *buf,unsigned int len); +int mapif_send(int fd,unsigned char *buf,unsigned int len); extern int autosave_interval; extern char db_path[]; diff --git a/src/common/db.c b/src/common/db.c index d76b7a44c..12d54176c 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -42,18 +42,20 @@ static void free_dbn(struct dbn* add_dbn) } #endif +// maybe change the void* to const char* ??? static int strdb_cmp(struct dbt* table,void* a,void* b) { if(table->maxlen) - return strncmp(a,b,table->maxlen); - return strcmp(a,b); + return strncmp((const char*)a,(const char*)b,table->maxlen); + return strcmp((const char*)a,(const char*)b); } +// maybe change the void* to unsigned char* ??? static unsigned int strdb_hash(struct dbt* table,void* a) { int i; unsigned int h; - unsigned char *p=a; + unsigned char *p = (unsigned char*)a; i=table->maxlen; if(i==0) i=0x7fffffff; @@ -131,14 +133,14 @@ void * db_search2(struct dbt *table, const char *key) { int i,sp; struct dbn *p,*pn,*stack[64]; - int slen = strlen(key); + int slen = strlen(key); for(i=0;iht[i])==NULL) continue; sp=0; while(1){ - if (strnicmp(key, p->key, slen) == 0) + if (strnicmp(key, (const char*)p->key, slen) == 0) return p->data; if((pn=p->left)!=NULL){ if(p->right){ diff --git a/src/common/grfio.c b/src/common/grfio.c index 013c21c74..6454d5048 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -656,7 +656,7 @@ void* grfio_read(char *fname) * Resource filename decode *------------------------------------------ */ -static unsigned char * decode_filename(unsigned char *buf,int len) +static char * decode_filename(unsigned char *buf,int len) { int lop; for(lop=0;lopsizeof(aentry.fn)-1){ + if(strlen(fname)>sizeof(aentry.fn)-1){ printf("file name too long : %s\n",fname); aFree(grf_filelist); exit(1); } srclen=0; - if((period_ptr=strrchr((const char *) fname,'.'))!=NULL){ + if((period_ptr=strrchr(fname,'.'))!=NULL){ for(lop=0;lop<4;lop++) { if(strcmpi(period_ptr,".gnd\0.gat\0.act\0.str"+lop*5)==0) break; @@ -750,7 +750,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, (const char *) fname,sizeof(aentry.fn)-1); + strncpy(aentry.fn, 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 @@ -777,13 +777,13 @@ static int grfio_entryread(char *gfname,int gentry) return 4; } - rBuf = (unsigned char *) aCallocA( rSize , 1); // Get a Read Size + rBuf = (unsigned char *)aCallocA( 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 = (unsigned char *) aCallocA( eSize , 1); // Get a Extend Size + grf_filelist = (unsigned char *)aCallocA( eSize , 1); // Get a Extend Size if (grf_filelist==NULL) { aFree(rBuf); fclose(fp); @@ -803,13 +803,14 @@ static int grfio_entryread(char *gfname,int gentry) int ofs2,srclen,srccount,type; FILELIST aentry; - fname = grf_filelist+ofs; - if (strlen((const char *) fname)>sizeof(aentry.fn)-1) { + fname = (char*)(grf_filelist+ofs); + if (strlen(fname)>sizeof(aentry.fn)-1) { printf("grf : file name too long : %s\n",fname); aFree(grf_filelist); exit(1); } - ofs2 = ofs+strlen(grf_filelist+ofs)+1; + //ofs2 = ofs+strlen((char*)(grf_filelist+ofs))+1; + ofs2 = ofs+strlen(fname)+1; type = grf_filelist[ofs2+12]; if(type==1 || type==3 || type==5) { srclen=getlong(grf_filelist+ofs2); diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c index 66f5b837f..de177ba8a 100644 --- a/src/ladmin/ladmin.c +++ b/src/ladmin/ladmin.c @@ -3316,11 +3316,11 @@ int parse_fromlogin(int fd) { memcpy(md5key, RFIFOP(fd,4), RFIFOW(fd,2) - 4); md5key[sizeof(md5key)-1] = '0'; if (passenc == 1) { - strncpy(md5str, RFIFOP(fd,4), RFIFOW(fd,2) - 4); + strncpy(md5str, (const char*)RFIFOP(fd,4), RFIFOW(fd,2) - 4); strcat(md5str, loginserveradminpassword); } else if (passenc == 2) { strncpy(md5str, loginserveradminpassword, sizeof(loginserveradminpassword)); - strcat(md5str, RFIFOP(fd,4)); + strcat(md5str, (const char*)RFIFOP(fd,4)); } MD5_String2binary(md5str, md5bin); WFIFOW(login_fd,0) = 0x7918; // Request for administation login (encrypted password) @@ -3815,7 +3815,7 @@ int parse_fromlogin(int fd) { case 0x7947: // answer of an account name search if (RFIFOREST(fd) < 30) return 0; - if (strcmp(RFIFOP(fd,6), "") == 0) { + if (strcmp((const char*)RFIFOP(fd,6), "") == 0) { if (defaultlanguage == 'F') { printf("Impossible de trouver le nom du compte [%d]. Le compte n'existe pas.\n", RFIFOL(fd,2)); ladmin_log("Impossible de trouver le nom du compte [%d]. Le compte n'existe pas." RETCODE, RFIFOL(fd,2)); @@ -4032,7 +4032,7 @@ int parse_fromlogin(int fd) { connect_until_time = (time_t)RFIFOL(fd,140); ban_until_time = (time_t)RFIFOL(fd,144); memset(memo, '\0', sizeof(memo)); - strncpy(memo, RFIFOP(fd,150), RFIFOW(fd,148)); + strncpy(memo, (const char*)RFIFOP(fd,150), RFIFOW(fd,148)); if (RFIFOL(fd,2) == -1) { if (defaultlanguage == 'F') { printf("Impossible de trouver le compte [%s]. Le compte n'existe pas.\n", parameters); diff --git a/src/login/login.c b/src/login/login.c index 11c970aca..1a0faddb0 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -186,7 +186,7 @@ int login_log(char *fmt, ...) { else { va_start(ap, fmt); gettimeofday(&tv, NULL); - strftime(tmpstr, 24, date_format, localtime(&(tv.tv_sec))); + strftime(tmpstr, 24, date_format, localtime((const time_t*)&(tv.tv_sec))); sprintf(tmpstr + strlen(tmpstr), ".%03d: %s", (int)tv.tv_usec / 1000, fmt); vfprintf(log_fp, tmpstr, ap); va_end(ap); @@ -326,14 +326,14 @@ int check_ipmask(unsigned int ip, const unsigned char *str) { unsigned int mask = 0, i = 0, m, ip2, a0, a1, a2, a3; unsigned char *p = (unsigned char *)&ip2, *p2 = (unsigned char *)&mask; - if (sscanf(str, "%d.%d.%d.%d/%n", &a0, &a1, &a2, &a3, &i) != 4 || i == 0) + if (sscanf((const char*)str, "%d.%d.%d.%d/%n", &a0, &a1, &a2, &a3, &i) != 4 || i == 0) return 0; p[0] = a0; p[1] = a1; p[2] = a2; p[3] = a3; - if (sscanf(str+i, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) == 4) { + if (sscanf((const char*)str+i, "%d.%d.%d.%d", &a0, &a1, &a2, &a3) == 4) { p2[0] = a0; p2[1] = a1; p2[2] = a2; p2[3] = a3; mask = ntohl(mask); - } else if (sscanf(str+i, "%d", &m) == 1 && m >= 0 && m <= 32) { + } else if (sscanf((const char*)(str+i), "%d", &m) == 1 && m >= 0 && m <= 32) { for(i = 0; i < m && i < 32; i++) mask = (mask >> 1) | 0x80000000; } else { @@ -372,7 +372,7 @@ int check_ip(unsigned int ip) { for(i = 0; i < access_allownum; i++) { access_ip = access_allow + i * ACO_STRSIZE; - if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, access_ip)) { + if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, (unsigned char*)access_ip)) { if(access_order == ACO_ALLOW_DENY) return 1; // With 'allow, deny' (deny if not allow), allow has priority flag = ACF_ALLOW; @@ -382,7 +382,7 @@ int check_ip(unsigned int ip) { for(i = 0; i < access_denynum; i++) { access_ip = access_deny + i * ACO_STRSIZE; - if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, access_ip)) { + if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, (unsigned char*)access_ip)) { //flag = ACF_DENY; // not necessary to define flag return 0; // At this point, if it's 'deny', we refuse connection. } @@ -420,7 +420,7 @@ int check_ladminip(unsigned int ip) { for(i = 0; i < access_ladmin_allownum; i++) { access_ip = access_ladmin_allow + i * ACO_STRSIZE; - if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, access_ip)) { + if (memcmp(access_ip, buf, strlen(access_ip)) == 0 || check_ipmask(ip, (unsigned char*)access_ip)) { return 1; } } @@ -431,7 +431,7 @@ int check_ladminip(unsigned int ip) { //----------------------------------------------------- // Function to suppress control characters in a string. //----------------------------------------------------- -int remove_control_chars(unsigned char *str) { +int remove_control_chars(char *str) { int i; int change = 0; @@ -448,9 +448,9 @@ int remove_control_chars(unsigned char *str) { //--------------------------------------------------- // E-mail check: return 0 (not correct) or 1 (valid). //--------------------------------------------------- -int e_mail_check(unsigned char *email) { +int e_mail_check(char *email) { char ch; - unsigned char* last_arobas; + char* last_arobas; // athena limits if (strlen(email) < 3 || strlen(email) > 39) diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 302e78b9e..c4c8bdafc 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -1177,8 +1177,8 @@ int parse_login(int fd) { printf("client connection request %s from %d.%d.%d.%d\n", RFIFOP(fd, 6), p[0], p[1], p[2], p[3]); - account.userid = RFIFOP(fd, 6); - account.passwd = RFIFOP(fd, 30); + account.userid = (char*)RFIFOP(fd, 6); + account.passwd = (char*)RFIFOP(fd, 30); #ifdef PASSWORDENC account.passwdenc= (RFIFOW(fd,0)==0x64)?0:PASSWORDENC; #else @@ -1186,7 +1186,7 @@ int parse_login(int fd) { #endif result=mmo_auth(&account, fd); - jstrescapecpy(t_uid,RFIFOP(fd, 6)); + jstrescapecpy(t_uid,(char*)RFIFOP(fd, 6)); if(result==-1){ int gm_level = isGM(account.account_id); if (min_level_to_connect > gm_level) { @@ -1392,8 +1392,8 @@ int parse_login(int fd) { printf("server connection request %s @ %d.%d.%d.%d:%d (%d.%d.%d.%d)\n", RFIFOP(fd, 60), RFIFOB(fd, 54), RFIFOB(fd, 55), RFIFOB(fd, 56), RFIFOB(fd, 57), RFIFOW(fd, 58), p[0], p[1], p[2], p[3]); - account.userid = RFIFOP(fd, 2); - account.passwd = RFIFOP(fd, 26); + account.userid = (char*)RFIFOP(fd, 2); + account.passwd = (char*)RFIFOP(fd, 26); account.passwdenc = 0; server_name = RFIFOP(fd,60); result = mmo_auth(&account, fd); diff --git a/src/map/chrif.c b/src/map/chrif.c index f7e6781d6..cda7b42e2 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -50,7 +50,7 @@ static int char_init_done = 0; * *------------------------------------------ */ -void chrif_setuserid(char *id) +void chrif_setuserid(char *id) { strncpy(userid, id, 24); } @@ -59,7 +59,7 @@ void chrif_setuserid(char *id) * *------------------------------------------ */ -void chrif_setpasswd(char *pwd) +void chrif_setpasswd(char *pwd) { strncpy(passwd, pwd, 24); } @@ -68,7 +68,7 @@ void chrif_setpasswd(char *pwd) * *------------------------------------------ */ -void chrif_setip(char *ip) +void chrif_setip(char *ip) { strncpy(char_ip_str, ip, 16); char_ip = inet_addr(char_ip_str); @@ -78,7 +78,7 @@ void chrif_setip(char *ip) * *------------------------------------------ */ -void chrif_setport(int port) +void chrif_setport(int port) { char_port = port; } @@ -87,7 +87,7 @@ void chrif_setport(int port) * *------------------------------------------ */ -int chrif_isconnect(void) +int chrif_isconnect(void) { return chrif_state == 2; } @@ -96,7 +96,7 @@ int chrif_isconnect(void) * *------------------------------------------ */ -int chrif_save(struct map_session_data *sd) +int chrif_save(struct map_session_data *sd) { nullpo_retr(-1, sd); @@ -119,7 +119,7 @@ int chrif_save(struct map_session_data *sd) * *------------------------------------------ */ -int chrif_connect(int fd) +int chrif_connect(int fd) { WFIFOW(fd,0) = 0x2af8; memcpy(WFIFOP(fd,2), userid, 24); @@ -136,7 +136,7 @@ int chrif_connect(int fd) * マップ送信 *------------------------------------------ */ -int chrif_sendmap(int fd) +int chrif_sendmap(int fd) { int i; @@ -167,7 +167,7 @@ int chrif_recvmap(int fd) ip = RFIFOL(fd,4); port = RFIFOW(fd,8); for(i = 10, j = 0; i < RFIFOW(fd,2); i += 16, j++) { - map_setipport(RFIFOP(fd,i), ip, port); + map_setipport((char*)RFIFOP(fd,i), ip, port); // if (battle_config.etc_log) // printf("recv map %d %s\n", j, RFIFOP(fd,i)); } @@ -181,15 +181,15 @@ int chrif_recvmap(int fd) * マップ鯖間移動のためのデータ準備要求 *------------------------------------------ */ -int chrif_changemapserver(struct map_session_data *sd, char *name, int x, int y, int ip, short port) +int chrif_changemapserver(struct map_session_data *sd, char *name, int x, int y, int ip, short port) { int i, s_ip; nullpo_retr(-1, sd); - + if (!sd || char_fd < 1 ) return -1; - + s_ip = 0; for(i = 0; i < fd_max; i++) if (session[i] && session[i]->session_data == sd) { @@ -218,7 +218,7 @@ int chrif_changemapserver(struct map_session_data *sd, char *name, int x, int y, * マップ鯖間移動ack *------------------------------------------ */ -int chrif_changemapserverack(int fd) +int chrif_changemapserverack(int fd) { struct map_session_data *sd = map_id2sd(RFIFOL(fd,2)); @@ -231,7 +231,7 @@ int chrif_changemapserverack(int fd) pc_authfail(sd->fd); return 0; } - clif_changemapserver(sd, RFIFOP(fd,18), RFIFOW(fd,34), RFIFOW(fd,36), RFIFOL(fd,38), RFIFOW(fd,42)); + clif_changemapserver(sd, (char*)RFIFOP(fd,18), RFIFOW(fd,34), RFIFOW(fd,36), RFIFOL(fd,38), RFIFOW(fd,42)); return 0; } @@ -240,7 +240,7 @@ int chrif_changemapserverack(int fd) * *------------------------------------------ */ -int chrif_connectack(int fd) +int chrif_connectack(int fd) { if (RFIFOB(fd,2)) { printf("Connected to char-server failed %d.\n", RFIFOB(fd,2)); @@ -273,7 +273,7 @@ int chrif_connectack(int fd) * *------------------------------------------ */ -int chrif_sendmapack(int fd) +int chrif_sendmapack(int fd) { if (RFIFOB(fd,2)) { printf("chrif : send map list to char server failed %d\n", RFIFOB(fd,2)); @@ -291,7 +291,7 @@ int chrif_sendmapack(int fd) * *------------------------------------------ */ -int chrif_authreq(struct map_session_data *sd) +int chrif_authreq(struct map_session_data *sd) { int i; @@ -319,7 +319,7 @@ int chrif_authreq(struct map_session_data *sd) * *------------------------------------------ */ -int chrif_charselectreq(struct map_session_data *sd) +int chrif_charselectreq(struct map_session_data *sd) { int i, s_ip; @@ -349,7 +349,7 @@ int chrif_charselectreq(struct map_session_data *sd) * キャラ名問い合わせ *------------------------------------------ */ -int chrif_searchcharid(int char_id) +int chrif_searchcharid(int char_id) { if (!char_id || char_fd < 1) return -1; @@ -365,11 +365,11 @@ int chrif_searchcharid(int char_id) * GMに変化要求 *------------------------------------------ */ -int chrif_changegm(int id, const char *pass, int len) +int chrif_changegm(int id, const char *pass, int len) { if (battle_config.etc_log) printf("chrif_changegm: account: %d, password: '%s'.\n", id, pass); - + if (char_fd < 1 ) return -1; @@ -386,14 +386,14 @@ int chrif_changegm(int id, const char *pass, int len) * Change Email *------------------------------------------ */ -int chrif_changeemail(int id, const char *actual_email, const char *new_email) +int chrif_changeemail(int id, const char *actual_email, const char *new_email) { if (battle_config.etc_log) printf("chrif_changeemail: account: %d, actual_email: '%s', new_email: '%s'.\n", id, actual_email, new_email); - + if (char_fd < 1 ) return -1; - + WFIFOW(char_fd,0) = 0x2b0c; WFIFOL(char_fd,2) = id; memcpy(WFIFOP(char_fd,6), actual_email, 40); @@ -414,11 +414,11 @@ int chrif_changeemail(int id, const char *actual_email, const char *new_email) * 5: changesex *------------------------------------------ */ -int chrif_char_ask_name(int id, char * character_name, short operation_type, int year, int month, int day, int hour, int minute, int second) +int chrif_char_ask_name(int id, char * character_name, short operation_type, int year, int month, int day, int hour, int minute, int second) { if (char_fd < 1 ) return -1; - + WFIFOW(char_fd, 0) = 0x2b0e; WFIFOL(char_fd, 2) = id; // account_id of who ask (for answer) -1 if nobody memcpy(WFIFOP(char_fd,6), character_name, 24); @@ -470,7 +470,7 @@ int chrif_changesex(int id, int sex) { * 3: login-server offline *------------------------------------------ */ -int chrif_char_ask_name_answer(int fd) +int chrif_char_ask_name_answer(int fd) { int acc; struct map_session_data *sd; @@ -573,7 +573,7 @@ int chrif_char_ask_name_answer(int fd) * End of GM change (@GM) (modified by Yor) *------------------------------------------ */ -int chrif_changedgm(int fd) +int chrif_changedgm(int fd) { int acc, level; struct map_session_data *sd = NULL; @@ -599,7 +599,7 @@ int chrif_changedgm(int fd) * 性別変化終了 (modified by Yor) *------------------------------------------ */ -int chrif_changedsex(int fd) +int chrif_changedsex(int fd) { int acc, sex, i; struct map_session_data *sd; @@ -671,14 +671,14 @@ int chrif_changedsex(int fd) * アカウント変数保存要求 *------------------------------------------ */ -int chrif_saveaccountreg2(struct map_session_data *sd) +int chrif_saveaccountreg2(struct map_session_data *sd) { int p, j; nullpo_retr(-1, sd); - + if (char_fd < 1 ) return -1; - + p = 8; for(j = 0; j < sd->status.account_reg2_num; j++) { struct global_reg *reg = &sd->status.account_reg2[j]; @@ -700,7 +700,7 @@ int chrif_saveaccountreg2(struct map_session_data *sd) * アカウント変数通知 *------------------------------------------ */ -int chrif_accountreg2(int fd) +int chrif_accountreg2(int fd) { int j, p; struct map_session_data *sd; @@ -722,7 +722,7 @@ int chrif_accountreg2(int fd) * 離婚情報同期要求 *------------------------------------------ */ -int chrif_divorce(int char_id, int partner_id) +int chrif_divorce(int char_id, int partner_id) { struct map_session_data *sd = NULL; @@ -748,7 +748,7 @@ int chrif_divorce(int char_id, int partner_id) * Disconnection of a player (account has been deleted in login-server) by [Yor] *------------------------------------------ */ -int chrif_accountdeletion(int fd) +int chrif_accountdeletion(int fd) { int acc; struct map_session_data *sd; @@ -775,7 +775,7 @@ int chrif_accountdeletion(int fd) * Disconnection of a player (account has been banned of has a status, from login-server) by [Yor] *------------------------------------------ */ -int chrif_accountban(int fd) +int chrif_accountban(int fd) { int acc; struct map_session_data *sd; @@ -865,7 +865,7 @@ int chrif_chardisconnect(struct map_session_data *sd) * Receiving GM accounts and their levels from char-server by [Yor] *------------------------------------------ */ -int chrif_recvgmaccounts(int fd) +int chrif_recvgmaccounts(int fd) { sprintf(tmp_output,"From login-server: receiving information of '"CL_WHITE"%d"CL_RESET"' GM accounts.\n", pc_read_gm_account(fd)); ShowInfo(tmp_output); @@ -877,11 +877,11 @@ int chrif_recvgmaccounts(int fd) * Request to reload GM accounts and their levels: send to char-server by [Yor] *------------------------------------------ */ -int chrif_reloadGMdb(void) +int chrif_reloadGMdb(void) { if (char_fd < 1 ) return -1; - + WFIFOW(char_fd,0) = 0x2af7; WFIFOSET(char_fd, 2); @@ -892,15 +892,15 @@ int chrif_reloadGMdb(void) * Send rates and motd to char server [Wizputer] *------------------------------------------ */ - int chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) + int chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) { char buf[256]; FILE *fp; int i; - + if (char_fd < 1 ) return -1; - + WFIFOW(char_fd,0) = 0x2b16; WFIFOW(char_fd,2) = base_rate; WFIFOW(char_fd,4) = job_rate; @@ -932,7 +932,7 @@ int chrif_reloadGMdb(void) *----------------------------------------- */ -int chrif_char_offline(struct map_session_data *sd) +int chrif_char_offline(struct map_session_data *sd) { if (char_fd < 1) return -1; @@ -979,7 +979,7 @@ int chrif_char_reset_offline(void) { *----------------------------------------- */ -int chrif_char_online(struct map_session_data *sd) +int chrif_char_online(struct map_session_data *sd) { if (char_fd < 1) return -1; @@ -997,7 +997,7 @@ int chrif_char_online(struct map_session_data *sd) * *------------------------------------------ */ -int chrif_parse(int fd) +int chrif_parse(int fd) { int packet_len, cmd; // only char-server can have an access to here. @@ -1048,7 +1048,7 @@ int chrif_parse(int fd) case 0x2b03: clif_charselectok(RFIFOL(fd,2)); break; case 0x2b04: chrif_recvmap(fd); break; case 0x2b06: chrif_changemapserverack(fd); break; - case 0x2b09: map_addchariddb(RFIFOL(fd,2), RFIFOP(fd,6)); break; + case 0x2b09: map_addchariddb(RFIFOL(fd,2), (char*)RFIFOP(fd,6)); break; case 0x2b0b: chrif_changedgm(fd); break; case 0x2b0d: chrif_changedsex(fd); break; case 0x2b0f: chrif_char_ask_name_answer(fd); break; @@ -1084,7 +1084,7 @@ int send_users_tochar(int tid, unsigned int tick, int id, int data) { WFIFOW(char_fd,0) = 0x2aff; for (i = 0; i < fd_max; i++) { - if (session[i] && (sd = session[i]->session_data) && sd->state.auth && + if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd->state.auth && !((battle_config.hide_GM_session || (sd->status.option & OPTION_HIDE)) && pc_isGM(sd))) { WFIFOL(char_fd,6+4*users) = sd->status.char_id; users++; diff --git a/src/map/map.c b/src/map/map.c index dc92d4113..00643faca 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -1521,14 +1521,16 @@ struct MAP_CACHE_INFO { int compressed_len; // zilb通せるようにする為の予約 }; // 56 byte -struct { - struct MAP_CACHE_HEAD { - int sizeof_header; - int sizeof_map; - // 上の2つ改変不可 - int nmaps; // マップの個数 - int filesize; - } head; +struct MAP_CACHE_HEAD { + int sizeof_header; + int sizeof_map; + // 上の2つ改変不可 + int nmaps; // マップの個数 + int filesize; +}; + +struct map_cache_ { + struct MAP_CACHE_HEAD head; struct MAP_CACHE_INFO *map; FILE *fp; int dirty; -- cgit v1.2.3-70-g09d2 From 8f3d851c422e444510b659a2f4f850cb5036e604 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Thu, 27 Jan 2005 15:53:28 +0000 Subject: Kick all characters when the char server disconnects from the map server git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1005 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 2 ++ src/map/chrif.c | 30 +++++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index 56c1592ba..de465eae7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,8 @@ Date Added 01/27 + * Kick all characters when the char server disconnects from the map + server [celest] * Added @changelook command for spriters to test view ID's [celest] * Added a check to Pneuma to prevent crashing [celest] * Tweaked garbage collection code after feedback from users diff --git a/src/map/chrif.c b/src/map/chrif.c index cda7b42e2..185fe307d 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -992,6 +992,27 @@ int chrif_char_online(struct map_session_data *sd) return 0; } +/*========================================== + * + *------------------------------------------ + */ +int chrif_disconnect_sub(struct map_session_data* sd,va_list va) { + clif_authfail_fd(sd->fd,1); + map_quit(sd); + return 0; +} + +int chrif_disconnect(int fd) { + if(fd == char_fd) { + char_fd = -1; + sprintf(tmp_output,"Map Server disconnected from Char Server.\n\n"); + ShowWarning(tmp_output); + clif_foreachclient(chrif_disconnect_sub); + chrif_connected = 0; + } + close(fd); + return 0; +} /*========================================== * @@ -1003,13 +1024,8 @@ int chrif_parse(int fd) // only char-server can have an access to here. // so, if it isn't the char-server, we disconnect the session (fd != char_fd). if (fd != char_fd || session[fd]->eof) { - if (fd == char_fd) { - if (chrif_connected == 1) { - sprintf(tmp_output,"Map Server disconnected from Char Server.\n\n"); - ShowWarning(tmp_output); - chrif_connected=0; - } - char_fd = -1; + if (fd == char_fd && chrif_connected == 1) { + chrif_disconnect (fd); // check_connect_char_server(0, 0, 0, 0); } close(fd); -- cgit v1.2.3-70-g09d2 From 94661807ec510d48ca6dd135f0e02a3a835bc614 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Fri, 11 Feb 2005 15:58:58 +0000 Subject: * Moved all changes in the SVN to a new SVN-Changelog.txt * Synchronise storage as well when saving character * Added fix for super novices' Guardian Angel system crashing * Check if login server is online before setting character to online (in SQL) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1076 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 1820 -------------------------------------------------- SVN-Changelog.txt | 1827 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/char_sql/char.c | 4 +- src/map/chrif.c | 2 + src/map/clif.c | 2 +- src/map/pc.c | 2 +- 6 files changed, 1834 insertions(+), 1823 deletions(-) create mode 100644 SVN-Changelog.txt (limited to 'src/map/chrif.c') diff --git a/Changelog.txt b/Changelog.txt index 181fd2f2c..a70f21276 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,1825 +1,5 @@ Date Added -02/11 - * not realy fixing the "unknown skill" error - but returning skill_castend_damage_id when called with skillid < 0 - still need to search a reason why it is called with -1 [Shinomori] - * EXPERIMENTAL: Reduced memory used for the skill_tree DB by 30+mb [celest] - * Added script commands isday and isnight - checks whether its night or - daytime. Example: if(isnight()) ... [celest] - * Skill Updates [celest] - - Sharp Shooting: Dropped jA's and kA's code and wrote a new - map_foreachinpath function in map.c -- about 14 times faster, but still - uncomplete - - Ankle Snare: Added matthias' suggestion to let agility reduce more trap - time, but no less than 3 seconds. - - Magnum Break: simplified code a bit, and changed to non-targetting / - automatically damages an area around the caster - - Tiger Fist: enable it to be used by its own besides as a part of - the combo skills - - Devotion: Fixed maximum level difference not reading its setting from - battle_athena.conf, thanks to leinsirk - - Soul Burn: Added some safety checks - -02/10 - * Login/Login SQL: fixed the client version check function [Sirius] - -02/09 - * Added conf-tmpl/readme.txt, explaining the import folder [1066: Ajarn] - * SQL Char: Rewrote the char_create function (now it's faster/optimized) [Sirius] - * SQL Char: Fixed the reply if a charname is invalid on create (now it replys denied..) [Sirius] - * SQL Char: Added a Character limit per Account (can be set in the config) [Sirius] - * SQL Char: Optimized some SQL-Querys [Sirius] - -02/06 - * NULL entries for guild data fixed [Credit to Sirius] [1060: Ajarn] - * Login server uses login_db_userid and login_db_user_pass for - queries now [Credit to Sirius] [1059: Ajarn] - * Login server can now check clientversion in clientinfo - [Credit to Sirius] [1059: Ajarn] - * Fixed txt build compile problems[1057: MouseJstr] - * Corrected end-of-line issues in source code [1056: MouseJstr] - * Coded new command: @MOBINFO [Lupus] - the command has also 2 aliases: @monsterinfo, @mi - It shows all Monster stats, Element, Race and stuff - It shows all items with their drop chance - It also shows MVP bonuses (MVP EXP, MVP Drops) - -02/05 - * increased the max_files allowed in a grf [1054: MouseJstr] - * Changed the way char deletion works for SQL [1051: Ajarn] - - If the email the client fails check then check if the - email is blank and the DB email is a@a.com (default) - If so, assume it was created with _M/_F, and delete it - * SQL Login accepts _M/_F now [Credit to Sirius] [1049: Ajarn] - * Map server now actually reads bind_ip [1048: Ajarn] - Side note: login reads bind_ip, but doesn't use login_ip now. - * Made eA compile under AMD64 64-bit native [1047: MouseJstr] - * Changed interface binding to use a bind_ip instead of using - the login_ip, char_ip, or map_ip. This lets you still be - able to set your WAN IP seperate from what interface you - wish to bind to. Also, the default is back to binding to - all interfaces on the machine. [1045: MouseJstr] - * optimizing OnTouch event name generation [Shinomori] - * fixing Celests Sharp Shooting [Shinomori] - * Updated Sharp Shooting AoE code, thanks to Neodis / k-Athena [celest] - - Update: Adapt jA's path_search algorithm and removed the need of struct - 'dev' in map_session_data - - Update: Increase range to 14 - * Tidied up explicit typecasts in status_get_max_hp, thanks to Ilpalazzo-sama - [celest] - * Non-MVP / miniboss summoned monsters should give exp, my mistake ^^; [celest] - Note:- minibosses are considered a 'Boss' as well, not just MVP's - * Fixed a typo that was preventing packet version 5 clients (628sak) from - logging in (it was supposed to only block those with 4 or below) [celest] - -02/04 - * Fixed more compile signed/unsigned errors [SVN 1040: MouseJstr] - * TXT convertors now read the import command in inter_athena.conf - [SVN 1038: Ajarn] - * Fixed some compile errors [SVN 1037: MouseJstr] - * Added common/buffer.(c/h) [SVN 1033: Ajarn] - * Login server can now set it's ip address in the config [SVN 1033: Ajarn] - * Servers now bind to a single ip address, thus allowing multiple servers to - a single port [SVN 1033: Ajarn] - * Added experimental code to generate a stack dump when it segfaults, thanks - to Ser [celest] - - does not work with Cygwin, as it does not have glibc - - to enable, edit the Makefile and remove the # on the line: - - # OPT += -DDUMPSTACK -rdynamic - - - What it does: everytime eA crashes it'll generate a file "stackdump_ - .txt" in your save folder with a backtrace, which you can - examine and send to a dev to be fixed. - - * Some more tidying up in status_get_ functions [celest] - -02/03 - * When loading shop scripts automatically check if the prices can be exploited - with OC/DC [celest] - * If the buying price provided in item_db.txt is above 2x higher than selling - price for an item no need to reset and redetermine the buying price [celest] - * Fixed a mistake that was causing Ruwach to only work in PvP and PvM [celest] - * Added DracoRPG's code for Joint Beat effects, thanks! [celest] - -02/02 - * Added checks to prevent some crashes in skill.c - [Full credit to shinomori] [SVN 1022: Ajarn] - * Removed nullpo check in skillnotok() -- otherwise it will display fail - messages for monster skills [celest] - * Added crash check for Ice Wall [celest] - * Added some optimisations by Ilpalazzo-sama [celest] - - reduce mob_data->size variable to 1 bytes - - change from if-else to switch statements in buildin_strmobinfo - -01/31 - * Fixed a typo in Pressure causing it to deduct sp from the caster, and remove - its sp_rate requirement [celest] - * Updated skill_range_leniency code when casting a ground targetting spell - ( as in Revision 968) [celest] - * Added Karma and Manner to const.txt - -- To change a player's alignment to more Good/Evil in scripting for example, - use: - set Karma, Karma + ; - - In older exe's (11-08 or older) you can actually check your karma in the - character alignment screen (alt-A) - The rest is up to your scripting creativity ^^ - - * Delete players' ID from id_db when kicking everyone from the map-server due - to char disconnection -- Fixes an odd crash with lazy mob AI [celest] - * Added at(@) command @autoloot, which turns autoloot on or off for the - player who uses it [Upa-Kun] - -01/29 - * Fixed Storage Bug with Named Stackable items. Thanks to Nimion [Lupus] - e.g. Arrows, Iron, Elemental stones, etc... - * Added a crash check to Safety Wall, thanks to LebrEf[TaVu] / Freya for - pointing it out [celest] - * Added some optimisations in clif_parse_MapMove, by Ilpalazzo-sama [celest] - -01/28 - * Fixed a typo that was causing /in to always report failure even when the - name was removed from the ignore list [celest] - * Link "wisexin", "wisexlist" and "wisall" to the PM ignore functions, and - "friendslistadd" and "friendslistremove" to the friends list functions - when parsing the packet DB [celest] - * added clif_parse_PMIgnoreList (packet 0xd3) from jA [celest] - * Added DUMP_ALL_PACKETS and moved dump packets code in clif_parse a bit to - support it [celest] - * Added base code for Party Item Sharing -- still needs some work in client- - server support [celest] - * new GC link http://amber.stormbirds.org/~joshs/gc6.4.tar.gz - This fixes some issues... works better - * Added macros skill_chk and skill_get to check for out of bounds errors when - retrieving info from the skill_db [celest] - -01/27 - * Added memory leak fixes with temporary script variables and pets-related - actions, by End_of_exam / jA 1109 [celest] - * Kick all characters when the char server disconnects from the map - server [celest] - * Added @changelook command for spriters to test view ID's [celest] - * Added a check to Pneuma to prevent crashing, thanks to LebrEf[TaVu]/Freya for - pointing it out [celest] [celest] - * Tweaked garbage collection code after feedback from users - [SVN 1002: MouseJstr] - * Fixed TRADE exploits (it cures proxy hack / vending+trade hack) thanks to Freya [Lupus] - -01/26 - * Added bug fix for a memory leak caused when a character logs out, - by End_of_exam / jA 1108 [celest] - * Fixed a bug in gettick cache when compiling in Windows, thanks to Shinomori - (jA 1094) [celest] - * Added updates from jA 1092 [celest] - - Changed "read_map_from_bitmap" to "read_map_from_cache", - "map_bitmap_path" to "map_cache_file" in map_athena - - Fixed item effects not showing when only one was used - - Fixed a bug in Safety Wall - - Allow only either Storm Gust or Lord of Vermillion to cause damage if - stacked together - - Added path_search_long, map_find_skill_unit_oncell - - * Added status_get_sc_def for calculating resistance against status - abnormalities [celest] - * Added status.c and status.h of jA 1091 update and moved some functions into - the new source files: - -- skill_status_change_ -> status_change_ - -- battle_get_ -> status_get_ - -- pc_calc_ -> status_calc_ - -- pc_getrefinebonus and pc_percentrefinery -> status_getrefinebonus and - status_percentrefinery - - * Updated auto_counter_type's description in battle_athena, thanks to - akusarujin for pointing it out [celest] - * Removed some unnecessary skill level checks in battle.c [celest] - * Removed my changes to /stable/Makefile which has libGC enabled by default - that i've accidentally commited, sorry ^^; [celest] - * Removed an unnecessary "cloneskill_lv" from map_session_data [celest] - * Removed WATER.TXT (this file wasn't used at all. There's no such mapflag as WATER even). [Lupus] - * Added Water Height of New Yuno Fileds 9 and 11. - Now Water Ball works there as should. Wizards could levelup on sleepers, too. [Lupus] - * libGC isn't ready to be the default quite yet... [MouseJstr] - - Enough people have asked so... Once you grab a copy of the - libGC library from (http://amber.stormbirds.org/~joshs/gc6.3.tar), - you start up a bash shell from inside cygwin and untar - the gc6.3.tar. This will produce a gc6.3 directory. Then - cd into that directory and type ./configure. Once that is - done you type "make" and then "make install". This will - spray the various includes and libraries all over your - cygwin install (most in /usr/local). - - Now, edit Makefile and change the CC line to use the - - CC = gcc -pipe -DGCOLLECT - - entry. Also change the GCLIB to - - GCLIB = -L/usr/local/lib -lgc - - Remember to comment out the ones no longer used. Do a clean - build and good luck. Obviously, this has not been tested - by that many people so you really are on the cutting edge - but if you have good results, send me a note - (joshs@stormbirds.org) so that we can see if it really is - ready for prime time. - - What should you see? Well, the map-server should not - grow/consume extra memory anymore. More so, it should use - dramatically less memory then it did before using the - garbage collector. - - The downside is that it will consume a little more CPU... - - The question is, how much? how laggy? what effect on lots - of players? I've heard stories saying it makes the server - unplayable and others told me that they saw no - player-visible effects at all. - - -01/25 - * Fixed TXT compile problems with libGC [celest] - * Added "Clients older than 2004-09-06aSakray" option to packet_ver_flag in - battle_athena, just in case server owners still prefer the older clients. - With so many changes to Sakray over the past months its much better upgrading - to the newer clients (November or higher recommended) available ;P [celest] - * Merged Full Strip into jA's tidier stripping skills code -- also fixes - a typo that was causing Full Strip to do the reverse effect instead, - and the skill not updating the target's status after successfully unequipping - items [celest] - * Tidy up the 4 chemical protection skills into one code block [celest] - * Corrected Slim Pitcher's code -- sorry, i missed a few things ^^; [celest] - -01/24 - * Fixed a typo in Provoke that was causing crashes [celest] - * Fixed another compile warning in src/char/char.c - [SVN 985] [MouseJstr] - * Fixed a account wipe bug in login/login.c (Thanks Wallex) - [SVN 984] [MouseJstr] - * Fixed a crash in char_sql/char.c where people were selecting - chars before requesting connections [SVN 983] [MouseJstr] - * some G++ compile tweaks and got through several files in the - map server - [SVN 976] [MouseJstr] - - Why are we doing a C++ conversion? We have a lot of duplicate - code and would like to make the "classes" in the server share - code.. For example, a pet should be able to share code from - the player or from a mob. Similerly, introducing a new type - of entity in the game should be as simple as creating a - sub-class instead of having to crawl through the entire source - tree searching for every class check and introducing handler - code in for your new type. - - Finally, while a garbage collector is "cool", it would still - be nice to have enough object knowledge on how to clean up - data that it is not absolutely required. It is faster for - us to clean up our own messes then introduce a whole system - for cleaning up after ourselves. - - Is there a C++ performance penalty? Not if the code is - written correctly. For example - 1) No templates - code bloat and destroys cpu cache - coheriancy - 2) No C++ exceptions - slows down entering and - exiting functions - 3) No operator overloading - makes it hard to - understand what is going on. - 4) No C++ STL libraries - Templates, huge, bloated, - unportable - 5) No method inlining - code bloat and reduces cache - coheriancy. Let the optimizer do it... - -01/23 - * char-server (SQL & TXT), login-server (SQL & TXT), and txt-coonvertors - (char and login) all compile on g++ now [svn 975] [Ajarn] - * Fixed the sizeof errors in g++ [SVN 972] [Ajarn] - * Reverted back some of the char* changes [SVN 972] [Ajarn] - * Changed parse_script to now return char* [SVN 969] [Ajarn] - * Converted run_script and run_script_main from unsigned char* to char* - [SVN 969] [Ajarn] - * Forgot a couple small changes [SVN 35] [Ajarn] - * Changed map_data.gat and map_data_other_server.gat from unsigned char* - to char* (this might be needed, because of unicode or something, please - correct me if I'm wrong) [SVN 34] [Ajarn] - * Converted decode_zip, encode_zip, remove_control_chars, mapif_sendall*, - and e_mail_check to use char* instead of unsigned char* (again, please test) - [SVN 34] [Ajarn] - * Modified skill unit group checking in skill_unit_onplace that might have - been causing crashes [celest] - * Updated packet 0x143 length's for version 14 (2004-11-01Sakexe) and version - 16 (2005-01-10Sakexe), thanks to jathena and ice2big [celest] - * Fixed login-server compile error with the "new" -> "new_" changes [celest] - -01/22 - * Fixed an error that was in my last commit (optimising g++ build) [SVN 29] - [Ajarn] - * Made strlib functions char*, instead of unsigned char*. Strings are meant - to be char. (Shouldn't break anything, but might, please test this for me) - [SVN 26] [Ajarn] - * Added cast for TXT version [SVN 25] [Ajarn] - * Added cast from allocation calls, from void* to intended type [SVN 24] [Ajarn] - * Changed bool -> bool_. Still need to make convertions between - char* and unsigned char* valid, and some other convertions too. - Also, sizeof is being used wierd in map.c, at least g++ - complains [SVN 22] [Ajarn] - * Changed the rest of the class variable names to class_ and all the new - variable names to new_, for futher g++ support [SVN 21] [Ajarn] - * Update both caster and target's SP after using Soul Change -- thanks to Aalye - / Freya [celest] - * Force a monster to switch attack target when being casted Provoke [celest] - * Corrected description for @enablenpc -- "@npcon" -> "@enablenpc" [celest] - * Since job normalising is still buggy require all 1st class skills to check - for Basic Skill level when calculating the skill tree [celest] - -01/21 - * Updated packet DB configurations : enable_packet_db, packet_db_ver, - -- check the .txt for description [celest] - - Note: For people having connection problems try setting 'enable_packet_db' - to 'no'... and use the latest client (01-10Sakexe) - - * Fixed a small typo in 12-06's packets -- 21b => 21d [celest] - * Updated packet_db.txt to only contain the latest version, like jAthena, - since there's not much point to re-read packets eA already supports - (although if you remove all the //'s it can still read multiple versions) - [celest] - * Added clif_config in clif.c - for keeping packet/client connections related - stuff [celest] - * Send 'Game Exe not latest version' to a client if it hasn't been authentified - yet, but is sending a non-connection-related packet to prevent crashing - -- assume the client is using an unknown exe [celest] - -01/20 - * Fixed compile time problems with the non-GC case [MouseJstr] - * Introduced aMallocA and aCallocA - - These two functions allocate "atomic" memory which means - "memory that does not contain references to other memory". - - This lets the garbage collector ignore these objects when searching - memory for references to other objects dramatically increasing - performance of the GC. - - When in doubt, use aMalloc and aCalloc. It is better to add - a tiny bit of work to the GC then do cause a crash due to memory - being cleaned up when it shouldn't. - [MouseJstr] - * Modified all calls to aMalloc and aCalloc that reference - atomic memory to use aMallocA and aCallocA - [MouseJstr] - * Modified the socket buffer allocator to use "atomic" memory - for the fifo data buffers [MouseJstr] -01/19 - * added support for the Hans-J. Boehm libC garbage collector - (A copy is in http://amber.stormbirds.org/~joshs/gc6.3.tar). - - It is ABSOLUTELY critical for people to use - aFree/aMalloc/aCalloc/aStrdup for this to work. If somebody - has just used free or malloc, this will crash when used with - the garbage collector. - - A amusing environmental variable to set is GC_PRINT_STATS (to 1) - so that you see real time statistics of leaked data being - recovered. - - grab a copy of the gc6.3.tar.. build it .. install it.. - modify the Makefile to have the - - CC = gcc -pipe -DGCOLLECT - GCLIB = -lgc - - lines... and make the sql servers (the txt server doesn't - build using this right now due to stupid Makefile issues) - - [MouseJstr] - * SVN 3 on http://svn.stormbirds.org/svn/eathena will be what - I diff against when I merge back into delta.. if we ever merge - back into delta [MouseJstr] - * Removed 12-06 Sakexe detection, since it doesn't seem to work, and - might be conflicting with 10-25 clients [celest] - * Update the Soul Burn target's SP when it has been successfully reduced to 0, - thanks to Aalye / Freya [celest] - * Moved SC_PRESERVE and SC_BATTLEORDERS's id so they'll display a status icon - when cast, thanks XiaoLin of cAthena [celest] - * Added missing code for Preserve -- i totally forgot to add it ^^; [celest] - -01/18 - * Added some skill bug fixes, thanks to Aalye / Freya [celest] - - stop player attacking if the target goes into hiding - - fixed Sword Reject not working against swords, only daggers - - additional check in case Marionette Control doesn't end properly even - when one of the partners has logged off - * Added stun, bleeding and SP loss effect for Pressure, thanks to DracoRpg - [celest] - * TEST: Fixed more compile warnings in MSVC [celest] - * TEST: Fixed some compile errors in MS Visual C++, thanks to Ser [celest] - -01/17 - * Some rewrites in skill_delayfix [celest] - - If the delay is < 0, add the weapon aspd delay to it - - If the skill is not weapon type, and has 0 delay, add 300ms as default - * Added min_skill_delay_limit as the minimum allowed delay for any skills - [celest] - * Some tidying up in battle_get_ functions [celest] - * Set exp table and job bonus table to 0 before reading - might solve some - memory bugs [celest] - * Updated skill range leniency code - If possible try and move towards the - skill target so that when casting it no longer falls out of range [celest] - -01/15 - * Added effects to enemies for Gospel [celest] - * Added mobs spawn to all Yuno fields (according to 4th Jan patch) [Lupus] - -01/14 - * Added party supporting effects for Gospel [celest] - -01/13 - * Added and testing support for 2004-12-06Sakexe [celest] - * Removed emblem changing requiring Glory of Guild limited to TXT only [celest] - * Corrected a typo preventing Plagiarism to work, thanks to orn [celest] - * Fixed Berzebub card and other 'reduce cast delays' equipment not working - [celest] - * Updated packet_db.txt loading to support reading into multiple packet - versions [celest] - * Removed packet_db_ver defining in packet_db.txt -- it'll determine itself - based on MAX_PACKET_VER [celest] - * Integrated packet size and function DB's into 1 packet_db [celest] - * Added MAX_PACKET_VER -- maximum versions supported by eA, including the - packet_db -- and changed packet size and function DB's to use it [celest] - * When sending 'Game exe not latest version' packet don't close the session - immediately so it will still be delivered [celest] - * Added map-server display if an unidentified client was rejected -- - also fixes the 'empty string sent to _showmessage' [celest] - * Added a bug - Celest, LOOK AT THIS BUG ASAP. [Codemaster] - * Tided up/fixed some mobs [Lupus] - -01/12 - * Implemented Vending Log [Lupus] - TODO: use log option to log only important deals (much money, rare items, etc) - -01/11 - * Added Shinomori's changes to npc event timers (I never realised it, thanks - ^^; ) [celest] - * Updated clif.c to be able to identify client versions based on the packet DB - [celest] - * Correct packet_db_ver to the maximum version allowed if it was set too high - or too low in packet_db.txt [celest] - * Added support for 2005-01-10Sakexe [celest] - * Updated packet functions for 2004-11-08 and 2004-12-06 (Note: eA *can* - support 12-06, but still doesn't recognise it... so unless we find a way, - it is *not* supported yet) [celest] - * Updated packet_db, thanks to Sara-chan [celest] - * REMOVED support for clients before packet version 10 (2004-08-25 and - earlier) - the client will receive a 'Game Exe not latest version' message - [celest] - * Added a check to prevent crashing when trying to log in with - 2005-01-10aSakexe in servers that don't support it [celest] - * Added a fix to @sound where if you forgot the .wav exention, i'd attempt to play the file without it (it adds the .wav) [Codemaster] [SVN 949] - * Added @disguiseall / @undisguiseall [Codemaster] [SVN 949] - * Added misc. clif.c fixes (jAthena added alot of close(fd)'s, so i added them, too) [Codemaster] [SVN 949] - * Added bug reports - Celest, you might want to check one of those out [Codemaster] [SVN 949] - * Fixed a bug in clif.c which didn't allow to enther the map-server. - It worked under win32, but didn't under Linux. [Lupus] - -01/10 - * Completed adding packet DB reading... still needs (a lot) more work in - clif.c [celest] - * Added Shinomori's suggestions for npc timers, thanks again ^^ [celest] - * Removed checking for script event timers' length, and added Shinomori's - changes [celest] - * Start adding packet DB reading [celest] - * Added 'max_eventtimer_length' (default is 32) to script_athena.conf. [celest] - Some event timers with names longer than 24 could cause the server to close - itself, change this if you need support for even longer names - * Removed PCLoginEvent requiring 'PCLoginEvent' for the player to be set to 1 - first to be activated. [celest] - * Added Shinomori and orn's fix for the skill tree to only check the first - required skill in the DB and skipping the rest [celest] - * Modified 'wedding' script command to work with "OnTimer" scripts even without - doing 'attachnpctimer' (The 'player not attached' error will still display, - but the effect will appear *over the NPC* instead of the player... - at least it won't fail ^^) [celest] - * Added 'attachnpctimer' script command for attaching the player to the current - npc's timer in "OnTimerxxxx" scripts, thanks to Wallex for the idea. [celest] - Syntax: - attachnpctimer; - attachnpctimer "; - - Check /npc/sample/npc_test_npctimer2.txt for example. - * Added 'detachnpctimer' script command for detaching players from the npc's - timer. [celest] Syntax: - detachnpctimer; - detachnpctimer "; - - * Added 'OnInterIfInitOnce' for WoE scripts & modified the WoE scripts as well [Ajarn & Codemaster] [Thanks to FREYA] [SVN 943] - * Added the @sound command and the NPC command of soundeffectall - - works just like soundeffect, but plays for everyone in the area [Codemaster] [SVN 942] - * Don't allow Pets to attack Guardians outside of WoE [Codemaster] [SVN 940] - * Require 15% of HP or more for WE_MALE skill [Codemaster] [SVN 940] - * Require 15% of SP or more for WE_FEMALE skill [Codemaster] [SVN 940] - -01/07 - * Upon changing to high novice 100 stat points should be given, not 88 [celest] - * Give high novices First Aid and Trick Dead upon job changing [celest] - * Remove some unnecessary checks in battle.c [celest] - * Added some checks to prevent novices still allowed to attack when using - Trick Dead [celest] - * Added 'summon' script command. Syntax: - - summon ,[,]; - - Example: 'summon "Poring", 1002, "OnPoringKilled"; 'will summon (note: - not *spawn*) 1 poring that'll help its master for 1 minute, - and activate the "OnPoringKilled" event when killed. - 'summon "--ja--",-1;' will summon a random monster. - - * Added Wallex's fix for the wedding script functions [celest] - * Added the below-mentioned alive packet to SQL's char and login [celest] - * Enabled login server 'anti-freeze' by default as a temporary solution - to char-login disconnection [celest] - * The TXT char server was rejecting login's "i'm alive" packet and disconnecting - it... fixed [celest] - * Stall_time wasn't being read in login_athena at all (not by the login server, - because the code didn't read it, nor by TXT map server, since its in the SQL - inter_athena.conf reading)... so moved it to inter_athena.conf, and - change sql_config_read in map.c to inter_config_read [celest] - * Some tidying up of battle_get_def and _def2 [celest] - * Added 'bDelayrate' and changed Phen card, Marduk Card and Berzebub Card's - effects to use this instead of bCastrate (which was reducing casting time, - not delay time) [celest] - * Some tidying up of skill_castfix and skill_delayfix [celest] - * Added Filougarou's fix for Bowling Bash causing it to only display damage, - but doesn't do any - thanks! [celest] - * Set delay_dependon_dex in battle_athena to 'no' by default [celest] - - Note: Just to clarify things, on official servers dex is not supposed to - reduce skill delays, only Poem of Bragi and Berzebub card does! - - * Fixed typo in skill_delayfix - reduce delays only if delaynodex was *not* set, - sorry ^^; [celest] - -01/06 - * Fixed various memory corruptions causing crashes (SVN 925) [MouseJstr] - * Fixed typo in src/map/map.c causing compile - errors (SVN 924) [MouseJstr] - * Removed the alive_timer mechanism entirly replaced with - a stall detection mechanism that will disconnect a player - who has not sent any data for a configurable - (conf/login_athena.conf:stall_time) amount of time. The default - is currently 60 seconds. - - The root cause of the disconnect error is that some NAT based - routers are not dropping the TCP connection when the aliased - machine goes offline abnormally. This means that we are seeing - a stalled but perfectly valid TCP connection. - - (SVN 924) [MouseJstr] -01/05 - * Fixed some typos in map_versionscreen() [MC Cameri] - * Removed loop freeing in map-server's do_final(), it was causing seg faults [MC Cameri] - * Finished do_storage_final() in map-server's do_final(), it was there but doing nothing [MC Cameri] - * Fixed Celest's typo making all vended items cost 0 zeny [Codemaster] [SVN 919] - * If a vending item was priced at 0 it'll be auto changed to 1million [celest] - * Fixed TXT logging - log_athena.conf reading was kind of messed up [celest] - * Added a simplified version of Qamera's OnConnect: OnDisconnect: OnDeath: - NPC events mod, (All credits go to him.) except adapted based on eA's current - PCLoginEvent. (by davidsiaw) [celest] - - Currently only 4 events have been added: PCDieEvent, PCKillEvent, - PCLogoutEvent and PCLoginEvent - - For notes and usage example check /npc/sample/PCLoginEvent.txt (by - davidsiaw) - - To enable them for a player in a script, do - "set , <0 or 1>;" - (yes it's saved in a permanent character variable and auto read every time) - - Simply put, if any of them is set to 1 the appropiate event will activate - p.s - Scripters who are already using PcLoginEvent, you'll need to add a - "set PCLoginEvent, 1;" now, sorry for the trouble. - - * Optimised PCLoginEvent activation a bit [celest] - * Set 'droprate0item''s default to 'yes' so that items with 0 rate will never - drop [celest] - * Look at item type other than item ID as well to check whether it is a card - in card-related script commands - better support for custom items [celest] - * Reset all skill variables if the skill fails so certain skills can't be - abused (such as Warp, thanks to Alex14 for pointing it out) [celest] - * Added /mapflag/noreturn.txt for disabling butterfly wings (not fly wings) - [celest] - * Fixed skill_require_db reading somehow getting corrupted if weapons usable - for the skill is more than 20, thus causing the skills to fail everytime - [celest] - * Fixed @killmonster crashing the server with summoned monsters, thanks to - Alex14 [celest] - * Added double_connection_system to battle_athena (not completed yet) [celest] - -01/04 - * Fixed GM Command Logging (Not sure why TXT logging still isn't working properly :( ) [Codemaster] [SVN 907] - * Fixed one of Lupus' additions to the item_db [Codemaster] [SVN 907] - * Fixed Seismic Weapon Skill (it 100% didn't break target's weapon at 4 level of the skill) [Lupus] - -01/02 - * Re-fixed map-server crashing if an empty line is in skill_castnodex.txt, - thanks to Alex14 for pointing it out (SVN 899) [celest] - * Modified breaking rates calculating - meltdown's chances is separated from - self breaking chances (SVN 900) [celest] - * Reduced MAX_SKILL_LEVEL to 10 to save a bit of memory and speed [celest] - * Tidied up parts in skill_castfix a bit (SVN 895) [celest] - * Fixed map-server crashing if an empty line was added in any of the skill-xx - db files (SVN 895) [celest] - * Updated skill_castnodex reading - An *optional* 3rd value can be added to set - whether a skill's delay time can be affected by dex (SVN 895) [celest] - Example: 46,1,1 - double strafe's delay is not affected by dex - 46,1,0:0:0:0:1 - only level 5 double strafe is not affected by dex - * More atempts at memory leak fixes [Codemaster] [SVN 890] - * Updated weapon breaking rates, thanks to DracoRPG (SVN 891) [celest] - * Optimized enchanting skills success rates calculation, thanks to Wallex - (you were right! ^^; ) (SVN 891) [celest] - * Modified Spiral Pierce and Breaker to type ranged (SVN 891) [celest] - -01/01/05 - * Attempted to fix a memory leak [Codemaster] - tell me if it works XD (NPC/Mob memory leak in npc_parse_mob(...)) [SVN 886] - * Added a char config that allows GMs that have a certain level or above to - bypass the server's user limit [Codemaster] - * Changed some create arrow outputs for new kRO 12/21/04 patch [Aria] - * Fixed some respawn delays of MVP/Miniboss monsters. Redo Umbala/Niflheim fields, added missing mobs, corrected - monsters quantity. In Niflheim fixed wrong Lord of Death monster ID. [Lupus] -12/30 - * Added ispartneron, getpartnerid, and warppartner script - commands to properly support jawaii NPC's (SVN 880) [MouseJstr] - * Moved supernovice guardian angel messages to msg_athena.conf [celest] - -12/29 - * Fix account register wipe issue (SVN 868) [MouseJstr] - * Double storage/lag exploit fixed (SVN 867) [MouseJstr] - * Another -1 alive_timer fix (SVN 866) [MouseJstr] - * Added @dmstart and @dmtick for debugging malloc tests [MouseJstr] - * Fix some more compile errors on different platforms [MouseJstr] - * Fixing a crash if you change the name of a pet you don't have (SVN 863) [MouseJstr] - * Eliminated src/common/malloc.c when not needed [MouseJstr] - * 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 - members are found - prevent divide by zero crashes (why would an empty guild - be requested to update its' member info in the first place?) [celest] - * Added Shinomori's fixes for string copying in script.c [celest] - * Removed @giveitem since #item it's the one that does this and added some of it's support to #item [MC Cameri] - -#item - * Uncommented out import in charcommand_athena.conf, there is - need to have it commented (all the others ones are - uncommented) [Ajarn] - -12/28 - * When restarting the char-server, reset the online status - of all characters and guild-members (SVN 849) [MouseJstr] - * Fix double timer_delete caused by pc_alive_timer (SVN 848) - [MouseJstr] - * Fixed typo in npcs_athena.conf (mc_cameri verses mc_Cameri), - thanks Mellow972 for pointing that out (SVN 845) [MouseJstr] - * Reduced weapon breaking chance for Overthrust, thanks Draco - i almost - forgot to add this update [celest] - * added checks into the skill code to prevent proxy's/bots - from crashing the server by using skillid's that - are WAY out of range (SVN 841) [MouseJstr] - * Fixed clif.c errors that prevent old clients from being used. [nsstrunks] - * Fixed @jobchange to not default to upper (SVN 837) [MouseJstr] - * Fixed a compile error in @mobsearch (SVN 836) [MouseJstr] -12/27 - * Updated 1206's packet fuctions in clif.c [celest] - * Updated the new guild skills - cannot be reused within 5 minutes of - activating it [celest] - * Added @mobsearch, @cleanmap and @giveitem from jA [celest] - * Fixed the guild issues (SVN 832) [MouseJstr] - * Updated description for player_check_cloak_type [celest] - * Increased skill range limitations in pc_no_footset [celest] - * Added exp_calc_type - to alternate between 3 different versions for exp - calculating [celest] - * Reinitialized variable 'c' in map_readmap, it's supposed to have a start value. Ex. '-'. [MC Cameri] - * Commented out dump_timer_heap() again... [MC Cameri] - * Added include of string.h in malloc.c, was causing compile errors/warnings [MC Cameri] - * Modified the map progress bar to reduce updates (SVN 829) [MouseJstr] - * Updated map cache system from jA 1087 - change read_map_from_bitmap to 2 to - enable zlib compression [celest] - * don't delete alive_timers of -1 (SVN 823) [MouseJstr] - * switched malloc,calloc,realloc to aMalloc, aCalloc, aRealloc - so support the use of a garbage collector (SVN 821) [MouseJstr] - * Removed some printf's from map-sql [MC Cameri] - * Uncommented MSG_SQL, for _ShowMessage(), usage: ShowSQL() [MC Cameri] - * Removed fixed bugs in dev/bugs.txt [MC Cameri] - * Now I remember what I was smoking.. (SVN 819) [MouseJstr] - * Fixed a bug in the guild_castle persistance code - in char_sql. What was I smoking? (SVN: 816) [MouseJstr] - * Corrected a bad error in itemdb_read_itemslottable [celest] - * Corrected wrong logging of text in int_guild.c, thanks to Alex14 [celest] - * Summoned monsters will not give exp and items [celest] - * Added the 6 new Yuno fields to maps_athena.conf [celest] - * Added some Freya's optimisations in clif_parse [celest] - * Added clif_update_mobhp - monsters' hp viewing now updates properly [celest] - * Set alive_timer to -1 when quitting, not 0, or the map server might assume - its still active [celest] - * Changed the *_override_grffile to no by default, because many were having issues with it [Ajarn] - -12/26 - * Fixed ANOTHER pet crash (double free) (SVN: 804) [MouseJstr] - * Added a proper #define for MAX_VENDING (SVN: 802) [MouseJstr] - * Fixed crash associated with vending more then 12 items - which walked on memory.. corrupting the pet data - structure (SVN: 801) [MouseJstr] - * Fixed a crash that resulted when disconnecting (SVN 800) - the new client when the old client is still connected [MouseJstr] - * Fixed some gcc 2.95 compile errors [MouseJstr] - * Fixed some array bounds errors (SVN 799) [MouseJstr] - * @mapexit (and do_final) now persist all data to the - char server before exiting to eliminate storage/inventory - inconsistancies.. [MouseJstr] (SVN 793) - * Some cleanup of spiritball memory management [MouseJstr] - * Dramatic performance work for exp updates to sql. Previously, [MouseJstr] - when u killed a mob (in party share), it would cause the char_server to - - 1) Delete all guilds for all members of your party - 2) Re-create all guilds for all members of your party with the new exp - values. - - Now it just generates 2 sql statements per party member, - - 1) update the guild exp, - 2) update the guild_member exp. - - - src/common/socket.c src/common/socket.h src/char_sql/char.c - src/char_sql/int_guild.c src/map/chrif.h src/map/pc.c - src/map/map.c src/map/chrif.c - - * Disabled import charcommand_conf.txt by default [celest] - * Added Bitmap File system from jA 1086 - automatically generates a cache - from maps in the GRF to speed up loading. You can enable/disable it with - read_map_from_bitmap in map_athena.conf. Note: AFM maps will override this - cache [celest] - * Added --run_once flag for the map server for testing purposes - closes itself - when everything is done loading [celest] - * Added some code for Moonlit Petals and Basilica [celest] - -12/24 - * Added suggested fix when client disconnected [celest] - - send "disconnected due to time gap" and close session when timed out - - send "server still recognises last login" message and close existing - session when client reconnects - * Upped windwalk to lv 10 in skill_tree [MouseJstr] - * Fixed a scripting crash (SVN: 781) [MouseJstr] - * removed @changesex and @charchangesex until we can - fix it properly [MouseJstr] - * Fixed item-dup bug in storage and cart [MouseJstr] - * @skilltree was looking outside of the particular class - of the char to see if they could do a skill [MouseJstr] - * Fixed a calc_skill_tree bug where too many skills were - visible [MouseJstr] - * Added Dev/GDB_reports.txt, take a look in it devs [Ajarn] - * Corrected description for player_skill_nofootset and monster_skill_nofootset - in battle_athena.conf [celest] - * Added a special NPC Logging command 'logmes'. It works as mes"Hello world!"; - It is useful for such NPC as BANKS, CASINO, etc. To keep track of won money, etc. - Check kafra_bank.txt 1.1 for example. - Note: mes = otput into client's NPC window - debugmes = output into map-server window - logmes = output into lognpc log DB. - -12/23 - * Fixed some bugs in the clif.c changes (SVN 766 to SVN 767) [MouseJstr] - * Added ayo monsters to @disguise - * Began updated clif.c to work with 1108 and 1206, tested and works [nsstrunks] - * Fixed skills still being available after a job change [MouseJstr] - * Changed pc_alive_timer to use map_id2sd - should be more accurate [celest] - * Added jA 1084's fix to mob.c - check whether the player is still alive - when calculating exp [celest] - * Added clif_changed_dir, clif_adopt_process [celest] - * updated Backstab to show the target's new direction [celest] - * Corrected the file types of several files in the SVN tree to - fix the newline issues [MouseJstr] - * Updated mapflags (added missing payon_in03,ayo_in01,ayo_in02, que_god01, que_god02) [Lupus] - * Updated Sacrifice : it's now self-activating, and lasts for 5 attacks [celest] - * Fixed compile errors in party.c [celest] - * Moved SC_EDP back to 114 [celest] - * Added some of Shinomori's fixes [celest] - * Added optimisation in intif_parse_WisMessage from Freya [celest] - -12/22 - * Eliminated skill tree mapping since we have entries - for all the classes in the skill_tree.txt files [MouseJstr] - * Added finding_ore_rate to battle_athena.conf, thanks to orn [celest] - * Changed how party exp is passed out to eliminate players - current in a chat window or those who havn't moved or attacked - in 2 minutes [MouseJstr] - * Fixed a bug in resnametable from local directories, - by fixing a bug in grfio_read causing memory corruptions [MouseJstr] - * Rearranged how guild messages, gm messages, and party messages - are moved back and forth between the inter server and the - map server.. eliminating unneeded round trips to eliminate - lag on a loaded char-server. [MouseJstr] - - src\char_sql\int_party.c src\char_sql\int_guild.c - src\char_sql\inter.c src\map\atcommand.c src\map\guild.c - src\map\intif.c src\map\party.c src\char\int_guild.c - src\char\inter.c src\char\int_party.c - - * Reverted npc.c back to before jA 1081. This fixes warp portals missing and other npc bugs [Ajarn] - * Added conditional SHOW_DEBUG_MSG for displaying ShowDebug()'s output, it was missing before [MC Cameri] - * Added #zeny, removed @charzeny [MC Cameri] - * Fixed reading itemslottable.txt causing cards to become unuseable [celest] - * Added error message if file renaming in lock_fclose fails [celest] - * Fixed frost diver not working ... my bad =p [celest] - * Corrected typo in clif_hpmeter - md -> sd [celest] - * Check if the player has been authentified by the char server before - clearing any timers in map_quit [celest] - * Added eventtimercount and timerskill_count - check these before clearing - or deleting timers [celest] - * Added sc_count check in skill_stop_dancing [celest] - * Translated the japanese part in battle_athena.conf [celest] - * Added ignore the new skill delays when chaining monk combos [celest] - -12/21 - * Since conf/maps_list.txt was removed, added conf/maps_athena.conf [Ajarn] - * Fixed a few NPCs that were giving curly errors. It seems to be caused by a bug that the NPCs' last line isn't read or something [Codemaster] - * Fixed a tiny compile warning in npc.c [Codemaster] - * Allowed the NPCs without proper curly brackets to still load, but give an error still [Codemaster] - * Added variable 'current_file' which tells the filename of the script while loading npcs [MC Cameri] - -the variable its set in do_init_npc() or something like that, so you can only access it - after the use of do_init_npc(). - * Fixed the display of a warning saying that a right curly brace was missing [MC Cameri] - * Removed @charwarp and @rura+ and added #warp, #rura, #rura+ [MC Cameri] - * Removed conf/npcs_list.txt, and placed it in npc/npcs_athena.conf [MC Cameri] - * Moved some code in pc_break_equip that was causing compile errors [celest] - * guild skills vanished due to incorrect placement of a - check for quest skills in the calc_skilltree code [MouseJstr] - * Fixed skill LK_HEADCRUSH, LK_JOINTBEAT to work on both on - and off peco's for lord knights (fixed typo in - skill_tree.txt) [MouseJstr] - * removed LK_SPIRALPIERCE from lord knights not on peco's[MouseJstr] - * Moved the code from map_quit to pc_makesavestatus that - "adjusts" the skill tree before persisting to the character - server [MouseJstr] - * made pc_makesavestatus() properly persist skills that are - unavailable but not forgotten (example, spiral pierce). You can now - get spiral pierce, get off your peco, log out, log in, and - get back on your peco and still have not lost the skill - points you invested. This also solves the problems of when - the skill tree gets changed, players loosing the points. [MouseJstr] - * Made pc_resetskill() properly reset skills that are - currently not visible due to skilltree changes [MouseJstr] - * Finished updating most of the map-server to 1082... i'll leave the more - technical ones for the other devs ^^; [celest] - * Added other new battle_athena options from jA 1082 ... descriptions not - translated yet [celest] - * Removed my own additions for skill delays using aspd and added jA's code - (-removed-) [celest] - * Adapted skill_range_leniency to jA's code - should be more stable [celest] - * Fixed drop rates only limited to multiples of 100's - thanks to jathena - for pointing it out [celest] - * Added missing code for castle_defense_rate [celest] - * Removed pc_undead_nofreeze - no code for it [celest] - * Updated unrefineable items table - thanks to jathena [celest] - * Added 3 new script commands: [celest] - - skilleffect : shows a skill effect on the player - - doskill/skilluseid (originally by Qamera) : casts a skill on the player - - skillusepos : casts a skill on a position - * Added SC_SpeedUp0 [celest] - * Merged itemdb_read for SQL and TXT [celest] - * Moved itemdb_read_itemslottable in itemdb.c for better readability [celest] - * Removed itemdb_read_cardillustnametable limited to TXT only [celest] - * Added reading itemslotcounttable.txt from the GRF to auto set number of slots - per item [celest] - * Added a display message when reading itemslottable from the GRF [celest] - * Added options in battle_athena.conf to enable/disable reading the GRF for - indoorrswtable.txt, leveluseskillspamount.txt, num2cardillustnametable.txt, - itemslottable.txt & itemslotcounttable.txt [celest] - * Removed conf/npcs_list.txt, and placed it in npc/npcs_athena.conf - -12/20 - * Fixed npc_parse_mob with large/tiny monsters causing - memory corruption [MouseJstr] - * Fixed a crash in char.c with new chars [MouseJstr] - * Updated npcs_list.txt [Ajarn] - * If last_pos.x or .y == 0, set to start point [MouseJstr] - * Fixed map loading. If a map was not found, it would remove the next map in the list [Ajarn] - * Moddified some *_athena.conf's (my typos and some inncorect default values) [Ajarn] - * Added Valaris' double connection bug fix (imalive watchdog) [Valaris] - * Fixed map-server exiting when it came across a bad NPC file [Codemaster] - * Updated Valaris' large/tiny monsters - of course, he told us what he did wrong and how to fix it :) [Codemaster & Valaris] - * Updated makefiles to new strlib locations [Codemaster] - * Moved strlib.h and strlib.c into the common directory [Codemaster] - * Updated a bit of jA 1081 - it's not completly updated yet!!! [Codemaster] - * Fixed some gcc 2.95 problems [MouseJstr] - * Speedups in socket code [MouseJstr] - * made samesex weddings work and give out correct ring [MouseJstr] - * CFixed wedding NPC halting after server reboot/crash (shadowlady put in comments but didn't add to code) [Aria] - * Added reading leveluseskillspamount.txt from the GRF to auto set sp used for each skill [celest] - * Added reading indoorrswtable.txt from the GRF to auto set 'indoor' mapflags - [celest] - * Added check in grfio.c to prevent crashing if a file wasn't found [celest] - * Rolling GUILDCACHE and FASTCHAR into main branches/stable - tree [MouseJstr] - * Changed max_paramter to an unsigned int so that you can have over 255 as your max stat [Codemaster] - * Experimental: Reverting a change on deleting any skill units when we're - logging off - might reduce the 'delete_timer' errors [celest] - * Added check whether an item is allowed to be dropped, for example wedding - rings [celest] - * Updated Acid Terror - should never miss [celest] - * updated Sword Reject - should display reflected damage properly now [celest] - * Updated Double Strafe - should only work with bows [celest] - * Replaced checking whether items can be refined or not with a new function [celest] - * Added Gengar's fix for npctalk outputting to chat [celest] - * Allowed some values in script_config to be customised in script_athena.conf [celest] - -12/19 - * Added -DFASTCHAR to char_sql for testing performance work - before I merge it into the main running code [MouseJstr] - * Added ShowDebug(), Debug(), DisplayDebug(), printDebug(), CL_DEBUG, MSG_DEBUG to _ShowMessage() [MC Cameri] - * Replaced many \033[x;xm with their corresponding CL_xx constants [MC Cameri] - * Separated NPCs and Maps from map_athena.conf into npcs_list.txt and maps_list.conf [MC Cameri] - * Modified all the *_athena.conf's to have the import command enabled by default [Ajarn] - * Added charcommand_conf.txt and log_conf.txt in conf-tmpl/import [Ajarn] - * Fixed import command for log_athena.conf file [Ajarn] - * Updated charcommand.conf [nsstrunks] - -12/18 - * Added some of my info to Dev/quotes.txt, not done yet... [Ajarn] - * Added some ideas to Dev/Ideas_Suggestions.txt [Ajarn] - * Fixed import command in inter_athena.conf file [Ajarn] - * Fixed a few command compiling problems for TXT [Codemaster] - * Modified the main.sql to add the friend0 column; also added the upgrade_1.0.0.sql file [Codemaster] - * Introduced StringBuf into utils for use in building larger queries [MouseJstr] - * tested GUILD_CACHE (reducing guild related sql traffic to 30%) in - prep for unleasing it on the sql using public [MouseJstr] - * Fixed some SQL queries crashing char server [davidsiaw] - * Added several PID GM commands, thanks to Dino9021 [nsstrunks] - * Storage was merging items incorrectly [Mousejstr] - * eliminated a uninitialized var when using afm maps [MouseJstr] - * Added concept of dirty storage to reduce saves/load - to the char server (do a clean build!) [MouseJstr] - * Eliminated storage_storageopen2 as unused [MouseJstr] - * Switched to account2storage2() whenever possible - to eliminate the possibility of saving empty storage - back to the character server (storage wipes) [MouseJstr] - * Made it save storage as soon as you close the storage - window to reduce possibility of loss/abuse [MouseJstr] - -12/17 - * Added #item [MC Cameri] - * Added #storagelist, removed @charstoragelist [MC Cameri] - * db.c: Fixed probs with OnInit, OnTime, and etc NPC probs - Just reverted it back. [Lupus] - * Fixed warning message in db.c line 445 [MC Cameri] - * Added #effect, removed @chareffect [MC Cameri] - * Reverted a change in map.c causing problems, sorry >.< [celest] - * Updated Sphere Mine - it'll now move in the opposite direction if - being hit by its master [celest] - * Updated Wind Walk [celest] - * Fixed skill #301 causing crashes [MouseJstr] - * Fixed documentation error on gm_skills_unconditionl [MouseJstr] - * added @grind test command.. only for testing [MouseJstr] - * Added clearweather to the atcommand configuration file. [nsstrunks] - -12/16 - * Added a fix for AFM loading, thanks to Pete [celest] - * Updated maximum levels for supernovice to 99 [celest] - * Updated supernovice jobexp table - should be same from 50 onwards [celest] - * Corrected maximum job level checking in @joblvup and @charjob [celest] - * Added the new spell scrolls, thanks to Landarma [celest] - * Corrected a few skills, thanks to orn [celest] - * Corrected Extremity Fist to not require Explosion Spirits when being used - right after using Combo Finish or Dilemma [celest] - * Added instant cast weapon skills rely on attack speed as cast delays, not - on dex [celest] - * Fixed mob_ghostring_fix not working [celest] - * Changed default value for mob_ghostring_fix to 'yes' [celest] - * Added #itemlist, removed @charitemlist [MC Cameri] - * Changed @job and #job so that when it's used it unequips all the items, to prevent sprite errors [MC Cameri] - * Fixed a misuse of mysql_config (thanks Daegalus for - creating a reproducable environment for me) [MouseJstr] - * Fixed compile time errors for gcc 2.95 [MouseJstr] - * Updated Forging and Potion making formulas by DracoRPG [celest] - * Changes to the guild skills - - Dropped using sc_data and use flag values instead - - Changed moving guild skill units to once every 'move request' only instead - of every movement - should reduce server load abit - - Corrected crash when checking its skill requirements - * Initialise 'canregen' when logging into map - forgot to add this earlier, - sorry ^^; [celest] - -12/15 - * Fixed more compile errors gcc 2.95 [MouseJstr] - * Removed log files from svn... they will be created when - needed [MouseJstr] - * Removed unused var in src/map/map.c:107 [MouseJstr] - * fix compile error in text converters [MouseJstr] - * Skill Updates [celest] - - Corrected traps to last longer in GvG - - Some minor changes to Hiding, Cloaking and Chasewalk to prevent it from - not working if sc_data is null - - Corrected an error in Cannibalize - - Updated Marionette Control to check its range from the partner - - Updated Berserk to disable hp and sp regen for 5 minutes after the skill - * Changed the weather gm commands to be able to toggle on and off. For example, - use @snow once to turn it on, reuse it again to turn it off. [celest] - * Added Jawaii and Ayothaya to @go list [celest] - * Changed the default values for ranged, magic and misc damage rate in - battle_athena to 60, 50 and 60 [celest] - * Removed redundant 'berserkdamagetick' from map_session_data [celest] - * Added changes to map.h according to Shinomori [celest] - -12/14 - * Changed "Map-server can't connect to char-server" message to reduce output spamming and set it to - display only once [MC Cameri] - * Added a busy animation for npc loading [MC Cameri] - * Replaced the way map loading was displayed into a progress-like way [MC Cameri] - * Fixed some typos in _ShowMessage() [MC Cameri] - * Replaced lots of more printf's in map-server with _ShowMessage() [MC Cameri] - * Added constants for console colors in showmsg.h [MC Cameri] - * src/char_sql/int_guild.c:56 - t_mes2 was not big enough causing - stack overrun's, corruptions, and crashes [MouseJstr] - * common/mmo.h: changed base_level and job_level to unsigned int to increase max levels [Codemaster] - * char/char.c: added a NULL check for the file in parse_friend_txt [Codemaster] - * map/atcommand.c/.h: added @clearweather (thanks to Dexity) [Codemaster] - * map/charcommand.c/.h: added #spiritball [Codemaster] - * map/mob.c: fixed a compiler warning (ln was an int and was supposed to be an unsigned long int) [Codemaster] - * Added nullpo_retb to nullpo.c - does a break; if null [celest] - * Replaced some parts in skill.c with nullpo checks [celest] - * Corrected some typos - penaly -> penalty [celest] - * Skill Updates [celest] - - Most of 12/14's Sakray patch - * The SKILL_MAX_DB (yes, a different #define from the one below) - was not large enough for current skills causing memory - corruptions and crashes [MouseJstr] - * Fixed how socket handles EAGIN errors (retry instead of - disconnecting) [MouseJstr] - -12/13 - * Skill Updates [celest] - - Added the new 'Throw Tomahawk' skill (Requires Sakexe1129 or newer) - - Added some new monster skills - but still not complete. - - Adjusted Palm Strike, Tiger Fist and Chain Crush based on 12/14's patch - * Removed redundant 'sg_count' for map_session_data and mob_data [celest] - * Save both persons' data after trading in case a crash causes them to - rollback - fix by Freya [celest] - * Removed 'type' paramater from pc_unequipitem to use 'flag' instead[celest] - * Moved unequip checking code from clif.c to pc.c [celest] - * Replaced many printf's in map-server with _ShowMessage(). [MC Cameri] - * Skill timers for skills with id's higher then 450 were - corrupting memory [MouseJstr] - * Increased max skills to 650 from 450 fixing MANY crashes [MouseJstr] - * Creating Guild events were reading beyond supplied guild names , - causing crashes [MouseJstr] - * trades were derefing -2 into the inventory table sometimes [MouseJstr] - * Not having a arrow in your inventory but having a bow - could cause it to set sd->status.inventory[-1].equip=32768 - resulting in a memory corruption [MouseJstr] - * local broadcasts of messages larger then 64 bytes were - corrupting the stack, causing crashes [MouseJstr] - * mob eventnames were reading beyond source point, risking - going over page boundries, causing crashes [MouseJstr] - * Internal MAIL system: moved all strings to msg_athena.conf [Lupus] - -12/12 - * Made guild skills to check for skill levels first when casting [celest] - -12/11 - * Modified arrow checking in skill.c [celest] - * Corrected Cart Revolution damage calculation [celest] - -12/10 - * Fixed players unable to move in AFM maps [celest] - * Added error message if a player's last map couldn't be found [celest] - * Moved AFM map check to map_mapname2mapid [celest] - * Added USE_AFM and USE_AF2 to be used later [celest] - * Modified sc_data check in pc_damage [celest] - -12/9 - * Moved a map_freeblock_unlock() around to eliminate a - crash [MouseJstr] - * Fixed how players are cleaned up when they disconnected - during authentication [MouseJstr] - * Adjusted some messages in @marry [MouseJstr] - * Skill Updates [celest] - - Fixed Auto Spell not working - - Fixed skill level check causing Baphomet card not to work at all (possibly - other problems too) - - Added some new monster skills based on jA mod 1077 - * Changed @job to accept text job names - For example: @job wizard, @job high - priestess, @job super baby [celest] - * Added sc_data check for pc_damage [celest] - -12/8 - * Fixed @rings [MouseJstr] - * Added @marry, @divorce, and @rings [MouseJstr] - * fixed @revive [MouseJstr] - * Added option to turn off login server logging [celest] - * Moved char server starting logging to after we've read the configuration - file first [celest] - * Fixed crash with supernovices with 100% base exp [celest] - * Updated the readme a little. [Mass Zero] - -12/7 - * Added GUILDCACHE #define to int_guild.c for testing performance - effects [MouseJstr] - * Skill Updates [celest] - - Arrow Shower, Double Strafing, Charge Arrow, Throw Arrow, Sharp Shooting, - Arrow Vulcan, and Musical Strike now take arrows when used - - Level 6-10 Stone Curse will not consume a red gem now when it fails - - Players should be able to use items when they're stoned but not yet - completely petrified - - Corrected Triple Blow to work with bows (they actually do ^^) - * Added 'guildgetexp' script command [celest] - * Added bLongAtkRate item effect [celest] - * Implemented Confusion (50%) - still need more info on how monsters act - when they're confused [celest] - * Added 'Guardian Angel' code for supernovices [celest] - -12/6 - * Fixed file props for new npcs [MouseJstr] - * Fixed weddings.txt as per Fress_Boy [MouseJstr] - * Added a case_sensitive to login [MouseJstr] - * Fixed follow crashing server when gm dies [MouseJstr] - * Fixed global message not working on txt [Wizputer] - * fixed a server crash in mobinsite [MouseJstr] - * fixed a server crash in party sharing exp [MouseJstr] - * fixed a server crash in BS_FINDINGORE [MouseJstr] - * Updated Chase Walk [celest] - * Added 'checkoption1' and 'checkoption2' script functions - Refer to - /npc/sample/npc_testchkoption.txt for similiar examples [celest] - * Updated maximum level for Guild Skills [celest] - -12/5 - * Fixed another crash sending updates to disconnected - clients [MouseJstr] - * Fixed the range_check again to stop it from crashing - servers [MouseJstr] - * removed stubbed out unfinished atcommands as per Cameri [MouseJstr] - * Fixed nullpo's for gcc 2.95 [MouseJstr] - * Fixed bug in which login-txt was crashing in do_final() due to some free's [MC Cameri] - * Added nullpo's to all atcommand's functions, phew... [MC Cameri] - Note: I point out that MouseJstr has added some @commands that start with char which - havent been finished, they are just there but don't do anything. - * Removed mapbug.txt and corresponding function in map.c (realized it's pointless) [MC Cameri] - * Added allow_atcommand_when_mute - Change this to set whether muted players - can use gm commands [celest] - * Temporarily leaving the changing guild emblems requiring Glory of Guild - feature only for TXT until the SQL char-server supports guild skills fully[celest] - * Modified battle_range again to check if src's type is a player first [celest] - * Corrected typo in battle_range [celest] - * Fixed a crash where party chats can be sent to a - partially disconnected player [MouseJstr] - -12/4 - * Fixed a crash in clif_send when player disconnects but player - object is not fully removed from map [MouseJstr] - * Fixed a crash associated with NPC_BARRIER [MouseJstr] - * Renamed flush_fifos_at_exit to flush_fifos [MouseJstr] - * call check_connect_char_server() on char_server disconnect [MouseJstr] - * stale skill groups were crashing server [MouseJstr] - * Fixed crash in SC_LULLABY [MouseJstr] -12/3 - * hacked the frozen mob issue [MouseJstr] - * Fixed a battle_range crash [MouseJstr] - * Updated Stone Curse, Soul Drain, Auto Berserk [celest] - * Added a fix for MVP exp being multiplied twice by Gengar - * Modified battle_range to check for sd first [celest] - -12/2 - * Fixed double login feature, resets online users when map connects to char [Wizputer] - * Changed all LOGS inserts to INSERT DELAYED (MySQL has this feature and cache unimportant queries, then - executes them at once together = 10x faster) [Lupus] - * Skill Updates [celest] - - Modified Weapon Refine - should only +1 every time. - - Updated Berserk, Chase Walk, Slim Pitcher - - Added skill_range_leniency : In some cases when moving to cast a skill the - exe will a send a UseSkill packet before the server has moved us to the - correct position, causing it to fail. Leaving this at 1 should be enough. - - Fixed a bug that was causing monsters not to move towards the target - * Added check for clif.c in case the server didn't realise we've died [celest] - * Added a fix for @npcmove by JohnC and Fredzilla - * Added motd_type : Set this to 1 if your clients have langtype problems and - can't display the motd properly[celest] - * Edited atcommand.c to fix compile warnings [celest] - -12/1 - - Make it build against gcc 2.95 [MouseJstr] - - Changed #define MAX_PET_DB to 300, it's easier for people adding new pets like this. [Nas] - * Skill Updates [celest] - - Updated Poison React - - Added Soul Change, Soul Burn - - Added a somewhat crude timer for Venom splasher - - Added a fix for Guild Skills causing crashes by Sara, thanks! - -11/30 - * Fixed client crash when disguised characters die [celest] - * Skill Updates [celest] - - Fixed and finished Guild Skills (~90%) - - Fixed Meltdown and Overthrust used together breaking your own weapon - - Updated Weapon Repair :- uses different materials depending on repaired item - (Iron Ore/Iron/Steel/Rough Oridecon) - - Fixed sp recovery problem, thanks to OutSider for pointing it out - - Updated Tiger Knuckle Fist stun time - - Added cooldown time for Emergency Recall - - Fixed typo in skill.c, thanks to Toster - -11/29 - * Fixed crash in src/char_sql/char.c when setting chars offline [MouseJstr] - * Added mapbug.txt which is displayed in map-server, displays - the last bug or w/e fixed for the map-server [MC Cameri] - -You may change it whenever you want - -It will only show if mapbug.txt exists - -This file must not be included in releases - * Made some changes in map_versionscreen() to make it easier to - read/change in the source [MC Cameri] - * Fixed a typo in _ShowMessage() removing the message caption. [MC Cameri] - * Fixed typo in map_helpscreen() showing -h instead of --?. [MC Cameri] - * Added more sc_data checks in skill.c and pc.c [celest] - * Updated Quagmire, Enchant Deadly Poison, Fog Wall [celest] - -11/28 - * Fixed a crash in login_sql/login.c [MouseJstr] - * made common/socket.c more crash resistant [MouseJstr] - * Added flush_fifos to socket.c so that we can make sure everything - has been sent before we shut the process down [MouseJstr] - * Modified src/char_sql/char.c to flush fifos on exit [MouseJstr] - * Fixed a crash in src/map/map.c shutdown where it would - use the char_fd session after it was alrady cleaned up [MouseJstr] - * removed conf-templ/atcommand_athena.conf.orig [MouseJstr] - * removed a USE from sql-files/main.sql that should not be there [MouseJstr] - * Changed MSG_INFO color to bright white, since bright blue want so bright... [MC Cameri] - * Made Map Removed: %d string be displayed only if there were maps removed. [MC Cameri] - * Fixed online system for char not sending players left "online" to login when restarting [Wizputer] - * Fixed damage formula of Cart revolution: 150% +1% per 80ea [Lupus] - * Removed 2x Chance of Equipment Breaking during CRITICAL attacks [Lupus] - * Fix some file props [MouseJstr] - * Added map_versionscreen(), displayed when --version flag is passed on command-line. [MC Cameri] - * Finished map_helpscreen(), displayed when --help flag passed on command-line. [MC Cameri] - * Changed Guilds Extention Skill to +6 people per level. [Lupus] - (tested it for 2 weeks! or a big server) - * Added a fix for gettimeofday() for WIN32 [Codemaster] - * skill Updates: - - Updated Slow Poison, modified checks for skill_unit_onplace abit. [celest] - - Updated Finger Offensive, thanks to orn [celest] - * Updated packet_ver_flag's default value, thanks to iscandium [celest] - * Added warning if motd.txt was not found [celest] - (Turn on error_log in battle_athena.conf to enable it) - -11/27 - * Fixed a few map crashes when char-server crashes [Wizputer] - * Added fix of 0x2aff and 0x2af8 flooding [Wizputer - thanks Toster] - * Fixed Map crash when person uses global message hacks [Wizputer] - * Fixed online system, online column works and prevent double login at the login server [Wizputer] - * Fixed some compile time errors associated with showmsg [MouseJstr] - * Added get_svn_revision() in core.c [MC Cameri] - -Only if you have the file .svn\entries, it will show the revision # at runtime. - -11/26 - * Fixed Abrakadabra (2 minor bugs of consumed items - they were ignored if placed in 0 pos) [Lupus] - * Finished Full Strip, Weapon Refine, Slim Pitcher and Full Protection. [celest] - * Added skill_nocast_db.txt. Use it to set which skills cannot be used in - which conditions [celest] - -11/25 - * Added @skilltree to help GM's answer skill tree questions [MouseJstr] - * Update Spider Web; I believe you cannot use it on yourself now. [Codemaster] - * Added Ore Discovery, and base code for Slim Pitcher and Preservation [celest] - -11/24 - * @charreset #reset [MC Cameri] - * @charstatsall is now #statsall [MC Cameri] - * @charsave is now #save [MC Cameri] - * Updated most of jA's 1067; battle.c and skill.c might need more updates! [Codemaster] - * Fixed char-txt crashing when closing, Codemaster free()'s. [MC Cameri] - * Skill Updates: [celest] - - Updated guild skills (60%) - - updated Weapon Repair and Aura Blade by DracoRPG - - modified Weapon Repair to use Identify's packet, should show a list of - repairable items now - -11/23 - * Fixed script loading small/large monsters. [Valaris] - * @charoption is now #option [MC Cameri] - * @charpetfriendly is now #petfriendly [MC Cameri] - * @charstats is now #stats [MC Cameri] - * Skill Updates: [celest] - - Added some code for the new guild skills (50%) and Moonlit Petals (5%) - - Notes to other devs: Guild skills with id's 10000-10014 will be stored in - skill_db[500-514] - - Corrected Hilt Binding - - Corrected Assassin Cross' dual wield - - Changed player_cloak_check_type to yes by default and edited description - since it's already fully implemented. - - Added a bit more restrictions to Call Partner and Emergency Recall and - updated mapflag for sec_pri.gat - - Added pc_calcspeed and updated Cloaking so it won't need to recalculate - the player's entire status everytime there is movement. - -11/22 - * (TXT)Stripped some code off read_gm_accounts() and made with it addGM() [MC Cameri] - -Usage: addGM(account_id,level); - * (TXT)Changed GM_accounts.txt to meet new standards. [MC Cameri] - * (TXT)Enabled the use of id ranges in GM_accounts.txt [MC Cameri] - * Added a few free()'s so that I am sure it freed the allocated memory (char & login) [Codemaster] - * Changed monsters_ignore_gm option to a level value. [Valaris] - (accounts greater than or equal to this setting won't be attacked by aggressives.) - * Fixed mapflag #s and constants for setmapflag and remove mapflag. [Valaris] - * Added skill names for kRO 11/23's new skills [celest] - - Preserve, Full Strip, Weapon Refine, Slim Pitcher, Full Chemical Protection, - (Throw) Tomahawk - * timer.c static int timer_heap_max=0; //fix by Shinomori from eA forums - ititialize static var!!! - * Added the old effect list # into effect_list.txt of spira's. [shadow] - * Added new flag (#3) to clif_specialeffect [MC Cameri] - * @doom,@die,@doommap now display the Dark Cross effect on you. [MC Cameri] -11/21 - * Display IP when wdata is expanded [Wizputer] - * Added bClassChange,%; Has random chance to turn monster into another monster. [Valaris] - * Re-Fixed Trade/Vending exploit [Lupus] - * Fixed @whozeny. [Valaris] - * Added rest of mapflags to const.txt. [Valaris] - * Closed AFM files after reading, this fixed the improper char-server session #. [Valaris] - * Skill updates: [Celest] - - Updated Basilica, Sharp Shooting, Berserk, Meditatio (Thanks to DracoRPG!) - - Fixed a typo with Blade Stop that was causing crashes, sorry. ^^; - - Reverted changes to Cloaking, ours is already more updated! ^_^ - - Added temporary code for guild skills to stop crashing - * @alive, @raisemap, @raise, @revive now display the resurrection skill animation [MC Cameri] - * @charpetrename(AtCommand) is now #petrename(CharCommand) [MC Cameri] - * @charjob/(AtCommand) is now #jobchange(CharCommand) [MC Cameri] - * Removed japanese interserver packets, should fix various problems (jumpto, where, charposreq). [Valaris] - * Added Yor's trade exploit bug fix. Added 2 skills bugs in the bugs.txt [Lupus] - * Added charcommand.c/.h for the following reasons: [MC Cameri] - - Less congestion in atcommand.c - - Port commands that start with @char to #, example: - ~ @charoption will now be #option - -11/20 - * Added str_lower() function to atcommand.c (from OA). [MC Cameri] - * Simplified @charchangesex to @charchangesex [player], your sex is changed to the opposite one [MC Cameri] - * Added @refresh, which is like a @jumpto <>. [MC Cameri] - * Added @petid to find pet names, useful when you dont know which pets have eggs. [MC Cameri] - * Added an effect_list in docs/ for descriptions, free to add onto that later. [spira] - - Attempt to find new skill effects. - * Added "nogo" mapflag to prevent the use of @go on a specified map. [Valaris] - * Fixed small/big monster spawning crashing (mixed up the merge). [Valaris] - * Fixed crash with upgrading TXT and having more than 256 accounts. [Valaris] - * TXT upgrades will convert broken flag to attribute column. [Valaris] - * Prevent use of emotion packet to display red mute emote. [Valaris] - * Initialized "day" variable in npc.c. [Valaris] - * Added @whozeny. Shows list of top 50 online players and their zeny sorted from highest to lowest. [Valaris] - * Added @happyhappyjoyjoy. Makes all players on server do a random emote. [Valaris] - * Removed -funroll-loops from compile, thanks to kashy for pointing out the problems caused by this. (Do not re-add!) [Valaris] - * Added check for max vending_max_value when reading config [kobra_k88] - * Skill updates [celest] - - Napalm vulcan, Enchant Deadly Poison, Slow Poison (based on jAthena 1066) - - Create Deadly Poison, thanks to DracoRPG! - - Added effect for Meteor Assault - * Added night_darkness_level to battle_athena.conf. [celest] - Use this to set 'how dark' it'll become during night time. Use 0 for default, - or between 1-10. (Yeah, i know lots of people hated the original night! xP) - Warning: It may cause errors with old exe's! - -11/19 - * Re-added check for empty bottle when using aqua benedicta. [Valaris] - * Fixed skills not showing after using @allskill [celest] - -11/18 - * Added a line to @unmute, added @mute. [celest] - Usage: @mute