Index: conf/atcommand_athena.conf =================================================================== --- conf/atcommand_athena.conf (revision 15963) +++ conf/atcommand_athena.conf (working copy) @@ -58,4 +58,4 @@ /* Commands help file */ help: { @include "conf/help.txt" -} \ No newline at end of file +} Index: src/map/atcommand.c =================================================================== --- src/map/atcommand.c (revision 15963) +++ src/map/atcommand.c (working copy) @@ -52,6 +52,10 @@ #define ACMD_FUNC(x) static int atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message) #define MAX_MSG 1000 +/// Atcommand suggestion settings +#define MAX_SUGGESTIONS 10 +#define FULL_MATCH 1 + typedef struct AtCommandInfo AtCommandInfo; typedef struct AliasInfo AliasInfo; @@ -79,6 +83,7 @@ static AtCommandInfo* get_atcommandinfo_byname(const char *name); // @help static const char* atcommand_checkalias(const char *aliasname); // @help +static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand); // @help //----------------------------------------------------------- // Return the message string of the specified number by [Yor] @@ -1657,11 +1662,13 @@ if (!pc_can_use_command(sd, command_name, COMMAND_ATCOMMAND)) { sprintf(atcmd_output, msg_txt(153), message); // "%s is Unknown Command" clif_displaymessage(fd, atcmd_output); + atcommand_get_suggestions(sd, command_name, true); return -1; } if (!config_setting_lookup_string(help, command_name, &text)) { clif_displaymessage(fd, "There is no help for this command_name."); + atcommand_get_suggestions(sd, command_name, true); return -1; } @@ -6251,7 +6258,7 @@ }; int i; ARR_FIND( 0, ARRAYLENGTH(emo), i, stricmp(message, emo[i]) == 0 ); - if( i == E_DICE1 ) i = rand()%6 + E_DICE1; // randomize /dice + if( i == E_DICE1 ) i = rnd()%6 + E_DICE1; // randomize /dice if( i < ARRAYLENGTH(emo) ) { if (sd->emotionlasttime + 1 >= time(NULL)) { // not more than 1 per second @@ -8744,6 +8751,66 @@ return aliasname; } +/// AtCommand suggestion +static void atcommand_get_suggestions(struct map_session_data* sd, const char *name, bool atcommand) +{ + DBIterator* atcommand_iter = db_iterator(atcommand_db); + DBIterator* alias_iter = db_iterator(atcommand_alias_db); + AtCommandInfo* command_info = NULL; + AliasInfo* alias_info = NULL; + AtCommandType type; + char* suggestions[MAX_SUGGESTIONS]; + int count = 0; + + if (atcommand) + type = COMMAND_ATCOMMAND; + else + type = COMMAND_CHARCOMMAND; + + for (command_info = dbi_first(atcommand_iter); dbi_exists(atcommand_iter) && count < MAX_SUGGESTIONS; command_info = dbi_next(atcommand_iter)) { +#if FULL_MATCH + if ( strstr(command_info->command, name) != NULL && pc_can_use_command(sd, command_info->command, type) ) +#else + if ( strstr(command_info->command, name) == command_info->command && pc_can_use_command(sd, command_info->command, type) ) +#endif + { + suggestions[count] = command_info->command; + ++count; + } + } + + for (alias_info = dbi_first(alias_iter); dbi_exists(alias_iter) && count < MAX_SUGGESTIONS; alias_info = dbi_next(alias_iter)) { +#if FULL_MATCH + if ( strstr(alias_info->alias, name) != NULL && pc_can_use_command(sd, alias_info->command->command, type) ) +#else + if ( strstr(alias_info->alias, name) == alias_info->alias && pc_can_use_command(sd, alias_info->command->command, type) ) +#endif + { + suggestions[count] = alias_info->alias; + ++count; + } + } + + if (count > 0) + { + char buffer[512]; + int i; + + strcpy(buffer,"Maybe you meant:\n"); + + for(i=0; i < count; ++i) + { + strcat(buffer,suggestions[i]); + strcat(buffer," "); + } + + clif_displaymessage(sd->fd, buffer); + } + + dbi_destroy(atcommand_iter); + dbi_destroy(alias_iter); +} + /// Executes an at-command. bool is_atcommand(const int fd, struct map_session_data* sd, const char* message, int type) { @@ -8842,6 +8909,7 @@ if( pc_get_group_level(sd) ) { // TODO: remove or replace with proper permission sprintf(output, msg_txt(153), command); // "%s is Unknown Command." clif_displaymessage(fd, output); + atcommand_get_suggestions(sd, command + 1, *message == atcommand_symbol); return true; } else return false; @@ -8998,4 +9066,4 @@ void do_final_atcommand(void) { atcommand_db_clear(); -} \ No newline at end of file +} Index: src/map/script.c =================================================================== --- src/map/script.c (revision 15963) +++ src/map/script.c (working copy) @@ -4226,6 +4226,7 @@ sd->npc_menu -= menu_countoptions(text, sd->npc_menu, &menu); if( sd->npc_menu <= 0 ) break;// entry found + pc_setregstr(sd, add_str("@options$"),text); } pc_setreg(sd, add_str("@menu"), menu); script_pushint(st, menu); @@ -5467,10 +5468,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); @@ -5498,22 +5499,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; @@ -6384,7 +6382,7 @@ return 0; } /*========================================== - *Žw’èID‚ÌPT–ŒŽæ“Ÿ + * return the name of a partyid *------------------------------------------*/ BUILDIN_FUNC(getpartyname) { @@ -9073,7 +9071,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) { @@ -9616,7 +9615,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 15963) +++ src/map/elemental.c (working copy) @@ -9,6 +9,7 @@ #include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/utils.h" +#include "../common/random.h" #include "log.h" #include "clif.h" @@ -247,12 +248,15 @@ case SC_UPHEAVAL_OPTION: case SC_CIRCLE_OF_FIRE_OPTION: case SC_TIDAL_WEAPON_OPTION: - if( bl ) status_change_end(bl,type,-1); // Master - status_change_end(&ed->bl,type-1,-1); // Elemental Spirit + if( bl ) status_change_end(bl,type,INVALID_TIMER); // Master + status_change_end(&ed->bl,type-1,INVALID_TIMER); // Elemental Spirit break; case SC_ZEPHYR: - if( bl ) status_change_end(bl,type,-1); + if( bl ) status_change_end(bl,type,INVALID_TIMER); break; + default: + ShowWarning("Invalide SC=%d in elemental_clean_single_effect\n",type); + break; } } if( skill_get_unit_id(skill_num,0) ) @@ -345,8 +349,8 @@ if( elemental_skillnotok(skillnum, ed) ) return 0; - - if( ed->ud.skilltimer != -1 ) + + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; else if( DIFF_TICK(tick, ed->ud.canact_tick) < 0 ) return 0; @@ -409,8 +413,8 @@ if( elemental_skillnotok(skillnum, ed) ) return 0; - - if( ed->ud.skilltimer != -1 ) + + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; else if( DIFF_TICK(gettick(), ed->ud.canact_tick) < 0 ) return 0; @@ -562,11 +566,11 @@ return 0; ed->last_thinktime = tick; - - if( ed->ud.skilltimer != -1 ) + + if( ed->ud.skilltimer != INVALID_TIMER ) return 0; - - if( ed->ud.walktimer != -1 && ed->ud.walkpath.path_pos <= 2 ) + + if( ed->ud.walktimer != INVALID_TIMER && ed->ud.walkpath.path_pos <= 2 ) return 0; //No thinking when you just started to walk. if(ed->ud.walkpath.path_pos < ed->ud.walkpath.path_len && ed->ud.target == sd->bl.id) @@ -582,13 +586,13 @@ master_dist = distance_bl(&sd->bl, &ed->bl); if( master_dist > AREA_SIZE ) { // Master out of vision range. elemental_unlocktarget(ed); - unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,3); + unit_warp(&ed->bl,sd->bl.m,sd->bl.x,sd->bl.y,CLR_TELEPORT); return 0; } else if( master_dist > MAX_ELEDISTANCE ) { // Master too far, chase. short x = sd->bl.x, y = sd->bl.y; if( ed->target_id ) elemental_unlocktarget(ed); - if( ed->ud.walktimer != -1 && ed->ud.target == sd->bl.id ) + if( ed->ud.walktimer != INVALID_TIMER && ed->ud.target == sd->bl.id ) return 0; //Already walking to him if( DIFF_TICK(tick, ed->ud.canmove_tick) < 0 ) return 0; //Can't move yet. @@ -608,14 +612,15 @@ return 1; } - if( battle_check_range(&ed->bl,target,ed->db->range2) && rand()%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; } //Attempt to attack. //At this point we know the target is attackable, we just gotta check if the range matches. - if( ed->ud.target == target->id && ed->ud.attacktimer != -1 ) //Already locked. + if( ed->ud.target == target->id && ed->ud.attacktimer != INVALID_TIMER ) //Already locked. return 1; if( battle_check_range(&ed->bl, target, ed->base_status.rhw.range) ) {//Target within range, engage @@ -639,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/battle.c =================================================================== --- src/map/battle.c (revision 15963) +++ src/map/battle.c (working copy) @@ -183,7 +183,7 @@ return bl_list[rnd()%c]; } -// ƒ_??[ƒW‚Ì’x‰„ +// ï¿œ_??[ï¿œWᅵ̒xᅵᅵ struct delay_damage { struct block_list *src; int target; @@ -266,6 +266,7 @@ return 0; } + int battle_attr_ratio(int atk_elem,int def_type, int def_lv) { @@ -340,7 +341,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 +396,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,-1); // 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 +470,7 @@ clif_millenniumshield(sd,sce->val2); sce->val3 = 1000; // Next Shield } else - status_change_end(bl,SC_MILLENNIUMSHIELD,-1); // All shields down + status_change_end(bl,SC_MILLENNIUMSHIELD, INVALID_TIMER); // All shields down } return 0; } @@ -556,11 +558,11 @@ if( sc->data[SC_DEEPSLEEP] ) { damage += damage / 2; // 1.5 times more damage while in Deep Sleep. - status_change_end(bl,SC_DEEPSLEEP,-1); + status_change_end(bl,SC_DEEPSLEEP, INVALID_TIMER); } if( sc->data[SC_VOICEOFSIREN] ) - status_change_end(bl,SC_VOICEOFSIREN,-1); + status_change_end(bl,SC_VOICEOFSIREN, INVALID_TIMER); } @@ -632,9 +634,9 @@ //Finally added to remove the status of immobile when aimedbolt is used. [Jobbie] if( skill_num == RA_AIMEDBOLT && (sc->data[SC_BITE] || sc->data[SC_ANKLE] || sc->data[SC_ELECTRICSHOCKER]) ) { - status_change_end(bl, SC_BITE, -1); - status_change_end(bl, SC_ANKLE, -1); - status_change_end(bl, SC_ELECTRICSHOCKER, -1); + status_change_end(bl, SC_BITE, INVALID_TIMER); + status_change_end(bl, SC_ANKLE, INVALID_TIMER); + status_change_end(bl, SC_ELECTRICSHOCKER, INVALID_TIMER); } //Finally Kyrie because it may, or not, reduce damage to 0. @@ -652,7 +654,7 @@ if (!damage) return 0; - if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rand()%100 < sce->val1 ) { + if( (sce = sc->data[SC_LIGHTNINGWALK]) && flag&BF_LONG && rnd()%100 < sce->val1 ) { int dx[8]={0,-1,-1,-1,0,1,1,1}; int dy[8]={1,1,0,-1,-1,-1,0,1}; int dir = map_calc_dir(bl, src->x, src->y); @@ -661,7 +663,7 @@ unit_setdir(bl, dir); } d->dmg_lv = ATK_DEF; - status_change_end(bl, SC_LIGHTNINGWALK, -1); + status_change_end(bl, SC_LIGHTNINGWALK, INVALID_TIMER); return 0; } @@ -674,20 +676,20 @@ if( sd && (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON && rnd()%100 < sce->val2 ) pc_addspiritball(sd,skill_get_time(LG_FORCEOFVANGUARD,sce->val1),sce->val3); - if( sc->data[SC__DEADLYINFECT] && damage > 0 && rand()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 ) + if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 ) status_change_spread(bl, src); // Deadly infect attacked side if( sc && sc->data[SC__SHADOWFORM] ) { struct block_list *s_bl = map_id2bl(sc->data[SC__SHADOWFORM]->val2); if( !s_bl ) { // If the shadow form target is not present remove the sc. - status_change_end(bl, SC__SHADOWFORM, -1); + status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); } else if( status_isdead(s_bl) || !battle_check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both. - status_change_end(bl, SC__SHADOWFORM, -1); + status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); if( s_bl->type == BL_PC ) ((TBL_PC*)s_bl)->shadowform_id = 0; } else { if( (--sc->data[SC__SHADOWFORM]->val3) < 0 ) { // If you have exceded max hits supported, remove the sc in both. - status_change_end(bl, SC__SHADOWFORM, -1); + status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); if( s_bl->type == BL_PC ) ((TBL_PC*)s_bl)->shadowform_id = 0; } else { @@ -730,7 +732,7 @@ } if( sc->data[SC_POISONINGWEAPON] && skill_num != GC_VENOMPRESSURE && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < sc->data[SC_POISONINGWEAPON]->val3 ) sc_start(bl,sc->data[SC_POISONINGWEAPON]->val2,100,sc->data[SC_POISONINGWEAPON]->val1,skill_get_time2(GC_POISONINGWEAPON,sc->data[SC_POISONINGWEAPON]->val1)); - if( sc->data[SC__DEADLYINFECT] && damage > 0 && rand()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 ) + if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 ) status_change_spread(src, bl); } @@ -768,7 +770,7 @@ mobskill_event((TBL_MOB*)bl,src,gettick(),MSC_SKILLUSED|(skill_num<<16)); } if( sd ) { - if( (sd->sc.option&OPTION_MADOGEAR) && rand()%100 < 50 ) { + if( (sd->sc.option&OPTION_MADOGEAR) && rnd()%100 < 50 ) { short element = skill_get_ele(skill_num, skill_lv); if( !skill_num || element == -1 ) { //Take weapon's element struct status_data *sstatus = NULL; @@ -900,7 +902,7 @@ } /*========================================== - * HP/SP‹zŽû‚ÌŒvŽZ + * HP/SP drain calculation *------------------------------------------*/ static int battle_calc_drain(int damage, int rate, int per) { @@ -919,7 +921,7 @@ } /*========================================== - * ?C—ûƒ_??[ƒW + * Passif skill dammages increases *------------------------------------------*/ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type) { @@ -1589,11 +1591,11 @@ i*=i; ATK_ADD(i); //Add str bonus. switch (tstatus->size) { //Size-fix. Is this modified by weapon perfection? - case 0: //Small: 125% + case SZ_SMALL: //Small: 125% ATK_RATE(125); break; //case 1: //Medium: 100% - case 2: //Large: 75% + case SZ_BIG: //Large: 75% ATK_RATE(75); break; } @@ -1610,8 +1612,8 @@ sd->inventory_data[index] && sd->inventory_data[index]->type == IT_ARMOR) ATK_ADD(sd->inventory_data[index]->weight/10); - break; - } else + } + else ATK_ADD(sstatus->rhw.atk2); //Else use Atk2 break; case HFLI_SBR44: //[orn] @@ -2123,9 +2125,9 @@ break; case NC_ARMSCANNON: switch( tstatus->size ) { - case 0: skillratio += 100 + 500 * skill_lv; break;// Small - case 1: skillratio += 100 + 400 * skill_lv; break;// Medium - case 2: skillratio += 100 + 300 * skill_lv; break;// Large + case SZ_SMALL: skillratio += 100 + 500 * skill_lv; break;// Small + case SZ_MEDIUM: skillratio += 100 + 400 * skill_lv; break;// Medium + case SZ_BIG: skillratio += 100 + 300 * skill_lv; break;// Large } if( status_get_lv(src) > 100 ) skillratio += skillratio * (status_get_lv(src) - 100) / 200; // Base level bonus. //NOTE: Their's some other factors that affects damage, but not sure how exactly. Will recheck one day. [Rytech] @@ -3299,10 +3301,10 @@ skillratio += 10*skill_lv-30; break; case SL_STIN: - skillratio += (tstatus->size?-99:10*skill_lv); //target size must be small (0) for full damage. + skillratio += (tstatus->size!=SZ_SMALL?-99:10*skill_lv); //target size must be small (0) for full damage. break; case SL_STUN: - skillratio += (tstatus->size!=2?5*skill_lv:-99); //Full damage is dealt on small/medium targets + skillratio += (tstatus->size!=SZ_BIG?5*skill_lv:-99); //Full damage is dealt on small/medium targets break; case SL_SMA: skillratio += -60 + status_get_lv(src); //Base damage is 40% + lv% @@ -3708,7 +3710,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) { @@ -3765,7 +3767,7 @@ { int level = sd?sd->status.base_level:status_get_lv(src); md.damage = skill_lv*sstatus->dex*(3+level/100)*(1+sstatus->int_/35); - md.damage+= md.damage*(rand()%20-10)/100; + md.damage+= md.damage*(rnd()%20-10)/100; md.damage+= 40*(sd?pc_checkskill(sd,RA_RESEARCHTRAP):0); } break; @@ -4022,7 +4024,7 @@ return md; } /*========================================== - * ƒ_??[ƒWŒvŽZˆêŠ‡?ˆ—?—p + * ï¿œ_??[ï¿œ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) { @@ -4079,12 +4081,12 @@ 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,-1); + status_change_end(bl,SC_DEATHBOUND, INVALID_TIMER); rdamage += rd1; if (rdamage < 1) rdamage = 1; } } - if( sc && sc->data[SC_CRESCENTELBOW] && !(flag&BF_SKILL) && !is_boss(src) && rand()%100 < sc->data[SC_CRESCENTELBOW]->val2 ) + if( sc && sc->data[SC_CRESCENTELBOW] && !(flag&BF_SKILL) && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ) { // Stimated formula from test rdamage += (int)((*dmg) + (*dmg) * status_get_hp(src) * 2.15 / 100000); if( rdamage < 1 ) rdamage = 1; @@ -4180,7 +4182,7 @@ return 0; } /*========================================== - * ’Ê??UŒ‚?ˆ—?‚Ü‚Æ‚ß + * ᅵᅵ??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; @@ -4247,13 +4249,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); @@ -4322,7 +4324,7 @@ return ATK_MISS; } if( sc->data[SC_GT_ENERGYGAIN] ) { - if( sd && rand()%100 < 10 + 5 * sc->data[SC_GT_ENERGYGAIN]->val1) + if( sd && rnd()%100 < 10 + 5 * sc->data[SC_GT_ENERGYGAIN]->val1) pc_addspiritball(sd, skill_get_time(MO_CALLSPIRITS, sc->data[SC_GT_ENERGYGAIN]->val1), sc->data[SC_GT_ENERGYGAIN]->val1); @@ -4344,9 +4346,9 @@ if( --(sc->data[SC_SPELLFIST]->val1) >= 0 ) wd = battle_calc_attack(BF_MAGIC,src,target,sc->data[SC_SPELLFIST]->val3,sc->data[SC_SPELLFIST]->val4,flag); else - status_change_end(src,SC_SPELLFIST,-1); + status_change_end(src,SC_SPELLFIST,INVALID_TIMER); } - if( sc->data[SC_GIANTGROWTH] && (wd.flag&BF_SHORT) && rand()%100 < sc->data[SC_GIANTGROWTH]->val2 ) + if( sc->data[SC_GIANTGROWTH] && (wd.flag&BF_SHORT) && rnd()%100 < sc->data[SC_GIANTGROWTH]->val2 ) wd.damage *= 3; // Triple Damage } if (sd && sd->state.arrow_atk) //Consume arrow. @@ -4452,7 +4454,7 @@ } } if (sd) { - if( wd.flag&BF_SHORT && sc && sc->data[SC__AUTOSHADOWSPELL] && rand()%100 < sc->data[SC__AUTOSHADOWSPELL]->val3 && + if( wd.flag&BF_SHORT && sc && sc->data[SC__AUTOSHADOWSPELL] && rnd()%100 < sc->data[SC__AUTOSHADOWSPELL]->val3 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id != 0 && sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].flag == SKILL_FLAG_PLAGIARIZED ) { int r_skill = sd->status.skill[sc->data[SC__AUTOSHADOWSPELL]->val1].id, @@ -4509,6 +4511,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; } @@ -4685,6 +4691,7 @@ return 0; // Disable guardians/emperiums owned by Guilds on non-woe times. break; } + default: break; //other type doesn't have slave yet } switch( src->type ) @@ -4701,9 +4708,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) @@ -4853,7 +4860,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 15963) +++ src/map/skill.c (working copy) @@ -955,7 +955,7 @@ status_zap(bl, 0, rate); break; case SL_STUN: - if (tstatus->size==1) //Only stuns mid-sized mobs. + if (tstatus->size==SZ_MEDIUM) //Only stuns mid-sized mobs. sc_start(bl,SC_STUN,(30+10*skilllv),skilllv,skill_get_time(skillid,skilllv)); break; @@ -1186,11 +1186,11 @@ case NC_PILEBUNKER: if( rnd()%100 < 5 + 15*skilllv ) { //Deactivatable Statuses: Kyrie Eleison, Auto Guard, Steel Body, Assumptio, and Millennium Shield - status_change_end(bl, SC_KYRIE, -1); - status_change_end(bl, SC_AUTOGUARD, -1); - status_change_end(bl, SC_STEELBODY, -1); - status_change_end(bl, SC_ASSUMPTIO, -1); - status_change_end(bl, SC_MILLENNIUMSHIELD, -1); + status_change_end(bl, SC_KYRIE, INVALID_TIMER); + status_change_end(bl, SC_AUTOGUARD, INVALID_TIMER); + status_change_end(bl, SC_STEELBODY, INVALID_TIMER); + status_change_end(bl, SC_ASSUMPTIO, INVALID_TIMER); + status_change_end(bl, SC_MILLENNIUMSHIELD, INVALID_TIMER); } break; case NC_FLAMELAUNCHER: @@ -1260,7 +1260,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 * (rand()%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)); @@ -1269,7 +1269,7 @@ sc_start(bl, SC_FEAR, 5 + 5 * skilllv, skilllv, skill_get_time(skillid, skilllv)); break; case WM_SOUND_OF_DESTRUCTION: - if( rand()%100 < 5 + 5 * skilllv ) { // Temporarly Check Until We Get the Official Formula + if( rnd()%100 < 5 + 5 * skilllv ) { // Temporarly Check Until We Get the Official Formula status_change_end(bl, SC_DANCING, INVALID_TIMER); status_change_end(bl, SC_RICHMANKIM, INVALID_TIMER); status_change_end(bl, SC_ETERNALCHAOS, INVALID_TIMER); @@ -1323,7 +1323,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; } @@ -2635,7 +2635,7 @@ struct status_change *ssc = status_get_sc(src); if( ssc && ssc->data[SC_POISONINGWEAPON] && rnd()%100 < 70 + 5*skilllv ) { sc_start(bl,ssc->data[SC_POISONINGWEAPON]->val2,100,ssc->data[SC_POISONINGWEAPON]->val1,skill_get_time2(GC_POISONINGWEAPON,ssc->data[SC_POISONINGWEAPON]->val1)); - status_change_end(src,SC_POISONINGWEAPON,-1); + status_change_end(src,SC_POISONINGWEAPON,INVALID_TIMER); clif_skill_nodamage(src,bl,skillid,skilllv,1); } } @@ -2666,12 +2666,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) @@ -3096,10 +3096,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) ); } } } @@ -3119,9 +3119,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); @@ -4001,7 +4003,7 @@ else { skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag); - status_change_end(src,SC_ROLLINGCUTTER,-1); + status_change_end(src,SC_ROLLINGCUTTER,INVALID_TIMER); } break; @@ -4147,7 +4149,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; } @@ -4231,9 +4233,10 @@ { //TODO: Need a confirmation if the other type of hidden status is included to be scanned. [Jobbie] if( rnd()%100 < 50 ) sc_start(bl, SC_INFRAREDSCAN, 10000, skilllv, skill_get_time(skillid, skilllv)); - status_change_end(bl, SC_HIDING, -1); - status_change_end(bl, SC_CLOAKING, -1); - status_change_end(bl, SC_CLOAKINGEXCEED, -1); // Need confirm it. + 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 { @@ -4296,30 +4299,36 @@ break; case SR_HOWLINGOFLION: - status_change_end(bl, SC_SWINGDANCE, -1); - status_change_end(bl, SC_SYMPHONYOFLOVER, -1); - status_change_end(bl, SC_MOONLITSERENADE, -1); - status_change_end(bl, SC_RUSHWINDMILL, -1); - status_change_end(bl, SC_ECHOSONG, -1); - status_change_end(bl, SC_HARMONIZE, -1); - status_change_end(bl, SC_SIRCLEOFNATURE, -1); - status_change_end(bl, SC_SATURDAYNIGHTFEVER, -1); - status_change_end(bl, SC_DANCEWITHWUG, -1); - status_change_end(bl, SC_LERADSDEW, -1); - status_change_end(bl, SC_MELODYOFSINK, -1); - status_change_end(bl, SC_BEYONDOFWARCRY, -1); - status_change_end(bl, SC_UNLIMITEDHUMMINGVOICE, -1); + { + 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: if( flag&1 ) { struct status_change *tsc = status_get_sc(bl); if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CHASEWALK] || tsc->data[SC_CLOAKING] || tsc->data[SC_CLOAKINGEXCEED]) ) { - status_change_end(bl, SC_HIDING, -1); - status_change_end(bl, SC_CLOAKING, -1); - status_change_end(bl, SC_CHASEWALK, -1); - status_change_end(bl, SC_CLOAKINGEXCEED, -1); + 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); sc_start(bl,SC_STUN, 25 + 5 * skilllv,skilllv,skill_get_time(skillid,skilllv));//Does it apply the stun chance to targets knocked out of hiding, or it applys allways? [Rytech] skill_attack(BF_WEAPON, src, src, bl, skillid, skilllv, tick, flag); } else @@ -4330,7 +4339,7 @@ break; case WM_LULLABY_DEEPSLEEP: - if( rand()%100 < 88 + 2 * skilllv ) + if( rnd()%100 < 88 + 2 * skilllv ) sc_start(bl,status_skill2sc(skillid),100,skilllv,skill_get_time(skillid,skilllv)); break; @@ -4338,10 +4347,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, -1); + 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; @@ -4355,7 +4364,7 @@ break; case GN_CRAZYWEED: - if( rand()%100 < 75 ) { + if( rnd()%100 < 75 ) { if( bl->type == BL_SKILL ) { struct skill_unit *su = (struct skill_unit *)bl; if( !su ) @@ -4399,7 +4408,7 @@ int i = skill_get_splash(skillid,skilllv); 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( rand()%100 < 30 ) + if( rnd()%100 < 30 ) map_foreachinrange(skill_area_sub,bl,i,BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id); else skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,flag); @@ -4409,7 +4418,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( rand()%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); @@ -4422,7 +4431,7 @@ int i = skill_get_splash(skillid,skilllv); 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( rand()%100 < 30 ) + if( rnd()%100 < 30 ) map_foreachinrange(skill_area_sub,bl,i,BL_CHAR,src,skillid,skilllv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id); else skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,flag); @@ -4451,7 +4460,7 @@ if( (sc && sc->data[type2]) || (tsc && tsc->data[type]) ) { elemental_clean_single_effect(ele, skillid); } - if( rand()%100 < 50 ) + if( rnd()%100 < 50 ) skill_attack(skill_get_type(skillid),src,src,bl,skillid,skilllv,tick,flag); else { sc_start(src,type2,100,skilllv,skill_get_time(skillid,skilllv)); @@ -5435,8 +5444,8 @@ case NC_EMERGENCYCOOL: clif_skill_nodamage(src,bl,skillid,skilllv,1); - status_change_end(src,SC_OVERHEAT_LIMITPOINT,-1); - status_change_end(src,SC_OVERHEAT,-1); + status_change_end(src,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER); + status_change_end(src,SC_OVERHEAT,INVALID_TIMER); break; case SR_WINDMILL: case GN_CART_TORNADO: @@ -7446,9 +7455,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, -1); - status_change_end(bl, SC_STONE, -1); - status_change_end(bl, SC_BLIND, -1); + 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, @@ -7465,9 +7474,9 @@ if( (tsc && (tsc->data[SC_SLEEP] || tsc->data[SC_STUN] || tsc->data[SC_SILENCE]))&& (rnd()%100 < 30+5*skilllv) ) { - status_change_end(bl, SC_SLEEP, -1); - status_change_end(bl, SC_STUN, -1); - status_change_end(bl, SC_SILENCE, -1); + status_change_end(bl, SC_SLEEP, INVALID_TIMER); + status_change_end(bl, SC_STUN, INVALID_TIMER); + status_change_end(bl, SC_SILENCE, INVALID_TIMER); } clif_skill_nodamage(bl, bl, skillid, skilllv, sc_start(bl, type, 100, skilllv, skill_get_time(skillid, skilllv))); @@ -7540,7 +7549,7 @@ break; } if(i==SC_BERSERK /*|| i==SC_SATURDAYNIGHTFEVER*/) tsc->data[i]->val2=0; //Mark a dispelled berserk to avoid setting hp to 100 by setting hp penalty to 0. - status_change_end(bl,(sc_type)i,-1); + status_change_end(bl,(sc_type)i,INVALID_TIMER); } break; } @@ -7606,7 +7615,7 @@ break; // Already work on this target if( tsc && tsc->data[SC_STONE] ) - status_change_end(bl,SC_STONE,-1); + status_change_end(bl,SC_STONE,INVALID_TIMER); else status_change_start(bl,SC_STONE,10000,skilllv,0,0,1000,(8+2*skilllv)*1000,2); } @@ -7622,7 +7631,7 @@ else { rate = 1; - status_change_end(bl,SC_STONE,-1); + status_change_end(bl,SC_STONE,INVALID_TIMER); } if( rate ) @@ -7732,7 +7741,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; } @@ -7822,7 +7831,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; @@ -7840,11 +7849,11 @@ if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || tsc->data[SC_CHASEWALK] || tsc->data[SC_CLOAKINGEXCEED] || tsc->data[SC__INVISIBILITY]) ) { - status_change_end(bl, SC_HIDING, -1); - status_change_end(bl, SC_CLOAKING, -1); - status_change_end(bl, SC_CHASEWALK, -1); - status_change_end(bl, SC_CLOAKINGEXCEED, -1); - status_change_end(bl, SC__INVISIBILITY, -1); + 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); + status_change_end(bl, SC__INVISIBILITY, INVALID_TIMER); sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)); sc_start(bl,SC_BLIND,53 + 2 * skilllv,skilllv,skill_get_time(skillid,skilllv)); @@ -7894,7 +7903,7 @@ case LG_REFLECTDAMAGE: if( tsc && tsc->data[type] ) - status_change_end(bl,type,-1); + status_change_end(bl,type,INVALID_TIMER); else sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)); clif_skill_nodamage(src,bl,skillid,skilllv,1); @@ -7930,7 +7939,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,-1); + status_change_end(bl,SC_SHIELDSPELL_DEF, INVALID_TIMER); break; case 2: val = 10 * shield_data->def; // % Reflected damage. @@ -7958,7 +7967,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|2,skill_castend_damage_id); - status_change_end(bl,SC_SHIELDSPELL_MDEF,-1); + status_change_end(bl,SC_SHIELDSPELL_MDEF,INVALID_TIMER); break; case 2: sc_start(bl,SC_SHIELDSPELL_MDEF,100,opt,-1); @@ -8149,7 +8158,7 @@ if( !status_isdead(bl) ) break; - if( rand()%100 < 88 + 2 * skilllv ) { + if( rnd()%100 < 88 + 2 * skilllv ) { int heal = tstatus->sp; if( heal <= 0 ) heal = 1; @@ -8196,7 +8205,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), @@ -8246,9 +8255,9 @@ case WM_RANDOMIZESPELL: { int improv_skillid = 0, improv_skilllv; do { - i = rand() % MAX_SKILL_IMPROVISE_DB; + i = rnd() % MAX_SKILL_IMPROVISE_DB; improv_skillid = skill_improvise_db[i].skillid; - } while( improv_skillid == 0 || rand()%10000 >= skill_improvise_db[i].per ); + } while( improv_skillid == 0 || rnd()%10000 >= skill_improvise_db[i].per ); improv_skilllv = 4 + skilllv; clif_skill_nodamage (src, bl, skillid, skilllv, 1); @@ -8777,7 +8786,7 @@ if (ud->state.running && ud->skillid == TK_JUMPKICK) { ud->state.running = 0; - status_change_end(src, SC_RUN, -1); + status_change_end(src, SC_RUN, INVALID_TIMER); flag = 1; } @@ -9505,7 +9514,7 @@ } clif_skill_damage(src,src,tick,status_get_amotion(src),0,-30000,1,skillid,skilllv,6); skill_unitsetting(src, skillid, skilllv, x, y, flag); - status_change_end(src,SC_POISONINGWEAPON,-1); + status_change_end(src,SC_POISONINGWEAPON,INVALID_TIMER); break; /** * Arch Bishop @@ -9609,7 +9618,7 @@ case LG_BANDING: if( sc && sc->data[SC_BANDING] ) - status_change_end(src,SC_BANDING,-1); + 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); @@ -9678,11 +9687,11 @@ } } break; - + case SO_FIREWALK: case SO_ELECTRICWALK: if( sc && sc->data[type] ) - status_change_end(src,type,-1); + status_change_end(src,type,INVALID_TIMER); clif_skill_nodamage(src, src ,skillid, skilllv, sc_start2(src, type, 100, skillid, skilllv, skill_get_time(skillid, skilllv))); break; @@ -11052,18 +11061,14 @@ } hp = tstatus->max_hp * hp / 100; sp = tstatus->max_sp * sp / 100; - status_heal(bl, hp, sp, 0); - if( tstatus->hp < tstatus->max_hp ) - clif_skill_nodamage(&src->bl, bl, AL_HEAL, hp, 1); - if( tstatus->sp < tstatus->max_sp ) - clif_skill_nodamage(&src->bl, bl, MG_SRECOVERY, sp, 1); + status_heal(bl, hp, sp, 2); sc_start(bl, type, 100, sg->skill_lv, (sg->interval * 3) + 100); } // 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,-1); - status_change_end(bl,SC_CLOAKING,-1); + 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] @@ -11105,7 +11110,7 @@ if( tsc ) { if( !sg->val2 ) { int sec = skill_get_time2(sg->skill_id, sg->skill_lv); - if( status_change_start(bl, type, 10000, sg->skill_lv, 0, 0, 0, sec, 0) ) { + if( sc_start(bl, type, 100, sg->skill_lv, sec) ) { const struct TimerData* td = tsc->data[type]?get_timer(tsc->data[type]->timer):NULL; if( td ) sec = DIFF_TICK(td->tick, tick); @@ -12172,7 +12177,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; @@ -12180,7 +12185,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. @@ -12190,19 +12195,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; @@ -13929,7 +13934,7 @@ if( !wall ) { if( sce->val1 < 3 ) //End camouflage. - status_change_end(bl, SC_CAMOUFLAGE, -1); + status_change_end(bl, SC_CAMOUFLAGE, INVALID_TIMER); else if( sce->val3&1 ) { //Remove wall bonus @@ -14042,7 +14047,7 @@ case RA_ELECTRICSHOCKER: { struct block_list* target = map_id2bl(group->val2); if( target ) - status_change_end(target, SC_ELECTRICSHOCKER, -1); + status_change_end(target, SC_ELECTRICSHOCKER, INVALID_TIMER); } break; case SC_MAELSTROM: @@ -14237,7 +14242,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,-1); + status_change_end(src,SC_NEUTRALBARRIER_MASTER, INVALID_TIMER); } } break; @@ -14246,7 +14251,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,-1); + status_change_end(src,SC_STEALTHFIELD_MASTER, INVALID_TIMER); } } break; @@ -14255,7 +14260,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,-1); + status_change_end(src,SC_BANDING, INVALID_TIMER); } } break; @@ -15118,10 +15123,10 @@ qty = 3; break; //3 items to make at once. case 9: - qty = 3 + rand()%3; + qty = 3 + rnd()%3; break; //3~5 items to make at once. case 10: - qty = 4 + rand()%3; + qty = 4 + rnd()%3; break; //4~6 items to make at once. default: qty = 2; @@ -15237,8 +15242,8 @@ tmp_item.amount = 0; if( skill_id == GN_MIX_COOKING && firstQty > 1 ) {// Mix Cooking level 2. // Success. As I see the chance as level 2 is global, not indiviual. - if( rand()%10000 < make_per ) - tmp_item.amount = 5 + rand()%5; + if( rnd()%10000 < make_per ) + tmp_item.amount = 5 + rnd()%5; } else { for (i=0; i< qty; i++) { //Apply quantity modifiers. if (rnd()%10000 < make_per || qty == 1) { //Success @@ -15357,11 +15362,11 @@ memset(&tmp_item,0,sizeof(tmp_item)); tmp_item.nameid = nameid; do { - i = rand()%5; + i = rnd()%5; tmp_item.nameid = products[i][0]; } - while( rand()%10000 >= products[i][1] ); - tmp_item.amount = (firstQty > 1 )? 5 + rand()%5 : 1; // When it fails it gives a random amount of items. + while( rnd()%10000 >= products[i][1] ); + tmp_item.amount = (firstQty > 1 )? 5 + rnd()%5 : 1; // When it fails it gives a random amount of items. tmp_item.identify = 1; if( pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) { clif_additem(sd,0,0,flag); @@ -15521,7 +15526,7 @@ int i, j, points, skillid, preserved = 0, max_preserve; nullpo_ret(sd); - if( sd->sc.data[SC_STOP] ) status_change_end(&sd->bl,SC_STOP,-1); + if( sd->sc.data[SC_STOP] ) status_change_end(&sd->bl,SC_STOP,INVALID_TIMER); if( nameid <= 0 ) return 0; if( pc_search_inventory(sd,nameid) < 0 ) @@ -15571,13 +15576,13 @@ 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,-1); + status_change_end(&sd->bl,SC_STOP,INVALID_TIMER); } if( (id = sd->status.skill[skill_id].id) == 0 || sd->status.skill[skill_id].flag != SKILL_FLAG_PLAGIARIZED || @@ -15592,6 +15597,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; @@ -15610,8 +15616,8 @@ if( skill_lv == 2 ) del_amount -= (del_amount % 10); - add_amount = (skill_lv == 1) ? del_amount * (5 + rand()%5) : 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; @@ -15638,7 +15644,7 @@ return 1; } - if( skill_lv == 2 && rand()%100 < 25 ) { // At level 2 have a fail chance. You loose your items if it fails. + if( skill_lv == 2 && rnd()%100 < 25 ) { // At level 2 have a fail chance. You loose your items if it fails. clif_skill_fail(sd,SO_EL_ANALYSIS,0,0); return 1; } Index: src/map/unit.c =================================================================== --- src/map/unit.c (revision 15963) +++ 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; @@ -155,7 +155,7 @@ if(map_getcell(bl->m,x+dx,y+dy,CELL_CHKNOPASS)) return unit_walktoxy_sub(bl); - // ƒoƒVƒŠƒJ”»’è + // ï¿œoï¿œVᅵᅵᅵJᅵᅵᅵᅵ map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl); @@ -309,8 +309,8 @@ map_random_dir(bl, &ud->to_x, &ud->to_y); if(ud->walktimer != INVALID_TIMER) { - // Œ»Ý•à‚¢‚Ä‚¢‚éÅ’†‚Ì–Ú“I’n•ÏX‚Ȃ̂Ń}ƒX–Ú‚Ì’†S‚É—ˆ‚œŽž‚É - // timerŠÖ”‚©‚çunit_walktoxy_sub‚ðŒÄ‚Ô‚æ‚€‚É‚·‚é + // ᅵᅵᅵݕᅵᅵᅵᅵĂᅵᅵᅵŒᅵᅵ̖ړIï¿œnᅵύXᅵȂ̂Ń}ï¿œXᅵڂ̒ᅵᅵSᅵɗᅵᅵᅵᅵᅵᅵᅵ + // timerᅵ֐ᅵᅵᅵᅵᅵunit_walktoxy_subᅵᅵᅵĂԂ悀ᅵɂᅵᅵᅵ ud->state.change_walk_target = 1; return 1; } @@ -491,7 +491,7 @@ nullpo_ret(bl); if (!unit_can_move(bl)) { - status_change_end(bl,SC_WUGDASH,-1); + status_change_end(bl,SC_WUGDASH,INVALID_TIMER); return 0; } @@ -516,7 +516,7 @@ if(to_x == bl->x && to_y == bl->y) { unit_bl2ud(bl)->state.running = 0; - status_change_end(bl,SC_WUGDASH,-1); + status_change_end(bl,SC_WUGDASH, INVALID_TIMER); if( sd ){ clif_fixpos(bl); @@ -533,7 +533,7 @@ if (i==0) { unit_bl2ud(bl)->state.running = 0; - status_change_end(bl,SC_WUGDASH,-1); + status_change_end(bl,SC_WUGDASH,INVALID_TIMER); if( sd ){ clif_fixpos(bl); @@ -1004,8 +1004,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); @@ -1091,7 +1091,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: @@ -1126,11 +1126,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; @@ -1293,11 +1292,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,-1); + 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,-1); + status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER); } } @@ -1336,7 +1335,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); @@ -1373,7 +1372,7 @@ return 0; } - /* ŽË’ö‚ƏáŠQ•šƒ`ƒFƒbƒN */ + /* Check range and obstacle */ bl.type = BL_NUL; bl.m = src->m; bl.x = skill_x; @@ -1425,7 +1424,7 @@ if( sc->data[SC_CURSEDCIRCLE_ATKER] ) { sc->data[SC_CURSEDCIRCLE_ATKER]->val3 = 1; - status_change_end(src,SC_CURSEDCIRCLE_ATKER,-1); + status_change_end(src,SC_CURSEDCIRCLE_ATKER, INVALID_TIMER); } } @@ -1476,8 +1475,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) { @@ -1564,7 +1563,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); @@ -1608,7 +1607,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) { @@ -1666,7 +1665,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) { @@ -1871,7 +1870,7 @@ return 1; } -// unit_data ‚̏‰Šú‰»ˆ— +// unit_data initialization process void unit_dataset(struct block_list *bl) { struct unit_data *ud; @@ -1930,7 +1929,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) { Index: src/map/battle.h =================================================================== --- src/map/battle.h (revision 15963) +++ 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 15963) +++ 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 15963) +++ src/map/unit.h (working copy) @@ -66,60 +66,60 @@ 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 target_lv); -// 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); @@ -128,7 +128,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 15963) +++ 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 15963) +++ 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 15963) +++ 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 15963) +++ 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 15963) +++ src/map/mob.c (working copy) @@ -223,10 +223,10 @@ //FIXME: This implementation is not stable, npc scripts will stop working once MAX_MOB_DB changes value! [Skotlex] if(data->class_ > 2*MAX_MOB_DB){ // large/tiny mobs [Valaris] - data->state.size=2; + data->state.size=SZ_BIG; data->class_ -= 2*MAX_MOB_DB; } else if (data->class_ > MAX_MOB_DB) { - data->state.size=1; + data->state.size=SZ_MEDIUM; data->class_ -= MAX_MOB_DB; } @@ -239,12 +239,12 @@ if( i ) { - if( i&2 ) - data->state.size = 1; - else if( i&4 ) - data->state.size = 2; - 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. } @@ -2197,9 +2197,9 @@ } // change experience for different sized monsters [Valaris] - if(md->special_state.size==1) + if(md->special_state.size==SZ_MEDIUM) per /=2.; - else if(md->special_state.size==2) + else if(md->special_state.size==SZ_BIG) per *=2.; if( md->dmglog[i].flag == MDLF_PET ) @@ -2313,9 +2313,9 @@ } // change drops depending on monsters size [Valaris] - if(md->special_state.size==1 && drop_rate >= 2) + if(md->special_state.size==SZ_MEDIUM && drop_rate >= 2) drop_rate/=2; - else if(md->special_state.size==2) + else if(md->special_state.size==SZ_BIG) drop_rate*=2; if (src) { //Drops affected by luk as a fixed increase [Valaris] @@ -2722,7 +2722,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 +2763,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 +2778,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 +2884,7 @@ } /*========================================== - *MOBskill‚©‚çŠY“–skillid‚Ìskillidx‚ð•Ô‚· + * MOBskill lookup *------------------------------------------*/ int mob_skillid2skillidx(int class_,int skillid) { @@ -3896,7 +3896,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 15963) +++ 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) { @@ -1367,9 +1367,9 @@ case BL_NPC: { TBL_NPC *nd = ((TBL_NPC*)bl); - if( nd->size == 2 ) + if( nd->size == SZ_BIG ) clif_specialeffect(&nd->bl,423,AREA); - else if( nd->size == 1 ) + else if( nd->size == SZ_MEDIUM ) clif_specialeffect(&nd->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; @@ -3162,7 +3162,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)); } @@ -4050,18 +4050,18 @@ TBL_NPC* nd = (TBL_NPC*)bl; if( nd->chat_id ) clif_dispchat((struct chat_data*)map_id2bl(nd->chat_id),sd->fd); - if( nd->size == 2 ) + if( nd->size == SZ_BIG ) clif_specialeffect_single(bl,423,sd->fd); - else if( nd->size == 1 ) + else if( nd->size == SZ_MEDIUM ) clif_specialeffect_single(bl,421,sd->fd); } break; 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_single(bl,423,sd->fd); - else if(md->special_state.size==1) + else if(md->special_state.size==SZ_MEDIUM) clif_specialeffect_single(bl,421,sd->fd); } break; @@ -11725,22 +11725,22 @@ switch( RFIFOL(fd,2) ) { - case 0: // ƒMƒ‹ƒhŠî–{î•ñA“¯–¿“G‘Ώî•ñ + case 0: // ï¿œMᅵᅵᅵhᅵᅵ{ᅵᅵᅵAᅵᅵᅵᅵᅵGᅵΏᅵᅵ clif_guild_basicinfo(sd); clif_guild_allianceinfo(sd); break; - case 1: // ƒƒ“ƒo[ƒŠƒXƒgA–ðE–ŒƒŠƒXƒg + case 1: // ᅵᅵᅵᅵᅵoï¿œ[ᅵᅵᅵXï¿œgï¿œAᅵᅵEᅵᅵᅵᅵᅵXï¿œg clif_guild_positionnamelist(sd); clif_guild_memberlist(sd); break; - case 2: // –ðE–ŒƒŠƒXƒgA–ðEî•ñƒŠƒXƒg + case 2: // ᅵᅵEᅵᅵᅵᅵᅵXï¿œgï¿œAᅵᅵEᅵᅵñƒŠƒXï¿œg clif_guild_positionnamelist(sd); clif_guild_positioninfolist(sd); break; - case 3: // ƒXƒLƒ‹ƒŠƒXƒg + case 3: // ï¿œXï¿œLᅵᅵᅵᅵᅵXï¿œg clif_guild_skillinfo(sd); break; - case 4: // ’Ç•úƒŠƒXƒg + case 4: // ᅵǕᅵXï¿œg clif_guild_expulsionlist(sd); break; default: @@ -15857,7 +15857,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); } @@ -16159,7 +16159,7 @@ #endif #if PACKETVER < 2 3, 28, 19, 11, 3, -1, 9, 5, 52, 51, 56, 58, 41, 2, 6, 6, -#elif PACKETVER < 20071106 // 78-7b ‹T“‡ˆÈ~ lv99ƒGƒtƒFƒNƒg—p +#elif PACKETVER < 20071106 // 78-7b ï¿œTᅵᅵᅵȍ~ lv99ï¿œGï¿œtï¿œFï¿œNï¿œgï¿œp 3, 28, 19, 11, 3, -1, 9, 5, 54, 53, 58, 60, 41, 2, 6, 6, #elif PACKETVER <= 20081217 // change in 0x78 and 0x7c 3, 28, 19, 11, 3, -1, 9, 5, 55, 53, 58, 60, 42, 2, 6, 6, @@ -16194,7 +16194,7 @@ 6, 3,106, 10, 10, 34, 0, 6, 8, 4, 4, 4, 29, -1, 10, 6, #if PACKETVER < 1 90, 86, 24, 6, 30,102, 8, 4, 8, 4, 14, 10, -1, 6, 2, 6, -#else // 196 comodoˆÈ~ ó‘Ô•\ŽŠƒAƒCƒRƒ“—p +#else // 196 comodoᅵȍ~ ᅵᅵԕ\ᅵᅵᅵAï¿œCï¿œRᅵᅵᅵp 90, 86, 24, 6, 30,102, 9, 4, 8, 4, 14, 10, -1, 6, 2, 6, #endif #if PACKETVER < 20081126 Index: src/map/chat.c =================================================================== --- src/map/chat.c (revision 15963) +++ 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 15963) +++ src/map/mob.h (working copy) @@ -63,6 +63,12 @@ MDLF_PET, }; +enum size { + SZ_SMALL = 0, + SZ_MEDIUM, + SZ_BIG, +}; + struct mob_skill { enum MobSkillState state; short skill_id,skill_lv; Index: src/map/itemdb.c =================================================================== --- src/map/itemdb.c (revision 15963) +++ 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/guild.c =================================================================== --- src/map/guild.c (revision 15963) +++ 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/intif.c =================================================================== --- src/map/intif.c (revision 15963) +++ 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; @@ -2078,19 +2124,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) @@ -2100,7 +2146,7 @@ if((int)RFIFOREST(fd)strdb_foreach * called from npc_parse_script *------------------------------------------*/ int npc_timerevent_export(struct npc_data *nd, int i) @@ -1062,7 +1062,7 @@ } /*========================================== - * NPC‚̃I[ƒvƒ“ƒ`ƒƒƒbƒg”­ŒŸ + * NPC I guess something like npctalk *------------------------------------------*/ int npc_globalmessage(const char* name, const char* mes) { @@ -1104,7 +1104,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 15963) +++ 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 { @@ -1106,9 +1106,9 @@ if (sc->data[SC_BERSERK] && status->hp <= 100) status_change_end(target, SC_BERSERK, INVALID_TIMER); if( sc->data[SC_RAISINGDRAGON] && status->hp <= 1000 ) - status_change_end(target, SC_RAISINGDRAGON, -1); - if (sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100) - status_change_end(target, SC_SATURDAYNIGHTFEVER, -1); + status_change_end(target, SC_RAISINGDRAGON, INVALID_TIMER); + if( sc->data[SC_SATURDAYNIGHTFEVER] && status->hp <= 100 ) + status_change_end(target, SC_SATURDAYNIGHTFEVER, INVALID_TIMER); } switch (target->type) @@ -1543,8 +1543,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. @@ -1570,6 +1570,7 @@ tsc = status_get_sc(target); + // Check for target's status changes. if(tsc && tsc->count) { if( tsc->data[SC_INVINCIBLE] ) return 0; @@ -2156,7 +2157,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; @@ -2239,13 +2240,13 @@ //Give them all modes except these (useful for clones) status->mode = MD_MASK&~(MD_BOSS|MD_PLANT|MD_DETECTOR|MD_ANGRY|MD_TARGETWEAK); - status->size = (sd->class_&JOBL_BABY)?0:1; + status->size = (sd->class_&JOBL_BABY)?SZ_SMALL:SZ_MEDIUM; if (battle_config.character_size && pc_isriding(sd)) { //[Lupus] if (sd->class_&JOBL_BABY) { - if (battle_config.character_size&2) + if (battle_config.character_size&SZ_BIG) status->size++; } else - if(battle_config.character_size&1) + if(battle_config.character_size&SZ_MEDIUM) status->size++; } status->aspd_rate = 1000; @@ -5127,8 +5128,8 @@ } /*========================================== - * ‘ΏۂÌClass‚ð•Ô‚·(”Ä—p) - * –ß‚è‚͐®”‚Å0ˆÈã + * ᅵΏۂᅵClassᅵᅵԂᅵ(ᅵėp) + * ᅵ߂ᅵ͐ᅵᅵᅵᅵᅵ0ᅵȏᅵ *------------------------------------------*/ int status_get_class(struct block_list *bl) { nullpo_ret(bl); @@ -5144,8 +5145,8 @@ return 0; } /*========================================== - * ‘Ώۂ̃Œƒxƒ‹‚ð•Ô‚·(”Ä—p) - * –ß‚è‚͐®”‚Å0ˆÈã + * ᅵΏۂ̃ᅵᅵxᅵᅵᅵᅵԂᅵ(ᅵėp) + * ᅵ߂ᅵ͐ᅵᅵᅵᅵᅵ0ᅵȏᅵ *------------------------------------------*/ int status_get_lv(struct block_list *bl) { nullpo_ret(bl); @@ -6727,7 +6728,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 @@ -6800,7 +6801,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. @@ -7403,13 +7404,13 @@ val_flag |= 1|2|4; break; case SC_WHITEIMPRISON: - status_change_end(bl, SC_BURNING, -1); - status_change_end(bl, SC_FREEZING, -1); - status_change_end(bl, SC_FREEZE, -1); - status_change_end(bl, SC_STONE, -1); + status_change_end(bl, SC_BURNING, INVALID_TIMER); + status_change_end(bl, SC_FREEZING, INVALID_TIMER); + status_change_end(bl, SC_FREEZE, INVALID_TIMER); + status_change_end(bl, SC_STONE, INVALID_TIMER); break; case SC_FREEZING: - status_change_end(bl, SC_BURNING, -1); + status_change_end(bl, SC_BURNING, INVALID_TIMER); break; case SC_READING_SB: // val2 = sp reduction per second @@ -7521,9 +7522,9 @@ val3 = 0; break; case SC_WARMER: - status_change_end(bl, SC_FREEZE, -1); - status_change_end(bl, SC_FREEZING, -1); - status_change_end(bl, SC_CRYSTALIZE, -1); + status_change_end(bl, SC_FREEZE, INVALID_TIMER); + status_change_end(bl, SC_FREEZING, INVALID_TIMER); + status_change_end(bl, SC_CRYSTALIZE, INVALID_TIMER); break; case SC_STRIKING: val4 = tick / 1000; @@ -8146,7 +8147,7 @@ return 1; } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙí‘S‰ðœ + * ï¿œXï¿œeï¿œ[ï¿œ^ï¿œXᅵُᅵSᅵᅵᅵᅵ * type: * 0 - ??? * 1 - ??? @@ -8235,7 +8236,7 @@ } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙíI—¹ + * ï¿œXï¿œeï¿œ[ï¿œ^ï¿œXᅵُᅵIᅵᅵ *------------------------------------------*/ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const char* file, int line) { @@ -8624,7 +8625,7 @@ } break; case SC_ADORAMUS: - status_change_end(bl, SC_BLIND, -1); + status_change_end(bl, SC_BLIND, INVALID_TIMER); break; case SC__SHADOWFORM: { struct map_session_data *s_sd = map_id2sd(sce->val2); @@ -8668,7 +8669,7 @@ int i; i = min(sd->spiritball,5); pc_delspiritball(sd, sd->spiritball, 0); - status_change_end(bl, SC_EXPLOSIONSPIRITS, -1); + status_change_end(bl, SC_EXPLOSIONSPIRITS, INVALID_TIMER); while( i > 0 ) { pc_addspiritball(sd, skill_get_time(MO_CALLSPIRITS, pc_checkskill(sd,MO_CALLSPIRITS)), 5); --i; @@ -8901,7 +8902,7 @@ } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙíI—¹ƒ^ƒCƒ}[ + * ï¿œXï¿œeï¿œ[ï¿œ^ï¿œXᅵُᅵIᅵᅵᅵ^ï¿œCï¿œ}ï¿œ[ *------------------------------------------*/ int status_change_timer(int tid, unsigned int tick, int id, intptr_t data) { @@ -9097,7 +9098,7 @@ } break; - case SC_DANCING: //ƒ_ƒ“ƒXƒXƒLƒ‹‚ÌŽžŠÔSPÁ”ï + case SC_DANCING: //ï¿œ_ᅵᅵᅵXï¿œXï¿œLᅵᅵᅵ̎ᅵᅵᅵSPᅵᅵᅵᅵ { int s = 0; int sp = 1; @@ -9650,8 +9651,8 @@ { struct block_list *s_bl = battle_get_master(bl); if( s_bl ) - status_change_end(s_bl,type+1,-1); - status_change_end(bl,type,-1); + 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); @@ -9687,7 +9688,7 @@ } /*========================================== - * ƒXƒe[ƒ^ƒXˆÙíƒ^ƒCƒ}[”͈͏ˆ— + * ï¿œXï¿œeï¿œ[ï¿œ^ï¿œXᅵُᅵ^ï¿œCï¿œ}ï¿œ[ᅵ͈͏ᅵᅵᅵ *------------------------------------------*/ int status_change_timer_sub(struct block_list* bl, va_list ap) { @@ -9704,7 +9705,7 @@ tsc = status_get_sc(bl); switch( type ) { - case SC_SIGHT: /* ƒTƒCƒg */ + case SC_SIGHT: /* ï¿œTï¿œCï¿œg */ case SC_CONCENTRATE: status_change_end(bl, SC_HIDING, INVALID_TIMER); status_change_end(bl, SC_CLOAKING, INVALID_TIMER); @@ -9712,7 +9713,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: /* ᅵᅵᅵAï¿œt */ if (tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || tsc->data[SC_CAMOUFLAGE] || tsc->data[SC_CLOAKINGEXCEED] || tsc->data[SC__INVISIBILITY])) { @@ -9742,7 +9743,7 @@ break; case SC_CURSEDCIRCLE_TARGET: if( tsc && tsc->data[SC_CURSEDCIRCLE_TARGET] && tsc->data[SC_CURSEDCIRCLE_TARGET]->val2 == src->id ) { - status_change_end(bl, type, -1); + status_change_end(bl, type, INVALID_TIMER); } break; } @@ -10326,7 +10327,7 @@ } /*========================================== - * ƒXƒLƒ‹ŠÖŒW‰Šú‰»ˆ— + * ï¿œXï¿œLᅵᅵᅵ֌Wᅵᅵᅵᅵᅵᅵ *------------------------------------------*/ int do_init_status(void) { Index: src/map/trade.c =================================================================== --- src/map/trade.c (revision 15963) +++ 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 15963) +++ 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 ) @@ -1448,6 +1452,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); @@ -2008,7 +2013,7 @@ } /*========================================== - * ? ”õ•i‚É‚æ‚é”\—Í“™‚̃{?ƒiƒXÝ’è + * ? ᅵᅵᅵiᅵɂᅵᅵ\ᅵ͓ᅵᅵ̃{?ï¿œiï¿œXᅵݒᅵ *------------------------------------------*/ int pc_bonus(struct map_session_data *sd,int type,int val) { @@ -2594,7 +2599,7 @@ } /*========================================== - * ? ”õ•i‚É‚æ‚é”\—Í“™‚̃{?ƒiƒXÝ’è + * ? ᅵᅵᅵiᅵɂᅵᅵ\ᅵ͓ᅵᅵ̃{?ï¿œiï¿œXᅵݒᅵ *------------------------------------------*/ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) { @@ -3327,7 +3332,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 +3387,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 +3410,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 +3426,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 +3454,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 +3550,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 +3614,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 +3626,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 +3704,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 +3735,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 +3779,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 +3795,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 +3849,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 +3873,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 +4010,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 +4035,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) || @@ -4099,7 +4130,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) { @@ -4159,7 +4193,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) { @@ -4186,7 +4223,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) { @@ -4209,7 +4249,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) { @@ -4225,7 +4268,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) { @@ -4249,7 +4295,7 @@ } /*========================================== - * ƒXƒeƒBƒ‹•iŒöŠJ + * Display item stolen msg to player sd *------------------------------------------*/ int pc_show_steal(struct block_list *bl,va_list ap) { @@ -4271,7 +4317,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) { @@ -4352,7 +4401,10 @@ } /*========================================== - * + * Stole zeny from bl (mob) + * return + * 0 = fail + * 1 = success *------------------------------------------*/ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) { @@ -4373,7 +4425,7 @@ rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2; if(rnd()%1000 < rate) { - int amount = md->level*10 + rand()%100; + int amount = md->level*10 + rnd()%100; log_zeny(sd, LOG_TYPE_STEAL, sd, amount); pc_getzeny(sd, amount); @@ -4541,7 +4593,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) { @@ -4552,7 +4608,7 @@ m=sd->bl.m; - if (map[sd->bl.m].flag.noteleport) // ƒeƒŒƒ|?ƒg‹ÖŽ~ + if (map[sd->bl.m].flag.noteleport) // ï¿œeᅵᅵᅵ|?ï¿œgᅵ֎~ return 0; do{ @@ -4616,14 +4672,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; @@ -4645,13 +4703,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) { @@ -4697,7 +4750,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) { @@ -5367,7 +5421,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]; @@ -5389,7 +5443,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) { @@ -5482,8 +5536,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); @@ -5494,6 +5550,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) @@ -5504,8 +5561,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); @@ -5515,6 +5577,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) @@ -5684,7 +5747,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) { @@ -5746,6 +5810,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] @@ -6173,6 +6238,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; @@ -6495,10 +6563,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) { @@ -6544,7 +6613,7 @@ } /*========================================== - * script—pPCƒXƒe?ƒ^ƒXÝ’è + * script set pc status registry *------------------------------------------*/ int pc_setparam(struct map_session_data *sd,int type,int val) { @@ -6712,7 +6781,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) { @@ -6770,7 +6841,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) { @@ -6808,9 +6880,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) @@ -6901,7 +6971,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 @@ -6967,7 +7037,7 @@ } /*========================================== - * Œ©‚œ–Ú?X + * Tell client player sd has change equipement *------------------------------------------*/ int pc_equiplookall(struct map_session_data *sd) { @@ -6984,7 +7054,7 @@ } /*========================================== - * Œ©‚œ–Ú?X + * Tell client player sd has change look (hair,equip...) *------------------------------------------*/ int pc_changelook(struct map_session_data *sd,int type,int val) { @@ -7044,7 +7114,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) { @@ -7107,20 +7177,20 @@ if( (sd->class_&MAPID_THIRDMASK) == MAPID_MECHANIC ) { if( type&OPTION_MADOGEAR && !(p_type&OPTION_MADOGEAR) ) { status_calc_pc(sd, 0); - status_change_end(&sd->bl,SC_MAXIMIZEPOWER,-1); - status_change_end(&sd->bl,SC_OVERTHRUST,-1); - status_change_end(&sd->bl,SC_WEAPONPERFECTION,-1); - status_change_end(&sd->bl,SC_ADRENALINE,-1); - status_change_end(&sd->bl,SC_CARTBOOST,-1); - status_change_end(&sd->bl,SC_MELTDOWN,-1); - status_change_end(&sd->bl,SC_MAXOVERTHRUST,-1); + status_change_end(&sd->bl,SC_MAXIMIZEPOWER,INVALID_TIMER); + status_change_end(&sd->bl,SC_OVERTHRUST,INVALID_TIMER); + status_change_end(&sd->bl,SC_WEAPONPERFECTION,INVALID_TIMER); + status_change_end(&sd->bl,SC_ADRENALINE,INVALID_TIMER); + status_change_end(&sd->bl,SC_CARTBOOST,INVALID_TIMER); + status_change_end(&sd->bl,SC_MELTDOWN,INVALID_TIMER); + status_change_end(&sd->bl,SC_MAXOVERTHRUST,INVALID_TIMER); } else if( !(type&OPTION_MADOGEAR) && p_type&OPTION_MADOGEAR ) { status_calc_pc(sd, 0); - status_change_end(&sd->bl,SC_SHAPESHIFT,-1); - status_change_end(&sd->bl,SC_HOVERING,-1); - status_change_end(&sd->bl,SC_ACCELERATION,-1); - status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,-1); - status_change_end(&sd->bl,SC_OVERHEAT,-1); + status_change_end(&sd->bl,SC_SHAPESHIFT,INVALID_TIMER); + status_change_end(&sd->bl,SC_HOVERING,INVALID_TIMER); + status_change_end(&sd->bl,SC_ACCELERATION,INVALID_TIMER); + status_change_end(&sd->bl,SC_OVERHEAT_LIMITPOINT,INVALID_TIMER); + status_change_end(&sd->bl,SC_OVERHEAT,INVALID_TIMER); } } @@ -7162,7 +7232,7 @@ } /*========================================== - * ƒJ?ƒgÝ’è + * Give player a cart *------------------------------------------*/ int pc_setcart(struct map_session_data *sd,int type) { @@ -7187,12 +7257,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 @@ -7202,12 +7272,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); @@ -7217,7 +7287,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) { @@ -7229,7 +7299,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) { @@ -7241,7 +7312,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) { @@ -7269,7 +7341,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) { @@ -7281,7 +7354,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) { @@ -7561,7 +7635,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) { @@ -7586,7 +7660,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?’ljÁ + * Add eventtimer for player sd ? *------------------------------------------*/ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) { @@ -7604,7 +7678,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?íœ + * Del eventtimer for player sd ? *------------------------------------------*/ int pc_deleventtimer(struct map_session_data *sd,const char *name) { @@ -7634,7 +7708,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) { @@ -7653,7 +7727,7 @@ } /*========================================== - * ƒCƒxƒ“ƒgƒ^ƒCƒ}?‘Síœ + * Remove all eventtimer for player sd *------------------------------------------*/ int pc_cleareventtimer(struct map_session_data *sd) { @@ -7676,10 +7750,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) { @@ -7862,7 +7936,7 @@ } /*========================================== - * ? ”õ‚µ‚œ•š‚ðŠO‚· + * Called when attemting to unequip an item from player * type: * 0 - only unequip * 1 - calculate status after unequipping @@ -7991,8 +8065,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) { @@ -8072,7 +8146,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) { @@ -8091,7 +8165,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) { @@ -8106,7 +8181,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) { @@ -8128,7 +8203,10 @@ } /*========================================== - * sd‚ÍŒ‹¥‚µ‚Ä‚¢‚é‚©(?¥‚̏ꍇ‚Í‘Š•û‚Ìchar_id‚ð•Ô‚·) + * Checking if sd is married + * Return + * partner_id = yes, + * 0 = no *------------------------------------------*/ int pc_ismarried(struct map_session_data *sd) { @@ -8140,7 +8218,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) { @@ -8155,6 +8236,9 @@ /*========================================== * Divorce sd from its partner + * return + * -1 = fail + * 0 = success *------------------------------------------*/ int pc_divorce(struct map_session_data *sd) { @@ -8193,7 +8277,7 @@ } /*========================================== - * sd‚Ì‘Š•û‚Ìmap_session_data‚ð•Ô‚· + * Get sd partner charid. (Married partner) *------------------------------------------*/ struct map_session_data *pc_get_partner(struct map_session_data *sd) { @@ -8204,6 +8288,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) @@ -8213,6 +8300,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) @@ -8222,6 +8312,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) @@ -8231,6 +8324,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; @@ -8292,7 +8388,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) { @@ -8306,7 +8402,7 @@ } /*========================================== - * Ž©“®ƒZ?ƒu (timer??) + * Save 1 player data at autosave intervalle *------------------------------------------*/ int pc_autosave(int tid, unsigned int tick, int id, intptr_t data) { @@ -8423,7 +8519,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 @@ -8596,7 +8692,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)); @@ -8681,12 +8777,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 struct block_list* static DBMap* pc_db=NULL; // int id -> struct map_session_data* static DBMap* mobid_db=NULL; // int id -> struct mob_data* @@ -183,12 +183,12 @@ } // -// blockíœ‚̈À‘S«Šm•Û?— +// blockᅵ폜ᅵ̈ᅵᅵSᅵᅵᅵmᅵᅵ?ᅵᅵ // /*========================================== - * block‚ðfree‚·‚é‚Æ‚«free‚Ì?‚í‚è‚ÉŒÄ‚Ô - * ƒƒbƒN‚³‚ê‚Ä‚¢‚é‚Æ‚«‚̓oƒbƒtƒ@‚É‚œ‚ß‚é + * blockᅵᅵfreeᅵᅵᅵᅵƂᅵfreeᅵᅵ?ᅵᅵᅵɌĂᅵ + * ᅵᅵᅵbï¿œNᅵᅵᅵᅵĂᅵᅵᅵƂᅵᅵ̓oï¿œbï¿œtï¿œ@ᅵɂᅵᅵ߂ᅵ *------------------------------------------*/ int map_freeblock (struct block_list *bl) { @@ -205,7 +205,7 @@ return block_free_lock; } /*========================================== - * block‚Ìfree‚ðˆêŽsI‚É‹ÖŽ~‚·‚é + * blockᅵᅵfreeᅵᅵᅵᅵsIᅵɋ֎~ᅵᅵᅵᅵ *------------------------------------------*/ int map_freeblock_lock (void) { @@ -213,9 +213,9 @@ } /*========================================== - * block‚Ìfree‚̃ƒbƒN‚ð‰ðœ‚·‚é - * ‚±‚Ì‚Æ‚«AƒƒbƒN‚ªŠ®‘S‚É‚È‚­‚È‚é‚Æ - * ƒoƒbƒtƒ@‚É‚œ‚Ü‚Á‚Ä‚¢‚œblock‚ð‘S•”íœ + * blockᅵᅵfreeᅵ̃ᅵᅵbï¿œNᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ + * ᅵᅵᅵ̂ƂᅵᅵAᅵᅵᅵbï¿œNᅵᅵᅵᅵᅵSᅵɂȂᅵᅵȂᅵᅵ + * ï¿œoï¿œbï¿œtï¿œ@ᅵɂᅵᅵ܂ᅵᅵĂᅵᅵᅵblockᅵᅵSᅵᅵᅵ폜 *------------------------------------------*/ int map_freeblock_unlock (void) { @@ -235,10 +235,10 @@ return block_free_lock; } -// map_freeblock_lock() ‚ðŒÄ‚ñ‚Å map_freeblock_unlock() ‚ðŒÄ‚΂Ȃ¢ -// ŠÖ”‚ª‚ ‚Á‚œ‚̂ŁA’èŠú“I‚Éblock_free_lock‚ðƒŠƒZƒbƒg‚·‚é‚æ‚€‚É‚·‚éB -// ‚±‚̊֐”‚́Ado_timer() ‚̃gƒbƒvƒŒƒxƒ‹‚©‚çŒÄ‚΂ê‚é‚̂ŁA -// block_free_lock ‚𒌐ڂ¢‚¶‚Á‚Ä‚àŽxá–³‚¢‚Í‚žB +// map_freeblock_lock() ᅵᅵᅵĂᅵᅵ map_freeblock_unlock() ᅵᅵᅵĂ΂Ȃᅵ +// ᅵ֐ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̂ŁAᅵᅵᅵIᅵᅵblock_free_lockᅵᅵᅵᅵᅵZï¿œbï¿œgᅵᅵᅵᅵ悀ᅵɂᅵᅵᅵB +// ᅵᅵᅵ̊֐ᅵᅵ́Ado_timer() ᅵ̃gï¿œbï¿œvᅵᅵᅵxᅵᅵᅵᅵᅵᅵĂ΂ᅵᅵ̂ŁA +// block_free_lock ᅵ𒌐ڂᅵᅵᅵᅵᅵᅵĂᅵᅵxᅵᖳᅵᅵᅵ͂ᅵᅵB int map_freeblock_timer(int tid, unsigned int tick, int id, intptr_t data) { @@ -252,11 +252,11 @@ } // -// block‰»?— +// blockᅵᅵ?ᅵᅵ // /*========================================== - * map[]‚Ìblock_list‚©‚ç?‚ª‚Á‚Ä‚¢‚éê‡‚É - * bl->prev‚Ébl_head‚̃AƒhƒŒƒX‚ð“ü‚ê‚Ä‚š‚­ + * map[]ᅵᅵblock_listᅵᅵᅵᅵ?ᅵᅵᅵᅵᅵĂᅵᅵᅵꍇᅵᅵ + * bl->prevᅵᅵbl_headᅵ̃Aï¿œhᅵᅵᅵXᅵᅵᅵᅵĂᅵᅵᅵ *------------------------------------------*/ static struct block_list bl_head; @@ -339,10 +339,10 @@ int pos; nullpo_ret(bl); - // ?‚Éblocklist‚©‚ç?‚¯‚Ä‚¢‚é + // ?ᅵᅵblocklistᅵᅵᅵᅵ?ᅵᅵᅵĂᅵᅵᅵ if (bl->prev == NULL) { if (bl->next != NULL) { - // prev‚ªNULL‚Ånext‚ªNULL‚Å‚È‚¢‚Ì‚Í—L‚Á‚Ä‚Í‚È‚ç‚È‚¢ + // prevᅵᅵNULLᅵᅵnextᅵᅵNULLᅵłȂᅵᅵ̂͗LᅵᅵᅵĂ͂ȂᅵȂᅵ ShowError("map_delblock error : bl->next!=NULL\n"); } return 0; @@ -357,7 +357,7 @@ if (bl->next) bl->next->prev = bl->prev; if (bl->prev == &bl_head) { - // ƒŠƒXƒg‚Ì“ª‚Ȃ̂ŁAmap[]‚Ìblock_list‚ðXV‚·‚é + // ᅵᅵᅵXï¿œgᅵ̓ᅵᅵȂ̂ŁAmap[]ᅵᅵblock_listᅵᅵᅵXï¿œVᅵᅵᅵᅵ if (bl->type == BL_MOB) { map[bl->m].block_mob[pos] = bl->next; } else { @@ -402,7 +402,7 @@ status_change_end(bl, SC_MAGICROD, INVALID_TIMER); if (sc->data[SC_PROPERTYWALK] && sc->data[SC_PROPERTYWALK]->val3 >= skill_get_maxcount(sc->data[SC_PROPERTYWALK]->val1,sc->data[SC_PROPERTYWALK]->val2) ) - status_change_end(bl,SC_PROPERTYWALK,-1); + status_change_end(bl,SC_PROPERTYWALK, INVALID_TIMER); } else if (bl->type == BL_NPC) npc_unsetcells((TBL_NPC*)bl); @@ -589,10 +589,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_foreachinrange: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -600,7 +600,7 @@ va_end(ap); } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; //[Skotlex] @@ -661,10 +661,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_foreachinrange: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -672,16 +672,16 @@ va_end(ap); } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; //[Skotlex] } /*========================================== - * map m (x0,y0)-(x1,y1)?‚Ì‘Sobj‚É?‚µ‚Ä - * func‚ðŒÄ‚Ô - * type!=0 ‚È‚ç‚»‚ÌŽí—Þ‚Ì‚Ý + * map m (x0,y0)-(x1,y1)?ᅵ̑Sobjᅵᅵ?ᅵᅵᅵᅵ + * funcᅵᅵᅵĂᅵ + * type!=0 ᅵȂ炻ᅵ̎ᅵނ̂ᅵ *------------------------------------------*/ int map_foreachinarea(int (*func)(struct block_list*,va_list), int m, int x0, int y0, int x1, int y1, int type, ...) { @@ -726,10 +726,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_foreachinarea: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -737,7 +737,7 @@ va_end(ap); } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; //[Skotlex] @@ -792,10 +792,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_forcountinrange: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -805,7 +805,7 @@ break; } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; //[Skotlex] @@ -853,10 +853,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_foreachinarea: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -866,18 +866,18 @@ break; } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; //[Skotlex] } /*========================================== - * ‹éŒ`(x0,y0)-(x1,y1)‚ª(dx,dy)ˆÚ“®‚µ‚œŽb? - * —̈æŠO‚É‚È‚é—̈æ(‹éŒ`‚©LŽšŒ`)?‚Ìobj‚É - * ?‚µ‚Äfunc‚ðŒÄ‚Ô + * ᅵᅵ`(x0,y0)-(x1,y1)ᅵᅵ(dx,dy)ᅵړᅵᅵᅵᅵᅵᅵb? + * ᅵ̈ᅵOᅵɂȂᅵ̈ᅵ(ᅵᅵ`ᅵᅵLᅵᅵᅵ`)?ᅵᅵobjᅵᅵ + * ?ᅵᅵᅵᅵfuncᅵᅵᅵĂᅵ * - * dx,dy‚Í-1,0,1‚Ì‚Ý‚Æ‚·‚éi‚Ç‚ñ‚È’l‚Å‚à‚¢‚¢‚Á‚Û‚¢Hj + * dx,dyᅵᅵ-1,0,1ᅵ݂̂ƂᅵᅵᅵiᅵǂᅵȒlᅵłᅵᅵᅵᅵᅵᅵᅵᅵۂᅵᅵHï¿œj *------------------------------------------*/ int map_foreachinmovearea(int (*func)(struct block_list*,va_list), struct block_list* center, int range, int dx, int dy, int type, ...) { @@ -991,7 +991,7 @@ if(bl_list_count>=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; @@ -1037,10 +1037,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_foreachincell: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -1048,7 +1048,7 @@ va_end(ap); } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; @@ -1274,10 +1274,10 @@ if(bl_list_count>=BL_LIST_MAX) ShowWarning("map_foreachinmap: block count too many!\n"); - map_freeblock_lock(); // ƒƒ‚ƒŠ‚©‚ç‚̉ð•ú‚ð‹ÖŽ~‚·‚é + map_freeblock_lock(); // ᅵᅵᅵᅵᅵᅵᅵᅵᅵᅵ̉ᅵᅵᅵᅵ֎~ᅵᅵᅵᅵ for(i=blockcount;iprev) // —L?‚©‚Ç‚€‚©ƒ`ƒFƒbƒN + if(bl_list[i]->prev) // ï¿œL?ᅵᅵᅵǂᅵᅵᅵᅵ`ï¿œFï¿œbï¿œN { va_list ap; va_start(ap, type); @@ -1285,7 +1285,7 @@ va_end(ap); } - map_freeblock_unlock(); // ‰ð•ú‚ð‹–‰Â‚·‚é + map_freeblock_unlock(); // ᅵᅵᅵᅵᅵᅵᅵ‚ᅵᅵᅵ bl_list_count = blockcount; return returnCount; @@ -1326,12 +1326,12 @@ } /*========================================== - * °ƒAƒCƒeƒ€‚ðÁ‚· + * ᅵᅵᅵAï¿œCï¿œeᅵᅵᅵᅵᅵᅵᅵᅵ * - * data==0‚ÌŽbÍtimer‚ŏÁ‚Š‚œŽê * data!=0‚ÌŽb͏E‚€“™‚ŏÁ‚Š‚œŽbƂµ‚Ä“®? + * data==0ᅵ̎bï¿œtimerᅵŏᅵᅵᅵᅵᅵᅵᅵ * data!=0ᅵ̎b͏EᅵᅵᅵᅵᅵŏᅵᅵᅵᅵᅵᅵbƂᅵᅵēᅵ?? * - * ŒãŽÒ‚́Amap_clearflooritem(id)‚Ö - * map.h?‚Å#define‚µ‚Ä‚ ‚é + * ᅵᅵ҂́Amap_clearflooritem(id)ᅵᅵ + * map.h?ᅵᅵ#defineᅵᅵᅵĂᅵᅵᅵ *------------------------------------------*/ int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data) { @@ -1471,10 +1471,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) { @@ -1610,7 +1613,7 @@ } /*========================================== - * id_db‚Öbl‚ð’ljÁ + * id_dbᅵᅵblᅵᅵljᅵ *------------------------------------------*/ void map_addiddb(struct block_list *bl) { @@ -1638,7 +1641,7 @@ } /*========================================== - * id_db‚©‚çbl‚ðíœ + * id_dbᅵᅵᅵᅵblᅵᅵᅵ폜 *------------------------------------------*/ void map_deliddb(struct block_list *bl) { @@ -1774,7 +1777,7 @@ } /*========================================== - * id”Ô?‚ÌPC‚ð’T‚·B‹‚È‚¯‚ê‚ÎNULL + * idᅵᅵ?ᅵᅵPCᅵᅵTᅵᅵᅵBᅵᅵᅵȂᅵᅵᅵᅵNULL *------------------------------------------*/ struct map_session_data * map_id2sd(int id) { @@ -1892,8 +1895,8 @@ } /*========================================== - * id”Ô?‚Ì•š‚ð’T‚· - * ˆêŽObject‚̏ꍇ‚Í”z—ñ‚ðˆø‚­‚Ì‚Ý + * idᅵᅵ?ᅵ̕ᅵᅵᅵTᅵᅵ + * ᅵᅵObjectᅵ̏ꍇᅵ͔zᅵᅵᅵᅵᅵ̂ᅵ *------------------------------------------*/ struct block_list * map_id2bl(int id) { @@ -2190,7 +2193,7 @@ } /*========================================== - * map.npc‚֒ljÁ (warp“™‚̗̈掝‚¿‚Ì‚Ý) + * map.npcᅵ֒ljᅵ (warpᅵᅵᅵ̗̈掝ᅵᅵᅵ̂ᅵ) *------------------------------------------*/ bool map_addnpc(int m,struct npc_data *nd) { @@ -2313,7 +2316,7 @@ } /*========================================== - * map–Œ‚©‚çmap”Ô?‚Ö?Š· + * mapᅵᅵᅵᅵᅵᅵmapᅵᅵ?ᅵᅵ?ᅵᅵ *------------------------------------------*/ int map_mapname2mapid(const char* name) { @@ -2341,7 +2344,7 @@ } /*========================================== - * ‘ŒŽImap–Œ‚©‚çip,port?Š· + * ᅵᅵᅵImapᅵᅵᅵᅵᅵᅵip,port?ᅵᅵ *------------------------------------------*/ int map_mapname2ipport(unsigned short name, uint32* ip, uint16* port) { @@ -2453,7 +2456,7 @@ return 0; } -// gatŒn +// gatï¿œn inline static struct mapcell map_gat2cell(int gat) { struct mapcell cell = {0}; @@ -2486,7 +2489,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) { @@ -2740,7 +2743,7 @@ } /*========================================== - * ‘ŒŽIŠÇ—‚̃}ƒbƒv‚ðdb‚ɒljÁ + * ᅵᅵᅵIᅵǗᅵᅵ̃}ï¿œbï¿œvᅵᅵdbᅵɒljᅵ *------------------------------------------*/ int map_setipport(unsigned short mapindex, uint32 ip, uint16 port) { @@ -2761,7 +2764,7 @@ } /** - * ‘ŒŽIŠÇ—‚̃}ƒbƒv‚ð‘S‚č폜 + * ᅵᅵᅵIᅵǗᅵᅵ̃}ï¿œbï¿œvᅵᅵSᅵč폜 * @see DBApply */ int map_eraseallipport_sub(DBKey key, DBData *data, va_list va) @@ -2781,7 +2784,7 @@ } /*========================================== - * ‘ŒŽIŠÇ—‚̃}ƒbƒv‚ðdb‚©‚çíœ + * ᅵᅵᅵIᅵǗᅵᅵ̃}ï¿œbï¿œvᅵᅵdbᅵᅵᅵᅵ폜 *------------------------------------------*/ int map_eraseipport(unsigned short mapindex, uint32 ip, uint16 port) { @@ -3224,7 +3227,7 @@ } /*========================================== - * Ý’èƒtƒ@ƒCƒ‹‚ð?‚Ý?‚Þ + * ᅵݒᅵtï¿œ@ï¿œCᅵᅵᅵᅵ?ᅵᅵ?ᅵᅵ *------------------------------------------*/ int map_config_read(char *cfgName) { @@ -3561,7 +3564,7 @@ } /*========================================== - * mapŽII—¹E— + * mapï¿œIï¿œIᅵᅵᅵEᅵᅵ *------------------------------------------*/ void do_final(void) { @@ -3938,7 +3941,7 @@ do_init_duel(); do_init_elemental(); - npc_event_do_oninit(); // npc‚ÌOnInitƒCƒxƒ“ƒg?s + npc_event_do_oninit(); // npcᅵᅵOnInitï¿œCï¿œxᅵᅵᅵg?ï¿œs if( console ) { Index: src/map/map.h =================================================================== --- src/map/map.h (revision 15963) +++ 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 15963) +++ 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 15963) +++ 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 15963) +++ athena-start (working copy) @@ -50,6 +50,16 @@ echo "Now Started Athena." ;; + 'start2') + print_start + check_files + + exec ./${L_SRV}& + exec ./${C_SRV}& + # exec ./${M_SRV}& + + echo "Now Started Athena." +;; 'stop') ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill ;;