Index: src/common/db.c =================================================================== --- src/common/db.c (revision 16039) +++ src/common/db.c (working copy) @@ -2742,7 +2742,7 @@ while( node ) { if( node->key == key ) { if( node->prev && n > 5 ) { - // ˆ—Œø—Š‰ü‘P‚ׂ̈Éhead‚Ɉړ®‚³‚¹‚é + //Moving the head in order to improve processing efficiency if(node->prev) node->prev->next = node->next; if(node->next) node->next->prev = node->prev; node->next = *head; @@ -2789,7 +2789,7 @@ while( node ) { if( node->key == key ) { if( node->prev && n > 5 ) { - // ˆ—Œø—Š‰ü‘P‚ׂ̈Éhead‚Ɉړ®‚³‚¹‚é + //Moving the head in order to improve processing efficiency if(node->prev) node->prev->next = node->next; if(node->next) node->next->prev = node->prev; node->next = *head; @@ -2803,7 +2803,7 @@ node = node->next; n++; } - // Œ©‚‚©‚ç‚È‚¢‚Ì‚Å‘}“ü + //Insert because it can not find linkdb_insert( head, key, data ); } Index: src/common/strlib.c =================================================================== --- src/common/strlib.c (revision 16039) +++ src/common/strlib.c (working copy) @@ -581,6 +581,8 @@ sv->done = true; state = END; break; + default: //do nothing + break; } } if( IS_END() ) Index: src/common/nullpo.c =================================================================== --- src/common/nullpo.c (revision 16039) +++ src/common/nullpo.c (working copy) @@ -12,7 +12,8 @@ const char *fmt, va_list ap); /*====================================== - * Nullƒ`ƒFƒbƒN ‹y‚Ñ î•ño—Í + * Semble checker si le target est null et retourne 0 (false) dans ce cas + * Semble chek les arguments fournit egalement ?? *--------------------------------------*/ int nullpo_chk_f(const char *file, int line, const char *func, const void *target, const char *fmt, ...) Index: src/char/int_mercenary.c =================================================================== --- src/char/int_mercenary.c (revision 16039) +++ src/char/int_mercenary.c (working copy) @@ -136,6 +136,7 @@ return true; } + static void mapif_mercenary_send(int fd, struct s_mercenary *merc, unsigned char flag) { int size = sizeof(struct s_mercenary) + 5; Index: src/char/int_party.c =================================================================== --- src/char/int_party.c (revision 16039) +++ src/char/int_party.c (working copy) @@ -324,9 +324,10 @@ } //------------------------------------------------------------------- -// map server‚ւ̒ʐM +// Communication to the map server -// ƒp[ƒeƒBì¬‰Â”Û + +// Create a party whether or not int mapif_party_created(int fd,int account_id,int char_id,struct party *p) { WFIFOHEAD(fd, 39); @@ -348,7 +349,7 @@ return 0; } -// ƒp[ƒeƒBî•ñŒ©‚‚©‚ç‚ž +//Party information not found static void mapif_party_noinfo(int fd, int party_id, int char_id) { WFIFOHEAD(fd, 12); @@ -359,7 +360,8 @@ WFIFOSET(fd,12); ShowWarning("int_party: info not found (party_id=%d char_id=%d)\n", party_id, char_id); } -// ƒp[ƒeƒBî•ñ‚Ü‚Æ‚ß‘—‚è + +//Digest party information static void mapif_party_info(int fd, struct party* p, int char_id) { unsigned char buf[8 + sizeof(struct party)]; @@ -373,7 +375,8 @@ else mapif_send(fd,buf,WBUFW(buf,2)); } -// ƒp[ƒeƒBƒƒ“ƒo’ljÁ‰Â”Û + +//Whether or not additional party members int mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, int flag) { WFIFOHEAD(fd, 15); WFIFOW(fd,0) = 0x3822; @@ -386,7 +389,7 @@ return 0; } -// ƒp[ƒeƒBÝ’è•ÏX’Ê’m +// Party setting change notification int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag) { unsigned char buf[16]; @@ -403,7 +406,7 @@ return 0; } -// ƒp[ƒeƒB’E‘Þ’Ê’m +//Withdrawal notification party int mapif_party_withdraw(int party_id,int account_id, int char_id) { unsigned char buf[16]; @@ -415,7 +418,7 @@ return 0; } -// ƒp[ƒeƒBƒ}ƒbƒvXV’Ê’m +//Party map update notification int mapif_party_membermoved(struct party *p,int idx) { unsigned char buf[20]; @@ -431,7 +434,7 @@ return 0; } -// ƒp[ƒeƒB‰ðŽU’Ê’m +//Dissolution party notification int mapif_party_broken(int party_id,int flag) { unsigned char buf[16]; @@ -442,7 +445,8 @@ //printf("int_party: broken %d\n",party_id); return 0; } -// ƒp[ƒeƒB“à”­ŒŸ + +//Remarks in the party int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd) { unsigned char buf[512]; @@ -456,7 +460,7 @@ } //------------------------------------------------------------------- -// map server‚©‚ç‚̒ʐM +// Communication from the map server // Create Party @@ -507,7 +511,8 @@ return 0; } -// ƒp[ƒeƒBî•ñ—v‹ + +// Party information request static void mapif_parse_PartyInfo(int fd, int party_id, int char_id) { struct party_data *p; @@ -518,7 +523,8 @@ else mapif_party_noinfo(fd, party_id, char_id); } -// ƒp[ƒeƒB’ljÁ—v‹ + +// Add request party int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member) { struct party_data *p; @@ -556,7 +562,7 @@ return 0; } -// ƒp[ƒeƒB[Ý’è•ÏX—v‹ +//Party setting change request int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item) { struct party_data *p; @@ -576,7 +582,8 @@ inter_party_tosql(&p->party, PS_BASIC, 0); return 0; } -// ƒp[ƒeƒB’E‘Þ—v‹ + +//Request leave party int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) { struct party_data *p; @@ -684,7 +691,7 @@ return 0; } -// ƒp[ƒeƒB‰ðŽU—v‹ +//Request party dissolution int mapif_parse_BreakParty(int fd,int party_id) { struct party_data *p; @@ -697,7 +704,8 @@ mapif_party_broken(fd,party_id); return 0; } -// ƒp[ƒeƒBƒƒbƒZ[ƒW‘—M + +//Party sending the message int mapif_parse_PartyMessage(int fd,int party_id,int account_id,char *mes,int len) { return mapif_party_message(party_id,account_id,mes,len, fd); @@ -727,11 +735,12 @@ return 1; } -// map server ‚©‚ç‚̒ʐM -// E‚PƒpƒPƒbƒg‚̂݉ðÍ‚·‚邱‚Æ -// EƒpƒPƒbƒg’·ƒf[ƒ^‚Íinter.c‚ɃZƒbƒg‚µ‚Ä‚š‚­‚±‚Æ -// EƒpƒPƒbƒg’·ƒ`ƒFƒbƒN‚âARFIFOSKIP‚͌Ăяo‚µŒ³‚ōs‚í‚ê‚é‚̂ōs‚Á‚Ä‚Í‚È‚ç‚È‚¢ -// EƒGƒ‰[‚È‚ç0(false)A‚»‚€‚Å‚È‚¢‚È‚ç1(true)‚ð‚©‚Š‚³‚È‚¯‚ê‚΂Ȃç‚È‚¢ + +// Communication from the map server +//-Analysis that only one packet +// Data packet length is set to inter.c that you +// Do NOT go and check the packet length, RFIFOSKIP is done by the caller +// ? (False), must return 1 (true) if error, 0 if otherwise. int inter_party_parse_frommap(int fd) { RFIFOHEAD(fd); @@ -751,7 +760,7 @@ return 1; } -// ƒT[ƒo[‚©‚ç’E‘Þ—v‹iƒLƒƒƒ‰íœ—pj +//Leave request from the server (for delete character) int inter_party_leave(int party_id,int account_id, int char_id) { return mapif_parse_PartyLeave(-1,party_id,account_id, char_id); Index: src/char/char.c =================================================================== --- src/char/char.c (revision 16039) +++ src/char/char.c (working copy) @@ -1005,7 +1005,7 @@ || SQL_ERROR == SqlStmt_BindColumn(stmt, 26, SQLDT_INT, &p->guild_id, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 27, SQLDT_INT, &p->pet_id, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 28, SQLDT_INT, &p->hom_id, 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 29, SQLDT_INT, &p->ele_id, 0, NULL, NULL) + || SQL_ERROR == SqlStmt_BindColumn(stmt, 29, SQLDT_INT, &p->ele_id, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 30, SQLDT_SHORT, &p->hair, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 31, SQLDT_SHORT, &p->hair_color, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 32, SQLDT_SHORT, &p->clothes_color, 0, NULL, NULL) Index: src/char/int_guild.c =================================================================== --- src/char/int_guild.c (revision 16039) +++ src/char/int_guild.c (working copy) @@ -1871,7 +1871,7 @@ return 1; } -// ƒT[ƒo[‚©‚ç’E‘Þ—v‹iƒLƒƒƒ‰íœ—pj +// processes a mapserver connection event int inter_guild_leave(int guild_id, int account_id, int char_id) { return mapif_parse_GuildLeave(-1, guild_id, account_id, char_id, 0, "** Character Deleted **"); Index: src/char/int_elemental.c =================================================================== --- src/char/int_elemental.c (revision 16039) +++ src/char/int_elemental.c (working copy) @@ -20,9 +20,9 @@ if( ele->elemental_id == 0 ) { // Create new DB entry if( SQL_ERROR == Sql_Query(sql_handle, - "INSERT INTO `elemental` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`life_time`)" - "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%u')", - ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi, ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time) ) + "INSERT INTO `elemental` (`char_id`,`class`,`mode`,`hp`,`sp`,`max_hp`,`max_sp`,`str`,`agi`,`vit`,`int`,`dex`,`luk`,`life_time`)" + "VALUES ('%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%d','%u')", + ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi, ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time) ) { Sql_ShowDebug(sql_handle); flag = false; @@ -30,11 +30,11 @@ else ele->elemental_id = (int)Sql_LastInsertId(sql_handle); } else if( SQL_ERROR == Sql_Query(sql_handle, - "UPDATE `elemental` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%d', `sp` = '%d'," - "`max_hp` = '%d', `max_sp` = '%d', `str` = '%d', `agi` = '%d', `vit` = '%d', `int` = '%d', `dex` = '%d'," - "`luk` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'", - ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi, - ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time, ele->elemental_id) ) + "UPDATE `elemental` SET `char_id` = '%d', `class` = '%d', `mode` = '%d', `hp` = '%d', `sp` = '%d'," + "`max_hp` = '%d', `max_sp` = '%d', `str` = '%d', `agi` = '%d', `vit` = '%d', `int` = '%d', `dex` = '%d'," + "`luk` = '%d', `life_time` = '%u' WHERE `ele_id` = '%d'", + ele->char_id, ele->class_, ele->mode, ele->hp, ele->sp, ele->max_hp, ele->max_sp, ele->str, ele->agi, + ele->vit, ele->int_, ele->dex, ele->luk, ele->life_time, ele->elemental_id) ) { // Update DB entry Sql_ShowDebug(sql_handle); flag = false; @@ -44,23 +44,23 @@ bool mapif_elemental_load(int ele_id, int char_id, struct s_elemental *ele) { char* data; - + memset(ele, 0, sizeof(struct s_elemental)); ele->elemental_id = ele_id; ele->char_id = char_id; - + if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `class`, `mode`, `hp`, `sp`, `max_hp`, `max_sp`, `str`, `agi`, `vit`, `int`, `dex`," - "`luk`, `life_time` FROM `elemental` WHERE `ele_id` = '%d' AND `char_id` = '%d'", + "`luk`, `life_time` FROM `elemental` WHERE `ele_id` = '%d' AND `char_id` = '%d'", ele_id, char_id) ) { Sql_ShowDebug(sql_handle); return false; } - + if( SQL_SUCCESS != Sql_NextRow(sql_handle) ) { Sql_FreeResult(sql_handle); return false; } - + Sql_GetData(sql_handle, 0, &data, NULL); ele->class_ = atoi(data); Sql_GetData(sql_handle, 1, &data, NULL); ele->mode = atoi(data); Sql_GetData(sql_handle, 2, &data, NULL); ele->hp = atoi(data); @@ -86,7 +86,7 @@ Sql_ShowDebug(sql_handle); return false; } - + return true; } @@ -94,7 +94,7 @@ static void mapif_elemental_send(int fd, struct s_elemental *ele, unsigned char flag) { int size = sizeof(struct s_elemental) + 5; - + WFIFOHEAD(fd,size); WFIFOW(fd,0) = 0x387c; WFIFOW(fd,2) = size; @@ -150,7 +150,7 @@ *------------------------------------------*/ int inter_elemental_parse_frommap(int fd) { unsigned short cmd = RFIFOW(fd,0); - + switch( cmd ) { case 0x307c: mapif_parse_elemental_create(fd, (struct s_elemental*)RFIFOP(fd,4)); break; case 0x307d: mapif_parse_elemental_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break; Index: src/map/script.c =================================================================== --- src/map/script.c (revision 16039) +++ src/map/script.c (working copy) @@ -5691,10 +5692,10 @@ *------------------------------------------*/ BUILDIN_FUNC(countitem2) { - int nameid, iden, ref, attr, c1, c2, c3, c4; int count = 0; int i; struct item_data* id = NULL; + struct item tmp_it; struct script_data* data; TBL_PC* sd = script_rid2sd(st); @@ -5722,22 +5723,19 @@ return 1; } - nameid = id->nameid; - iden = script_getnum(st,3); - ref = script_getnum(st,4); - attr = script_getnum(st,5); - c1 = (short)script_getnum(st,6); - c2 = (short)script_getnum(st,7); - c3 = (short)script_getnum(st,8); - c4 = (short)script_getnum(st,9); + tmp_it.nameid = id->nameid; + tmp_it.identify = script_getnum(st,3); + tmp_it.refine = script_getnum(st,4); + tmp_it.attribute = script_getnum(st,5); + tmp_it.card[0] = (short)script_getnum(st,6); + tmp_it.card[1] = (short)script_getnum(st,7); + tmp_it.card[2] = (short)script_getnum(st,8); + tmp_it.card[3] = (short)script_getnum(st,9); for(i = 0; i < MAX_INVENTORY; i++) - if (sd->status.inventory[i].nameid > 0 && sd->inventory_data[i] != NULL && - sd->status.inventory[i].amount > 0 && sd->status.inventory[i].nameid == nameid && - sd->status.inventory[i].identify == iden && sd->status.inventory[i].refine == ref && - sd->status.inventory[i].attribute == attr && sd->status.inventory[i].card[0] == c1 && - sd->status.inventory[i].card[1] == c2 && sd->status.inventory[i].card[2] == c3 && - sd->status.inventory[i].card[3] == c4 + if ( (&sd->status.inventory[i] != NULL) + && sd->status.inventory[i].amount > 0 + && compare_item(&sd->status.inventory[i],&tmp_it,1) ) count += sd->status.inventory[i].amount; @@ -6608,7 +6606,7 @@ return 0; } /*========================================== - *Žw’èID‚ÌPT–ŒŽæ“Ÿ + * return the name of a partyid *------------------------------------------*/ BUILDIN_FUNC(getpartyname) { @@ -9295,7 +9293,8 @@ } /*========================================== - * ó‘Ԉُí‘ϐ«‚ðŒvŽZ‚µ‚œŠm—Š‚ð•Ô‚· + * To get rate of a sc type, actually I don't really get it since we returning tick but oh well.. + * @TODO that fonction doesn't take an consideration last status_change_start altering so... *------------------------------------------*/ BUILDIN_FUNC(getscrate) { @@ -9838,7 +9837,9 @@ } /*========================================== - * RID‚̃Aƒ^ƒbƒ` + * Attach un joueurs au script, st.rid + * Permet a un script d'executer des actions + * requierant un joueur autrement que par contact direct. *------------------------------------------*/ BUILDIN_FUNC(attachrid) { Index: src/map/elemental.c =================================================================== --- src/map/elemental.c (revision 16039) +++ src/map/elemental.c (working copy) @@ -255,7 +255,7 @@ if( bl ) status_change_end(bl,type,INVALID_TIMER); break; default: - ShowWarning("Invalid SC=%d in elemental_clean_single_effect\n",type); + ShowWarning("Invalide SC=%d in elemental_clean_single_effect\n",type); break; } } @@ -349,7 +349,7 @@ if( elemental_skillnotok(skillnum, ed) ) return 0; - + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 ) @@ -413,7 +413,7 @@ if( elemental_skillnotok(skillnum, ed) ) return 0; - + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; else if( DIFF_TICK(gettick(), ed->ud.canact_tick) < 0 ) @@ -566,10 +566,10 @@ return 0; ed->last_thinktime = tick; - + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; - + if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 ) return 0; //No thinking when you just started to walk. @@ -612,7 +612,8 @@ return 1; } - if( battle_check_range(&ed->bl,target,ed->db->range2) && rnd()%100 < 2 ) { // 2% chance to cast attack skill. + if( battle_check_range(&ed->bl,target,view_range) && rnd()%100 < 2 ) // 2% chance to cast attack skill. + { if( elemental_action(ed,target,tick) ) return 1; } @@ -643,7 +644,7 @@ return 0; } -static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr data) { +static int elemental_ai_timer(int tid, unsigned int tick, int id, intptr_t data) { map_foreachpc(elemental_ai_sub_foreachclient,tick); return 0; Index: src/map/atcommand.h =================================================================== --- src/map/atcommand.h (revision 16039) +++ src/map/atcommand.h (working copy) @@ -4,6 +4,7 @@ #ifndef _ATCOMMAND_H_ #define _ATCOMMAND_H_ +//#include "map.h" struct map_session_data; //This is the distance at which @autoloot works, Index: src/map/battle.c =================================================================== --- src/map/battle.c (revision 16039) +++ src/map/battle.c (working copy) @@ -105,6 +105,7 @@ case BL_HOM: return ((struct homun_data*)bl)->ud.target; case BL_MER: return ((struct mercenary_data*)bl)->ud.target; case BL_ELEM: return ((struct elemental_data*)bl)->ud.target; + default: break; //unhandled type } return 0; } @@ -145,6 +146,7 @@ c = 23; return bl_list[rnd()%c]; } + static int battle_getenemyarea_sub(struct block_list *bl, va_list ap) { struct block_list **bl_list, *src; @@ -183,7 +185,7 @@ return bl_list[rnd()%c]; } -// ƒ_??[ƒW‚Ì’x‰„ +// ï¿œ_??[ï¿œWᅵ̒xᅵᅵ struct delay_damage { struct block_list *src; int target; @@ -266,6 +268,7 @@ return 0; } + int battle_attr_ratio(int atk_elem,int def_type, int def_lv) { @@ -340,7 +343,8 @@ } /*========================================== - * ƒ_??[ƒW??IŒvŽZ + * Main battle_calc function + * primary call *------------------------------------------*/ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv) { @@ -394,7 +398,7 @@ (skill_num && skill_get_ele(skill_num, skill_lv) == ELE_GHOST) || (!skill_num && (status_get_status_data(src))->rhw.ele == ELE_GHOST) ) - status_change_end(bl,SC_WHITEIMPRISON,INVALID_TIMER); // Those skills do damage and removes effect + status_change_end(bl,SC_WHITEIMPRISON, INVALID_TIMER); // Those skills do damage and removes effect else { d->dmg_lv = ATK_BLOCK; @@ -468,7 +472,7 @@ clif_millenniumshield(sd,sce->val2); sce->val3 = 1000; // Next Shield } else - status_change_end(bl,SC_MILLENNIUMSHIELD,INVALID_TIMER); // All shields down + status_change_end(bl,SC_MILLENNIUMSHIELD, INVALID_TIMER); // All shields down } return 0; } @@ -533,9 +537,8 @@ } //Now damage increasing effects - if( sc->data[SC_AETERNA] && skill_num != PF_SOULBURN ) - { - if( src->type != BL_MER || skill_num == 0 ) + if (sc->data[SC_AETERNA] && skill_num != PF_SOULBURN) { + if (src->type != BL_MER || skill_num == 0) damage <<= 1; // Lex Aeterna only doubles damage of regular attacks from mercenaries if( skill_num != ASC_BREAKER || !(flag&BF_WEAPON) ) @@ -556,11 +559,11 @@ if( sc->data[SC_DEEPSLEEP] ) { damage += damage / 2; // 1.5 times more damage while in Deep Sleep. - status_change_end(bl,SC_DEEPSLEEP,INVALID_TIMER); + status_change_end(bl,SC_DEEPSLEEP, INVALID_TIMER); } if( sc->data[SC_VOICEOFSIREN] ) - status_change_end(bl,SC_VOICEOFSIREN,INVALID_TIMER); + status_change_end(bl,SC_VOICEOFSIREN, INVALID_TIMER); } @@ -900,7 +903,7 @@ } /*========================================== - * HP/SP‹zŽû‚ÌŒvŽZ + * HP/SP drain calculation *------------------------------------------*/ static int battle_calc_drain(int damage, int rate, int per) { @@ -919,7 +922,7 @@ } /*========================================== - * ?C—ûƒ_??[ƒW + * Passif skill dammages increases *------------------------------------------*/ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type) { @@ -1024,6 +1027,7 @@ return damage; } + /*========================================== * Calculates the standard damage of a normal attack assuming it hits, * it calculates nothing extra fancy, is needed for magnum break's WATK_ELEMENT bonus. [Skotlex] @@ -1607,7 +1611,8 @@ sd->inventory_data[index] && sd->inventory_data[index]->type == IT_ARMOR) ATK_ADD(sd->inventory_data[index]->weight/10); - } else + } + else ATK_ADD(sstatus->rhw.atk2); //Else use Atk2 break; case HFLI_SBR44: //[orn] @@ -2303,7 +2308,7 @@ case 13261: // Coconut Bomb case 13262: // Melon Bomb case 13263: // Pinapple Bomb - skillratio += 400; // Unconfirded + skillratio += 400; // Unconfirmed break; case 13264: // Banana Bomb 2000% skillratio += 1900; @@ -3703,7 +3700,7 @@ } /*========================================== - * ‚»‚Ì‘Œƒ_??[ƒWŒvŽZ + * Calcule les degat d'une attaque Misc selon le skill *------------------------------------------*/ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag) { @@ -4015,7 +4012,7 @@ return md; } /*========================================== - * ƒ_??[ƒWŒvŽZˆêŠ‡?ˆ—?—p + * *------------------------------------------*/ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count) { @@ -4072,7 +4069,7 @@ rd1 = min(damage,status_get_max_hp(bl)) * sc->data[SC_DEATHBOUND]->val2 / 100; // Amplify damage. *dmg = rd1 * 30 / 100; // Received damge = 30% of amplifly damage. clif_skill_damage(src,bl,gettick(), status_get_amotion(src), 0, -30000, 1, RK_DEATHBOUND, sc->data[SC_DEATHBOUND]->val1,6); - status_change_end(bl,SC_DEATHBOUND,INVALID_TIMER); + status_change_end(bl,SC_DEATHBOUND, INVALID_TIMER); rdamage += rd1; if (rdamage < 1) rdamage = 1; } @@ -4142,6 +4139,7 @@ if (rhp || rsp) status_zap(tbl, rhp, rsp); } + // Deals the same damage to targets in area. [pakpil] int battle_damage_area( struct block_list *bl, va_list ap) { unsigned int tick; @@ -4172,8 +4170,9 @@ return 0; } + /*========================================== - * ’Ê??UŒ‚?ˆ—?‚Ü‚Æ‚ß + * *------------------------------------------*/ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag) { struct map_session_data *sd = NULL, *tsd = NULL; @@ -4240,13 +4239,13 @@ } } } + if(sc && sc->count){ + if (sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2)) + status_change_end(src, SC_CLOAKING, INVALID_TIMER); - if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2)) - status_change_end(src, SC_CLOAKING, INVALID_TIMER); - - if (sc && sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2)) - status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER); - + if (sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2)) + status_change_end(src,SC_CLOAKINGEXCEED,INVALID_TIMER); + } if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) ) { int dir = map_calc_dir(target,src->x,src->y); @@ -4289,8 +4288,9 @@ return ATK_MISS; } } - - if (sc) { + + if (sc && sc->count) + { if (sc->data[SC_SACRIFICE]) { int skilllv = sc->data[SC_SACRIFICE]->val1; damage_lv ret_val; @@ -4502,6 +4502,10 @@ status_change_end(target, SC_POISONREACT, INVALID_TIMER); } } + if (sc && sc->data[SC_CAMOUFLAGE] && !(sc->data[SC_CAMOUFLAGE]->val3&2)){ //moved so basic attack get critical bonus + status_change_end(src,SC_CAMOUFLAGE,INVALID_TIMER); + } + map_freeblock_unlock(); return wd.dmg_lv; } @@ -4554,6 +4558,7 @@ if (((TBL_SKILL*)src)->group && ((TBL_SKILL*)src)->group->src_id) src = map_id2bl(((TBL_SKILL*)src)->group->src_id); break; + default: break; //other type doesn't have master (recursive check so don't showwarning) } } while (src && src != prev); return prev; @@ -4695,9 +4700,9 @@ int inf2 = 0; if (!su->group) return 0; + inf2 = skill_get_inf2(su->group->skill_id); if( battle_config.vs_traps_bctall && (target->type&battle_config.vs_traps_bctall) && - (inf2 = skill_get_inf2(su->group->skill_id))&INF2_TRAP && - map_flag_vs(src->m) ) + inf2&INF2_TRAP && map_flag_vs(src->m) ) return 1;//traps may target everyone if (su->group->src_id == target->id) { if (inf2&INF2_NO_TARGET_SELF) @@ -4707,6 +4712,7 @@ } break; } + default: break; //unhandle others } switch( s_bl->type ) @@ -4847,7 +4853,7 @@ return (flag&state)?1:-1; } /*========================================== - * ŽË’ö”»’è + * ᅵ˒ᅵᅵᅵᅵᅵ *------------------------------------------*/ bool battle_check_range(struct block_list *src, struct block_list *bl, int range) { Index: src/map/skill.c =================================================================== --- src/map/skill.c (revision 16039) +++ src/map/skill.c (working copy) @@ -781,7 +781,7 @@ rate += rate*sc->data[SC_SKILLRATE_UP]->val2/100; status_change_end(src, SC_SKILLRATE_UP, INVALID_TIMER); } - sc_start4(src,SC_COMBO, rate, TK_COUNTER, bl->id,0,0, + sc_start2(src,SC_COMBO, rate, TK_COUNTER, bl->id, (2000 - 4*sstatus->agi - 2*sstatus->dex)); } } @@ -795,7 +795,7 @@ skill_get_time2(AS_ENCHANTPOISON,sce->val1),0); // Enchant Deadly Poison gives a chance to deadly poison attacked enemies if((sce=sc->data[SC_EDP])) - sc_start4(bl,SC_DPOISON,sce->val2, sce->val1,0,0,0, + sc_start(bl,SC_DPOISON,sce->val2, sce->val1, skill_get_time2(ASC_EDP,sce->val1)); } } @@ -1268,7 +1268,7 @@ if( dstsd ) skill_addtimerskill(src,tick+status_get_amotion(src),bl->id,0,0,skillid,skilllv,BF_WEAPON,0); else if( dstmd && !is_boss(bl) ) - sc_start(bl, SC_STUN, 100, skilllv, 1000 + 1000 * (rnd() %3)); + sc_start(bl, SC_STUN, 100, skilllv, 1000 + 1000 * (rnd()%3)); break; case SR_GENTLETOUCH_QUIET: sc_start(bl, SC_SILENCE, 2 * skilllv, skilllv, skill_get_time(skillid, skilllv)); @@ -1331,7 +1331,7 @@ sc_start(bl, SC_MELON_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv)); // Reduces ASPD and moviment speed break; case 13264: - sc_start(bl, SC_BANANA_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv)); // Reduces LUK À?Needed confirm it, may be it's bugged in kRORE? + sc_start(bl, SC_BANANA_BOMB, 100, skilllv, skill_get_time(GN_SLINGITEM, skilllv)); // Reduces LUK ï¿œ?Needed confirm it, may be it's bugged in kRORE? sc_start(bl, SC_BANANA_BOMB_SITDOWN, 75, skilllv, skill_get_time(GN_SLINGITEM_RANGEMELEEATK,skilllv)); // Sitdown for 3 seconds. break; } @@ -2031,10 +2031,16 @@ break; case BL_SKILL: su = (struct skill_unit *)target; - if( su && su->group && (su->group->unit_id == UNT_ANKLESNARE || su->group->unit_id == UNT_ELECTRICSHOCKER - || su->group->unit_id == UNT_CLUSTERBOMB || su->group->unit_id == UNT_REVERBERATION) ) - return 0; // ankle snare, electricshocker, clusterbomb, reverberation cannot be knocked back + if( su && su->group) + switch(su->group->unit_id){ //defined trap that cannot be knocked back + case UNT_ANKLESNARE: //allow easier modification [Lighta], @TODO set up an flag on skill_unit_db for that + case UNT_ELECTRICSHOCKER: + // case UNT_CLUSTERBOMB: //http://irowiki.org/wiki/Bomb_Cluster + case UNT_REVERBERATION: + return 0; + } break; + default : break; //unhandled type } if (direction == -1) // : do the computation here instead of outside @@ -2104,7 +2110,7 @@ struct map_session_data *sd, *tsd; int type,damage,rdamage=0; - if(skillid > 0 && skilllv <= 0) return 0; + if( skillid > 0 && skilllv <= 0 ) return 0; // Invalid skill id or level. nullpo_ret(src); //Source is the master behind the attack (player/mob/pet) nullpo_ret(dsrc); //dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src. @@ -2674,12 +2680,12 @@ } /*========================================== - * ƒXƒLƒ‹”Í??U?—p(map_foreachinarea‚©‚çŒÄ‚΂ê‚é) - * flag‚ɂ‚¢‚Ä?F16?i?‚ðŠm”F + * ï¿œXï¿œLᅵᅵᅵᅵ??U?ï¿œp(map_foreachinareaᅵᅵᅵᅵĂ΂ᅵᅵ) + * flagᅵɂ‚ᅵᅵᅵ?F16?i?ᅵᅵᅵmï¿œF * MSB <- 00fTffff ->LSB - * T =ƒ^?ƒQƒbƒg‘I?—p(BCT_*) - * ffff=Ž©—R‚ÉŽg—p‰Â”\ - * 0 =—\–ñ?B0‚ɌŒè + * T =ï¿œ^?ï¿œQï¿œbï¿œgï¿œI?ï¿œp(BCT_*) + * ffff=ᅵᅵᅵRᅵɎgï¿œpᅵ”\ + * 0 =ï¿œ\ᅵᅵ?B0ᅵɌŒᅵ *------------------------------------------*/ typedef int (*SkillFunc)(struct block_list *, struct block_list *, int, int, unsigned int, int); int skill_area_sub (struct block_list *bl, va_list ap) @@ -2878,6 +2884,7 @@ { case BL_HOM: sd = ((TBL_HOM*)bl)->master; break; case BL_MER: sd = ((TBL_MER*)bl)->master; break; + default : break; //unhandled type } status = status_get_status_data(bl); @@ -3104,10 +3111,10 @@ if( j ) { i = applyeffects[rnd()%j]; - status_change_start(target, i, 10000, skl->skill_lv, + sc_start4(target, i, 100, skl->skill_lv, (i == SC_BURNING ? 1000 : 0), (i == SC_BURNING ? src->id : 0), - 0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv), 0); + 0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv) ); } } } @@ -3127,9 +3134,11 @@ break; case LG_MOONSLASHER: case SR_WINDMILL: - if( target->type == BL_PC ) { - struct map_session_data *tsd = NULL; - if( (tsd = ((TBL_PC*)target)) && !pc_issit(tsd) ) { + if( target->type == BL_PC ) + { + TBL_PC *tsd = BL_CAST(BL_PC,target); + if( tsd && !pc_issit(tsd) ) + { pc_setsit(tsd); skill_sit(tsd,1); clif_sitting(&tsd->bl); @@ -3229,6 +3238,7 @@ } return 1; } + static int skill_ative_reverberation( struct block_list *bl, va_list ap) { struct skill_unit *su = (TBL_SKILL*)bl; struct skill_unit_group *sg; @@ -4155,7 +4165,7 @@ if( j == 0 ) { // No Spheres - clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_SUMMON_NONE,0); break; } @@ -4241,6 +4251,7 @@ sc_start(bl, SC_INFRAREDSCAN, 10000, skilllv, skill_get_time(skillid, skilllv)); status_change_end(bl, SC_HIDING, INVALID_TIMER); status_change_end(bl, SC_CLOAKING, INVALID_TIMER); + status_change_end(bl, SC_CHASEWALK, INVALID_TIMER); status_change_end(bl, SC_CLOAKINGEXCEED, INVALID_TIMER); // Need confirm it. } else @@ -4304,20 +4315,26 @@ break; case SR_HOWLINGOFLION: - status_change_end(bl, SC_SWINGDANCE, INVALID_TIMER); - status_change_end(bl, SC_SYMPHONYOFLOVER, INVALID_TIMER); - status_change_end(bl, SC_MOONLITSERENADE, INVALID_TIMER); - status_change_end(bl, SC_RUSHWINDMILL, INVALID_TIMER); - status_change_end(bl, SC_ECHOSONG, INVALID_TIMER); - status_change_end(bl, SC_HARMONIZE, INVALID_TIMER); - status_change_end(bl, SC_SIRCLEOFNATURE, INVALID_TIMER); - status_change_end(bl, SC_SATURDAYNIGHTFEVER, INVALID_TIMER); - status_change_end(bl, SC_DANCEWITHWUG, INVALID_TIMER); - status_change_end(bl, SC_LERADSDEW, INVALID_TIMER); - status_change_end(bl, SC_MELODYOFSINK, INVALID_TIMER); - status_change_end(bl, SC_BEYONDOFWARCRY, INVALID_TIMER); - status_change_end(bl, SC_UNLIMITEDHUMMINGVOICE, INVALID_TIMER); + { + struct status_change *tsc = status_get_sc(bl); + if(tsc && tsc->count){ + int i=0; + const enum sc_type scs[] = { + SC_SWINGDANCE, SC_SYMPHONYOFLOVER, + SC_MOONLITSERENADE, SC_RUSHWINDMILL, SC_ECHOSONG, SC_HARMONIZE, + SC_DEEPSLEEP, SC_VOICEOFSIREN, SC_SATURDAYNIGHTFEVER, SC_GLOOMYDAY, //Group B + SC_UNLIMITEDHUMMINGVOICE, SC_SONGOFMANA, SC_DANCEWITHWUG, + SC_BEYONDOFWARCRY, SC_MELODYOFSINK, SC_LERADSDEW, SC_SIRCLEOFNATURE //Group B Wanderer + }; + + for (i = 0; i < ARRAYLENGTH(scs); i++){ + if(i==SC_SATURDAYNIGHTFEVER) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0. + if (tsc->data[scs[i]]) + status_change_end(bl, scs[i], INVALID_TIMER); + } + } skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag); + } break; case SR_EARTHSHAKER: @@ -4346,10 +4363,10 @@ struct status_change *tsc = status_get_sc(bl); if( tsc && tsc->data[SC_POISON] ) { skill_attack(skill_get_type(skillid), src, src, bl, skillid, skilllv, tick, flag); - status_change_end(bl, SC_POISON, INVALID_TIMER); + status_change_end(bl, SC_POISON, INVALID_TIMER); } else if( sd ) - clif_skill_fail(sd, skillid, 0, 0); + clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0); } break; @@ -4417,7 +4434,7 @@ case EL_ROCK_CRUSHER: clif_skill_nodamage(src,battle_get_master(src),skillid,skilllv,1); clif_skill_damage(src, src, tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6); - if( rnd()%100 < 50 ) + if( rnd()%100 < 50 ) skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); else skill_attack(BF_WEAPON,src,src,bl,EL_ROCK_CRUSHER_ATK,skilllv,tick,flag); @@ -4802,6 +4819,7 @@ else switch (src->type) { case BL_MOB: target_id = ((TBL_MOB*)src)->target_id; break; case BL_PET: target_id = ((TBL_PET*)src)->target_id; break; + default : break; //unhandled type } if (!target_id) break; @@ -7454,9 +7472,9 @@ if( (tsc && (tsc->data[SC_FREEZE] || tsc->data[SC_STONE] || tsc->data[SC_BLIND]))&& (rnd()%100 < 30+5*skilllv) ) { - status_change_end(bl, SC_FREEZE, INVALID_TIMER); - status_change_end(bl, SC_STONE, INVALID_TIMER); - status_change_end(bl, SC_BLIND, INVALID_TIMER); + status_change_end(bl, SC_FREEZE, INVALID_TIMER); + status_change_end(bl, SC_STONE, INVALID_TIMER); + status_change_end(bl, SC_BLIND, INVALID_TIMER); } // Success rate only applies to the curing effect and not stat bonus. clif_skill_nodamage(bl, bl, skillid, skilllv, @@ -7740,7 +7758,7 @@ case RA_WUGDASH: if( tsce ) { - clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, -1)); + clif_skill_nodamage(src,bl,skillid,skilllv,status_change_end(bl, type, INVALID_TIMER)); map_freeblock_unlock(); return 0; } @@ -7830,7 +7848,7 @@ clif_skill_nodamage(src,bl,skillid,1,1); } else - clif_skill_fail(sd,skillid,0x15,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_GC_WEAPONBLOCKING,0); } break; @@ -7938,7 +7956,7 @@ clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skillid, skilllv, 6); if( rate < brate ) map_foreachinrange(skill_area_sub,src,skill_get_splash(skillid,skilllv),BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id); - status_change_end(bl,SC_SHIELDSPELL_DEF,INVALID_TIMER); + status_change_end(bl,SC_SHIELDSPELL_DEF, INVALID_TIMER); break; case 2: val = 10 * shield_data->def; // % Reflected damage. @@ -8039,6 +8057,7 @@ clif_skill_nodamage(bl,src,skillid,skilllv, sc_start(bl, type, 100, skilllv, skill_get_time(skillid, skilllv))); break; + case SR_CURSEDCIRCLE: if( flag&1 ) { if( is_boss(bl) ) break; @@ -8204,7 +8223,7 @@ status_fix_damage(src,bl,9999,clif_damage(src,bl,tick,0,0,9999,0,0,0)); } else if( sd ) { if( !sd->status.party_id ) { - clif_skill_fail(sd,skillid,0x11,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_NEED_HELPER,0); break; } if( map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid,skilllv), @@ -8281,6 +8300,7 @@ else switch (src->type) { case BL_MOB: target_id = ((TBL_MOB*)src)->target_id; break; case BL_PET: target_id = ((TBL_PET*)src)->target_id; break; + default : break; //unhandled type } if (!target_id) break; @@ -8355,12 +8375,12 @@ // Remove previous elemental fisrt. if( sd->ed && elemental_delete(sd->ed,0) ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } // Summoning the new one. if( !elemental_create(sd,elemental_class,skill_get_time(skillid,skilllv)) ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -8371,12 +8391,12 @@ if( sd ) { int mode = EL_MODE_PASSIVE; // Standard mode. if( !sd->ed ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if( skilllv == 4 ) {// At level 4 delete elementals. if( elemental_delete(sd->ed, 0) ) - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } switch( skilllv ) {// Select mode bassed on skill level used. @@ -8385,7 +8405,7 @@ case 3: mode = EL_MODE_AGGRESSIVE; break; } if( !elemental_change_mode(sd->ed,mode) ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -8407,11 +8427,11 @@ int s_hp = sd->battle_status.hp * 10 / 100, s_sp = sd->battle_status.sp * 10 / 100; int e_hp, e_sp; if( !ed ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } if( !status_charge(&sd->bl,s_hp,s_sp) ) { - clif_skill_fail(sd,skillid,0,0); + clif_skill_fail(sd,skillid,USESKILL_FAIL_LEVEL,0); break; } e_hp = ed->battle_status.max_hp * 10 / 100; @@ -8434,7 +8454,7 @@ clif_skill_nodamage(src, bl, skillid, skilllv, 1); sc_start2(bl, type, 100, skilllv, src->id, skill_get_time(skillid,skilllv)); } else if( sd ) { - clif_skill_fail(sd, skillid, 0, 0); + clif_skill_fail(sd, skillid, USESKILL_FAIL_LEVEL, 0); break; } break; @@ -8466,7 +8486,7 @@ else skill_attack(BF_WEAPON,src,src,bl,GN_SLINGITEM_RANGEMELEEATK,skilllv,tick,flag); } else //Otherwise, it fails, shows animation and removes items. - clif_skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,0xa,0); + clif_skill_fail(sd,GN_SLINGITEM_RANGEMELEEATK,USESKILL_FAIL,0); } else { struct script_code *script = sd->inventory_data[i]->script; if( !script ) @@ -9617,7 +9637,7 @@ case LG_BANDING: if( sc && sc->data[SC_BANDING] ) - status_change_end(src,SC_BANDING,INVALID_TIMER); + status_change_end(src,SC_BANDING, INVALID_TIMER); else if( (sg = skill_unitsetting(src,skillid,skilllv,src->x,src->y,0)) != NULL ) { sc_start4(src,SC_BANDING,100,skilllv,0,0,sg->group_id,skill_get_time(skillid,skilllv)); if( sd ) pc_banding(sd,skilllv); @@ -9686,7 +9706,7 @@ } } break; - + case SO_FIREWALK: case SO_ELECTRICWALK: if( sc && sc->data[type] ) @@ -11075,8 +11095,8 @@ // Reveal hidden players every 5 seconds. if( sg->val2 % 5 == 0 ) { // TODO: check if other hidden status can be removed. - status_change_end(bl,SC_HIDING,INVALID_TIMER); - status_change_end(bl,SC_CLOAKING,INVALID_TIMER); + status_change_end(bl,SC_HIDING, INVALID_TIMER); + status_change_end(bl,SC_CLOAKING, INVALID_TIMER); } } /* Enable this if kRO fix the current skill. Currently no damage on undead and demon monster. [Jobbie] @@ -12186,7 +12206,7 @@ case SC_MANHOLE: case SC_DIMENSIONDOOR: if( sc && sc->data[SC_MAGNETICFIELD] ) { - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -12194,7 +12214,7 @@ int count; count = skill_check_pc_partner(sd, skill, &lv, skill_get_splash(skill,lv), 0); if( count < 1 ) { - clif_skill_fail(sd,skill,0x11,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_NEED_HELPER,0); return 0; } else require.sp -= require.sp * 20 * count / 100; // -20% each W/M in the party. @@ -12204,19 +12224,19 @@ case SO_ELECTRICWALK: // Can't be casted until you've walked all cells. if( sc && sc->data[SC_PROPERTYWALK] && sc->data[SC_PROPERTYWALK]->val3 < skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) { - clif_skill_fail(sd,skill,0x0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case SO_EL_CONTROL: if( !sd->status.ele_id || !sd->ed ) { - clif_skill_fail(sd,skill,0x00,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; case RETURN_TO_ELDICASTES: if( sd->sc.option&OPTION_MADOGEAR ) { //Cannot be used if Mado is equipped. - clif_skill_fail(sd,skill,0,0); + clif_skill_fail(sd,skill,USESKILL_FAIL_LEVEL,0); return 0; } break; @@ -14251,7 +14271,7 @@ struct status_change *sc = NULL; if( (sc = status_get_sc(src)) != NULL && sc->data[SC_NEUTRALBARRIER_MASTER] ) { sc->data[SC_NEUTRALBARRIER_MASTER]->val2 = 0; - status_change_end(src,SC_NEUTRALBARRIER_MASTER,INVALID_TIMER); + status_change_end(src,SC_NEUTRALBARRIER_MASTER, INVALID_TIMER); } } break; @@ -14260,7 +14280,7 @@ struct status_change *sc = NULL; if( (sc = status_get_sc(src)) != NULL && sc->data[SC_STEALTHFIELD_MASTER] ) { sc->data[SC_STEALTHFIELD_MASTER]->val2 = 0; - status_change_end(src,SC_STEALTHFIELD_MASTER,INVALID_TIMER); + status_change_end(src,SC_STEALTHFIELD_MASTER, INVALID_TIMER); } } break; @@ -14269,7 +14289,7 @@ struct status_change *sc = NULL; if( (sc = status_get_sc(src)) && sc->data[SC_BANDING] ) { sc->data[SC_BANDING]->val4 = 0; - status_change_end(src,SC_BANDING,INVALID_TIMER); + status_change_end(src,SC_BANDING, INVALID_TIMER); } } break; @@ -15318,7 +15338,7 @@ break; case GN_MAKEBOMB: case GN_MIX_COOKING: - clif_msg_skill(sd,skill_id,0x627); + clif_msg_skill(sd,skill_id,1); break; case GN_S_PHARMACY: break; // No effects here. @@ -15387,13 +15407,13 @@ clif_additem(sd,0,0,flag); map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0); } - clif_msg_skill(sd,skill_id,0x628); + clif_msg_skill(sd,skill_id,2); } break; case GN_S_PHARMACY: break; // No effects here. case GN_MAKEBOMB: - clif_msg_skill(sd,skill_id,0x628); + clif_msg_skill(sd,skill_id,2); break; default: if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20 ) @@ -15591,10 +15611,10 @@ return 1; } + int skill_select_menu(struct map_session_data *sd,int flag,int skill_id) { int id, lv, prob, aslvl = 0; nullpo_ret(sd); - if (sd->sc.data[SC_STOP]) { aslvl = sd->sc.data[SC_STOP]->val1; status_change_end(&sd->bl,SC_STOP,INVALID_TIMER); @@ -15612,6 +15632,7 @@ sc_start4(&sd->bl,SC__AUTOSHADOWSPELL,100,id,lv,prob,0,skill_get_time(SC_AUTOSHADOWSPELL,aslvl)); return 0; } + int skill_elementalanalysis(struct map_session_data* sd, int n, int skill_lv, unsigned short* item_list) { int i; @@ -15631,7 +15652,7 @@ if( skill_lv == 2 ) del_amount -= (del_amount % 10); add_amount = (skill_lv == 1) ? del_amount * (5 + rnd()%5) : del_amount / 10 ; - + if( (nameid = sd->status.inventory[idx].nameid) <= 0 || del_amount > sd->status.inventory[idx].amount ) { clif_skill_fail(sd,SO_EL_ANALYSIS,0,0); return 1; @@ -16631,6 +16652,7 @@ return true; } + static bool skill_parse_row_spellbookdb(char* split[], int columns, int current) {// SkillID,PreservePoints @@ -16655,6 +16677,7 @@ return false; } + static bool skill_parse_row_improvisedb(char* split[], int columns, int current) {// SkillID int i = atoi(split[0]); Index: src/map/unit.c =================================================================== --- src/map/unit.c (revision 16039) +++ src/map/unit.c (working copy) @@ -7,6 +7,7 @@ #include "../common/db.h" #include "../common/malloc.h" #include "../common/random.h" + #include "unit.h" #include "map.h" #include "path.h" @@ -136,8 +137,7 @@ return 0; } ud->walktimer = INVALID_TIMER; - if( bl->prev == NULL ) return 0; // block_list ‚©‚甲‚¯‚Ä‚¢‚é‚̂ňړ®’âŽ~‚·‚é - + if( bl->prev == NULL ) return 0; // Stop moved because it is missing from the block_list if(ud->walkpath.path_pos>=ud->walkpath.path_len) return 0; @@ -1010,8 +1008,8 @@ int temp = 0; nullpo_ret(src); - if(status_isdead(src)) - return 0; // Ž€‚ñ‚Å‚¢‚È‚¢‚© + if( status_isdead(src) ) + return 0; //Do not continue source is dead sd = BL_CAST(BL_PC, src); ud = unit_bl2ud(src); @@ -1097,7 +1095,7 @@ return 0; tstatus = status_get_status_data(target); - //’Œ‘O‚̃XƒLƒ‹ó‹µ‚Ì‹L˜^ + //The previous record of skill status if(sd) { switch(skill_num){ case SA_CASTCANCEL: @@ -1132,11 +1130,10 @@ break; case WL_WHITEIMPRISON: if( battle_check_target(src,target,BCT_SELF|BCT_ENEMY) < 0 ) { - clif_skill_fail(sd,skill_num,0xb,0); + clif_skill_fail(sd,skill_num,USESKILL_FAIL_TOTARGET,0); return 0; } break; - } if (!skill_check_condition_castbegin(sd, skill_num, skill_lv)) return 0; @@ -1259,6 +1256,7 @@ md->state.aggressive = (tstatus->mode&MD_ANGRY)?1:0; md->min_chase = md->db->range3; break; + default: break; //unhandled type } } } @@ -1295,11 +1293,11 @@ status_change_end(src,SC_CLOAKINGEXCEED, INVALID_TIMER); if (!src->prev) return 0; } else if( sc->data[SC_CAMOUFLAGE] && skill_num != RA_CAMOUFLAGE ) - status_change_end(src,SC_CAMOUFLAGE,INVALID_TIMER); + status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER); if( sc->data[SC_CURSEDCIRCLE_ATKER] ) { sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1; - status_change_end(src,SC_CURSEDCIRCLE_ATKER,INVALID_TIMER); + status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER); } } @@ -1338,7 +1336,7 @@ nullpo_ret(src); - if(!src->prev) return 0; // map ã‚É‘¶Ý‚·‚é‚© + if(!src->prev) return 0; // Exists on the map if(status_isdead(src)) return 0; sd = BL_CAST(BL_PC, src); @@ -1375,7 +1373,7 @@ return 0; } - /* ŽË’ö‚ƏáŠQ•šƒ`ƒFƒbƒN */ + /* Check range and obstacle */ bl.type = BL_NUL; bl.m = src->m; bl.x = skill_x; @@ -1427,7 +1425,7 @@ if( sc->data[SC_CURSEDCIRCLE_ATKER] ) { sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1; - status_change_end(src,SC_CURSEDCIRCLE_ATKER,INVALID_TIMER); + status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER); } } @@ -1499,8 +1497,8 @@ } /*========================================== - * UŒ‚—v‹ - * type‚ª1‚È‚çŒp‘±UŒ‚ + * Attack request + * If type is an ongoing attack *------------------------------------------*/ int unit_attack(struct block_list *src,int target_id,int continuous) { @@ -1581,7 +1579,7 @@ { nullpo_retr(false, bl); - if( bl->x==x && bl->y==y ) // “¯‚¶ƒ}ƒX + if( bl->x==x && bl->y==y ) //Same place return true; return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH); @@ -1625,7 +1623,7 @@ return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH); } /*========================================== - * Calculates position of Pet/Mercenary/Homunculus + * Calculates position of Pet/Mercenary/Homunculus/Elemental *------------------------------------------*/ int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir) { @@ -1683,7 +1681,7 @@ } /*========================================== - * PC‚̍UŒ‚ (timerŠÖ”) + * Attack of the PC (function timer) *------------------------------------------*/ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick) { @@ -1881,7 +1879,7 @@ return 1; } -// unit_data ‚̏‰Šú‰»ˆ— +// unit_data initialization process void unit_dataset(struct block_list *bl) { struct unit_data *ud; @@ -1922,7 +1920,7 @@ } /*========================================== - * Œ©‚œ–ڂ̃TƒCƒY‚ð•ÏX‚·‚é + * To change the size of the object (player or mob only) *------------------------------------------*/ int unit_changeviewsize(struct block_list *bl,short size) { @@ -2418,7 +2416,8 @@ elemental_summon_stop(ed); break; - } + } + default: break; //unhandled type } skill_clear_unitgroup(bl); Index: src/map/battle.h =================================================================== --- src/map/battle.h (revision 16039) +++ src/map/battle.h (working copy) @@ -14,7 +14,7 @@ ATK_DEF // attack connected } damage_lv; -// ƒ_ƒ[ƒW +// dammage structure struct Damage { int damage,damage2; int type,div_; @@ -47,7 +47,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag); int battle_calc_bg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag); -enum { // ÅIŒvŽZ‚̃tƒ‰ƒO +enum { //Attack type for battle calc BF_WEAPON = 0x0001, BF_MAGIC = 0x0002, BF_MISC = 0x0004, Index: src/map/skill.h =================================================================== --- src/map/skill.h (revision 16039) +++ src/map/skill.h (working copy) @@ -87,7 +87,7 @@ int itemid[MAX_SKILL_ITEM_REQUIRE],amount[MAX_SKILL_ITEM_REQUIRE]; }; -// ƒXƒLƒ‹ƒf?ƒ^ƒx?ƒX +// Database skills struct s_skill_db { char name[NAME_LENGTH]; char desc[40]; @@ -116,7 +116,7 @@ extern struct s_skill_db skill_db[MAX_SKILL_DB]; #define MAX_SKILL_UNIT_LAYOUT 50 -#define MAX_SQUARE_LAYOUT 5 // 11*11‚̃†ƒjƒbƒg”z’u‚ªÅ‘å +#define MAX_SQUARE_LAYOUT 5 // 11*11 Placement of a maximum unit #define MAX_SKILL_UNIT_COUNT ((MAX_SQUARE_LAYOUT*2+1)*(MAX_SQUARE_LAYOUT*2+1)) struct s_skill_unit_layout { int count; @@ -194,7 +194,7 @@ UF_DUALMODE = 0x0800, // Spells should trigger both ontimer and onplace/onout/onleft effects. }; -// ƒAƒCƒeƒ€ì¬ƒf?ƒ^ƒx?ƒX +// Create Database item struct s_skill_produce_db { int nameid, trigger; int req_skill,req_skill_lv,itemlv; @@ -202,14 +202,14 @@ }; extern struct s_skill_produce_db skill_produce_db[MAX_SKILL_PRODUCE_DB]; -// –îì¬ƒf?ƒ^ƒx?ƒX +// Creating database arrow struct s_skill_arrow_db { int nameid, trigger; int cre_id[MAX_ARROW_RESOURCE],cre_amount[MAX_ARROW_RESOURCE]; }; extern struct s_skill_arrow_db skill_arrow_db[MAX_SKILL_ARROW_DB]; -// ƒAƒuƒ‰ƒJƒ_ƒuƒ‰ƒf?ƒ^ƒx?ƒX +// Abracadabra database struct s_skill_abra_db { int skillid; int req_lv; @@ -226,7 +226,8 @@ //Returns the cast type of the skill: ground cast, castend damage, castend no damage enum { CAST_GROUND, CAST_DAMAGE, CAST_NODAMAGE }; int skill_get_casttype(int id); //[Skotlex] -// ƒXƒLƒ‹ƒf?ƒ^ƒx?ƒX‚ւ̃AƒNƒZƒT + +// Accessor to the skills database // int skill_get_index( int id ); int skill_get_type( int id ); @@ -276,13 +277,13 @@ int skill_cleartimerskill(struct block_list *src); int skill_addtimerskill(struct block_list *src,unsigned int tick,int target,int x,int y,int skill_id,int skill_lv,int type,int flag); -// ’ljÁ?‰Ê +// Results? Added int skill_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,int dmg_lv,unsigned int tick); int skill_counter_additional_effect( struct block_list* src, struct block_list *bl,int skillid,int skilllv,int attack_type,unsigned int tick); int skill_blown(struct block_list* src, struct block_list* target, int count, int direction, int flag); int skill_break_equip(struct block_list *bl, unsigned short where, int rate, int flag); int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int lv, int time); -// ƒ†ƒjƒbƒgƒXƒLƒ‹ +// Skills unit struct skill_unit_group* skill_id2group(int group_id); struct skill_unit_group *skill_unitsetting(struct block_list* src, short skillid, short skilllv, short x, short y, int flag); struct skill_unit *skill_initunit (struct skill_unit_group *group, int idx, int x, int y, int val1, int val2); @@ -317,7 +318,7 @@ // Guild skills [celest] int skill_guildaura_sub (struct map_session_data* sd, int id, int strvit, int agidex); -// ‰r¥ƒLƒƒƒ“ƒZƒ‹ +// Chant canceled int skill_castcancel(struct block_list *bl,int type); int skill_sit (struct map_session_data *sd, int type); @@ -331,7 +332,7 @@ bool skill_check_cloaking(struct block_list *bl, struct status_change_entry *sce); -// ƒXƒe?ƒ^ƒXˆÙí +// Abnormal status int skill_enchant_elemental_end(struct block_list *bl, int type); int skillnotok(int skillid, struct map_session_data *sd); int skillnotok_hom(int skillid, struct homun_data *hd); @@ -339,13 +340,13 @@ int skill_chastle_mob_changetarget(struct block_list *bl,va_list ap); -// ƒAƒCƒeƒ€ì¬ +// Item creation int skill_can_produce_mix( struct map_session_data *sd, int nameid, int trigger, int qty); int skill_produce_mix( struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty ); int skill_arrow_create( struct map_session_data *sd,int nameid); -// mobƒXƒLƒ‹‚Ì‚œ‚ß +// skills for the mob int skill_castend_nodamage_id( struct block_list *src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag ); int skill_castend_damage_id( struct block_list* src, struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag ); int skill_castend_pos2( struct block_list *src, int x,int y,int skillid,int skilllv,unsigned int tick,int flag); Index: src/map/unit.h =================================================================== --- src/map/unit.h (revision 16039) +++ src/map/unit.h (working copy) @@ -68,61 +68,61 @@ unsigned dead_sit : 2; }; -// PC, MOB, PET ‚É‹€’Ê‚·‚鏈—‚ð‚P‚‚ɂ܂Ƃ߂éŒv‰æ +// PC, MOB, PET Planning process into one that is common to -// •àsŠJŽn -// –ß‚è’l‚́A0 ( ¬Œ÷ ), 1 ( Žž”s ) +// walk initiation +// The return value is 0 (success), 1 (failure) int unit_walktoxy( struct block_list *bl, short x, short y, int easy); int unit_walktobl( struct block_list *bl, struct block_list *target, int range, int easy); int unit_run(struct block_list *bl); int unit_calc_pos(struct block_list *bl, int tx, int ty, int dir); -// •às’âŽ~ -// type‚͈ȉº‚Ì‘g‚ݍ‡‚킹 : -// 1: ˆÊ’uî•ñ‚Ì‘—M( ‚±‚̊֐”‚ÌŒã‚Ɉʒuî•ñ‚𑗐M‚·‚éê‡‚Í•s—v ) -// 2: ƒ_ƒ[ƒWƒfƒBƒŒƒC—L‚è -// 4: •s–Ÿ(MOB‚̂݁H) +// Stop walking +// The combination of the following type: +// 1: (If you want to send the location information after this function is not required) transmission of location information +// 2: Damaged delay +// 4: Unknown (only MOB?) int unit_stop_walking(struct block_list *bl,int type); int unit_can_move(struct block_list *bl); int unit_is_walking(struct block_list *bl); int unit_set_walkdelay(struct block_list *bl, unsigned int tick, int delay, int type); int unit_escape(struct block_list *bl, struct block_list *target, short dist); -// ˆÊ’u‚Ì‹­§ˆÚ“®(‚«”ò‚΂µ‚È‚Ç) +// Position of forced move (such as a blow) int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool checkpath); int unit_warp(struct block_list *bl, short map, short x, short y, clr_type type); int unit_setdir(struct block_list *bl,unsigned char dir); uint8 unit_getdir(struct block_list *bl); int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag); -// ‚»‚±‚Ü‚Å•às‚Å‚œ‚Ç‚è’…‚¯‚é‚©‚Ì”»’è +// Determination of walking path until you reach in there bool unit_can_reach_pos(struct block_list *bl,int x,int y,int easy); bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, int easy, short *x, short *y); -// UŒ‚ŠÖ˜A +// Attack-related int unit_stop_attack(struct block_list *bl); int unit_attack(struct block_list *src,int target_id,int continuous); int unit_cancel_combo(struct block_list *bl); -// ƒXƒLƒ‹Žg—p +// Using the skill int unit_skilluse_id(struct block_list *src, int target_id, short skill_num, short skill_lv); int unit_skilluse_pos(struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv); -// ƒXƒLƒ‹Žg—p( •â³Ï‚݃LƒƒƒXƒgŽžŠÔAƒLƒƒƒ“ƒZƒ‹•s‰ÂÝ’è•t‚« ) +// Skill use (corrected cast time, not with setting Cancel) int unit_skilluse_id2(struct block_list *src, int target_id, short skill_num, short skill_lv, int casttime, int castcancel); int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, short skill_num, short skill_lv, int casttime, int castcancel); -// ‰r¥ƒLƒƒƒ“ƒZƒ‹ +// Chant canceled int unit_skillcastcancel(struct block_list *bl,int type); int unit_counttargeted(struct block_list *bl); int unit_set_target(struct unit_data* ud, int target_id); -// unit_data ‚̏‰Šú‰»ˆ— +// unit_data Initialization process void unit_dataset(struct block_list *bl); int unit_fixdamage(struct block_list *src,struct block_list *target,unsigned int tick,int sdelay,int ddelay,int damage,int div,int type,int damage2); -// ‚»‚Ì‘Œ +// Other struct unit_data* unit_bl2ud(struct block_list *bl); void unit_remove_map_pc(struct map_session_data *sd, clr_type clrtype); void unit_free_pc(struct map_session_data *sd); @@ -131,7 +131,7 @@ int unit_free(struct block_list *bl, clr_type clrtype); int unit_changeviewsize(struct block_list *bl,short size); -// ‰Šú‰»ƒ‹[ƒ`ƒ“ +// Initialization routine int do_init_unit(void); int do_final_unit(void); /** Index: src/map/mercenary.c =================================================================== --- src/map/mercenary.c (revision 16039) +++ src/map/mercenary.c (working copy) @@ -371,7 +371,7 @@ const enum sc_type scs[] = { SC_MERC_FLEEUP, SC_MERC_ATKUP, SC_MERC_HPUP, SC_MERC_SPUP, SC_MERC_HITUP }; int index = rnd() % ARRAYLENGTH(scs); - status_change_start(&md->bl, scs[index], 10000, rnd()%5, 0, 0, 0, 600000, 0); + sc_start(&md->bl, scs[index], 100, rnd()%5, 600000); return 0; } Index: src/map/storage.c =================================================================== --- src/map/storage.c (revision 16039) +++ src/map/storage.c (working copy) @@ -27,7 +27,7 @@ static DBMap* guild_storage_db; // int guild_id -> struct guild_storage* /*========================================== - * ‘qŒÉ“àƒAƒCƒeƒ€ƒ\[ƒg + * Sort items in the warehouse *------------------------------------------*/ static int storage_comp_item(const void *_i1, const void *_i2) { @@ -54,9 +54,9 @@ } /*========================================== - * ‰Šú‰»‚Æ‚© + * Init/Terminate *------------------------------------------*/ -int do_init_storage(void) // map.c::do_init()‚©‚çŒÄ‚΂ê‚é +int do_init_storage(void) // Called from map.c::do_init() { guild_storage_db=idb_alloc(DB_OPT_RELEASE_DATA); return 1; @@ -110,14 +110,18 @@ return 0; } -// helper function -int compare_item(struct item *a, struct item *b) +/* helper function + * checking if 2 item structure are identique + * flag : + * 1 = not checking expire_time + */ +int compare_item(struct item *a, struct item *b, short flag) { if( a->nameid == b->nameid && a->identify == b->identify && a->refine == b->refine && a->attribute == b->attribute && - a->expire_time == b->expire_time ) + (flag&1 || (a->expire_time == b->expire_time) )) { int i; for (i = 0; i < MAX_SLOTS && (a->card[i] == b->card[i]); i++); @@ -150,7 +154,7 @@ {//Stackable for( i = 0; i < MAX_STORAGE; i++ ) { - if( compare_item(&stor->items[i], item_data) ) + if( compare_item(&stor->items[i], item_data,0) ) {// existing items found, stack them if( amount > MAX_AMOUNT - stor->items[i].amount ) return 1; @@ -404,7 +408,7 @@ if(itemdb_isstackable2(data)){ //Stackable for(i=0;iitems[i], item_data)) { + if(compare_item(&stor->items[i], item_data, 0)) { if(stor->items[i].amount+amount > MAX_AMOUNT) return 1; stor->items[i].amount+=amount; Index: src/map/storage.h =================================================================== --- src/map/storage.h (revision 16039) +++ src/map/storage.h (working copy) @@ -23,6 +23,7 @@ void do_reconnect_storage(void); void storage_storage_quit(struct map_session_data *sd, int flag); +int compare_item(struct item *a, struct item *b, short flag); struct guild_storage* guild2storage(int guild_id); int guild_storage_delete(int guild_id); int storage_guild_storageopen(struct map_session_data *sd); Index: src/map/buyingstore.c =================================================================== --- src/map/buyingstore.c (revision 16039) +++ src/map/buyingstore.c (working copy) @@ -6,6 +6,7 @@ #include "../common/showmsg.h" // ShowWarning #include "../common/socket.h" // RBUF* #include "../common/strlib.h" // safestrncpy +#include "../common/nullpo.h" //security check #include "atcommand.h" // msg_txt #include "battle.h" // battle_config.* #include "buyingstore.h" // struct s_buyingstore @@ -46,6 +47,8 @@ bool buyingstore_setup(struct map_session_data* sd, unsigned char slots) { + nullpo_retr(sd,false); + if( !battle_config.feature_buying_store || sd->state.vending || sd->state.buyingstore || sd->state.trading || slots == 0 ) { return false; @@ -90,6 +93,7 @@ {// canceled, or no items return; } + nullpo_retv(sd); if( !battle_config.feature_buying_store || pc_istrading(sd) || sd->buyingstore.slots == 0 || count > sd->buyingstore.slots || zenylimit <= 0 || zenylimit > sd->status.zeny || !storename[0] ) {// disabled or invalid input Index: src/map/mob.c =================================================================== --- src/map/mob.c (revision 16039) +++ src/map/mob.c (working copy) @@ -239,12 +239,12 @@ if( i ) { - if( i&2 ) - data->state.size = SZ_MEDIUM; - else if( i&4 ) - data->state.size = SZ_BIG; - if( i&8 ) - data->state.ai = 1; + if (i&2) + data->state.size=SZ_MEDIUM; + else if (i&4) + data->state.size=SZ_BIG; + if (i&8) + data->state.ai=1; } data->eventname[0] = '\0'; //Clear event as it is not used. } @@ -2508,6 +2508,7 @@ case BL_PET: sd = ((TBL_PET*)src)->msd; break; case BL_HOM: sd = ((TBL_HOM*)src)->master; break; case BL_MER: sd = ((TBL_MER*)src)->master; break; + default : break; //unhandled type } if( sd && sd->md && src && src->type != BL_HOM && mob_db(md->class_)->lv > sd->status.base_level/2 ) @@ -2722,7 +2723,7 @@ } /*========================================== - * mob‰ñ•œ + * mob heal, permet d'update la barre d'hp d'un mob pour le joueur *------------------------------------------*/ void mob_heal(struct mob_data *md,unsigned int heal) { @@ -2763,7 +2764,7 @@ } /*========================================== - * ‰æ–Ê“à‚ÌŽæ‚芪‚«‚̐”ŒvŽZ—p(foreachinarea) + * Permet de savoir si un mob est le slave d'un mobid *------------------------------------------*/ int mob_countslave_sub(struct block_list *bl,va_list ap) { @@ -2778,7 +2779,7 @@ } /*========================================== - * ‰æ–Ê“à‚ÌŽæ‚芪‚«‚̐”ŒvŽZ + * Permet de compter le nombre de slave d'un mob sur la map *------------------------------------------*/ int mob_countslave(struct block_list *bl) { @@ -2884,7 +2885,7 @@ } /*========================================== - *MOBskill‚©‚çŠY“–skillid‚Ìskillidx‚ð•Ô‚· + * MOBskill lookup *------------------------------------------*/ int mob_skillid2skillidx(int class_,int skillid) { @@ -3896,7 +3897,7 @@ class_=atoi(str[0]); - if(mob_db(class_) == mob_dummy) // ’l‚ªˆÙí‚Ȃ珈—‚µ‚È‚¢B + if(mob_db(class_) == mob_dummy) // invalid class (probably undefined in db) { ShowWarning("mob_readdb_mobavail: Unknown mob id %d.\n", class_); return false; Index: src/map/clif.c =================================================================== --- src/map/clif.c (revision 16039) +++ src/map/clif.c (working copy) @@ -196,7 +196,7 @@ static int clif_parse (int fd); /*========================================== - * mapŽI‚ÌipÝ’è + * map?¿œI?¿œ?¿œip?¿œÝ’ï¿œ *------------------------------------------*/ int clif_setip(const char* ip) { @@ -1358,9 +1358,9 @@ case BL_MOB: { TBL_MOB *md = ((TBL_MOB*)bl); - if(md->special_state.size==2) // tiny/big mobs [Valaris] + if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris] clif_specialeffect(&md->bl,423,AREA); - else if(md->special_state.size==1) + else if(md->special_state.size==SZ_MEDIUM) clif_specialeffect(&md->bl,421,AREA); } break; @@ -1564,9 +1564,9 @@ case BL_MOB: { TBL_MOB *md = ((TBL_MOB*)bl); - if(md->special_state.size==2) // tiny/big mobs [Valaris] + if(md->special_state.size==SZ_BIG) // tiny/big mobs [Valaris] clif_specialeffect(&md->bl,423,AREA); - else if(md->special_state.size==1) + else if(md->special_state.size==SZ_MEDIUM) clif_specialeffect(&md->bl,421,AREA); } break; @@ -3161,7 +3161,7 @@ fd=sd->fd; WFIFOHEAD(fd, packet_len(0x013c)); WFIFOW(fd,0)=0x013c; - WFIFOW(fd,2)=val+2;//–î‚̃AƒCƒeƒ€ID + WFIFOW(fd,2)=val+2;//Item ID of the arrow WFIFOSET(fd,packet_len(0x013c)); } @@ -15856,7 +15856,7 @@ sd->menuskill_id = SC_AUTOSHADOWSPELL; sd->menuskill_val = c; } else { - status_change_end(&sd->bl,SC_STOP,-1); + status_change_end(&sd->bl,SC_STOP, INVALID_TIMER); clif_skill_fail(sd,SC_AUTOSHADOWSPELL,0x15,0); } Index: src/map/chat.c =================================================================== --- src/map/chat.c (revision 16039) +++ src/map/chat.c (working copy) @@ -156,11 +156,11 @@ pc_setchatid(sd,cd->bl.id); - clif_joinchatok(sd,cd); // V‚œ‚ÉŽQ‰Á‚µ‚œl‚É‚Í‘Sˆõ‚̃ŠƒXƒg - clif_addchat(cd,sd); // Šù‚É’†‚É‹‚œl‚ɂ͒ljÁ‚µ‚œl‚Ì•ñ - clif_dispchat(cd,0); // ŽüˆÍ‚̐l‚ɂ͐l”•Ï‰»•ñ + clif_joinchatok(sd,cd); //To the person who newly joined the list of all + clif_addchat(cd,sd); //Reports To the person who already in the chat + clif_dispchat(cd,0); //Reported number of changes to the people around - chat_triggerevent(cd); // ƒCƒxƒ“ƒg + chat_triggerevent(cd); //Event return 0; } @@ -372,7 +372,7 @@ } /*========================================== - * ‹K’èl”ˆÈã‚ŃCƒxƒ“ƒg‚ª’è‹`‚³‚ê‚Ä‚é‚È‚çŽÀs + * Trigger npc event when we enter the chatroom *------------------------------------------*/ int chat_triggerevent(struct chat_data *cd) { Index: src/map/mob.h =================================================================== --- src/map/mob.h (revision 16039) +++ src/map/mob.h (working copy) @@ -64,9 +64,9 @@ }; enum size { - SZ_SMALL = 0, - SZ_MEDIUM, - SZ_BIG, + SZ_SMALL = 0, + SZ_MEDIUM, + SZ_BIG, }; struct mob_skill { Index: src/map/guild.c =================================================================== --- src/map/guild.c (revision 16039) +++ src/map/guild.c (working copy) @@ -39,12 +39,12 @@ struct eventlist *next; }; -// ƒMƒ‹ƒh‚ÌEXPƒLƒƒƒbƒVƒ…‚̃tƒ‰ƒbƒVƒ…‚ÉŠÖ˜A‚·‚é’萔 -#define GUILD_SEND_XY_INVERVAL 5000 // À•W‚â‚g‚o‘—M‚ÌŠÔŠu -#define GUILD_PAYEXP_INVERVAL 10000 // ŠÔŠu(ƒLƒƒƒbƒVƒ…‚̍ő吶‘¶ŽžŠÔAƒ~ƒŠ•b) -#define GUILD_PAYEXP_LIST 8192 // ƒLƒƒƒbƒVƒ…‚̍ő吔 +//Constant related to the flash of the Guild EXP cache +#define GUILD_SEND_XY_INVERVAL 5000 // Interval of sending coordinates and HP +#define GUILD_PAYEXP_INVERVAL 10000 //Interval (maximum survival time of the cache, in milliseconds) +#define GUILD_PAYEXP_LIST 8192 //The maximum number of cache -// ƒMƒ‹ƒh‚ÌEXPƒLƒƒƒbƒVƒ… +//Guild EXP cache struct guild_expcache { int guild_id, account_id, char_id; uint64 exp; @@ -91,7 +91,7 @@ return guild_skill_tree[id-GD_SKILLBASE].max; } -// ƒMƒ‹ƒhƒXƒLƒ‹‚ª‚ ‚é‚©Šm”F +// Retrive skilllv learned by guild int guild_checkskill(struct guild *g,int id) { int idx = id-GD_SKILLBASE; @@ -110,8 +110,7 @@ skillid = atoi(split[0]); id = skillid - GD_SKILLBASE; - if( id < 0 || id >= MAX_GUILDSKILL ) - { + if (id < 0 || id >= MAX_GUILDSKILL) { ShowWarning("guild_read_guildskill_tree_db: Invalid skill id %d.\n", skillid); return false; } @@ -119,13 +118,12 @@ guild_skill_tree[id].id = skillid; guild_skill_tree[id].max = atoi(split[1]); - if( guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0 ) - {// enable guild's glory when required for emblems + if (guild_skill_tree[id].id == GD_GLORYGUILD && battle_config.require_glory_guild && guild_skill_tree[id].max == 0) { + // enable guild's glory when required for emblems guild_skill_tree[id].max = 1; } - for( k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++ ) - { + for (k = 0; k < MAX_GUILD_SKILL_REQUIRE; k++) { guild_skill_tree[id].need[k].id = atoi(split[k*2+2]); guild_skill_tree[id].need[k].lv = atoi(split[k*2+3]); } @@ -147,8 +145,7 @@ if (idx < 0 || idx >= MAX_GUILDSKILL) return 0; - for(i=0;i guild_checkskill(g,guild_skill_tree[idx].need[i].id)) return 0; @@ -261,7 +258,7 @@ return( i < g->max_member ) ? g->member[i].position : -1; } -// ƒƒ“ƒo[î•ñ‚̍쐬 +//Creation of member information void guild_makemember(struct guild_member *m,struct map_session_data *sd) { nullpo_retv(sd); @@ -283,7 +280,7 @@ } /** - * ƒMƒ‹ƒh‚ÌEXPƒLƒƒƒbƒVƒ…‚ðinterŽI‚Ƀtƒ‰ƒbƒVƒ…‚·‚é + * Server cache to be flushed to inter the Guild EXP * @see DBApply */ int guild_payexp_timer_sub(DBKey key, DBData *data, va_list ap) { @@ -392,7 +389,7 @@ return 1; } -// ì¬‰Â”Û +//Whether or not to create guilde int guild_created(int account_id,int guild_id) { struct map_session_data *sd=map_id2sd(account_id); @@ -400,7 +397,7 @@ if(sd==NULL) return 0; if(!guild_id) { - clif_guild_created(sd,2); // ì¬Žž”si“¯–ŒƒMƒ‹ƒh‘¶Ýj + clif_guild_created(sd,2); // Creation failure (presence of the same name Guild) return 0; } //struct guild *g; @@ -411,13 +408,13 @@ return 0; } -// î•ñ—v‹ +//Information request int guild_request_info(int guild_id) { return intif_guild_request_info(guild_id); } -// ƒCƒxƒ“ƒg•t‚«î•ñ—v‹ +//Information request with event int guild_npc_request_info(int guild_id,const char *event) { if( guild_search(guild_id) ) @@ -442,7 +439,7 @@ return guild_request_info(guild_id); } -// Š‘®ƒLƒƒƒ‰‚ÌŠm”F +//Confirmation of the character belongs to guild int guild_check_member(struct guild *g) { int i; @@ -469,7 +466,7 @@ return 0; } -// î•ñŠ“ŸŽž”si‚»‚ÌID‚̃Lƒƒƒ‰‚ð‘S•”–¢Š‘®‚É‚·‚éj +//Delete association with guild_id for all characters int guild_recv_noinfo(int guild_id) { struct map_session_data *sd; @@ -486,7 +483,7 @@ return 0; } -// î•ñŠ“Ÿ +//Get and display information for all member int guild_recv_info(struct guild *sg) { struct guild *g,before; @@ -504,7 +501,7 @@ idb_put(guild_db,sg->guild_id,g); before=*sg; - // Å‰‚̃[ƒh‚Ȃ̂ц[ƒU[‚̃`ƒFƒbƒN‚ðs‚€ + //Perform the check on the user because the first load guild_check_member(sg); if ((sd = map_nick2sd(sg->master)) != NULL) { @@ -539,32 +536,32 @@ bm++; } - for(i=0;imax_member;i++){ // î•ñ‚Ì‘—M + for(i=0;imax_member;i++){ //Transmission of information at all members sd = g->member[i].sd; if( sd==NULL ) continue; if( before.guild_lv!=g->guild_lv || bm!=m || before.max_member!=g->max_member ){ - clif_guild_basicinfo(sd); // Šî–{î•ñ‘—M - clif_guild_emblem(sd,g); // ƒGƒ“ƒuƒŒƒ€‘—M + clif_guild_basicinfo(sd); //Submit basic information + clif_guild_emblem(sd,g); //Submit emblem } - if(bm!=m){ // ƒƒ“ƒo[î•ñ‘—M + if(bm!=m){ //Send members information clif_guild_memberlist(g->member[i].sd); } if( before.skill_point!=g->skill_point) - clif_guild_skillinfo(sd); // ƒXƒLƒ‹î•ñ‘—M + clif_guild_skillinfo(sd); //Submit information skills - if( guild_new ){ // –¢‘—M‚Ȃ珊‘®î•ñ‚à‘—‚é + if( guild_new ){ // Send information and affiliation if unsent clif_guild_belonginfo(sd,g); clif_guild_notice(sd,g); sd->guild_emblem_id=g->emblem_id; } } - // ƒCƒxƒ“ƒg‚Ì”­¶ + //Occurrence of an event if (guild_infoevent_db->remove(guild_infoevent_db, db_i2key(sg->guild_id), &data)) { struct eventlist *ev = db_data2ptr(&data), *ev2; @@ -579,8 +576,9 @@ return 0; } - -// ƒMƒ‹ƒh‚Ö‚ÌŠ©—U +/*============================================= + * Player sd send a guild invatation to player tsd to join his guild + *--------------------------------------------*/ int guild_invite(struct map_session_data *sd,struct map_session_data *tsd) { struct guild *g; @@ -616,7 +614,7 @@ return 0; } - // ’èˆõŠm”F + //search an empty spot in guild ARR_FIND( 0, g->max_member, i, g->member[i].account_id == 0 ); if(i==g->max_member){ clif_guild_inviteack(sd,3); @@ -714,7 +712,9 @@ g->member[i].sd = sd; } -// ƒMƒ‹ƒhƒƒ“ƒo‚ª’ljÁ‚³‚ê‚œ +/*========================================== + * Add a player to a given guild_id + *----------------------------------------*/ int guild_member_added(int guild_id,int account_id,int char_id,int flag) { struct map_session_data *sd= map_id2sd(account_id),*sd2; @@ -724,7 +724,7 @@ return 0; if(sd==NULL || sd->guild_invite==0){ - // ƒLƒƒƒ‰‘€‚É“o˜^‚Å‚«‚È‚©‚Á‚œ‚œ‚ß’E‘Þ—v‹‚ðo‚· + // cancel if player not present or invalide guild_id invitation if (flag == 0) { ShowError("guild: member added error %d is not online\n",account_id); intif_guild_leave(guild_id,account_id,char_id,0,"** Data Error **"); @@ -735,13 +735,13 @@ sd->guild_invite = 0; sd->guild_invite_account = 0; - if(flag==1){ // Žž”s + if(flag==1){ //failure if( sd2!=NULL ) clif_guild_inviteack(sd2,3); return 0; } - // ¬Œ÷ + //if all ok adding player to guild sd->status.guild_id = g->guild_id; sd->guild_emblem_id = g->emblem_id; //Packets which were sent in the previous 'guild_sent' implementation. @@ -759,7 +759,9 @@ return 0; } -// ƒMƒ‹ƒh’E‘Þ—v‹ +/*========================================== + * Player request leaving a given guild_id + *----------------------------------------*/ int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes) { struct guild *g; @@ -780,7 +782,9 @@ return 0; } -// ƒMƒ‹ƒh’Ç•ú—v‹ +/*========================================== + * Request remove a player to a given guild_id + *----------------------------------------*/ int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes) { struct map_session_data *tsd; @@ -917,7 +921,7 @@ } if(idx == -1 || c == 0) { - // ƒMƒ‹ƒh‚̃ƒ“ƒo[ŠO‚È‚Ì‚Å’Ç•úˆµ‚¢‚·‚é + //Treat char_id who doesn't match guild_id (not found as member) struct map_session_data *sd = map_id2sd(account_id); if(sd && sd->status.char_id == char_id) { sd->status.guild_id=0; @@ -953,7 +957,10 @@ return 0; } -// ƒMƒ‹ƒh‰ï˜b‘—M + +/*==================================================== + * Send a message to whole guild + *---------------------------------------------------*/ int guild_send_message(struct map_session_data *sd,const char *mes,int len) { nullpo_ret(sd); @@ -968,7 +975,10 @@ return 0; } -// ƒMƒ‹ƒh‰ï˜bŽóM + +/*==================================================== + * Guild receive a message, will be displayed to whole member + *---------------------------------------------------*/ int guild_recv_message(int guild_id,int account_id,const char *mes,int len) { struct guild *g; @@ -977,12 +987,18 @@ clif_guild_message(g,account_id,mes,len); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒo‚Ì–ðE•ÏX + +/*==================================================== + * Member changing position in guild + *---------------------------------------------------*/ int guild_change_memberposition(int guild_id,int account_id,int char_id,short idx) { return intif_guild_change_memberinfo(guild_id,account_id,char_id,GMI_POSITION,&idx,sizeof(idx)); } -// ƒMƒ‹ƒhƒƒ“ƒo‚Ì–ðE•ÏX’Ê’m + +/*==================================================== + * Notification of new position for member + *---------------------------------------------------*/ int guild_memberposition_changed(struct guild *g,int idx,int pos) { nullpo_ret(g); @@ -995,7 +1011,10 @@ clif_charnameupdate(g->member[idx].sd); return 0; } -// ƒMƒ‹ƒh–ðE•ÏX + +/*==================================================== + * Change guild title or member + *---------------------------------------------------*/ int guild_change_position(int guild_id,int idx, int mode,int exp_mode,const char *name) { @@ -1009,7 +1028,10 @@ safestrncpy(p.name,name,NAME_LENGTH); return intif_guild_position(guild_id,idx,&p); } -// ƒMƒ‹ƒh–ðE•ÏX’Ê’m + +/*==================================================== + * Notification of member has changed his guild tiltle + *---------------------------------------------------*/ int guild_position_changed(int guild_id,int idx,struct guild_position *p) { struct guild *g=guild_search(guild_id); @@ -1025,7 +1047,10 @@ clif_charnameupdate(g->member[i].sd); return 0; } -// ƒMƒ‹ƒh’m•ÏX + +/*==================================================== + * Change guild notice + *---------------------------------------------------*/ int guild_change_notice(struct map_session_data *sd,int guild_id,const char *mes1,const char *mes2) { nullpo_ret(sd); @@ -1034,7 +1059,10 @@ return 0; return intif_guild_notice(guild_id,mes1,mes2); } -// ƒMƒ‹ƒh’m•ÏX’Ê’m + +/*==================================================== + * Notification of guild has changed his notice + *---------------------------------------------------*/ int guild_notice_changed(int guild_id,const char *mes1,const char *mes2) { int i; @@ -1052,7 +1080,10 @@ } return 0; } -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX + +/*==================================================== + * Change guild emblem + *---------------------------------------------------*/ int guild_change_emblem(struct map_session_data *sd,int len,const char *data) { struct guild *g; @@ -1066,7 +1097,10 @@ return intif_guild_emblem(sd->status.guild_id,len,data); } -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX’Ê’m + +/*==================================================== + * Notification of guild emblem changed + *---------------------------------------------------*/ int guild_emblem_changed(int len,int guild_id,int emblem_id,const char *data) { int i; @@ -1146,7 +1180,9 @@ return db_ptr2data(c); } -// ƒMƒ‹ƒh‚ÌEXPã”[ +/*==================================================== + * return Taxed experience from player sd to guild + *---------------------------------------------------*/ unsigned int guild_payexp(struct map_session_data *sd,unsigned int exp) { struct guild *g; @@ -1178,7 +1214,11 @@ return exp; } -// Celest +/*==================================================== + * Player sd pay a tribue experience exp to his guild + * Add this experience to guild exp + * [Celest] + *---------------------------------------------------*/ int guild_getexp(struct map_session_data *sd,int exp) { struct guild_expcache *c; @@ -1195,7 +1235,9 @@ return exp; } -// ƒXƒLƒ‹ƒ|ƒCƒ“ƒgŠ„‚èU‚è +/*==================================================== + * Ask to increase guildskill skill_num + *---------------------------------------------------*/ int guild_skillup(TBL_PC* sd, int skill_num) { struct guild* g; @@ -1216,7 +1258,10 @@ return 0; } -// ƒXƒLƒ‹ƒ|ƒCƒ“ƒgŠ„‚èU‚è’Ê’m + +/*==================================================== + * Notification of guildskill skill_num increase request + *---------------------------------------------------*/ int guild_skillupack(int guild_id,int skill_num,int account_id) { struct map_session_data *sd=map_id2sd(account_id); @@ -1263,7 +1308,14 @@ } return; } -// ƒMƒ‹ƒh“¯–¿”Š“Ÿ + + +/*==================================================== + * Count number of relation the guild have + * flag : + * 0 = allied + * 1 = ennemy + *---------------------------------------------------*/ int guild_get_alliance_count(struct guild *g,int flag) { int i,c; @@ -1302,7 +1354,9 @@ return( i < MAX_GUILDALLIANCE ) ? 1 : 0; } -// ƒMƒ‹ƒh“¯–¿—v‹ +/*==================================================== + * Player sd, asking player tsd an alliance between there 2 guild + *---------------------------------------------------*/ int guild_reqalliance(struct map_session_data *sd,struct map_session_data *tsd) { struct guild *g[2]; @@ -1343,7 +1397,7 @@ return 0; } - for(i=0;ialliance[i].guild_id==tsd->status.guild_id && g[0]->alliance[i].opposition==0){ clif_guild_allianceack(sd,0); @@ -1357,7 +1411,10 @@ clif_guild_reqalliance(tsd,sd->status.account_id,g[0]->name); return 0; } -// ƒMƒ‹ƒhŠ©—U‚Ö‚Ì•Ô“š + +/*==================================================== + * Player sd, awsser to player tsd (account_id) for an alliance request + *---------------------------------------------------*/ int guild_reply_reqalliance(struct map_session_data *sd,int account_id,int flag) { struct map_session_data *tsd; @@ -1369,13 +1426,13 @@ return 0; } - if(sd->guild_alliance!=tsd->status.guild_id) // Š©—U‚ƃMƒ‹ƒhID‚ªˆá‚€ + if(sd->guild_alliance!=tsd->status.guild_id) // proposed guild_id alliance doesn't match tsd guildid return 0; - if(flag==1){ // ³‘ø + if(flag==1){ // consent int i; - struct guild *g,*tg; // “¯–¿”ÄŠm”F + struct guild *g,*tg; // Reconfirm the number of alliance g=guild_search(sd->status.guild_id); tg=guild_search(tsd->status.guild_id); @@ -1403,11 +1460,11 @@ tsd->status.account_id,sd->status.account_id,9 ); } - // interŽI‚Ö“¯–¿—v¿ + // inform other servers intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id, sd->status.account_id,tsd->status.account_id,0 ); return 0; - }else{ // ‹‘”Û + }else{ // deny sd->guild_alliance=0; sd->guild_alliance_account=0; if(tsd!=NULL) @@ -1416,7 +1473,9 @@ return 0; } -// ƒMƒ‹ƒhŠÖŒW‰ðÁ +/*==================================================== + * Player sd asking to break alliance with guild guild_id + *---------------------------------------------------*/ int guild_delalliance(struct map_session_data *sd,int guild_id,int flag) { nullpo_ret(sd); @@ -1430,7 +1489,10 @@ return 0; } -// ƒMƒ‹ƒh“G‘Î + +/*==================================================== + * Player sd, asking player tsd a formal ennemy relation between there 2 guild + *---------------------------------------------------*/ int guild_opposition(struct map_session_data *sd,struct map_session_data *tsd) { struct guild *g; @@ -1451,9 +1513,9 @@ return 0; } - for(i=0;ialliance[i].guild_id==tsd->status.guild_id){ - if(g->alliance[i].opposition==1){ // ‚·‚Å‚É“G‘Î + if(g->alliance[i].opposition==1){ // check if not already hostile clif_guild_oppositionack(sd,2); return 0; } @@ -1465,13 +1527,15 @@ } } - // interŽI‚É“G‘Ηv¿ + // inform other serv intif_guild_alliance( sd->status.guild_id,tsd->status.guild_id, sd->status.account_id,tsd->status.account_id,1 ); return 0; } -// ƒMƒ‹ƒh“¯–¿/“G‘Î’Ê’m +/*==================================================== + * Notification of a relationship between 2 guild + *---------------------------------------------------*/ int guild_allianceack(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag,const char *name1,const char *name2) { struct guild *g[2]; @@ -1495,14 +1559,14 @@ sd[0]->guild_alliance_account=0; } - if(flag&0x70){ // Žž”s + if(flag&0x70){ // failure for(i=0;i<2-(flag&1);i++) if( sd[i]!=NULL ) clif_guild_allianceack(sd[i],((flag>>4)==i+1)?3:4); return 0; } - if(!(flag&0x08)){ // ŠÖŒW’ljÁ + if(!(flag&0x08)){ // new relationship for(i=0;i<2-(flag&1);i++) { if(g[i]!=NULL) @@ -1516,7 +1580,7 @@ } } } - }else{ // ŠÖŒW‰ðÁ + }else{ // remove relationship for(i=0;i<2-(flag&1);i++) { if(g[i]!=NULL) @@ -1525,21 +1589,21 @@ if( j < MAX_GUILDALLIANCE ) g[i]->alliance[j].guild_id = 0; } - if( sd[i]!=NULL ) // ‰ðÁ’Ê’m + if( sd[i]!=NULL ) // notify players clif_guild_delalliance(sd[i],guild_id[1-i],(flag&1)); } } - if((flag&0x0f)==0){ // “¯–¿’Ê’m + if((flag&0x0f)==0){ // alliance notification if( sd[1]!=NULL ) clif_guild_allianceack(sd[1],2); - }else if((flag&0x0f)==1){ // “G‘Î’Ê’m + }else if((flag&0x0f)==1){ // ennemy notification if( sd[0]!=NULL ) clif_guild_oppositionack(sd[0],0); } - for(i=0;i<2-(flag&1);i++){ // “¯–¿/“G‘΃ŠƒXƒg‚̍đ—M + for(i=0;i<2-(flag&1);i++){ // Retransmission of the relationship list to all members struct map_session_data *sd; if(g[i]!=NULL) for(j=0;jmax_member;j++) @@ -1549,10 +1613,9 @@ return 0; } -/** - * ƒMƒ‹ƒh‰ðŽU’Ê’m—p - * @see DBApply - */ +/*==================================================== + * Notification for the guild disbanded + *---------------------------------------------------*/ int guild_broken_sub(DBKey key, DBData *data, va_list ap) { struct guild *g = db_data2ptr(data); @@ -1562,7 +1625,7 @@ nullpo_ret(g); - for(i=0;ialliance[i].guild_id==guild_id){ for(j=0;jmax_member;j++) if( (sd=g->member[j].sd)!=NULL ) @@ -1608,7 +1671,7 @@ if(flag!=0 || g==NULL) return 0; - for(i=0;imax_member;i++){ // ƒMƒ‹ƒh‰ðŽU‚ð’Ê’m + for(i=0;imax_member;i++){ //Notification to disband the guild at all remaining member if((sd=g->member[i].sd)!=NULL){ if(sd->state.storage_flag == 2) storage_guild_storage_quit(sd,1); @@ -1700,7 +1763,10 @@ return 1; } -// ƒMƒ‹ƒh‰ðŽU + +/*==================================================== + * Guild disbanded + *---------------------------------------------------*/ int guild_break(struct map_session_data *sd,char *name) { struct guild *g; @@ -1893,6 +1959,9 @@ return 0; } +/*==================================================== + * Start normal woe and triggers all npc OnAgitStart + *---------------------------------------------------*/ int guild_agit_start(void) { // Run All NPC_Event[OnAgitStart] int c = npc_event_doall("OnAgitStart"); @@ -1900,6 +1969,9 @@ return 0; } +/*==================================================== + * End normal woe and triggers all npc OnAgitEnd + *---------------------------------------------------*/ int guild_agit_end(void) { // Run All NPC_Event[OnAgitEnd] int c = npc_event_doall("OnAgitEnd"); @@ -1907,6 +1979,9 @@ return 0; } +/*==================================================== + * Start woe2 and triggers all npc OnAgitStart2 + *---------------------------------------------------*/ int guild_agit2_start(void) { // Run All NPC_Event[OnAgitStart2] int c = npc_event_doall("OnAgitStart2"); @@ -1914,6 +1989,9 @@ return 0; } +/*==================================================== + * End woe2 and triggers all npc OnAgitEnd2 + *---------------------------------------------------*/ int guild_agit2_end(void) { // Run All NPC_Event[OnAgitEnd2] int c = npc_event_doall("OnAgitEnd2"); Index: src/map/itemdb.c =================================================================== --- src/map/itemdb.c (revision 16039) +++ src/map/itemdb.c (working copy) @@ -50,7 +50,7 @@ } /*========================================== - * –Œ‘O‚ÅŒŸõ + * Retourne l'item data a partir du nom de l'item. *------------------------------------------*/ struct item_data* itemdb_searchname(const char *str) { @@ -135,7 +135,7 @@ /*========================================== - * ” ŒnƒAƒCƒeƒ€ŒŸõ + * Retourne un item id random appartenant au groupe. *------------------------------------------*/ int itemdb_searchrandomid(int group) { @@ -584,7 +584,7 @@ } /*========================================== - * ‘•”õ§ŒÀƒtƒ@ƒCƒ‹“ǂݏo‚µ + * Read item forbiden by mapflag restricted *------------------------------------------*/ static bool itemdb_read_noequip(char* str[], int columns, int current) {// , @@ -870,7 +870,8 @@ } /*========================================== - * ƒAƒCƒeƒ€ƒf[ƒ^ƒx[ƒX‚̓ǂݍž‚Ý + * Reading item from item db + * item_db2 overwriting item_db *------------------------------------------*/ static int itemdb_readdb(void) { Index: src/map/intif.c =================================================================== --- src/map/intif.c (revision 16039) +++ src/map/intif.c (working copy) @@ -46,11 +46,11 @@ -1,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator] }; -extern int char_fd; // inter server‚Ìfd‚Íchar_fd‚ðŽg‚€ -#define inter_fd char_fd // ƒGƒCƒŠƒAƒX +extern int char_fd; // inter server Fd used for char_fd +#define inter_fd char_fd // alias //----------------------------------------------------------------- -// inter server‚Ö‚Ì‘—M +// Send to inter server int CheckForCharServer(void) { @@ -136,7 +136,7 @@ return 0; } -// GMƒƒbƒZ[ƒW‚𑗐M +// GM Send a message int intif_broadcast(const char* mes, int len, int type) { int lp = type ? 4 : 0; @@ -386,7 +386,7 @@ return 0; } -// ƒp[ƒeƒBì¬—v‹ +// Party creation request int intif_create_party(struct party_member *member,char *name,int item,int item2) { if (CheckForCharServer()) @@ -403,7 +403,8 @@ WFIFOSET(inter_fd,WFIFOW(inter_fd, 2)); return 0; } -// ƒp[ƒeƒBî•ñ—v‹ + +// Party information request int intif_request_partyinfo(int party_id, int char_id) { if (CheckForCharServer()) @@ -415,7 +416,8 @@ WFIFOSET(inter_fd,10); return 0; } -// ƒp[ƒeƒB’ljÁ—v‹ + +// Request to add a member to party int intif_party_addmember(int party_id,struct party_member *member) { if (CheckForCharServer()) @@ -428,7 +430,8 @@ WFIFOSET(inter_fd,WFIFOW(inter_fd, 2)); return 1; } -// ƒp[ƒeƒBÝ’è•ÏX + +// Request to change party configuration (exp,item share) int intif_party_changeoption(int party_id,int account_id,int exp,int item) { if (CheckForCharServer()) @@ -442,7 +445,8 @@ WFIFOSET(inter_fd,14); return 0; } -// ƒp[ƒeƒB’E‘Þ—v‹ + +// Request to leave party int intif_party_leave(int party_id,int account_id, int char_id) { if (CheckForCharServer()) @@ -455,7 +459,8 @@ WFIFOSET(inter_fd,14); return 0; } -// ƒp[ƒeƒBˆÚ“®—v‹ + +// Request keeping party for new map ?? int intif_party_changemap(struct map_session_data *sd,int online) { int m, mapindex; @@ -481,7 +486,8 @@ WFIFOSET(inter_fd,19); return 1; } -// ƒp[ƒeƒB[‰ðŽU—v‹ + +// Request breaking party int intif_break_party(int party_id) { if (CheckForCharServer()) @@ -492,7 +498,8 @@ WFIFOSET(inter_fd,6); return 0; } -// ƒp[ƒeƒB‰ï˜b‘—M + +// Sending party chat int intif_party_message(int party_id,int account_id,const char *mes,int len) { if (CheckForCharServer()) @@ -511,6 +518,7 @@ return 0; } +// Request a new leader for party int intif_party_leaderchange(int party_id,int account_id,int char_id) { if (CheckForCharServer()) @@ -524,8 +532,7 @@ return 0; } - -// ƒMƒ‹ƒhì¬—v‹ +// Request a Guild creation int intif_guild_create(const char *name,const struct guild_member *master) { if (CheckForCharServer()) @@ -541,7 +548,8 @@ WFIFOSET(inter_fd,WFIFOW(inter_fd,2)); return 0; } -// ƒMƒ‹ƒhî•ñ—v‹ + +// Request Guild information int intif_guild_request_info(int guild_id) { if (CheckForCharServer()) @@ -552,7 +560,8 @@ WFIFOSET(inter_fd,6); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒo’ljÁ—v‹ + +// Request to add member to the guild int intif_guild_addmember(int guild_id,struct guild_member *m) { if (CheckForCharServer()) @@ -566,6 +575,7 @@ return 0; } +// Request a new leader for guild int intif_guild_change_gm(int guild_id, const char* name, int len) { if (CheckForCharServer()) @@ -579,7 +589,7 @@ return 0; } -// ƒMƒ‹ƒhƒƒ“ƒo’E‘Þ/’Ç•ú—v‹ +// Request to leave guild int intif_guild_leave(int guild_id,int account_id,int char_id,int flag,const char *mes) { if (CheckForCharServer()) @@ -594,7 +604,8 @@ WFIFOSET(inter_fd,55); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒo‚̃Iƒ“ƒ‰ƒCƒ“ó‹µ/LvXV—v‹ + +//Update request / Lv online status of the guild members int intif_guild_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_) { if (CheckForCharServer()) @@ -610,7 +621,8 @@ WFIFOSET(inter_fd,19); return 0; } -// ƒMƒ‹ƒh‰ðŽU’Ê’m + +//Guild disbanded notification int intif_guild_break(int guild_id) { if (CheckForCharServer()) @@ -621,7 +633,8 @@ WFIFOSET(inter_fd,6); return 0; } -// ƒMƒ‹ƒh‰ï˜b‘—M + +// Send a guild message int intif_guild_message(int guild_id,int account_id,const char *mes,int len) { if (CheckForCharServer()) @@ -640,7 +653,8 @@ return 0; } -// ƒMƒ‹ƒhŠî–{î•ñ•ÏX—v‹ + +// Request a change of Guild basic information int intif_guild_change_basicinfo(int guild_id,int type,const void *data,int len) { if (CheckForCharServer()) @@ -654,7 +668,8 @@ WFIFOSET(inter_fd,len+10); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒoî•ñ•ÏX—v‹ + +// Request a change of Guild member information int intif_guild_change_memberinfo(int guild_id,int account_id,int char_id, int type,const void *data,int len) { @@ -671,7 +686,8 @@ WFIFOSET(inter_fd,len+18); return 0; } -// ƒMƒ‹ƒh–ðE•ÏX—v‹ + +// Request a change of Guild title int intif_guild_position(int guild_id,int idx,struct guild_position *p) { if (CheckForCharServer()) @@ -685,7 +701,8 @@ WFIFOSET(inter_fd,WFIFOW(inter_fd,2)); return 0; } -// ƒMƒ‹ƒhƒXƒLƒ‹ƒAƒbƒv—v‹ + +// Request an update of Guildskill skillnum int intif_guild_skillup(int guild_id, int skill_num, int account_id, int max) { if( CheckForCharServer() ) @@ -699,7 +716,8 @@ WFIFOSET(inter_fd, 18); return 0; } -// ƒMƒ‹ƒh“¯–¿/“G‘Ηv‹ + +// Request a new guild relationship int intif_guild_alliance(int guild_id1,int guild_id2,int account_id1,int account_id2,int flag) { if (CheckForCharServer()) @@ -714,7 +732,8 @@ WFIFOSET(inter_fd,19); return 0; } -// ƒMƒ‹ƒh’m•ÏX—v‹ + +// Request to change guild notice int intif_guild_notice(int guild_id,const char *mes1,const char *mes2) { if (CheckForCharServer()) @@ -727,7 +746,8 @@ WFIFOSET(inter_fd,186); return 0; } -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX—v‹ + +// Request to change guild emblem int intif_guild_emblem(int guild_id,int len,const char *data) { if (CheckForCharServer()) @@ -761,7 +781,8 @@ return 1; } -//ƒMƒ‹ƒhéè—̃Mƒ‹ƒh•ÏX—v‹ + +// Request change castle guild owner and save data int intif_guild_castle_datasave(int castle_id,int index, int value) { if (CheckForCharServer()) @@ -868,7 +889,7 @@ } //Success to send whisper. clif_wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56); - intif_wis_replay(id,0); // ‘—M¬Œ÷ + intif_wis_replay(id,0); // succes return 0; } @@ -925,7 +946,7 @@ return 0; } -// ƒAƒJƒEƒ“ƒg•Ï”’Ê’m +// Request player registre int intif_parse_Registers(int fd) { int j,p,len,max, flag; @@ -1017,13 +1038,15 @@ storage_guild_storageopen(sd); return 0; } + +// ACK guild_storage saved int intif_parse_SaveGuildStorage(int fd) { storage_guild_storagesaved(/*RFIFOL(fd,2), */RFIFOL(fd,6)); return 0; } -// ƒp[ƒeƒBì¬‰Â”Û +// ACK party creation int intif_parse_PartyCreated(int fd) { if(battle_config.etc_log) @@ -1031,7 +1054,8 @@ party_created(RFIFOL(fd,2), RFIFOL(fd,6),RFIFOB(fd,10),RFIFOL(fd,11), (char *)RFIFOP(fd,15)); return 0; } -// ƒp[ƒeƒBî•ñ + +// Receive party info int intif_parse_PartyInfo(int fd) { if( RFIFOW(fd,2) == 12 ){ @@ -1045,7 +1069,8 @@ party_recv_info((struct party *)RFIFOP(fd,8), RFIFOL(fd,4)); return 0; } -// ƒp[ƒeƒB’ljÁ’Ê’m + +// ACK adding party member int intif_parse_PartyMemberAdded(int fd) { if(battle_config.etc_log) @@ -1053,13 +1078,15 @@ party_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10), RFIFOB(fd, 14)); return 0; } -// ƒp[ƒeƒBÝ’è•ÏX’Ê’m + +// ACK changing party option int intif_parse_PartyOptionChanged(int fd) { party_optionchanged(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOW(fd,10),RFIFOW(fd,12),RFIFOB(fd,14)); return 0; } -// ƒp[ƒeƒB’E‘Þ’Ê’m + +// ACK member leaving party int intif_parse_PartyMemberWithdraw(int fd) { if(battle_config.etc_log) @@ -1067,32 +1094,36 @@ party_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); return 0; } -// ƒp[ƒeƒB‰ðŽU’Ê’m + +// ACK party break int intif_parse_PartyBroken(int fd) { party_broken(RFIFOL(fd,2)); return 0; } -// ƒp[ƒeƒBˆÚ“®’Ê’m + +// ACK party on new map int intif_parse_PartyMove(int fd) { party_recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17)); return 0; } -// ƒp[ƒeƒBƒƒbƒZ[ƒW + +// ACK party messages int intif_parse_PartyMessage(int fd) { party_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12); return 0; } -// ƒMƒ‹ƒhì¬‰Â”Û +// ACK guild creation int intif_parse_GuildCreated(int fd) { guild_created(RFIFOL(fd,2),RFIFOL(fd,6)); return 0; } -// ƒMƒ‹ƒhî•ñ + +// ACK guild infos int intif_parse_GuildInfo(int fd) { if(RFIFOW(fd,2) == 8) { @@ -1100,12 +1131,14 @@ guild_recv_noinfo(RFIFOL(fd,4)); return 0; } + if( RFIFOW(fd,2)!=sizeof(struct guild)+4 ) ShowError("intif: guild info : data size error Gid: %d recv size: %d Expected size: %d\n",RFIFOL(fd,4),RFIFOW(fd,2),sizeof(struct guild)+4); guild_recv_info((struct guild *)RFIFOP(fd,4)); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒo’ljÁ’Ê’m + +// ACK adding guild member int intif_parse_GuildMemberAdded(int fd) { if(battle_config.etc_log) @@ -1113,20 +1146,22 @@ guild_member_added(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14)); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒo’E‘Þ/’Ç•ú’Ê’m + +// ACK member leaving guild int intif_parse_GuildMemberWithdraw(int fd) { guild_member_withdraw(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),(char *)RFIFOP(fd,55),(char *)RFIFOP(fd,15)); return 0; } -// ƒMƒ‹ƒhƒƒ“ƒoƒIƒ“ƒ‰ƒCƒ“ó‘Ô/Lv•ÏX’Ê’m +// ACK guild member basic info int intif_parse_GuildMemberInfoShort(int fd) { guild_recv_memberinfoshort(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOB(fd,14),RFIFOW(fd,15),RFIFOW(fd,17)); return 0; } -// ƒMƒ‹ƒh‰ðŽU’Ê’m + +// ACK guild break int intif_parse_GuildBroken(int fd) { guild_broken(RFIFOL(fd,2),RFIFOB(fd,6)); @@ -1189,7 +1224,7 @@ return 0; } -// ƒMƒ‹ƒh–ðE•ÏX’Ê’m +// ACK change of guild title int intif_parse_GuildPosition(int fd) { if( RFIFOW(fd,2)!=sizeof(struct guild_position)+12 ) @@ -1197,54 +1232,61 @@ guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12)); return 0; } -// ƒMƒ‹ƒhƒXƒLƒ‹Š„‚èU‚è’Ê’m + +// ACK change of guild skill update int intif_parse_GuildSkillUp(int fd) { guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); return 0; } -// ƒMƒ‹ƒh“¯–¿/“G‘Î’Ê’m + +// ACK change of guild relationship int intif_parse_GuildAlliance(int fd) { guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43)); return 0; } -// ƒMƒ‹ƒh’m•ÏX’Ê’m + +// ACK change of guild notice int intif_parse_GuildNotice(int fd) { guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66)); return 0; } -// ƒMƒ‹ƒhƒGƒ“ƒuƒŒƒ€•ÏX’Ê’m + +// ACK change of guild emblem int intif_parse_GuildEmblem(int fd) { guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12)); return 0; } -// ƒMƒ‹ƒh‰ï˜bŽóM + +// ACK guild message int intif_parse_GuildMessage(int fd) { guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12); return 0; } -// ƒMƒ‹ƒhéƒf[ƒ^—v‹•ÔM +// Reply guild castle data request int intif_parse_GuildCastleDataLoad(int fd) { return guild_castledataloadack(RFIFOW(fd,2), (struct guild_castle *)RFIFOP(fd,4)); } +// ACK change of guildmaster int intif_parse_GuildMasterChanged(int fd) { return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); } -// pet +// Request pet creation int intif_parse_CreatePet(int fd) { pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6)); return 0; } +// ACK pet data int intif_parse_RecvPetData(int fd) { struct s_pet p; @@ -1261,6 +1303,8 @@ return 0; } + +// ACK pet save data int intif_parse_SavePetOk(int fd) { if(RFIFOB(fd,6) == 1) @@ -1269,6 +1313,7 @@ return 0; } +// ACK deleting pet int intif_parse_DeletePetOk(int fd) { if(RFIFOB(fd,2) == 1) @@ -1277,6 +1322,7 @@ return 0; } +// ACK changing name resquest, players,pets,hommon int intif_parse_ChangeNameOk(int fd) { struct map_session_data *sd = NULL; @@ -2112,19 +2158,19 @@ } //----------------------------------------------------------------- -// inter server‚©‚ç‚̒ʐM -// ƒGƒ‰[‚ª‚ ‚ê‚Î0(false)‚ð•Ô‚·‚±‚Æ -// ƒpƒPƒbƒg‚ªˆ—‚Å‚«‚ê‚Î1,ƒpƒPƒbƒg’·‚ª‘«‚è‚È‚¯‚ê‚Î2‚ð•Ô‚·‚±‚Æ +// Communication from the inter server +// Return a 0 (false) if there were any errors. +// 1, 2 if there are not enough to return the length of the packet if the packet processing int intif_parse(int fd) { int packet_len, cmd; cmd = RFIFOW(fd,0); - // ƒpƒPƒbƒg‚ÌIDŠm”F + // Verify ID of the packet if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) || packet_len_table[cmd-0x3800]==0){ return 0; } - // ƒpƒPƒbƒg‚Ì’·‚³Šm”F + // Check the length of the packet packet_len = packet_len_table[cmd-0x3800]; if(packet_len==-1){ if(RFIFOREST(fd)<4) @@ -2134,7 +2180,7 @@ if((int)RFIFOREST(fd)strdb_foreach * called from npc_parse_script *------------------------------------------*/ int npc_timerevent_export(struct npc_data *nd, int i) @@ -1060,7 +1060,7 @@ } /*========================================== - * NPC‚̃I[ƒvƒ“ƒ`ƒƒƒbƒg”­ŒŸ + * NPC I guess something like npctalk *------------------------------------------*/ int npc_globalmessage(const char* name, const char* mes) { @@ -1102,7 +1102,7 @@ } /*========================================== - * ƒNƒŠƒbƒNŽž‚ÌNPCˆ— + * NPC 1st call when clicking on npc *------------------------------------------*/ int npc_click(struct map_session_data* sd, struct npc_data* nd) { Index: src/map/status.c =================================================================== --- src/map/status.c (revision 16039) +++ src/map/status.c (working copy) @@ -62,7 +62,7 @@ int randombonus_max[MAX_REFINE]; // cumulative maximum random bonus damage } refine_info[REFINE_TYPE_MAX]; -static int atkmods[3][MAX_WEAPON_TYPE]; // •ŠíATKƒTƒCƒYC³(size_fix.txt) +static int atkmods[3][MAX_WEAPON_TYPE]; // ᅵᅵᅵᅵATKï¿œTï¿œCï¿œYï¿œCᅵᅵ(size_fix.txt) static char job_bonus[CLASS_COUNT][MAX_LEVEL]; #ifdef RENEWAL enum { @@ -1107,7 +1107,7 @@ status_change_end(target, SC_BERSERK, INVALID_TIMER); if( sc->data[SC_RAISINGDRAGON] && status->hp <= 1000 ) status_change_end(target, SC_RAISINGDRAGON, INVALID_TIMER); - if (sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100) + if( sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100 ) status_change_end(target, SC_SATURDAYNIGHTFEVER, INVALID_TIMER); } @@ -1118,6 +1118,8 @@ case BL_HOM: merc_damage((TBL_HOM*)target,src,hp,sp); break; case BL_MER: mercenary_damage((TBL_MER*)target,src,hp,sp); break; case BL_ELEM: elemental_damage((TBL_ELEM*)target,src,hp,sp); break; + default: //Unhandled case, do nothing to object. + break; } if( target->type == BL_PC && ((TBL_PC*)target)->disguise && src ) @@ -1282,6 +1284,9 @@ case BL_HOM: merc_hom_heal((TBL_HOM*)bl,hp,sp); break; case BL_MER: mercenary_heal((TBL_MER*)bl,hp,sp); break; case BL_ELEM: elemental_heal((TBL_ELEM*)bl,hp,sp); break; + default: + ShowWarning("Invalid bl type=%d in status_heal\n",bl->type); + break; } return hp+sp; @@ -1388,6 +1393,9 @@ case BL_PC: pc_revive((TBL_PC*)bl, hp, sp); break; case BL_MOB: mob_revive((TBL_MOB*)bl, hp); break; case BL_HOM: merc_hom_revive((TBL_HOM*)bl, hp, sp); break; + default: + ShowWarning("Invalid bl type=%d in status_revive\n",bl->type); + break; } return 1; } @@ -1554,8 +1562,8 @@ } } - - if (sc && sc->option) + // Check for src's status changes + if( sc && sc->option ) { if (sc->option&OPTION_HIDE) switch (skill_num) { //Usable skills while hiding. @@ -1581,6 +1589,7 @@ tsc = status_get_sc(target); + // Check for target's status changes. if(tsc && tsc->count) { if( tsc->data[SC_INVINCIBLE] ) return 0; @@ -1947,7 +1956,7 @@ if (flag&2) { // change for sized monsters [Valaris] - if (md->special_state.size==1) { + if (md->special_state.size==SZ_MEDIUM) { status->max_hp>>=1; status->max_sp>>=1; if (!status->max_hp) status->max_hp = 1; @@ -1966,7 +1975,7 @@ if (!status->int_) status->int_ = 1; if (!status->dex) status->dex = 1; if (!status->luk) status->luk = 1; - } else if (md->special_state.size==2) { + } else if (md->special_state.size==SZ_BIG) { status->max_hp<<=1; status->max_sp<<=1; status->hp=status->max_hp; @@ -2167,7 +2176,7 @@ b_weight = sd->weight; b_max_weight = sd->max_weight; - pc_calc_skilltree(sd); // ƒXƒLƒ‹ƒcƒŠ?‚ÌŒvŽZ + pc_calc_skilltree(sd); // ï¿œXï¿œLᅵᅵᅵcᅵᅵ?ᅵ̌vï¿œZ sd->max_weight = max_weight_base[pc_class2idx(sd->status.class_)]+sd->status.str*300; @@ -3703,6 +3712,9 @@ case BL_HOM: status_calc_homunculus_(BL_CAST(BL_HOM,bl), first); break; case BL_MER: status_calc_mercenary_(BL_CAST(BL_MER,bl), first); break; case BL_ELEM: status_calc_elemental_(BL_CAST(BL_ELEM,bl), first); break; + default: + ShowWarning("Invalid bl type=%d in status_calc_bl_ and flag&SCB_BASE\n",bl->type); + break; } } @@ -5113,7 +5125,8 @@ static unsigned short status_calc_mode(struct block_list *bl, struct status_change *sc, int mode) { if(!sc || !sc->count) - return mode; + return cap_value(mode,0,USHRT_MAX); + if(sc->data[SC_MODECHANGE]) { if (sc->data[SC_MODECHANGE]->val2) mode = sc->data[SC_MODECHANGE]->val2; //Set mode @@ -5128,22 +5141,26 @@ const char* status_get_name(struct block_list *bl) { nullpo_ret(bl); switch (bl->type) { - case BL_PC: return ((TBL_PC *)bl)->fakename[0] != '\0' ? ((TBL_PC*)bl)->fakename : ((TBL_PC*)bl)->status.name; - case BL_MOB: return ((TBL_MOB*)bl)->name; - case BL_PET: return ((TBL_PET*)bl)->pet.name; - case BL_HOM: return ((TBL_HOM*)bl)->homunculus.name; - case BL_NPC: return ((TBL_NPC*)bl)->name; + case BL_PC: return ((TBL_PC *)bl)->fakename[0] != '\0' ? ((TBL_PC*)bl)->fakename : ((TBL_PC*)bl)->status.name; + case BL_MOB: return ((TBL_MOB*)bl)->name; + case BL_PET: return ((TBL_PET*)bl)->pet.name; + case BL_HOM: return ((TBL_HOM*)bl)->homunculus.name; + case BL_NPC: return ((TBL_NPC*)bl)->name; + default: + ShowError("Invalide type=%d in status_get_name\n",bl->type); } return "Unknown"; } /*========================================== - * ‘ΏۂÌClass‚ð•Ô‚·(”Ä—p) - * –ß‚è‚͐®”‚Å0ˆÈã + * Hookup de la class d'un bl. + * Donne l'id de la classe *------------------------------------------*/ -int status_get_class(struct block_list *bl) { +int status_get_class(struct block_list *bl) +{ nullpo_ret(bl); - switch( bl->type ) { + switch( bl->type ) + { case BL_PC: return ((TBL_PC*)bl)->status.class_; case BL_MOB: return ((TBL_MOB*)bl)->vd->class_; //Class used on all code should be the view class of the mob. case BL_PET: return ((TBL_PET*)bl)->pet.class_; @@ -5151,14 +5168,17 @@ case BL_MER: return ((TBL_MER*)bl)->mercenary.class_; case BL_NPC: return ((TBL_NPC*)bl)->class_; case BL_ELEM: return ((TBL_ELEM*)bl)->elemental.class_; + default: + ShowError("Invalide type=%d in status_get_class\n",bl->type); } return 0; } /*========================================== - * ‘Ώۂ̃Œƒxƒ‹‚ð•Ô‚·(”Ä—p) - * –ß‚è‚͐®”‚Å0ˆÈã + * Avoir les battle_calc status d'un bl, hookup pour tous les type. + * Permet des fonction general sans extra switch *------------------------------------------*/ -int status_get_lv(struct block_list *bl) { +int status_get_lv(struct block_list *bl) +{ nullpo_ret(bl); switch (bl->type) { case BL_PC: return ((TBL_PC*)bl)->status.base_level; @@ -5167,6 +5187,8 @@ case BL_HOM: return ((TBL_HOM*)bl)->homunculus.level; case BL_MER: return ((TBL_MER*)bl)->db->lv; case BL_ELEM: return ((TBL_ELEM*)bl)->db->lv; + default: + ShowError("Invalide type=%d in status_get_lv\n",bl->type); } return 1; } @@ -5265,6 +5287,8 @@ if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->status.party_id; break; + default: + ShowWarning("Invalid bl type=%x in status_get_party_id\n",bl->type); } return 0; } @@ -5305,6 +5329,9 @@ if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->status.guild_id; break; + default: + ShowWarning("Invalid bl type=%x in status_get_guild_id\n",bl->type); + } return 0; } @@ -5346,6 +5373,9 @@ if (((TBL_ELEM*)bl)->master) return ((TBL_ELEM*)bl)->master->guild_emblem_id; break; + default: + ShowWarning("Invalid bl type=%x in status_get_emblem_id\n",bl->type); + } return 0; } @@ -5353,19 +5383,23 @@ int status_get_mexp(struct block_list *bl) { nullpo_ret(bl); - if(bl->type==BL_MOB) - return ((struct mob_data *)bl)->db->mexp; - if(bl->type==BL_PET) - return ((struct pet_data *)bl)->db->mexp; + switch(bl->type){ + case BL_MOB: return ((struct mob_data *)bl)->db->mexp; + case BL_PET: return ((struct pet_data *)bl)->db->mexp; + default: + ShowWarning("Invalid bl type=%x in status_get_mexp\n",bl->type); + } return 0; } int status_get_race2(struct block_list *bl) { nullpo_ret(bl); - if(bl->type == BL_MOB) - return ((struct mob_data *)bl)->db->race2; - if(bl->type==BL_PET) - return ((struct pet_data *)bl)->db->race2; + switch(bl->type){ + case BL_MOB: return ((struct mob_data *)bl)->db->race2; + case BL_PET: return ((struct pet_data *)bl)->db->race2; + default: + ShowWarning("Invalid bl type=%x in status_get_race2\n",bl->type); + } return 0; } @@ -5398,6 +5432,8 @@ case BL_HOM: return ((TBL_HOM*)bl)->vd; case BL_MER: return ((TBL_MER*)bl)->vd; case BL_ELEM: return ((TBL_ELEM*)bl)->vd; + default: + ShowWarning("Invalid bl type=%x in status_get_viewdata\n",bl->type); } return NULL; } @@ -5531,7 +5567,9 @@ else ShowError("status_set_viewdata (ELEMENTAL): No view data for class %d\n", class_); } - break; + break; + default: + ShowWarning("Invalid bl type=%x in status_set_viewdata\n",bl->type); } vd = status_get_viewdata(bl); if (vd && vd->cloth_color && ( @@ -5552,6 +5590,8 @@ case BL_HOM: return &((TBL_HOM*)bl)->sc; case BL_MER: return &((TBL_MER*)bl)->sc; case BL_ELEM: return &((TBL_ELEM*)bl)->sc; + default: + ShowWarning("invalide bl type=%x in status_get_sc\n"); } return NULL; } @@ -5608,6 +5648,8 @@ case SC__UNLUCKY: case SC__WEAKNESS: return 0; + default: //let.s continue if not + break; } sd = BL_CAST(BL_PC,bl); @@ -5735,8 +5777,9 @@ } } - if (sc) { - if (sc->data[SC_SCRESIST]) + if( sc && sc->count ) + { + if( sc->data[SC_SCRESIST] ) sc_def += sc->data[SC_SCRESIST]->val1; //Status resist else if (sc->data[SC_SIEGFRIED]) sc_def += sc->data[SC_SIEGFRIED]->val3; //Status resistance. @@ -5842,6 +5885,7 @@ case SC_DEEPSLEEP: case SC_MANDRAGORA: return 0; + default: break; //continue } } else if( sc->data[SC_INSPIRATION] ) { @@ -5865,6 +5909,7 @@ case SC__BODYPAINT: case SC__IGNORANCE: return 0; + default: break; //continue } } @@ -6174,6 +6219,7 @@ case SC_MAGNETICFIELD: return 0; + default: break; //continue } } @@ -6376,6 +6422,7 @@ if( type != SC_GT_CHANGE ) status_change_end(bl, SC_GT_CHANGE, INVALID_TIMER); break; + default: break; //our status doesn't end another one continue } //Check for overlapping fails @@ -6738,7 +6785,7 @@ status_zap(bl, diff, 0); } // fall through - case SC_POISON: /* “Å */ + case SC_POISON: /* ᅵᅵ */ val3 = tick/1000; //Damage iterations if(val3 < 1) val3 = 1; tick_time = 1000; // [GodLesZ] tick time @@ -6811,7 +6858,7 @@ else val4 |= battle_config.monster_cloak_check_type&7; break; - case SC_SIGHT: /* ƒTƒCƒg/ƒ‹ƒAƒt */ + case SC_SIGHT: /* ï¿œTï¿œCï¿œg/ᅵᅵᅵAï¿œt */ case SC_RUWACH: case SC_SIGHTBLASTER: val3 = skill_get_splash(val2, val1); //Val2 should bring the skill-id. @@ -7873,6 +7920,7 @@ if (battle_config.sc_castcancel&bl->type) unit_skillcastcancel(bl, 0); break; + default: break; //continue } // Set option as needed. @@ -8149,6 +8197,7 @@ case SC_RAISINGDRAGON: sce->val2 = status->max_hp / 100;// Officially tested its 1%hp drain. [Jobbie] break; + default: break; //continue } if( opt_flag&2 && sd && sd->touching_id ) @@ -8157,7 +8206,8 @@ return 1; } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙí‘S‰ðœ + * Ending all status except those listed. + * @TODO maybe usefull for dispel instead reseting a liste there. * type: * 0 - ??? * 1 - ??? @@ -8246,7 +8296,7 @@ } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙíI—¹ + * Special condition we want to effectuate, check before ending a status. *------------------------------------------*/ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line) { @@ -8294,6 +8344,7 @@ sce->timer = add_timer(gettick()+10, status_change_timer, bl->id, type); return 1; } + default: break; //continue } } @@ -8629,7 +8680,7 @@ struct unit_data *ud = unit_bl2ud(bl); if (ud) { ud->state.running = 0; - if (ud->walktimer != -1) + if (ud->walktimer != INVALID_TIMER) unit_stop_walking(bl,1); } } @@ -8689,6 +8740,7 @@ case SC_CURSEDCIRCLE_TARGET: clif_bladestop(bl, sce->val2, 0); break; + default: break; //continue } opt_flag = 1; @@ -8912,7 +8964,8 @@ } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙíI—¹ƒ^ƒCƒ}[ + * For recusive status, like for each 5s we drop sp etc. + * Reseting the end timer. *------------------------------------------*/ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data) { @@ -9108,7 +9161,7 @@ } break; - case SC_DANCING: //ƒ_ƒ“ƒXƒXƒLƒ‹‚ÌŽžŠÔSPÁ”ï + case SC_DANCING: //ï¿œ_ᅵᅵᅵXï¿œXï¿œLᅵᅵᅵ̎ᅵᅵᅵSPᅵᅵᅵᅵ { int s = 0; int sp = 1; @@ -9661,8 +9714,8 @@ { struct block_list *s_bl = battle_get_master(bl); if( s_bl ) - status_change_end(s_bl,type+1,INVALID_TIMER); - status_change_end(bl,type,INVALID_TIMER); + status_change_end(s_bl,type+1, INVALID_TIMER); + status_change_end(bl,type, INVALID_TIMER); break; } sc_timer_next(2000 + tick, status_change_timer, bl->id, data); @@ -9690,6 +9743,7 @@ /* they only end by status_change_end */ sc_timer_next(600000 + tick, status_change_timer, bl->id, data); return 0; + default: break; //continue } // default for all non-handled control paths is to end the status @@ -9698,7 +9752,7 @@ } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙíƒ^ƒCƒ}[”͈͏ˆ— + * ï¿œXï¿œeï¿œ[ï¿œ^ï¿œXᅵُᅵ^ï¿œCï¿œ}ï¿œ[ᅵ͈͏ᅵᅵᅵ *------------------------------------------*/ int status_change_timer_sub(struct block_list* bl, va_list ap) { @@ -9715,7 +9769,7 @@ tsc = status_get_sc(bl); switch( type ) { - case SC_SIGHT: /* ƒTƒCƒg */ + case SC_SIGHT: /* Reveal hidden ennemy on 3*3 range */ case SC_CONCENTRATE: status_change_end(bl, SC_HIDING, INVALID_TIMER); status_change_end(bl, SC_CLOAKING, INVALID_TIMER); @@ -9723,7 +9777,7 @@ status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER); status_change_end(bl, SC__INVISIBILITY, INVALID_TIMER); break; - case SC_RUWACH: /* ƒ‹ƒAƒt */ + case SC_RUWACH: /* Reveal hidden target and deal little dammages if ennemy */ if (tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || tsc->data[SC_CAMOUFLAGE] || tsc->data[SC_CLOAKINGEXCEED] || tsc->data[SC__INVISIBILITY])) { @@ -9756,6 +9810,8 @@ status_change_end(bl, type, INVALID_TIMER); } break; + default: + ShowWarning("Invalid statuc sc=%d in status_change_timer_sub\n",type); } return 0; } @@ -10203,8 +10259,7 @@ class_ = atoi(fields[0]); - if(!pcdb_checkid(class_)) - { + if(!pcdb_checkid(class_)) { ShowWarning("status_readdb_job1: Invalid job class %d specified.\n", class_); return false; } @@ -10337,7 +10392,7 @@ } /*========================================== - * ƒXƒLƒ‹ŠÖŒW‰Šú‰»ˆ— + * Creation et destruction de la db des status. *------------------------------------------*/ int do_init_status(void) { Index: src/map/status.h =================================================================== --- src/map/status.h (revision 16039) +++ src/map/status.h (working copy) @@ -1279,7 +1279,7 @@ BREAK_SHOULDER = 0x08, // DEF reduced by 50% BREAK_WAIST = 0x10, // DEF reduced by 25%, ATK reduced by 25% BREAK_NECK = 0x20, // current attack does 2x damage, inflicts 'bleeding' for 30 seconds - BREAK_FLAGS = BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK, + BREAK_FLAGS = (BREAK_ANKLE | BREAK_WRIST | BREAK_KNEE | BREAK_SHOULDER | BREAK_WAIST | BREAK_NECK), }; extern int current_equip_item_index; @@ -1388,8 +1388,8 @@ OPTION_DRAGON5 = 0x04000000, OPTION_MOUNTING = 0x08000000,//dull name (cuz ind named it :/) // compound constants - OPTION_CART = OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5, - OPTION_DRAGON = OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5, + OPTION_CART = (OPTION_CART1|OPTION_CART2|OPTION_CART3|OPTION_CART4|OPTION_CART5), + OPTION_DRAGON = (OPTION_DRAGON1|OPTION_DRAGON2|OPTION_DRAGON3|OPTION_DRAGON4|OPTION_DRAGON5), OPTION_MASK = ~OPTION_INVISIBLE, }; Index: src/map/trade.c =================================================================== --- src/map/trade.c (revision 16039) +++ src/map/trade.c (working copy) @@ -500,7 +500,7 @@ } /*========================================== - * Žæˆø‹–‘ø(trade‰Ÿ‚µ) + * Trading license (press trade) *------------------------------------------*/ void trade_tradecommit(struct map_session_data *sd) { Index: src/map/pc.c =================================================================== --- src/map/pc.c (revision 16039) +++ src/map/pc.c (working copy) @@ -47,7 +47,7 @@ #include -#define PVP_CALCRANK_INTERVAL 1000 // PVP‡ˆÊŒvŽZ‚ÌŠÔŠu +#define PVP_CALCRANK_INTERVAL 1000 // PVP calculation interval static unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL]; static unsigned int max_level[CLASS_COUNT][2]; static unsigned int statp[MAX_LEVEL+1]; @@ -277,6 +277,7 @@ return 0; } + int pc_banding(struct map_session_data *sd, short skill_lv) { int c; int b_sd[MAX_PARTY]; // In case of a full Royal Guard party. @@ -558,7 +559,7 @@ } /*========================================== - * Ú?Žb̏‰Šú‰? + * Off init ? Connection? *------------------------------------------*/ int pc_setnewpc(struct map_session_data *sd, int account_id, int char_id, int login_id1, unsigned int client_tick, int sex, int fd) { @@ -832,10 +833,15 @@ return false; // Job Change Fail } +/*================================================= +* Can the player equip the item at index n in inventory +* return +* 0 = no +* 1 = yes +*------------------------------------------------*/ int pc_isequip(struct map_session_data *sd,int n) { struct item_data *item; - //?¶‚â—{Žq‚̏ꍇ‚ÌŒ³‚̐E‹Æ‚ðŽZo‚·‚é nullpo_ret(sd); @@ -865,8 +871,7 @@ return 0; } - if (sd->sc.count) { - + if (sd->sc.count) { if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG] return 0; if(item->equip & EQP_SHIELD && item->type == IT_ARMOR && sd->sc.data[SC_STRIPSHIELD]) @@ -910,8 +915,8 @@ } /*========================================== - * session id‚É–â‘è–³‚µ - * charŽI‚©‚ç‘—‚ç‚ê‚Ä‚«‚œƒXƒe?ƒ^ƒX‚ðÝ’è + * No problem with the session id + * set the status that has been sent from char server *------------------------------------------*/ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_time, int group_id, struct mmo_charstatus *st, bool changing_mapservers) { @@ -1025,7 +1030,7 @@ for( i = 0; i < 3; i++ ) sd->hate_mob[i] = -1; - // ˆÊ’u‚̐ݒè + //warp player if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) { ShowError ("Last_point_map %s - id %d not found (error code %d)\n", mapindex_id2name(sd->status.last_point.map), sd->status.last_point.map, i); @@ -1195,6 +1200,7 @@ sd->status.skill[sd->reproduceskill_id].flag = SKILL_FLAG_PLAGIARIZED; } } + //Weird... maybe registries were reloaded? if (sd->state.active) return 0; @@ -1265,7 +1271,7 @@ /*========================================== - * ?‚Š‚ç‚ê‚éƒXƒLƒ‹‚ÌŒvŽZ + * Calculation of Skills lvls *------------------------------------------*/ int pc_calc_skilltree(struct map_session_data *sd) { @@ -1282,22 +1288,20 @@ } c = pc_class2idx(c); - for( i = 0; i < MAX_SKILL; i++ ) - { - if( sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) //Don't touch plagiarized skills + for (i = 0; i < MAX_SKILL; i++) { + if (sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) //Don't touch plagiarized skills sd->status.skill[i].id = 0; //First clear skills. } - for( i = 0; i < MAX_SKILL; i++ ) - { - if( sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED ) - { // Restore original level of skills after deleting earned skills. + for (i = 0; i < MAX_SKILL; i++) { + if (sd->status.skill[i].flag != SKILL_FLAG_PERMANENT && sd->status.skill[i].flag != SKILL_FLAG_PLAGIARIZED) { + // Restore original level of skills after deleting earned skills. sd->status.skill[i].lv = (sd->status.skill[i].flag == SKILL_FLAG_TEMPORARY) ? 0 : sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0; sd->status.skill[i].flag = SKILL_FLAG_PERMANENT; } - if( sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU ) - { //Enable Bard/Dancer spirit linked skills. + if (sd->sc.count && sd->sc.data[SC_SPIRIT] && sd->sc.data[SC_SPIRIT]->val2 == SL_BARDDANCER && i >= DC_HUMMING && i<= DC_SERVICEFORYOU) { + //Enable Bard/Dancer spirit linked skills. if( sd->status.sex ) { //Link dancer skills to bard. if( sd->status.skill[i-8].lv < 10 ) @@ -1368,8 +1372,7 @@ { if (sd->status.skill[k].id == 0 || sd->status.skill[k].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[k].flag == SKILL_FLAG_PLAGIARIZED) k = 0; //Not learned. - else - if (sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real lerned level + else if (sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real learned level k = sd->status.skill[skill_tree[c][i].need[j].id].flag - SKILL_FLAG_REPLACED_LV_0; else k = pc_checkskill(sd,k); @@ -1448,6 +1451,7 @@ if(battle_config.skillfree) return; //Function serves no purpose if this is set + nullpo_retv(sd); i = pc_calc_skilltree_normalize_job(sd); c = pc_mapid2jobid(i, sd->status.sex); @@ -1471,8 +1475,7 @@ { if( sd->status.skill[k].id == 0 || sd->status.skill[k].flag == SKILL_FLAG_TEMPORARY || sd->status.skill[k].flag == SKILL_FLAG_PLAGIARIZED ) k = 0; //Not learned. - else - if( sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real lerned level + else if( sd->status.skill[k].flag >= SKILL_FLAG_REPLACED_LV_0) //Real learned level k = sd->status.skill[skill_tree[c][i].need[j].id].flag - SKILL_FLAG_REPLACED_LV_0; else k = pc_checkskill(sd,k); @@ -1513,9 +1516,7 @@ sd->status.skill[i].id = 0; sd->status.skill[i].lv = 0; sd->status.skill[i].flag = 0; - } - else - if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0){ + } else if (sd->status.skill[i].flag >= SKILL_FLAG_REPLACED_LV_0) { sd->status.skill[i].lv = sd->status.skill[i].flag - SKILL_FLAG_REPLACED_LV_0; sd->status.skill[i].flag = 0; } @@ -3327,7 +3328,7 @@ return 1; } /*========================================== - * ƒJ?ƒh?“ü + * Append a cart to an item ? *------------------------------------------*/ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) { @@ -3382,18 +3383,18 @@ } // -// ƒAƒCƒeƒ€•š +// Items // /*========================================== - * ƒXƒLƒ‹‚É‚æ‚锃‚¢’lC³ + * Correction buying value by skills *------------------------------------------*/ int pc_modifybuyvalue(struct map_session_data *sd,int orig_value) { int skill,val = orig_value,rate1 = 0,rate2 = 0; - if((skill=pc_checkskill(sd,MC_DISCOUNT))>0) // ƒfƒBƒXƒJƒEƒ“ƒg + if((skill=pc_checkskill(sd,MC_DISCOUNT))>0) // merchant discount rate1 = 5+skill*2-((skill==10)? 1:0); - if((skill=pc_checkskill(sd,RG_COMPULSION))>0) // ƒRƒ€ƒpƒ‹ƒVƒ‡ƒ“ƒfƒBƒXƒJƒEƒ“ƒg + if((skill=pc_checkskill(sd,RG_COMPULSION))>0) // rogue discount rate2 = 5+skill*4; if(rate1 < rate2) rate1 = rate2; if(rate1) @@ -3405,12 +3406,12 @@ } /*========================================== - * ƒXƒLƒ‹‚É‚æ‚é?‚è’lC³ + * Correction selling value by skills *------------------------------------------*/ int pc_modifysellvalue(struct map_session_data *sd,int orig_value) { int skill,val = orig_value,rate = 0; - if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0) // ƒI?ƒo?ƒ`ƒƒ?ƒW + if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0) //OverCharge ? rate = 5+skill*2-((skill==10)? 1:0); if(rate) val = (int)((double)orig_value*(double)(100+rate)/100.); @@ -3421,8 +3422,8 @@ } /*========================================== - * ƒAƒCƒeƒ€‚𔃂Á‚œŽbɁAV‚µ‚¢ƒAƒCƒeƒ€—“‚ðŽg‚€‚©A - * 3–œŒÂ§ŒÀ‚É‚©‚©‚é‚©Šm”F + * Checking if we have enough place on inventory for new item + * Make sure to take 30,000 limit *------------------------------------------*/ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount) { @@ -3449,7 +3450,8 @@ } /*========================================== - * ‹ó‚«ƒAƒCƒeƒ€—“‚ÌŒÂ? + * Return number of available place in inventory + * Each non stackable item will reduce place by 1 *------------------------------------------*/ int pc_inventoryblank(struct map_session_data *sd) { @@ -3544,9 +3546,8 @@ ShowWarning("pc_getcash: Cash point overflow (cash=%d, have cash=%d, account_id=%d, char_id=%d).\n", cash, sd->cashPoints, sd->status.account_id, sd->status.char_id); cash = MAX_ZENY-sd->cashPoints; } + pc_setaccountreg(sd,"#CASHPOINTS",sd->cashPoints + cash); - pc_setaccountreg(sd, "#CASHPOINTS", sd->cashPoints+cash); - if( battle_config.cashshop_show_points ) { sprintf(output, msg_txt(505), cash, sd->cashPoints); @@ -3609,7 +3610,7 @@ } /*========================================== - * ƒAƒCƒeƒ€‚ð’T‚µ‚āAƒCƒ“ƒfƒbƒNƒX‚ð•Ô‚· + * Searching a specified itemid in inventory and return his stored index *------------------------------------------*/ int pc_search_inventory(struct map_session_data *sd,int item_id) { @@ -3621,7 +3622,14 @@ } /*========================================== - * ƒAƒCƒeƒ€’ljÁBŒÂ?‚Ì‚Ýitem\‘¢?‚Ì?Žš‚𖳎‹ + * Attempt tp add a new item in inventory + * return + 0 = success + 1 = invalid itemid not found or negative amount + 2 = overweight + 4 = no free place found + 5 = max amount reached + *------------------------------------------*/ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) { @@ -3692,7 +3700,10 @@ } /*========================================== - * ƒAƒCƒeƒ€‚ðŒž‚ç‚· + * Remove an item at index n from inventory by amount + * return + * 0 = succes + * 1 = invalid itemid or negative amount *------------------------------------------*/ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type) { @@ -3720,7 +3731,10 @@ } /*========================================== - * ƒAƒCƒeƒ€‚ð—Ž‚· + * Attempt to drop an item + * return + * 0 = fail + * 1 = success *------------------------------------------*/ int pc_dropitem(struct map_session_data *sd,int n,int amount) { @@ -3761,7 +3775,10 @@ } /*========================================== - * ƒAƒCƒeƒ€‚ðE‚€ + * Attempt to pickup an item + * return + * 0 = fail + * 1 = success *------------------------------------------*/ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem) { @@ -3774,7 +3791,7 @@ nullpo_ret(fitem); if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skillid!=BS_GREED) - return 0; // ‹——£‚ª‰“‚¢ + return 0; // Distance is too far if (sd->status.party_id) p = party_search(sd->status.party_id); @@ -3828,6 +3845,12 @@ return 1; } +/*========================================== + * Can we use the item ? + * Return + * 0 = no + * 1 = yes + *------------------------------------------*/ int pc_isUseitem(struct map_session_data *sd,int n) { struct item_data *item; @@ -3846,7 +3869,7 @@ if( !item->script ) //if it has no script, you can't really consume it! return 0; - switch( nameid ) + switch( nameid ) //lot of harcoded nameid here, need to be removed [Lighta] { case 605: // Anodyne if( map_flag_gvg(sd->bl.m) ) @@ -3983,7 +4006,10 @@ } /*========================================== - * ƒAƒCƒeƒ€‚ðŽg‚€ + * Last checks et use item + * return + * 0 = fail + * 1 = success *------------------------------------------*/ int pc_useitem(struct map_session_data *sd,int n) { @@ -4005,6 +4031,7 @@ ) return 0; + //Check if status forbid us if( sd->sc.count && ( sd->sc.data[SC_BERSERK] || (sd->sc.data[SC_GRAVITATION] && sd->sc.data[SC_GRAVITATION]->val3 == BCT_SELF) || @@ -4102,7 +4129,10 @@ } /*========================================== - * ƒJ?ƒgƒAƒCƒeƒ€’ljÁBŒÂ?‚Ì‚Ýitem\‘¢?‚Ì?Žš‚𖳎‹ + * Add item on cart for given index + * return + * 0 = success + * 1 = fail *------------------------------------------*/ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) { @@ -4162,7 +4192,10 @@ } /*========================================== - * ƒJ?ƒgƒAƒCƒeƒ€‚ðŒž‚ç‚· + * Delete item on cart for given index + * return + * 0 = success + * 1 = fail *------------------------------------------*/ int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type) { @@ -4189,7 +4222,10 @@ } /*========================================== - * ƒJ?ƒg‚ÖƒAƒCƒeƒ€ˆÚ“® + * Transfert item from inventory to cart + * return + * 0 = fail + * 1 = succes *------------------------------------------*/ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount) { @@ -4212,7 +4248,10 @@ } /*========================================== - * ƒJ?ƒg?‚̃AƒCƒeƒ€?Šm”F(ŒÂ?‚̍·•ª‚ð•Ô‚·) + * Get number of item on cart + * return + -1 = itemid not found or no amount found + x = remaining itemid on cart after get *------------------------------------------*/ int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount) { @@ -4228,7 +4267,10 @@ } /*========================================== - * ƒJ?ƒg‚©‚çƒAƒCƒeƒ€ˆÚ“® + * Retrieve an item at index idx from cart + * return + * 0 = player not found or (FIXME) succes (from pc_cart_delitem) + * 1 = failure *------------------------------------------*/ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount) { @@ -4252,7 +4294,7 @@ } /*========================================== - * ƒXƒeƒBƒ‹•iŒöŠJ + * Display item stolen msg to player sd *------------------------------------------*/ int pc_show_steal(struct block_list *bl,va_list ap) { @@ -4274,7 +4316,10 @@ return 0; } /*========================================== - * + * Stole an item from bl (mob) + * return + * 0 = fail + * 1 = succes *------------------------------------------*/ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv) { @@ -4355,7 +4400,10 @@ } /*========================================== - * + * Stole zeny from bl (mob) + * return + * 0 = fail + * 1 = success *------------------------------------------*/ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) { @@ -4544,7 +4592,11 @@ } /*========================================== - * PC‚̃‰ƒ“ƒ_ƒ€ƒ?ƒv + * Warp player sd to random location on current map + * may fail if no Cell walkable found (1000 attempt) + * return + * 0 = fail or FIXME succes (from pc_setpos) + * x(1|2) = fail *------------------------------------------*/ int pc_randomwarp(struct map_session_data *sd, clr_type type) { @@ -4555,7 +4607,7 @@ m=sd->bl.m; - if (map[sd->bl.m].flag.noteleport) // ƒeƒŒƒ|?ƒg‹ÖŽ~ + if (map[sd->bl.m].flag.noteleport) //Teleport forbiden return 0; do{ @@ -4619,14 +4671,16 @@ } // -// •Ší?? -// +// Skills +// /*========================================== - * ƒXƒLƒ‹‚Ì?õ Š—L‚µ‚Ä‚¢‚œê‡Lv‚ª•Ô‚é + * Return player sd skilllv learned for given skill *------------------------------------------*/ int pc_checkskill(struct map_session_data *sd,int skill_id) { - if(sd == NULL) return 0; + if( sd == NULL ) + return 0; + if( skill_id >= GD_SKILLBASE && skill_id < GD_MAX ) { struct guild *g; @@ -4648,13 +4702,8 @@ } /*========================================== - * •Ší?X‚É‚æ‚éƒXƒLƒ‹‚Ì??ƒ`ƒFƒbƒN - * ˆø?F - * struct map_session_data *sd ƒZƒbƒVƒ‡ƒ“ƒf?ƒ^ - * int nameid ?”õ•iID - * •Ô‚è’lF - * 0 ?X‚È‚µ - * -1 ƒXƒLƒ‹‚ð‰ðœ + * Checking if player match condition for given skill and kill status if not + * Status probably require for thoses skills (unsure) *------------------------------------------*/ int pc_checkallowskill(struct map_session_data *sd) { @@ -4700,7 +4749,8 @@ } /*========================================== - * ? ”õ•i‚̃`ƒFƒbƒN + * Return equiped itemid? on player sd at pos + * if -1 mean nothing equiped *------------------------------------------*/ int pc_checkequip(struct map_session_data *sd,int pos) { @@ -5370,7 +5420,7 @@ { int bonus = 0; struct status_data *status = status_get_status_data(src); - + nullpo_retv(sd); if (sd->expaddrace[status->race]) bonus += sd->expaddrace[status->race]; bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS]; @@ -5392,7 +5442,7 @@ return; } /*========================================== - * ??’lŽæ“Ÿ + * Give x exp at sd player and calculate remaining exp for next lvl *------------------------------------------*/ int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool quest) { @@ -5485,8 +5535,10 @@ }; /*========================================== - * base level‘€•K—v??’lŒvŽZ + * base level exp lookup. *------------------------------------------*/ + +///How much bexp do player need for next level unsigned int pc_nextbaseexp(struct map_session_data *sd) { nullpo_ret(sd); @@ -5497,6 +5549,7 @@ return exp_table[pc_class2idx(sd->status.class_)][0][sd->status.base_level-1]; } +///How much bexp do player need for this level unsigned int pc_thisbaseexp(struct map_session_data *sd) { if(sd->status.base_level>pc_maxbaselv(sd) || sd->status.base_level<=1) @@ -5507,8 +5560,13 @@ /*========================================== - * job level‘€•K—v??’lŒvŽZ + * job level exp lookup + * return + * 0 = not found + * x = exp for level *------------------------------------------*/ + +///How much jexp do player need for next level unsigned int pc_nextjobexp(struct map_session_data *sd) { nullpo_ret(sd); @@ -5518,6 +5576,7 @@ return exp_table[pc_class2idx(sd->status.class_)][1][sd->status.job_level-1]; } +///How much jexp do player need for next level unsigned int pc_thisjobexp(struct map_session_data *sd) { if(sd->status.job_level>pc_maxjoblv(sd) || sd->status.job_level<=1) @@ -5687,7 +5746,8 @@ } /*========================================== - * ƒXƒLƒ‹ƒ|ƒCƒ“ƒgŠ„‚èU‚è + * Update skilllv for player sd + * Skill point allocation *------------------------------------------*/ int pc_skillup(struct map_session_data *sd,int skill_num) { @@ -5749,6 +5809,7 @@ } } + //pc_calc_skilltree takes care of setting the ID to valid skills. [Skotlex] if (pc_has_permission(sd, PC_PERM_ALL_SKILL)) { //Get ALL skills except npc/guild ones. [Skotlex] //and except SG_DEVIL [Komurka] and MO_TRIPLEATTACK and RG_SNATCHER [ultramage] @@ -6001,7 +6062,7 @@ if( i == NV_TRICKDEAD && (sd->class_&MAPID_UPPERMASK) != MAPID_NOVICE ) { sd->status.skill[i].lv = 0; - sd->status.skill[i].flag = 0; + sd->status.skill[i].flag = SKILL_FLAG_PERMANENT; continue; } @@ -6176,6 +6237,9 @@ sd->canlog_tick = gettick(); } +/*========================================== + * Invoked when a player have negative current hp + *------------------------------------------*/ int pc_dead(struct map_session_data *sd,struct block_list *src) { int i=0,j=0,k=0; @@ -6278,6 +6342,8 @@ break; case BL_MER: src = &((TBL_MER*)src)->master->bl; + break; + default: //what should we do for other ?? break; } @@ -6498,10 +6564,11 @@ if(battle_config.pc_invincible_time > 0) pc_setinvincibletimer(sd, battle_config.pc_invincible_time); } -// script? ˜A // +// script +// /*========================================== - * script—pPCƒXƒe?ƒ^ƒX?‚ݏo‚µ + * script reading pc status registry *------------------------------------------*/ int pc_readparam(struct map_session_data* sd,int type) { @@ -6547,7 +6614,7 @@ } /*========================================== - * script—pPCƒXƒe?ƒ^ƒXÝ’è + * script set pc status registry *------------------------------------------*/ int pc_setparam(struct map_session_data *sd,int type,int val) { @@ -6715,7 +6782,9 @@ } /*========================================== - * HP/SP‰ñ•œ + * HP/SP Recovery + * Heal player hp nad/or sp linearly + * Calculate bonus by status *------------------------------------------*/ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) { @@ -6773,7 +6842,8 @@ } /*========================================== - * HP/SP‰ñ•œ + * HP/SP Recovery + * Heal player hp nad/or sp by rate *------------------------------------------*/ int pc_percentheal(struct map_session_data *sd,int hp,int sp) { @@ -6811,9 +6881,7 @@ } /*========================================== - * E?X - * ˆø? job E‹Æ 0`23 - * upper ’ʏí 0, ?¶ 1, —{Žq 2, ‚»‚Ì‚Ü‚Ü -1 + * Called when player changing job * Rewrote to make it tidider [Celest] *------------------------------------------*/ int pc_jobchange(struct map_session_data *sd,int job, int upper) @@ -6904,7 +6972,7 @@ for(i=0;iequip_index[i] >= 0) if(!pc_isequip(sd,sd->equip_index[i])) - pc_unequipitem(sd,sd->equip_index[i],2); // ?”õŠO‚µ + pc_unequipitem(sd,sd->equip_index[i],2); // ?ᅵᅵᅵOᅵᅵ } //Change look, if disguised, you need to undisguise @@ -6970,7 +7038,7 @@ } /*========================================== - * Œ©‚œ–Ú?X + * Tell client player sd has change equipement *------------------------------------------*/ int pc_equiplookall(struct map_session_data *sd) { @@ -6987,7 +7055,7 @@ } /*========================================== - * Œ©‚œ–Ú?X + * Tell client player sd has change look (hair,equip...) *------------------------------------------*/ int pc_changelook(struct map_session_data *sd,int type,int val) { @@ -7047,7 +7115,7 @@ } /*========================================== - * •t?•i(‘é,ƒyƒR,ƒJ?ƒg)Ý’è + * Give an option (type) to player (sd) and display it to client *------------------------------------------*/ int pc_setoption(struct map_session_data *sd,int type) { @@ -7165,7 +7233,7 @@ } /*========================================== - * ƒJ?ƒgÝ’è + * Give player a cart *------------------------------------------*/ int pc_setcart(struct map_session_data *sd,int type) { @@ -7190,12 +7258,12 @@ } /*========================================== - * ‘éÝ’è + * Give player a falcon *------------------------------------------*/ int pc_setfalcon(TBL_PC* sd, int flag) { if( flag ){ - if( pc_checkskill(sd,HT_FALCON)>0 ) // ƒtƒ@ƒ‹ƒRƒ“ƒ}ƒXƒ^ƒŠ?ƒXƒLƒ‹ŠŽ + if( pc_checkskill(sd,HT_FALCON)>0 ) // ï¿œtï¿œ@ᅵᅵᅵRᅵᅵᅵ}ï¿œXï¿œ^ᅵᅵ?ï¿œXï¿œLᅵᅵᅵᅵᅵᅵ pc_setoption(sd,sd->sc.option|OPTION_FALCON); } else if( pc_isfalcon(sd) ){ pc_setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon @@ -7205,12 +7273,12 @@ } /*========================================== - * ƒyƒRƒyƒRÝ’è + * Give player a wug (wolf) *------------------------------------------*/ int pc_setriding(TBL_PC* sd, int flag) { if( flag ){ - if( pc_checkskill(sd,KN_RIDING) > 0 ) // ƒ‰ƒCƒfƒBƒ“ƒOƒXƒLƒ‹ŠŽ + if( pc_checkskill(sd,KN_RIDING) > 0 ) // ᅵᅵᅵCï¿œfï¿œBᅵᅵᅵOï¿œXï¿œLᅵᅵᅵᅵᅵᅵ pc_setoption(sd, sd->sc.option|OPTION_RIDING); } else if( pc_isriding(sd) ){ pc_setoption(sd, sd->sc.option&~OPTION_RIDING); @@ -7220,7 +7288,7 @@ } /*========================================== - * ƒAƒCƒeƒ€ƒhƒƒbƒv‰Â•s‰Â”»’è + * Check if player can drop an item *------------------------------------------*/ int pc_candrop(struct map_session_data *sd, struct item *item) { @@ -7232,7 +7300,8 @@ } /*========================================== - * script—p??‚Ì’l‚ð?‚Þ + * Read ram register for player sd + * get val (int) from reg for player sd *------------------------------------------*/ int pc_readreg(struct map_session_data* sd, int reg) { @@ -7244,7 +7313,8 @@ return ( i < sd->reg_num ) ? sd->reg[i].data : 0; } /*========================================== - * script—p??‚Ì’l‚ðÝ’è + * Set ram register for player sd + * memo val(int) at reg for player sd *------------------------------------------*/ int pc_setreg(struct map_session_data* sd, int reg, int val) { @@ -7272,7 +7342,8 @@ } /*========================================== - * script—p•¶Žš—ñ??‚Ì’l‚ð?‚Þ + * Read ram register for player sd + * get val (str) from reg for player sd *------------------------------------------*/ char* pc_readregstr(struct map_session_data* sd, int reg) { @@ -7284,7 +7355,8 @@ return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL; } /*========================================== - * script—p•¶Žš—ñ??‚Ì’l‚ðÝ’è + * Set ram register for player sd + * memo val(str) at reg for player sd *------------------------------------------*/ int pc_setregstr(struct map_session_data* sd, int reg, const char* str) { @@ -7564,7 +7636,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}??— + * Exec eventtimer for player sd (retrieved from map_session (id)) *------------------------------------------*/ static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data) { @@ -7589,7 +7661,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?’ljÁ + * Add eventtimer for player sd ? *------------------------------------------*/ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) { @@ -7607,7 +7679,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?íœ + * Del eventtimer for player sd ? *------------------------------------------*/ int pc_deleventtimer(struct map_session_data *sd,const char *name) { @@ -7637,7 +7709,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?ƒJƒEƒ“ƒg’l’ljÁ + * Update eventtimer count for player sd *------------------------------------------*/ int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick) { @@ -7656,7 +7728,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?‘Síœ + * Remove all eventtimer for player sd *------------------------------------------*/ int pc_cleareventtimer(struct map_session_data *sd) { @@ -7679,10 +7751,10 @@ } // -// ? ”õ•š +// Equipment // /*========================================== - * ƒAƒCƒeƒ€‚ð?”õ‚·‚é + * Equip item on player sd at req_pos from inventory index n *------------------------------------------*/ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) { @@ -7865,7 +7937,7 @@ } /*========================================== - * ? ”õ‚µ‚œ•š‚ðŠO‚· + * Called when attemting to unequip an item from player * type: * 0 - only unequip * 1 - calculate status after unequipping @@ -7994,8 +8066,8 @@ } /*========================================== - * ƒAƒCƒeƒ€‚Ìindex”Ô?‚ð‹l‚ß‚œ‚è - * ? ”õ•i‚Ì?”õ‰Â”\ƒ`ƒFƒbƒN‚ðs‚È‚€ + * Checking if player (sd) have unauthorize, invalide item + * on inventory, cart, equiped for the map (item_noequip) *------------------------------------------*/ int pc_checkitem(struct map_session_data *sd) { @@ -8075,7 +8147,7 @@ } /*========================================== - * PVP‡ˆÊŒvŽZ—p(foreachinarea) + * Update PVP rank for sd1 to sd2 *------------------------------------------*/ int pc_calc_pvprank_sub(struct block_list *bl,va_list ap) { @@ -8094,7 +8166,8 @@ return 0; } /*========================================== - * PVP‡ˆÊŒvŽZ + * Calculate new rank beetween all present players (map_foreachinarea) + * and display result *------------------------------------------*/ int pc_calc_pvprank(struct map_session_data *sd) { @@ -8109,7 +8182,7 @@ return sd->pvp_rank; } /*========================================== - * PVP‡ˆÊŒvŽZ(timer) + * Calculate next sd ranking calculation from config *------------------------------------------*/ int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data) { @@ -8131,7 +8204,10 @@ } /*========================================== - * sd‚ÍŒ‹¥‚µ‚Ä‚¢‚é‚©(?¥‚̏ꍇ‚Í‘Š•û‚Ìchar_id‚ð•Ô‚·) + * Checking if sd is married + * Return + * partner_id = yes, + * 0 = no *------------------------------------------*/ int pc_ismarried(struct map_session_data *sd) { @@ -8143,7 +8219,10 @@ return 0; } /*========================================== - * sd‚ªdstsd‚ÆŒ‹¥(dstsdšsd‚ÌŒ‹¥?—‚à“¯Žbɍs‚€) + * Marry player sd to player dstsd + * return + * -1 = fail + * 0 = success *------------------------------------------*/ int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd) { @@ -8158,6 +8237,9 @@ /*========================================== * Divorce sd from its partner + * return + * -1 = fail + * 0 = success *------------------------------------------*/ int pc_divorce(struct map_session_data *sd) { @@ -8196,7 +8278,7 @@ } /*========================================== - * sd‚Ì‘Š•û‚Ìmap_session_data‚ð•Ô‚· + * Get sd partner charid. (Married partner) *------------------------------------------*/ struct map_session_data *pc_get_partner(struct map_session_data *sd) { @@ -8207,6 +8289,9 @@ return NULL; } +/*========================================== + * Get sd father charid. (Need to be baby) + *------------------------------------------*/ struct map_session_data *pc_get_father (struct map_session_data *sd) { if (sd && sd->class_&JOBL_BABY && sd->status.father > 0) @@ -8216,6 +8301,9 @@ return NULL; } +/*========================================== + * Get sd mother charid. (Need to be baby) + *------------------------------------------*/ struct map_session_data *pc_get_mother (struct map_session_data *sd) { if (sd && sd->class_&JOBL_BABY && sd->status.mother > 0) @@ -8225,6 +8313,9 @@ return NULL; } +/*========================================== + * Get sd children charid. (Need to be married) + *------------------------------------------*/ struct map_session_data *pc_get_child (struct map_session_data *sd) { if (sd && pc_ismarried(sd) && sd->status.child > 0) @@ -8234,6 +8325,9 @@ return NULL; } +/*========================================== + * Set player sd to bleed. (losing hp and/or sp each diff_tick) + *------------------------------------------*/ void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick) { int hp = 0, sp = 0; @@ -8295,7 +8389,7 @@ } /*========================================== - * ƒZ?ƒuƒ|ƒCƒ“ƒg‚Ì•Û‘¶ + * Memo player sd savepoint. (map,x,y) *------------------------------------------*/ int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y) { @@ -8309,7 +8403,7 @@ } /*========================================== - * Ž©“®ƒZ?ƒu (timer??) + * Save 1 player data at autosave intervalle *------------------------------------------*/ int pc_autosave(int tid, unsigned int tick, int id, intptr_t data) { @@ -8426,7 +8520,7 @@ skill = cap_value(pc_checkskill(sd,NC_MAINFRAME),0,4); if( sd->sc.data[SC_OVERHEAT_LIMITPOINT] ) { heat += sd->sc.data[SC_OVERHEAT_LIMITPOINT]->val1; - status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,-1); + status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT, INVALID_TIMER); } heat = max(0,heat); // Avoid negative HEAT @@ -8599,7 +8693,7 @@ FILE *fp; char line[24000],*p; - // •K—v??’l?‚Ý?‚Ý + //reset memset(exp_table,0,sizeof(exp_table)); memset(max_level,0,sizeof(max_level)); @@ -8684,12 +8778,12 @@ } ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt"); - // ƒXƒLƒ‹ƒcƒŠ? + // ï¿œXï¿œLᅵᅵᅵcᅵᅵ? memset(skill_tree,0,sizeof(skill_tree)); sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree); - // ?«C³ƒe?ƒuƒ‹ + // ?ᅵᅵᅵCᅵᅵᅵe?ï¿œuᅵᅵ for(i=0;i<4;i++) for(j=0;j=BL_LIST_MAX) ShowWarning("map_foreachinmovearea: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // Prohibit the release from memory for(i=blockcount;iprev) @@ -1002,7 +1002,7 @@ va_end(ap); } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // Allow Free bl_list_count = blockcount; return returnCount; @@ -1469,10 +1469,13 @@ } /*========================================== - * (m,x,y)‚𒆐S‚É3x3ˆÈ?‚ɏ°ƒAƒCƒeƒ€Ý’u - * - * item_data‚ÍamountˆÈŠO‚ðcopy‚·‚é - * type flag: &1 MVP item. &2 do stacking check. + * Rajoute un item sur la map au location (m,x,y) + * Parametres + * @item_data attribut de l'item + * @amount quantité + * @m, @x, @y index de la map et coordonnée en x,y + * @first_charid, @second_charid, @third_charid, champ pour les priorité de ramassage + * @flag: &1 MVP item. &2 do stacking check. *------------------------------------------*/ int map_addflooritem(struct item *item_data,int amount,int m,int x,int y,int first_charid,int second_charid,int third_charid,int flags) { @@ -2489,7 +2492,7 @@ } /*========================================== - * (m,x,y)‚̏ó‘Ԃ𒲂ׂé + * Confirme si le type de cell en (m,x,y) est celui passer en parametre *------------------------------------------*/ int map_getcell(int m,int x,int y,cell_chk cellchk) { Index: src/map/map.h =================================================================== --- src/map/map.h (revision 16039) +++ src/map/map.h (working copy) @@ -608,7 +608,7 @@ extern char wisp_server_name[]; -// ŽI‘S‘̏î•ñ +// users void map_setusers(int); int map_getusers(void); int map_usercount(void); Index: src/map/pet.c =================================================================== --- src/map/pet.c (revision 16039) +++ src/map/pet.c (working copy) @@ -1031,7 +1031,7 @@ memset(pd->loot->item,0,pd->loot->max * sizeof(struct item)); pd->loot->count = 0; pd->loot->weight = 0; - pd->ud.canact_tick = gettick()+10000; // 10*1000ms‚̊ԏE‚í‚È‚¢ + pd->ud.canact_tick = gettick()+10000; // Not picked up during the 10*1000ms if (dlist->item) add_timer(gettick()+540,pet_delay_item_drop,0,(intptr_t)dlist); @@ -1195,7 +1195,7 @@ } /*========================================== - *ƒyƒbƒgƒf[ƒ^“ǂݍž‚Ý + *Pet read db data *------------------------------------------*/ int read_petdb() { @@ -1343,7 +1343,7 @@ } /*========================================== - * ƒXƒLƒ‹ŠÖŒW‰Šú‰»ˆ— + * Initialization process relationship skills *------------------------------------------*/ int do_init_pet(void) { Index: src/map/path.c =================================================================== --- src/map/path.c (revision 16039) +++ src/map/path.c (working copy) @@ -45,7 +45,7 @@ /*========================================== * heap update (helper function) - * cost‚ªŒž‚Á‚œ‚̂ōª‚Ì•û‚ÖˆÚ“® + * move toward the root Because cost has decreased *------------------------------------------*/ static void update_heap_path(int *heap,struct tmp_path *tp,int index) { @@ -147,8 +147,7 @@ /*========================================== * Find the closest reachable cell, 'count' cells away from (x0,y0) in direction (dx,dy). - * - * ‚«”ò‚΂µ‚œ‚ ‚Ƃ̍À•W‚ðŠ“Ÿ + * Income after the coordinates of the blow *------------------------------------------*/ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count) { @@ -343,7 +342,7 @@ tp[i].flag=0; heap[0]=0; push_heap_path(heap,tp,calc_index(x0,y0)); - xs = md->xs-1; // ‚ ‚ç‚©‚¶‚ß‚PŒžŽZ‚µ‚Ä‚š‚­ + xs = md->xs-1; // Place by subtracting a pre- ys = md->ys-1; for(;;) @@ -361,10 +360,10 @@ if(x==x1 && y==y1) break; - // dc[0] : y++ ‚ÌŽž‚̃RƒXƒg‘•ª - // dc[1] : x-- ‚ÌŽž‚̃RƒXƒg‘•ª - // dc[2] : y-- ‚ÌŽž‚̃RƒXƒg‘•ª - // dc[3] : x++ ‚ÌŽž‚̃RƒXƒg‘•ª + // dc[0] : y++ //Incremental cost at the time + // dc[1] : x-- + // dc[2] : y-- + // dc[3] : x++ if(y < ys && !map_getcellp(md,x ,y+1,cell)) { f |= 1; dc[0] = (y >= y1 ? 20 : 0); Index: athena-start =================================================================== --- athena-start (revision 16039) +++ athena-start (working copy) @@ -50,6 +50,16 @@ echo "Now Started Athena." ;; + 'start2') + print_start + check_files + + exec ./${L_SRV}& + exec ./${C_SRV}& + gdb -ex run ./${M_SRV}& + + echo "Now Started Athena in debug mode." +;; 'stop') ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill ;;