# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/lighta/Documents/Myscript/RO/Servs/rathena # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: conf/msg_athena.conf --- conf/msg_athena.conf Base (BASE) +++ conf/msg_athena.conf Locally Modified (Based On LOCAL) @@ -6,8 +6,9 @@ // // English message // msg_number: translated message -// 0-499: reserved for GM commands -// 500-999 reserved for others +// 0-410: reserved for GM commands +// 500-900 reserved for others +// 900-1300 @atcommand // To disable a string (%s) field, make it's max length 0: // eg: @@ -302,12 +303,13 @@ 284: Leadership transferred. 285: You've become the party leader. 286: There's been no change in the setting. +287: You cannot change party leaders on this map. //Missing stuff for @killer related commands. -287: Killer state reset. 288: You are no longer killable. 289: The player is now killable. 290: The player is no longer killable. 291: Weather effects will dispell on warp/refresh +292: Killer state reset. // Guild Castles Number // -------------------- //299: ?? Castles @@ -374,6 +376,7 @@ 362: Duel: You can't use @reject without a duel invitation. 363: Duel: The duel invitation has been rejected. 364: Duel: You can't invite %s because he/she isn't on the same map. +365: Duel: Can't use %s in duel. // @duel (part 2) 370: -- Duels: %d/%d, Members: %d/%d, Max players: %d -- 371: -- Duels: %d/%d, Members: %d/%d -- @@ -412,6 +415,30 @@ 405: War of Emperium SE has been ended. 406: War of Emperium SE is currently not in progress. +//chrif related +410: Need disconnection to perform change-sex request... +411: Your sex has been changed (need disconnection by the server)... +412: Your account has 'Unregistered'. +413: Your account has an 'Incorrect Password'... +414: Your account has expired. +415: Your account has been rejected from server. +416: Your account has been blocked by the GM Team. +417: Your Game's EXE file is not the latest version. +418: Your account has been prohibited to log in. +419: Server is jammed due to over populated. +420: Your account has not more authorised. +421: Your account has been totally erased. +423: Your account has been banished until +424: Login-server has been asked to %s the player '%.*s'. +425: The player '%.*s' doesn't exist. +426: Your GM level don't authorise you to %s the player '%.*s'. +427: Login-server is offline. Impossible to %s the player '%.*s'. +428: block +429: ban +430: unblock +431: unban +432: change the sex of + // Homunculus messages 450: You already have a homunculus @@ -589,9 +616,19 @@ 667: You're not dead. 668: Your actual memo positions are: 669: You broke target's weapon +670: You can't leave battleground guilds. +671: Friend already exists. +672: Name not found in list. +673: This action can't be performed at the moment. Please try again later. +674: Friend removed +675: Cannot send mails too fast!!. +676: Alliances cannot be made during Guild Wars! +677: Alliances cannot be broken during Guild Wars! +678: You no longer are the Guild Master. +679: You have become the Guild Master! +680: You have been recovered! +//681-899 free -//670-899 free - //------------------------------------ // More atcommands message //------------------------------------ @@ -640,9 +677,9 @@ // @jobchange 922: Please enter a job ID. +923: You can not change to this job by command. +//924-979 free (future jobs?) -//923-979 free (future jobs?) - // @kami 980: Please enter a message (usage: @kami ). 981: Please enter color and message (usage: @kamic ). Index: src/char/char.c --- src/char/char.c Base (BASE) +++ src/char/char.c Locally Modified (Based On LOCAL) @@ -126,7 +126,7 @@ int found_char[MAX_CHARS]; // ids of chars on this account char email[40]; // e-mail (default: a@a.com) by [Yor] time_t expiration_time; // # of seconds 1/1/1970 (timestamp): Validity limit of the account (0 = unlimited) - int group_id; + int group_id; // permission uint32 version; uint8 clienttype; char new_name[NAME_LENGTH]; @@ -3367,7 +3367,7 @@ return -1; } -// char_mapif�̏������i���݂�inter_mapif����̂݁j +// Initialization process (currently only initialization inter_mapif) static int char_mapif_init(int fd) { return inter_mapif_init(fd); @@ -4728,7 +4728,7 @@ ShowInfo("Finished reading the char-server configuration.\n"); - inter_init_sql((argc > 2) ? argv[2] : inter_cfgName); // inter server �ʱ�ȭ + inter_init_sql((argc > 2) ? argv[2] : inter_cfgName); // inter server configuration ShowInfo("Finished reading the inter-server configuration.\n"); ShowInfo("Initializing char server.\n"); @@ -4764,10 +4764,10 @@ add_timer_func_list(broadcast_user_count, "broadcast_user_count"); add_timer_interval(gettick() + 1000, broadcast_user_count, 0, 0, 5 * 1000); - // ??? + // Timer to clear (online_char_db) add_timer_func_list(chardb_waiting_disconnect, "chardb_waiting_disconnect"); - // ??? + // Online Data timers (checking if char still connected) add_timer_func_list(online_data_cleanup, "online_data_cleanup"); add_timer_interval(gettick() + 1000, online_data_cleanup, 0, 0, 600 * 1000); Index: src/char/int_guild.c --- src/char/int_guild.c Base (BASE) +++ src/char/int_guild.c Locally Modified (Based On LOCAL) @@ -1142,7 +1142,7 @@ // Packet received from map server -// �M���h�쐬�v�� +// Guild creation request int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member *master) { struct guild *g; @@ -1837,11 +1837,13 @@ return mapif_guild_master_changed(g, g->member[0].account_id, g->member[0].char_id); } -// map server ����̒ʐM -// �E�P�p�P�b�g�̂݉�͂��邱�� -// �E�p�P�b�g���f�[�^��inter.c�ɃZ�b�g���Ă������� -// �E�p�P�b�g���`�F�b�N��ARFIFOSKIP�͌Ăяo�����ōs����̂ōs���Ă͂Ȃ�Ȃ� -// �E�G���[�Ȃ�0(false)�A�����łȂ��Ȃ�1(true)���������Ȃ���΂Ȃ�Ȃ� +// Communication from the map server +// - Can analyzed only one by one packet +// Data packet length that you set to inter.c +//- Shouldn't do checking and packet length, RFIFOSKIP is done by the caller +// Must Return +// 1 : ok +// 0 : error int inter_guild_parse_frommap(int fd) { RFIFOHEAD(fd); @@ -1871,7 +1873,7 @@ return 1; } -// �T�[�o�[����E�ޗv���i�L�����폜�p�j +//Leave request from the server (for deleting character from guild) int inter_guild_leave(int guild_id, int account_id, int char_id) { return mapif_parse_GuildLeave(-1, guild_id, account_id, char_id, 0, "** Character Deleted **"); Index: src/char/int_party.c --- src/char/int_party.c Base (BASE) +++ src/char/int_party.c Locally Modified (Based On LOCAL) @@ -324,9 +324,10 @@ } //------------------------------------------------------------------- -// map server�ւ̒ʐM +// Communication to the map server -// �p�[�e�B�쐬�”� + +// Create a party whether or not int mapif_party_created(int fd,int account_id,int char_id,struct party *p) { WFIFOHEAD(fd, 39); @@ -348,7 +349,7 @@ return 0; } -// �p�[�e�B��񌩂‚��炸 +//Party information not found static void mapif_party_noinfo(int fd, int party_id, int char_id) { WFIFOHEAD(fd, 12); @@ -359,7 +360,8 @@ WFIFOSET(fd,12); ShowWarning("int_party: info not found (party_id=%d char_id=%d)\n", party_id, char_id); } -// �p�[�e�B���܂Ƃߑ��� + +//Digest party information static void mapif_party_info(int fd, struct party* p, int char_id) { unsigned char buf[8 + sizeof(struct party)]; @@ -373,7 +375,8 @@ else mapif_send(fd,buf,WBUFW(buf,2)); } -// �p�[�e�B�����o�lj��”� + +//Whether or not additional party members int mapif_party_memberadded(int fd, int party_id, int account_id, int char_id, int flag) { WFIFOHEAD(fd, 15); WFIFOW(fd,0) = 0x3822; @@ -386,7 +389,7 @@ return 0; } -// �p�[�e�B�ݒ�ύX�ʒm +// Party setting change notification int mapif_party_optionchanged(int fd,struct party *p,int account_id,int flag) { unsigned char buf[16]; @@ -403,7 +406,7 @@ return 0; } -// �p�[�e�B�E�ޒʒm +//Withdrawal notification party int mapif_party_withdraw(int party_id,int account_id, int char_id) { unsigned char buf[16]; @@ -415,7 +418,7 @@ return 0; } -// �p�[�e�B�}�b�v�X�V�ʒm +//Party map update notification int mapif_party_membermoved(struct party *p,int idx) { unsigned char buf[20]; @@ -431,7 +434,7 @@ return 0; } -// �p�[�e�B���U�ʒm +//Dissolution party notification int mapif_party_broken(int party_id,int flag) { unsigned char buf[16]; @@ -442,7 +445,8 @@ //printf("int_party: broken %d\n",party_id); return 0; } -// �p�[�e�B������ + +//Remarks in the party int mapif_party_message(int party_id,int account_id,char *mes,int len, int sfd) { unsigned char buf[512]; @@ -456,7 +460,7 @@ } //------------------------------------------------------------------- -// map server����̒ʐM +// Communication from the map server // Create Party @@ -507,7 +511,8 @@ return 0; } -// �p�[�e�B���v�� + +// Party information request static void mapif_parse_PartyInfo(int fd, int party_id, int char_id) { struct party_data *p; @@ -518,7 +523,8 @@ else mapif_party_noinfo(fd, party_id, char_id); } -// �p�[�e�B�lj��v�� + +// Add a player to party request int mapif_parse_PartyAddMember(int fd, int party_id, struct party_member *member) { struct party_data *p; @@ -556,7 +562,7 @@ return 0; } -// �p�[�e�B�[�ݒ�ύX�v�� +//Party setting change request int mapif_parse_PartyChangeOption(int fd,int party_id,int account_id,int exp,int item) { struct party_data *p; @@ -576,7 +582,8 @@ inter_party_tosql(&p->party, PS_BASIC, 0); return 0; } -// �p�[�e�B�E�ޗv�� + +//Request leave party int mapif_parse_PartyLeave(int fd, int party_id, int account_id, int char_id) { struct party_data *p; @@ -684,7 +691,7 @@ return 0; } -// �p�[�e�B���U�v�� +//Request party dissolution int mapif_parse_BreakParty(int fd,int party_id) { struct party_data *p; @@ -697,7 +704,8 @@ mapif_party_broken(fd,party_id); return 0; } -// �p�[�e�B���b�Z�[�W���M + +//Party sending the message int mapif_parse_PartyMessage(int fd,int party_id,int account_id,char *mes,int len) { return mapif_party_message(party_id,account_id,mes,len, fd); @@ -727,11 +735,14 @@ return 1; } -// map server ����̒ʐM -// �E�P�p�P�b�g�̂݉�͂��邱�� -// �E�p�P�b�g���f�[�^��inter.c�ɃZ�b�g���Ă������� -// �E�p�P�b�g���`�F�b�N��ARFIFOSKIP�͌Ăяo�����ōs����̂ōs���Ă͂Ȃ�Ȃ� -// �E�G���[�Ȃ�0(false)�A�����łȂ��Ȃ�1(true)���������Ȃ���΂Ȃ�Ȃ� + +// Communication from the map server +//-Analysis that only one packet +// Data packet length is set to inter.c that you +// Do NOT go and check the packet length, RFIFOSKIP is done by the caller +// Return : +// 0 : error +// 1 : ok int inter_party_parse_frommap(int fd) { RFIFOHEAD(fd); @@ -751,7 +762,7 @@ return 1; } -// �T�[�o�[����E�ޗv���i�L�����폜�p�j +//Leave request from the server (for delete character) int inter_party_leave(int party_id,int account_id, int char_id) { return mapif_parse_PartyLeave(-1,party_id,account_id, char_id); Index: src/char/inter.c --- src/char/inter.c Base (BASE) +++ src/char/inter.c Locally Modified (Based On LOCAL) @@ -28,8 +28,8 @@ #include // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool] -#define WISDATA_TTL (60*1000) // Wis�f�[�^�̐�������(60�b) -#define WISDELLIST_MAX 256 // Wis�f�[�^�폜���X�g�̗v�f�� +#define WISDATA_TTL (60*1000) //Wis data Time To Live (60 seconds) +#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis Sql* sql_handle = NULL; @@ -1203,11 +1203,11 @@ int cmd; int len = 0; cmd = RFIFOW(fd,0); - // inter�I�NJ����𒲂ׂ� + // Check is valid packet entry if(cmd < 0x3000 || cmd >= 0x3000 + ARRAYLENGTH(inter_recv_packet_length) || inter_recv_packet_length[cmd - 0x3000] == 0) return 0; - // �p�P�b�g���𒲂ׂ� + // Check packet length if((len = inter_check_length(fd, inter_recv_packet_length[cmd - 0x3000])) == 0) return 2; Index: src/common/db.c --- src/common/db.c Base (BASE) +++ src/common/db.c Locally Modified (Based On LOCAL) @@ -2743,7 +2743,7 @@ while( node ) { if( node->key == key ) { if( node->prev && n > 5 ) { - // �������P�ׂ̈�head�Ɉړ������� + //Moving the head in order to improve processing efficiency if(node->prev) node->prev->next = node->next; if(node->next) node->next->prev = node->prev; node->next = *head; @@ -2790,7 +2790,7 @@ while( node ) { if( node->key == key ) { if( node->prev && n > 5 ) { - // �������P�ׂ̈�head�Ɉړ������� + //Moving the head in order to improve processing efficiency if(node->prev) node->prev->next = node->next; if(node->next) node->next->prev = node->prev; node->next = *head; @@ -2804,7 +2804,7 @@ node = node->next; n++; } - // ���‚���Ȃ��̂ő}�� + //Insert because it can not find linkdb_insert( head, key, data ); } Index: src/common/mmo.h --- src/common/mmo.h Base (BASE) +++ src/common/mmo.h Locally Modified (Based On LOCAL) @@ -536,15 +536,15 @@ char name[NAME_LENGTH]; }; -enum { - GBI_EXP =1, // �M���h��EXP - GBI_GUILDLV, // �M���h��Lv - GBI_SKILLPOINT, // �M���h�̃X�L���|�C���g - GBI_SKILLLV, // �M���h�X�L��Lv +enum { //Change Guild Infos + GBI_EXP =1, // Guild Experience (EXP) + GBI_GUILDLV, // Guild level + GBI_SKILLPOINT, // Guild skillpoints + GBI_SKILLLV, // Guild skilllv ?? seem unused }; -enum { - GMI_POSITION =0, // �����o�[�̖�E�ύX +enum { //Change Member Infos + GMI_POSITION =0, GMI_EXP, GMI_HAIR, GMI_HAIR_COLOR, Index: src/map/atcommand.c --- src/map/atcommand.c Base (BASE) +++ src/map/atcommand.c Locally Modified (Based On LOCAL) @@ -1151,7 +1151,7 @@ if (job == 13 || job == 21 || job == 22 || job == 26 || job == 27 || job == 4014 || job == 4022 || job == 4036 || job == 4044 || job == 4048 || (job >= JOB_RUNE_KNIGHT2 && job <= JOB_MECHANIC_T2) || (job >= JOB_BABY_RUNE2 && job <= JOB_BABY_MECHANIC2) ) // Deny direct transformation into dummy jobs - {clif_displaymessage(fd, "You can not change to this job by command."); + {clif_displaymessage(fd, msg_txt(923)); //"You can not change to this job by command." return 0;} if (pcdb_checkid(job)) @@ -5196,7 +5196,7 @@ if(sd->state.killer) clif_displaymessage(fd, msg_txt(241)); else { - clif_displaymessage(fd, msg_txt(287)); + clif_displaymessage(fd, msg_txt(292)); pc_stop_attack(sd); } return 0; @@ -7461,17 +7461,17 @@ int size = 0; nullpo_retr(-1, sd); - size = cap_value(atoi(message),0,2); + size = cap_value(atoi(message),SZ_SMALL,SZ_BIG); if(sd->state.size) { - sd->state.size = 0; + sd->state.size = SZ_SMALL; pc_setpos(sd, sd->mapindex, sd->bl.x, sd->bl.y, CLR_TELEPORT); } sd->state.size = size; - if( size == 1 ) + if( size == SZ_MEDIUM ) clif_specialeffect(&sd->bl,420,AREA); - else if( size == 2 ) + else if( size == SZ_BIG ) clif_specialeffect(&sd->bl,422,AREA); clif_displaymessage(fd, msg_txt(1303)); // Size change applied. @@ -7491,14 +7491,14 @@ for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) { if( pl_sd->state.size != size ) { if( pl_sd->state.size ) { - pl_sd->state.size = 0; + pl_sd->state.size = SZ_SMALL; pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); } pl_sd->state.size = size; - if( size == 1 ) + if( size == SZ_MEDIUM ) clif_specialeffect(&pl_sd->bl,420,AREA); - else if( size == 2 ) + else if( size == SZ_BIG ) clif_specialeffect(&pl_sd->bl,422,AREA); } } @@ -7528,19 +7528,19 @@ return -1; } - size = cap_value(size,0,2); + size = cap_value(size,SZ_SMALL,SZ_BIG); for( i = 0; i < g->max_member; i++ ) { if( (pl_sd = g->member[i].sd) && pl_sd->state.size != size ) { if( pl_sd->state.size ) { - pl_sd->state.size = 0; + pl_sd->state.size = SZ_SMALL; pc_setpos(pl_sd, pl_sd->mapindex, pl_sd->bl.x, pl_sd->bl.y, CLR_TELEPORT); } pl_sd->state.size = size; - if( size == 1 ) + if( size == SZ_MEDIUM ) clif_specialeffect(&pl_sd->bl,420,AREA); - else if( size == 2 ) + else if( size == SZ_BIG ) clif_specialeffect(&pl_sd->bl,422,AREA); } } Index: src/map/battle.c --- src/map/battle.c Base (BASE) +++ src/map/battle.c Locally Modified (Based On LOCAL) @@ -197,7 +197,7 @@ return bl_list[rnd()%c]; } -// �_??[�W�̒x�� +// Dammage delayed info struct delay_damage { int src_id; int target_id; @@ -350,29 +350,38 @@ } } } - if( tsc && tsc->count ) { - if( tsc->data[SC_SPIDERWEB] && atk_elem == ELE_FIRE ){ + if( tsc && tsc->count ) { //since an atk can only have one type let's optimise this a bit + switch(atk_elem){ + case ELE_FIRE: + if (tsc->data[SC_SPIDERWEB]) { tsc->data[SC_SPIDERWEB]->val1 = 0; // free to move now if( tsc->data[SC_SPIDERWEB]->val2-- > 0 ) damage <<= 1; // double damage if( tsc->data[SC_SPIDERWEB]->val2 == 0 ) status_change_end(target, SC_SPIDERWEB, INVALID_TIMER); } - if( tsc->data[SC_ORATIO] && atk_elem == ELE_HOLY ) - ratio += tsc->data[SC_ORATIO]->val1 * 2; - if( tsc->data[SC_VENOMIMPRESS] && atk_elem == ELE_POISON ) - ratio += tsc->data[SC_VENOMIMPRESS]->val2; - if( tsc->data[SC_THORNSTRAP] && atk_elem == ELE_FIRE ) - status_change_end(target, SC_THORNSTRAP, -1); - if( tsc->data[SC_FIRE_CLOAK_OPTION] && atk_elem == ELE_FIRE ) + if( tsc->data[SC_THORNSTRAP]) + status_change_end(target, SC_THORNSTRAP, INVALID_TIMER); + if( tsc->data[SC_FIRE_CLOAK_OPTION]) damage -= damage * tsc->data[SC_FIRE_CLOAK_OPTION]->val2 / 100; if( tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB){ - if( atk_elem == ELE_WIND) - damage = damage * 150 / 100; - if( atk_elem == ELE_FIRE ) status_change_end(target, SC_CRYSTALIZE, INVALID_TIMER); } + break; + case ELE_HOLY: + if( tsc->data[SC_ORATIO]) + ratio += tsc->data[SC_ORATIO]->val1 * 2; + break; + case ELE_POISON: + if( tsc->data[SC_VENOMIMPRESS]) + ratio += tsc->data[SC_VENOMIMPRESS]->val2; + break; + case ELE_WIND: + if( tsc->data[SC_CRYSTALIZE] && target->type != BL_MOB) + damage = damage * 150 / 100; + break; } + } //end tsc check if( src && src->type == BL_PC ){ struct map_session_data *sd = BL_CAST(BL_PC, src); int s; @@ -395,7 +404,9 @@ } /*========================================== - * �_??[�W??I�v�Z + * Check dammage trough status. + * ATK may be MISS, BLOCKED FAIL, reduc, increase, end status... + * After this we apply bg/gvg reduction *------------------------------------------*/ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv) { @@ -1002,7 +1013,7 @@ } /*========================================== - * HP/SP�z��̌v�Z + * HP/SP drain calculation *------------------------------------------*/ static int battle_calc_drain(int damage, int rate, int per) { @@ -1021,7 +1032,7 @@ } /*========================================== - * ?C��_??[�W + * Passif skill dammages increases *------------------------------------------*/ int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type) { @@ -2158,7 +2169,7 @@ && sd->inventory_data[index]->type == IT_WEAPON ) skillratio += max(10000 - sd->inventory_data[index]->weight, 0) / 10; skillratio += 50 * pc_checkskill(sd,LK_SPIRALPIERCE); - } // (1 + [(Caster�s Base Level - 100) / 200]) + } // (1 + [(Casters Base Level - 100) / 200]) skillratio = skillratio * (100 + (status_get_lv(src)-100) / 2) / 100; break; case RK_WINDCUTTER: @@ -2333,7 +2344,7 @@ skillratio += -100 + 15 * 200; RE_LVL_DMOD(100); break; - case LG_SHIELDSPELL:// [(Caster�s Base Level x 4) + (Shield DEF x 10) + (Caster�s VIT x 2)] % + case LG_SHIELDSPELL:// [(Casters Base Level x 4) + (Shield DEF x 10) + (Casters VIT x 2)] % if( sd ) { struct item_data *shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]]; skillratio = status_get_lv(src) * 4 + status_get_vit(src) * 2; @@ -2374,34 +2385,34 @@ RE_LVL_DMOD(100); break; case SR_SKYNETBLOW: - //ATK [{(Skill Level x 80) + (Caster�s AGI)} x Caster�s Base Level / 100] % + //ATK [{(Skill Level x 80) + (Caster AGI)} x Caster Base Level / 100] % skillratio = 80 * skill_lv + sstatus->agi; - if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_DRAGONCOMBO )//ATK [{(Skill Level x 100) + (Caster�s AGI) + 150} x Caster�s Base Level / 100] % + if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_DRAGONCOMBO )//ATK [{(Skill Level x 100) + (Caster AGI) + 150} x Caster Base Level / 100] % skillratio = 100 * skill_lv + sstatus->agi + 150; RE_LVL_DMOD(100); break; case SR_EARTHSHAKER: - if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || // [(Skill Level x 150) x (Caster�s Base Level / 100) + (Caster�s INT x 3)] % + if( tsc && (tsc->data[SC_HIDING] || tsc->data[SC_CLOAKING] || // [(Skill Level x 150) x (Caster Base Level / 100) + (Caster INT x 3)] % tsc->data[SC_CHASEWALK] || tsc->data[SC_CLOAKINGEXCEED] || tsc->data[SC__INVISIBILITY]) ){ skillratio = 150 * skill_lv; RE_LVL_DMOD(100); skillratio += sstatus->int_ * 3; - }else{ //[(Skill Level x 50) x (Caster�s Base Level / 100) + (Caster�s INT x 2)] % + }else{ //[(Skill Level x 50) x (Caster Base Level / 100) + (Caster INT x 2)] % skillratio += 50 * (skill_lv-2); RE_LVL_DMOD(100); skillratio += sstatus->int_ * 2; } break; - case SR_FALLENEMPIRE:// ATK [(Skill Level x 150 + 100) x Caster�s Base Level / 150] % + case SR_FALLENEMPIRE:// ATK [(Skill Level x 150 + 100) x Caster Base Level / 150] % skillratio += 150 *skill_lv; RE_LVL_DMOD(150); break; - case SR_TIGERCANNON:// ATK [((Caster�s consumed HP + SP) / 4) x Caster�s Base Level / 100] % + case SR_TIGERCANNON:// ATK [((Caster consumed HP + SP) / 4) x Caster Base Level / 100] % { int hp = sstatus->max_hp * (10 + 2 * skill_lv) / 100, sp = sstatus->max_sp * (6 + skill_lv) / 100; skillratio = (hp+sp) / 4; - if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // ATK [((Caster�s consumed HP + SP) / 2) x Caster�s Base Level / 100] % + if( sc && sc->data[SC_COMBO] && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // ATK [((Caster consumed HP + SP) / 2) x Caster Base Level / 100] % skillratio = (hp+sp) / 2; RE_LVL_DMOD(100); } @@ -2415,15 +2426,15 @@ RE_LVL_DMOD(150); break; case SR_KNUCKLEARROW: - if( wflag&4 ){ // ATK [(Skill Level x 150) + (1000 x Target�s current weight / Maximum weight) + (Target�s Base Level x 5) x (Caster�s Base Level / 150)] % + if( wflag&4 ){ // ATK [(Skill Level x 150) + (1000 x Target current weight / Maximum weight) + (Target Base Level x 5) x (Caster Base Level / 150)] % skillratio = 150 * skill_lv + status_get_lv(target) * 5 * (status_get_lv(src) / 100) ; if( tsd && tsd->weight ) skillratio += 100 * (tsd->weight / tsd->max_weight); - }else // ATK [(Skill Level x 100 + 500) x Caster�s Base Level / 100] % + }else // ATK [(Skill Level x 100 + 500) x Caster Base Level / 100] % skillratio += 400 + (100 * skill_lv); RE_LVL_DMOD(100); break; - case SR_WINDMILL: // ATK [(Caster�s Base Level + Caster�s DEX) x Caster�s Base Level / 100] % + case SR_WINDMILL: // ATK [(Caster Base Level + Caster DEX) x Caster Base Level / 100] % skillratio = status_get_lv(src) + sstatus->dex; RE_LVL_DMOD(100); break; @@ -2443,14 +2454,14 @@ skillratio += 300 * skill_lv - 100; RE_LVL_DMOD(150); break; - case SR_RIDEINLIGHTNING: // ATK [{(Skill Level x 200) + Additional Damage} x Caster�s Base Level / 100] % + case SR_RIDEINLIGHTNING: // ATK [{(Skill Level x 200) + Additional Damage} x Caster Base Level / 100] % if( (sstatus->rhw.ele) == ELE_WIND || (sstatus->lhw.ele) == ELE_WIND ) skillratio += skill_lv * 50; skillratio += -100 + 200 * skill_lv; RE_LVL_DMOD(100); break; case WM_REVERBERATION_MELEE: - // ATK [{(Skill Level x 100) + 300} x Caster�s Base Level / 100] + // ATK [{(Skill Level x 100) + 300} x Caster Base Level / 100] skillratio += 200 + 100 * pc_checkskill(sd, WM_REVERBERATION); RE_LVL_DMOD(100); break; @@ -2468,7 +2479,7 @@ skillratio += 400; break; case GN_CART_TORNADO: - // ATK [( Skill Level x 50 ) + ( Cart Weight / ( 150 - Caster�s Base STR ))] + ( Cart Remodeling Skill Level x 50 )] % + // ATK [( Skill Level x 50 ) + ( Cart Weight / ( 150 - Caster Base STR ))] + ( Cart Remodeling Skill Level x 50 )] % skillratio = 50 * skill_lv; if( sd && sd->cart_weight) skillratio += sd->cart_weight/10 / max(150-sstatus->str,1) + pc_checkskill(sd, GN_REMODELING_CART) * 50; @@ -2587,7 +2598,7 @@ if(sd) ATK_ADD( 40 * pc_checkskill(sd, RA_RESEARCHTRAP) ); break; - case RA_WUGDASH://(Caster�s Current Weight x 10 / 8) + case RA_WUGDASH ://(Caster Current Weight x 10 / 8) if( sd && sd->weight ) ATK_ADD( sd->weight / 8 ); case RA_WUGSTRIKE: @@ -2609,13 +2620,13 @@ ATK_ADD ( (sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src) ); } break; - case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target�s Base Level x 40) + case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target Base Level x 40) ATK_ADD( skill_lv * 240 + status_get_lv(target) * 40 ); if( sc && sc->data[SC_COMBO] - && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // (Tiger Cannon skill level x 500) + (Target�s Base Level x 40) + && sc->data[SC_COMBO]->val1 == SR_FALLENEMPIRE ) // (Tiger Cannon skill level x 500) + (Target Base Level x 40) ATK_ADD( skill_lv * 500 + status_get_lv(target) * 40 ); break; - case SR_FALLENEMPIRE:// [(Target�s Size value + Skill Level - 1) x Caster�s STR] + [(Target�s current weight x Caster�s DEX / 120)] + case SR_FALLENEMPIRE:// [(Target Size value + Skill Level - 1) x Caster STR] + [(Target current weight x Caster DEX / 120)] ATK_ADD( ((tstatus->size+1)*2 + skill_lv - 1) * sstatus->str); if( tsd && tsd->weight ){ ATK_ADD( (tsd->weight/10) * sstatus->dex / 120 ); @@ -2854,7 +2865,7 @@ ATK_ADD(10*sc->data[SC_GN_CARTBOOST]->val1); if(sc->data[SC_GT_CHANGE] && sc->data[SC_GT_CHANGE]->val2){ - struct block_list *bl; // ATK increase: ATK [{(Caster�s DEX / 4) + (Caster�s STR / 2)} x Skill Level / 5] + struct block_list *bl; // ATK increase: ATK [{(Caster DEX / 4) + (Caster STR / 2)} x Skill Level / 5] if( (bl = map_id2bl(sc->data[SC_GT_CHANGE]->val2)) ) ATK_ADD( ( status_get_dex(bl)/4 + status_get_str(bl)/2 ) * sc->data[SC_GT_CHANGE]->val1 / 5 ); } @@ -3710,8 +3721,8 @@ case WL_HELLINFERNO: skillratio = 300 * skill_lv; RE_LVL_DMOD(100); - // Shadow: MATK [{( Skill Level x 300 ) x ( Caster�s Base Level / 100 ) x 4/5 }] % - // Fire : MATK [{( Skill Level x 300 ) x ( Caster�s Base Level / 100 ) /5 }] % + // Shadow: MATK [{( Skill Level x 300 ) x ( Caster Base Level / 100 ) x 4/5 }] % + // Fire : MATK [{( Skill Level x 300 ) x ( Caster Base Level / 100 ) /5 }] % if( mflag&ELE_DARK ){ skillratio *= 4; s_ele = ELE_DARK; } skillratio /= 5; break; @@ -3755,7 +3766,7 @@ skillratio = (skillratio + 200) * skill_lv; RE_LVL_DMOD(100); break; - case LG_SHIELDSPELL:// [(Caster�s Base Level x 4) + (Shield MDEF x 100) + (Caster�s INT x 2)] % + case LG_SHIELDSPELL:// [(Casters Base Level x 4) + (Shield MDEF x 100) + (Casters INT x 2)] % if( sd ) { skillratio = status_get_lv(src) * 4 + sd->bonus.shieldmdef * 100 + status_get_int(src) * 2; } else @@ -3768,7 +3779,7 @@ skillratio += 50 * skill_lv; break; case WM_REVERBERATION_MAGIC: - // MATK [{(Skill Level x 100) + 100} x Caster�s Base Level / 100] % + // MATK [{(Skill Level x 100) + 100} x Casters Base Level / 100] % skillratio += 100 * (sd ? pc_checkskill(sd, WM_REVERBERATION) : 1); RE_LVL_DMOD(100); break; @@ -4052,7 +4063,7 @@ } /*========================================== - * ���̑��_??[�W�v�Z + * Calculate Misc dammage for skillid *------------------------------------------*/ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag) { @@ -4235,7 +4246,7 @@ md.damage = 100 + 200 * skill_lv + sstatus->int_; break; case GN_HELLS_PLANT_ATK: - //[{( Hell Plant Skill Level x Caster�s Base Level ) x 10 } + {( Caster�s INT x 7 ) / 2 } x { 18 + ( Caster�s Job Level / 4 )] x ( 5 / ( 10 - Summon Flora Skill Level )) + //[{( Hell Plant Skill Level x Casters Base Level ) x 10 } + {( Casters INT x 7 ) / 2 } x { 18 + ( Casters Job Level / 4 )] x ( 5 / ( 10 - Summon Flora Skill Level )) md.damage = ( skill_lv * status_get_lv(src) * 10 ) + ( sstatus->int_ * 7 / 2 ) * ( 18 + (sd?sd->status.job_level:0) / 4 ) * ( 5 / (10 - (sd?pc_checkskill(sd,AM_CANNIBALIZE):0)) ); break; case KO_HAPPOKUNAI: @@ -4395,7 +4406,7 @@ return md; } /*========================================== - * �_??[�W�v�Z�ꊇ?��?�p + * Battle main entry, from skill_attack *------------------------------------------*/ struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count) { @@ -4435,7 +4446,7 @@ rdamage = (*dmg) * sc->data[SC_REFLECTDAMAGE]->val2 / 100; if( rdamage > max_damage ) rdamage = max_damage; }else if( sc && sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){ - //ATK [{(Target�s HP / 100) x Skill Level} x Caster�s Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}] + //ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}] int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(bl) / 125; if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK rdamage = rdamage * ratio / 100 + (*dmg) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10; @@ -4564,7 +4575,7 @@ return 0; } /*========================================== - * ��??U��?��?�܂Ƃ� + * Do a basic physical attack (call trough unit_attack_timer) *------------------------------------------*/ 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; @@ -4631,13 +4642,12 @@ } } } - - if (sc && sc->data[SC_CLOAKING] && !(sc->data[SC_CLOAKING]->val4&2)) + 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_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4&2)) + else 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); @@ -5123,7 +5133,7 @@ //All else not specified is an invalid target. default: return 0; - } + } //end switch actual target switch( t_bl->type ) { //Checks on target master @@ -5152,7 +5162,7 @@ break; } default: break; //other type doesn't have slave yet - } + } //end switch master target switch( src->type ) { //Checks on actual src type case BL_PET: @@ -5179,7 +5189,7 @@ if (t_bl->type == BL_MOB && ((TBL_MOB*)t_bl)->class_ == MOBID_EMPERIUM && flag&BCT_ENEMY) return 0; //mercenary may not attack Emperium break; - } + } //end switch actual src switch( s_bl->type ) { //Checks on source master @@ -5233,7 +5243,7 @@ if (t_bl->type != s_bl->type) state |= BCT_ENEMY; break; - } + } //end switch on src master if( (flag&BCT_ALL) == BCT_ALL ) { //All actually stands for all attackable chars @@ -5293,7 +5303,7 @@ ) state &= ~BCT_ENEMY; } - } + }//end map_flag_vs chk rivality else { //Non pvp/gvg, check party/guild settings. if( flag&BCT_PARTY || state&BCT_ENEMY ) @@ -5309,7 +5319,7 @@ if(s_guild && t_guild && (s_guild == t_guild || guild_isallied(s_guild, t_guild))) state |= BCT_GUILD; } - } + } //end non pvp/gvg chk rivality if( !state ) //If not an enemy, nor a guild, nor party, nor yourself, it's neutral. state = BCT_NEUTRAL; @@ -5320,7 +5330,8 @@ return (flag&state)?1:-1; } /*========================================== - * �˒����� + * Check if can attack from this range + * Basic check then calling path_search for obstacle etc.. *------------------------------------------*/ bool battle_check_range(struct block_list *src, struct block_list *bl, int range) { Index: src/map/battle.h --- src/map/battle.h Base (BASE) +++ src/map/battle.h Locally Modified (Based On LOCAL) @@ -14,24 +14,24 @@ ATK_DEF // attack connected } damage_lv; -// �_���[�W +// dammage structure struct Damage { - int damage,damage2; - int type,div_; + int damage,damage2; //right, left dmg + int type,div_; //chk clif_damage for type @TODO add an enum ? ; nb of hit int amotion,dmotion; - int blewcount; - int flag; + int blewcount; //nb of knockback + int flag; //chk BF_* flag, (enum below) enum damage_lv dmg_lv; //ATK_LUCKY,ATK_FLEE,ATK_DEF }; -// �����\�i�ǂݍ��݂�pc.c�Abattle_attr_fix�Ŏg�p�j +//(Used in read pc.c,) attribute table (battle_attr_fix) extern int attr_fix_table[4][10][10]; struct map_session_data; struct mob_data; struct block_list; -// �_���[�W�v�Z +// Damage Calculation struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count); @@ -42,12 +42,12 @@ int battle_attr_ratio(int atk_elem,int def_type, int def_lv); int battle_attr_fix(struct block_list *src, struct block_list *target, int damage,int atk_elem,int def_type, int def_lv); -// �_���[�W�ŏI�v�Z +// Final calculation Damage int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int damage,int skill_num,int skill_lv); 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 { // Flag of the final calculation BF_WEAPON = 0x0001, BF_MAGIC = 0x0002, BF_MISC = 0x0004, @@ -62,10 +62,10 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, int skill_id, int skill_lv, int damage, enum damage_lv dmg_lv, int ddelay); -// �ʏ�U�������܂Ƃ� +// Summary normal attack treatment (basic attack) enum damage_lv battle_weapon_attack( struct block_list *bl,struct block_list *target,unsigned int tick,int flag); -// �e��p�����[�^�𓾂� +// Accessors struct block_list* battle_get_master(struct block_list *src); struct block_list* battle_gettargeted(struct block_list *target); struct block_list* battle_getenemy(struct block_list *target, int type, int range); @@ -93,7 +93,7 @@ bool battle_check_range(struct block_list *src,struct block_list *bl,int range); void battle_consume_ammo(struct map_session_data* sd, int skill, int lv); -// �ݒ� +// Settings #define MIN_HAIR_STYLE battle_config.min_hair_style #define MAX_HAIR_STYLE battle_config.max_hair_style Index: src/map/chat.c --- src/map/chat.c Base (BASE) +++ src/map/chat.c Locally Modified (Based On LOCAL) @@ -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/chrif.c --- src/map/chrif.c Base (BASE) +++ src/map/chrif.c Locally Modified (Based On LOCAL) @@ -730,7 +730,7 @@ } /*========================================== - * �L�������₢���킹 + * Search Char trough id on char serv *------------------------------------------*/ int chrif_searchcharid(int char_id) { @@ -803,7 +803,7 @@ WFIFOW(char_fd,30) = 5; WFIFOSET(char_fd,44); - clif_displaymessage(sd->fd, "Need disconnection to perform change-sex request..."); + clif_displaymessage(sd->fd, msg_txt(410)); //"Need disconnection to perform change-sex request..." if (sd->fd) clif_authfail_fd(sd->fd, 15); @@ -835,20 +835,16 @@ return; } - switch( type ) { - case 1 : action = "block"; break; - case 2 : action = "ban"; break; - case 3 : action = "unblock"; break; - case 4 : action = "unban"; break; - case 5 : action = "change the sex of"; break; - default: action = "???"; break; - } + if(type>0 && type<=5) + sprintf(action,msg_txt(427+type)); //block|ban|unblock|unban|change the sex of + else + sprintf(action,"???"); switch( answer ) { - case 0 : sprintf(output, "Login-server has been asked to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; - case 1 : sprintf(output, "The player '%.*s' doesn't exist.", NAME_LENGTH, player_name); break; - case 2 : sprintf(output, "Your GM level don't authorise you to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; - case 3 : sprintf(output, "Login-server is offline. Impossible to %s the player '%.*s'.", action, NAME_LENGTH, player_name); break; + case 0 : sprintf(output, msg_txt(424), action, NAME_LENGTH, player_name); break; + case 1 : sprintf(output, msg_txt(425), NAME_LENGTH, player_name); break; + case 2 : sprintf(output, msg_txt(426), action, NAME_LENGTH, player_name); break; + case 3 : sprintf(output, msg_txt(427), action, NAME_LENGTH, player_name); break; default: output[0] = '\0'; break; } @@ -856,7 +852,7 @@ } /*========================================== - * ���ʕω��I�� (modified by Yor) + * Request char server to change sex of char (modified by Yor) *------------------------------------------*/ int chrif_changedsex(int fd) { @@ -902,7 +898,7 @@ // save character sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters // do same modify in login-server for the account, but no in char-server (it ask again login_id1 to login, and don't remember it) - clif_displaymessage(sd->fd, "Your sex has been changed (need disconnection by the server)..."); + clif_displaymessage(sd->fd, msg_txt(411)); //"Your sex has been changed (need disconnection by the server)..." set_eof(sd->fd); // forced to disconnect for the change map_quit(sd); // Remove leftovers (e.g. autotrading) [Paradox924X] } @@ -1003,26 +999,20 @@ sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters if (RFIFOB(fd,6) == 0) // 0: change of statut, 1: ban { - switch (RFIFOL(fd,7)) { // status or final date of a banishment - case 1: clif_displaymessage(sd->fd, "Your account has 'Unregistered'."); break; - case 2: clif_displaymessage(sd->fd, "Your account has an 'Incorrect Password'..."); break; - case 3: clif_displaymessage(sd->fd, "Your account has expired."); break; - case 4: clif_displaymessage(sd->fd, "Your account has been rejected from server."); break; - case 5: clif_displaymessage(sd->fd, "Your account has been blocked by the GM Team."); break; - case 6: clif_displaymessage(sd->fd, "Your Game's EXE file is not the latest version."); break; - case 7: clif_displaymessage(sd->fd, "Your account has been prohibited to log in."); break; - case 8: clif_displaymessage(sd->fd, "Server is jammed due to over populated."); break; - case 9: clif_displaymessage(sd->fd, "Your account has not more authorised."); break; - case 100: clif_displaymessage(sd->fd, "Your account has been totally erased."); break; - default: clif_displaymessage(sd->fd, "Your account has not more authorised."); break; + int ret_status = RFIFOL(fd,7); // status or final date of a banishment + if(0fd, msg_txt(411+ret_status)); + else if(ret_status==100) + clif_displaymessage(sd->fd, msg_txt(421)); + else + clif_displaymessage(sd->fd, msg_txt(420)); //"Your account has not more authorised." } - } else if (RFIFOB(fd,6) == 1) // 0: change of statut, 1: ban { time_t timestamp; char tmpstr[2048]; timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment - strcpy(tmpstr, "Your account has been banished until "); + strcpy(tmpstr, msg_txt(423)); //"Your account has been banished until " strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(×tamp)); clif_displaymessage(sd->fd, tmpstr); } @@ -1399,10 +1389,10 @@ cmd = RFIFOW(fd,0); if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(packet_len_table) || packet_len_table[cmd-0x2af8] == 0) { - int r = intif_parse(fd); // intif�ɓn�� + int r = intif_parse(fd); // Passed on to the intif - if (r == 1) continue; // intif�ŏ������� - if (r == 2) return 0; // intif�ŏ����������A�f�[�^������Ȃ� + if (r == 1) continue; // Treated in intif + if (r == 2) return 0; // Didn't have enough data (len==-1) ShowWarning("chrif_parse: session #%d, intif_parse failed (unrecognized command 0x%.4x).\n", fd, cmd); set_eof(fd); @@ -1478,8 +1468,8 @@ } /*========================================== - * timer�֐� - * ������map�I�Ɍq�����Ă���N���C�A���g�l����char�I�֑��� + * timerFunction + * Send to char the number of client connected to map *------------------------------------------*/ int send_users_tochar(void) { @@ -1508,8 +1498,8 @@ } /*========================================== - * timer�֐� - * char�I�Ƃ̐ڑ����m�F���A�����؂�Ă�����ēx�ڑ����� + * timerFunction + * Chk the connection to char server, (if it down) *------------------------------------------*/ static int check_connect_char_server(int tid, unsigned int tick, int id, intptr_t data) { @@ -1591,7 +1581,7 @@ } /*========================================== - * �I�� + * Destructor *------------------------------------------*/ int do_final_chrif(void) { Index: src/map/clif.c --- src/map/clif.c Base (BASE) +++ src/map/clif.c Locally Modified (Based On LOCAL) @@ -193,6 +193,9 @@ /*========================================== * map�I��ip�ݒ� *------------------------------------------*/ +/*========================================== + * Ip setting of map-server + *------------------------------------------*/ int clif_setip(const char* ip) { char ip_str[16]; @@ -1357,9 +1360,9 @@ int i; if (sd->spiritball > 0) clif_spiritball(sd); - if(sd->state.size==2) // tiny/big players [Valaris] + if(sd->state.size==SZ_BIG) // tiny/big players [Valaris] clif_specialeffect(bl,423,AREA); - else if(sd->state.size==1) + else if(sd->state.size==SZ_MEDIUM) clif_specialeffect(bl,421,AREA); if( sd->bg_id && map[sd->bl.m].flag.battleground ) clif_sendbgemblem_area(sd); @@ -1384,9 +1387,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; @@ -1587,18 +1590,18 @@ { TBL_PC *sd = ((TBL_PC*)bl); // clif_movepc(sd); - if(sd->state.size==2) // tiny/big players [Valaris] + if(sd->state.size==SZ_BIG) // tiny/big players [Valaris] clif_specialeffect(&sd->bl,423,AREA); - else if(sd->state.size==1) + else if(sd->state.size==SZ_MEDIUM) clif_specialeffect(&sd->bl,421,AREA); } 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(&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; @@ -3211,7 +3214,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)); } @@ -4101,9 +4104,9 @@ { TBL_PC* tsd = (TBL_PC*)bl; clif_getareachar_pc(sd, tsd); - if(tsd->state.size==2) // tiny/big players [Valaris] + if(tsd->state.size==SZ_BIG) // tiny/big players [Valaris] clif_specialeffect_single(bl,423,sd->fd); - else if(tsd->state.size==1) + else if(tsd->state.size==SZ_MEDIUM) clif_specialeffect_single(bl,421,sd->fd); if( tsd->bg_id && map[tsd->bl.m].flag.battleground ) clif_sendbgemblem_single(sd->fd,tsd); @@ -12072,7 +12075,7 @@ } if( sd->bg_id ) { - clif_displaymessage(fd, "You can't leave battleground guilds."); + clif_displaymessage(fd, msg_txt(670)); //"You can't leave battleground guilds." return; } @@ -12889,7 +12892,7 @@ // Friend already exists for (i = 0; i < MAX_FRIENDS && sd->status.friends[i].char_id != 0; i++) { if (sd->status.friends[i].char_id == f_sd->status.char_id) { - clif_displaymessage(fd, "Friend already exists."); + clif_displaymessage(fd, msg_txt(671)); //"Friend already exists." return; } } @@ -12992,7 +12995,7 @@ (sd->status.friends[i].char_id != char_id || sd->status.friends[i].account_id != account_id); i++); if (i == MAX_FRIENDS) { - clif_displaymessage(fd, "Name not found in list."); + clif_displaymessage(fd, msg_txt(672)); //"Name not found in list." return; } @@ -13017,7 +13020,7 @@ } else { //friend not online -- ask char server to delete from his friendlist if(chrif_removefriend(char_id,sd->status.char_id)) { // char-server offline, abort - clif_displaymessage(fd, "This action can't be performed at the moment. Please try again later."); + clif_displaymessage(fd, msg_txt(673)); //"This action can't be performed at the moment. Please try again later." return; } } @@ -13030,7 +13033,7 @@ memcpy(&sd->status.friends[j-1], &sd->status.friends[j], sizeof(sd->status.friends[0])); memset(&sd->status.friends[MAX_FRIENDS-1], 0, sizeof(sd->status.friends[MAX_FRIENDS-1])); - clif_displaymessage(fd, "Friend removed"); + clif_displaymessage(fd, msg_txt(674)); //"Friend removed" WFIFOHEAD(fd,packet_len(0x20a)); WFIFOW(fd,0) = 0x20a; @@ -13840,7 +13843,7 @@ if( DIFF_TICK(sd->cansendmail_tick, gettick()) > 0 ) { - clif_displaymessage(sd->fd,"Cannot send mails too fast!!."); + clif_displaymessage(sd->fd,msg_txt(675)); //"Cannot send mails too fast!!." clif_Mail_send(fd, true); // fail return; } @@ -16042,7 +16045,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,USESKILL_FAIL_IMITATION_SKILL_NONE,0); } Index: src/map/elemental.c --- src/map/elemental.c Base (BASE) +++ src/map/elemental.c Locally Modified (Based On LOCAL) @@ -101,7 +101,7 @@ return 1; } -static int elemental_summon_end(int tid, unsigned int tick, int id, intptr data) { +static int elemental_summon_end(int tid, unsigned int tick, int id, intptr_t data) { struct map_session_data *sd; struct elemental_data *ed; @@ -643,7 +643,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/guild.c --- src/map/guild.c Base (BASE) +++ src/map/guild.c Locally Modified (Based On LOCAL) @@ -39,12 +39,13 @@ 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,10 +92,10 @@ return guild_skill_tree[id-GD_SKILLBASE].max; } -// �M���h�X�L�������邩�m�F -int guild_checkskill(struct guild *g,int id) -{ - int idx = id-GD_SKILLBASE; +// Retrive skilllv learned by guild + +int guild_checkskill(struct guild *g, int id) { + int idx = id - GD_SKILLBASE; if (idx < 0 || idx >= MAX_GUILDSKILL) return 0; return g->skill[idx].lv; @@ -261,7 +262,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 +284,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 +393,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 +401,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 +412,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 +443,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 +470,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 +487,7 @@ return 0; } -// ��񏊓� +//Get and display information for all member int guild_recv_info(struct guild *sg) { struct guild *g,before; @@ -504,7 +505,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 +540,32 @@ bm++; } - for(i=0;imax_member;i++){ // ���̑��M + for (i = 0; i < g->max_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 + if (before.guild_lv != g->guild_lv || bm != m || + before.max_member != g->max_member) { + 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 + if (before.skill_point != g->skill_point) + clif_guild_skillinfo(sd); //Submit information skills - if( guild_new ){ // �����M�Ȃ珊���������� - clif_guild_belonginfo(sd,g); - clif_guild_notice(sd,g); - sd->guild_emblem_id=g->emblem_id; + 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,10 +580,10 @@ return 0; } - -// �M���h�ւ̊��U -int guild_invite(struct map_session_data *sd,struct map_session_data *tsd) -{ +/*============================================= + * 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; int i; @@ -597,7 +598,7 @@ return 0; //Invite permission. if(!battle_config.invite_request_check) { - if (tsd->party_invite>0 || tsd->trade_partner || tsd->adopt_invite ) { // ���肪����ǂ��� + if (tsd->party_invite > 0 || tsd->trade_partner || tsd->adopt_invite) { //checking if there no other invitation pending clif_guild_inviteack(sd,0); return 0; } @@ -616,7 +617,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 +715,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 +727,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 +738,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 +762,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 +785,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 +924,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 +960,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 +978,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 +990,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 +1014,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 +1031,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 +1050,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 +1062,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 +1083,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 +1100,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 +1183,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 +1217,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 +1238,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 +1261,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); @@ -1238,13 +1286,14 @@ } } - // �S���ɒʒm + // Inform all members for(i=0;imax_member;i++) if((sd=g->member[i].sd)!=NULL) clif_guild_skillinfo(sd); return 0; } + void guild_guildaura_refresh(struct map_session_data *sd, int skill_num, int skill_lv) { struct skill_unit_group* group = NULL; int type = status_skill2sc(skill_num); @@ -1263,7 +1312,13 @@ } 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; @@ -1287,8 +1342,13 @@ skill_blockpc_start_(sd, skill_num[i], time , true); } -// �����֌W���ǂ����`�F�b�N -// �����Ȃ�1�A����ȊO��0 +/*==================================================== + * Check relation between guild_id1 and guild_id2 + * flag : + * 0 = allied + * 1 = ennemy + * return true if yes + *---------------------------------------------------*/ int guild_check_alliance(int guild_id1, int guild_id2, int flag) { struct guild *g; @@ -1302,14 +1362,16 @@ 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]; int i; if(agit_flag || agit2_flag) { // Disable alliance creation during woe [Valaris] - clif_displaymessage(sd->fd,"Alliances cannot be made during Guild Wars!"); + clif_displaymessage(sd->fd,msg_txt(676)); //"Alliances cannot be made during Guild Wars!" return 0; } // end addition [Valaris] @@ -1343,7 +1405,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 +1419,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 +1434,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 +1468,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,13 +1481,15 @@ 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); if(agit_flag || agit2_flag) { // Disable alliance breaking during woe [Valaris] - clif_displaymessage(sd->fd,"Alliances cannot be broken during Guild Wars!"); + clif_displaymessage(sd->fd,msg_txt(677)); //"Alliances cannot be broken during Guild Wars!" return 0; } // end addition [Valaris] @@ -1430,7 +1497,9 @@ 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 +1520,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 +1534,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 +1566,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 +1587,7 @@ } } } - }else{ // �֌W���� + } else { // remove relationship for(i=0;i<2-(flag&1);i++) { if(g[i]!=NULL) @@ -1525,21 +1596,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++) @@ -1550,7 +1621,7 @@ } /** - * �M���h���U�ʒm�p + * Notification for the guild disbanded * @see DBApply */ int guild_broken_sub(DBKey key, DBData *data, va_list ap) @@ -1562,7 +1633,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 +1679,7 @@ if(flag!=0 || g==NULL) return 0; - for(i=0;imax_member;i++){ // �M���h���U��ʒm + for(i=0;imax_member;i++){ // Destroy all relationships if((sd=g->member[i].sd)!=NULL){ if(sd->state.storage_flag == 2) storage_guild_storage_quit(sd,1); @@ -1675,13 +1746,13 @@ if (g->member[pos].sd && g->member[pos].sd->fd) { - clif_displaymessage(g->member[pos].sd->fd, "You no longer are the Guild Master."); + clif_displaymessage(g->member[pos].sd->fd, msg_txt(678)); //"You no longer are the Guild Master." g->member[pos].sd->state.gmaster_flag = 0; } if (g->member[0].sd && g->member[0].sd->fd) { - clif_displaymessage(g->member[0].sd->fd, "You have become the Guild Master!"); + clif_displaymessage(g->member[0].sd->fd, msg_txt(679)); //"You have become the Guild Master!" g->member[0].sd->state.gmaster_flag = g; //Block his skills for 5 minutes to prevent abuse. guild_block_skill(g->member[0].sd, 300000); @@ -1700,7 +1771,9 @@ return 1; } -// �M���h���U +/*==================================================== + * Guild disbanded + *---------------------------------------------------*/ int guild_break(struct map_session_data *sd,char *name) { struct guild *g; @@ -1850,7 +1923,7 @@ } } -// �M���h�f�[�^�ꊇ��M�i�����j +// Loadcastle data then invoque OnAgitInit* on last int guild_castledataloadack(int len, struct guild_castle *gc) { int i; @@ -1893,6 +1966,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 +1976,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 +1986,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 +1996,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 Base (BASE) +++ src/map/intif.c Locally Modified (Based On LOCAL) @@ -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) { @@ -1105,7 +1136,8 @@ 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 +1145,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 +1223,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 +1231,62 @@ guild_position_changed(RFIFOL(fd,4),RFIFOL(fd,8),(struct guild_position *)RFIFOP(fd,12)); return 0; } -// �M���h�X�L������U��ʒm + +// ACK change of guild skill update int intif_parse_GuildSkillUp(int fd) { guild_skillupack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); return 0; } -// �M���h����/�G�Βʒm + +// ACK change of guild relationship int intif_parse_GuildAlliance(int fd) { guild_allianceack(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOL(fd,14),RFIFOB(fd,18),(char *) RFIFOP(fd,19),(char *) RFIFOP(fd,43)); return 0; } -// �M���h���m�ύX�ʒm + +// ACK change of guild notice int intif_parse_GuildNotice(int fd) { guild_notice_changed(RFIFOL(fd,2),(char *) RFIFOP(fd,6),(char *) RFIFOP(fd,66)); return 0; } -// �M���h�G���u�����ύX�ʒm + +// ACK change of guild emblem int intif_parse_GuildEmblem(int fd) { guild_emblem_changed(RFIFOW(fd,2)-12,RFIFOL(fd,4),RFIFOL(fd,8), (char *)RFIFOP(fd,12)); return 0; } -// �M���h��b��M + +// ACK guild message int intif_parse_GuildMessage(int fd) { guild_recv_message(RFIFOL(fd,4),RFIFOL(fd,8),(char *) RFIFOP(fd,12),RFIFOW(fd,2)-12); return 0; } -// �M���h��f�[�^�v���ԐM + +// Reply guild castle data request int intif_parse_GuildCastleDataLoad(int fd) { return guild_castledataloadack(RFIFOW(fd,2), (struct guild_castle *)RFIFOP(fd,4)); } +// ACK change of guildmaster int intif_parse_GuildMasterChanged(int fd) { return guild_gm_changed(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10)); } -// pet +// Request pet creation int intif_parse_CreatePet(int fd) { pet_get_egg(RFIFOL(fd,2),RFIFOL(fd,7),RFIFOB(fd,6)); return 0; } +// ACK pet data int intif_parse_RecvPetData(int fd) { struct s_pet p; @@ -1261,6 +1303,8 @@ return 0; } + +// ACK pet save data int intif_parse_SavePetOk(int fd) { if(RFIFOB(fd,6) == 1) @@ -1269,6 +1313,7 @@ return 0; } +// ACK deleting pet int intif_parse_DeletePetOk(int fd) { if(RFIFOB(fd,2) == 1) @@ -1277,6 +1322,7 @@ return 0; } +// ACK changing name resquest, players,pets,hommon int intif_parse_ChangeNameOk(int fd) { struct map_session_data *sd = NULL; @@ -2112,19 +2158,19 @@ } //----------------------------------------------------------------- -// inter server����̒ʐM -// �G���[�������0(false)��Ԃ����� -// �p�P�b�g�������ł����1,�p�P�b�g��������Ȃ����2��Ԃ����� +// Communication from the inter server +// Return a 0 (false) if there were any errors. +// 1, 2 if there are not enough to return the length of the packet if the packet processing int intif_parse(int fd) { int packet_len, cmd; cmd = RFIFOW(fd,0); - // �p�P�b�g��ID�m�F + // Verify ID of the packet if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) || packet_len_table[cmd-0x3800]==0){ return 0; } - // �p�P�b�g�̒����m�F + // Check the length of the packet packet_len = packet_len_table[cmd-0x3800]; if(packet_len==-1){ if(RFIFOREST(fd)<4) @@ -2134,7 +2180,7 @@ if((int)RFIFOREST(fd), @@ -585,7 +586,7 @@ } /*========================================== - * ���������t�@�C���ǂݏo�� + * Read item forbiden by mapflag (can't equip item) *------------------------------------------*/ static bool itemdb_read_noequip(char* str[], int columns, int current) {// , @@ -1075,7 +1076,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/map.c --- src/map/map.c Base (BASE) +++ src/map/map.c Locally Modified (Based On LOCAL) @@ -93,7 +93,7 @@ char *MSG_CONF_NAME; char *GRF_PATH_FILENAME; -// �ɗ� static�Ń�?�J����?�߂� +// DBMap declaartion static DBMap* id_db=NULL; // int id -> struct block_list* static DBMap* pc_db=NULL; // int id -> struct map_session_data* static DBMap* mobid_db=NULL; // int id -> struct mob_data* @@ -187,8 +187,7 @@ // /*========================================== - * block��free����Ƃ�free��?���ɌĂ� - * ���b�N����Ă���Ƃ��̓o�b�t�@�ɂ��߂� + * Attempt to free a map blocklist *------------------------------------------*/ int map_freeblock (struct block_list *bl) { @@ -339,7 +338,7 @@ int pos; nullpo_ret(bl); - // ?��blocklist����?���Ă��� + // blocklist (2ways chainlist) if (bl->prev == NULL) { if (bl->next != NULL) { // prev��NULL��next��NULL�łȂ��̂͗L���Ă͂Ȃ�Ȃ� @@ -991,7 +990,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 +1001,7 @@ va_end(ap); } - map_freeblock_unlock(); // �������‚��� + map_freeblock_unlock(); // Allow Free bl_list_count = blockcount; return returnCount; @@ -1326,7 +1325,7 @@ /*========================================== * ���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���Ă��� @@ -1469,10 +1468,13 @@ } /*========================================== - * (m,x,y)�𒆐S��3x3��?�ɏ��A�C�e���ݒu - * - * item_data��amount�ȊO��copy���� - * type flag: &1 MVP item. &2 do stacking check. + * Add an item to location (m,x,y) + * Parameters + * @item_data item attributes + * @amount quantity + * @m, @x, @y mapid,x,y + * @first_charid, @second_charid, @third_charid, looting priority + * @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) { @@ -2497,7 +2499,7 @@ } /*========================================== - * (m,x,y)�̏�Ԃ𒲂ׂ� + * Confirm if celltype in (m,x,y) match the one given in cellchk *------------------------------------------*/ int map_getcell(int m,int x,int y,cell_chk cellchk) { @@ -3978,7 +3980,7 @@ do_init_battleground(); do_init_duel(); - npc_event_do_oninit(); // npc��OnInit�C�x���g?�s + npc_event_do_oninit(); // Init npcs (OnInit) if( console ) { Index: src/map/map.h --- src/map/map.h Base (BASE) +++ src/map/map.h Locally Modified (Based On LOCAL) @@ -610,15 +610,16 @@ extern char wisp_server_name[]; -// �I�S�̏�� +// users void map_setusers(int); int map_getusers(void); int map_usercount(void); -// block�폜�֘A + +// blocklist lock int map_freeblock(struct block_list *bl); int map_freeblock_lock(void); int map_freeblock_unlock(void); -// block�֘A +// blocklist manipulation int map_addblock(struct block_list* bl); int map_delblock(struct block_list* bl); int map_moveblock(struct block_list *, int, int, unsigned int); @@ -631,10 +632,10 @@ int map_foreachincell(int (*func)(struct block_list*,va_list), int m, int x, int y, int type, ...); int map_foreachinpath(int (*func)(struct block_list*,va_list), int m, int x0, int y0, int x1, int y1, int range, int length, int type, ...); int map_foreachinmap(int (*func)(struct block_list*,va_list), int m, int type, ...); -//block�֘A�ɒlj� +//blocklist nb in one cell int map_count_oncell(int m,int x,int y,int type); struct skill_unit *map_find_skill_unit_oncell(struct block_list *,int x,int y,int skill_id,struct skill_unit *, int flag); -// �ꎞ�Iobject�֘A +// search and creation int map_get_new_object_id(void); int map_search_freecell(struct block_list *src, int m, short *x, short *y, int rx, int ry, int flag); // @@ -642,13 +643,13 @@ // npc bool map_addnpc(int,struct npc_data *); -// ���A�C�e���֘A +// map item int map_clearflooritem_timer(int tid, unsigned int tick, int id, intptr_t data); int map_removemobs_timer(int tid, unsigned int tick, int id, intptr_t data); #define map_clearflooritem(id) map_clearflooritem_timer(0,0,id,1) 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); -// �L����id�����L������ �ϊ��֘A +// player to map session void map_addnickdb(int charid, const char* nick); void map_delnickdb(int charid, const char* nick); void map_reqnickdb(struct map_session_data* sd,int charid); Index: src/map/mercenary.c --- src/map/mercenary.c Base (BASE) +++ src/map/mercenary.c Locally Modified (Based On LOCAL) @@ -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/mob.c --- src/map/mob.c Base (BASE) +++ src/map/mob.c Locally Modified (Based On LOCAL) @@ -2834,7 +2834,7 @@ } /*========================================== - * ��ʓ��̎�芪���̐��v�Z�p(foreachinarea) + * Count slave sub, curently chking if mob master is the given id *------------------------------------------*/ int mob_countslave_sub(struct block_list *bl,va_list ap) { @@ -2849,7 +2849,7 @@ } /*========================================== - * ��ʓ��̎�芪���̐��v�Z + * Cout how many slave a mob got on map *------------------------------------------*/ int mob_countslave(struct block_list *bl) { @@ -2955,7 +2955,8 @@ } /*========================================== - *MOBskill����Y��skillid��skillidx��Ԃ� + * MOBskill lookup (get skillindex trough skillid) + * return -1 if not found *------------------------------------------*/ int mob_skillid2skillidx(int class_,int skillid) { @@ -3965,7 +3966,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/npc.c --- src/map/npc.c Base (BASE) +++ src/map/npc.c Locally Modified (Based On LOCAL) @@ -138,9 +138,7 @@ } /*========================================== - * NPC�̖���/�L�� - * npc_enable - * npc_enable_sub �L���OnTouch�C�x���g�����s + * sub fonction of npc_enable, Run OnTouch event when enabled *------------------------------------------*/ int npc_enable_sub(struct block_list *bl, va_list ap) { @@ -167,6 +165,9 @@ return 0; } +/*========================================== + * Disable / Enable NPC + *------------------------------------------*/ int npc_enable(const char* name, int flag) { struct npc_data* nd = npc_name2id(name); @@ -198,14 +199,14 @@ } else clif_changeoption(&nd->bl); - if( flag&3 && (nd->u.scr.xs >= 0 || nd->u.scr.ys >= 0) ) + if( flag&3 && (nd->u.scr.xs >= 0 || nd->u.scr.ys >= 0) ) //check if player standing on a OnTouchArea map_foreachinarea( npc_enable_sub, nd->bl.m, nd->bl.x-nd->u.scr.xs, nd->bl.y-nd->u.scr.ys, nd->bl.x+nd->u.scr.xs, nd->bl.y+nd->u.scr.ys, BL_PC, nd ); return 0; } /*========================================== - * NPC�𖼑O�ŒT�� + * NPC lookup (get npc_data trough npcname) *------------------------------------------*/ struct npc_data* npc_name2id(const char* name) { @@ -240,8 +241,9 @@ return 0; } #endif + /*========================================== - * �C�x���g�L���[�̃C�x���g���� + * Dequeue event and add timer for execution (100ms) *------------------------------------------*/ int npc_event_dequeue(struct map_session_data* sd) { @@ -299,7 +301,8 @@ int npc_event_sub(struct map_session_data* sd, struct event_data* ev, const char* eventname); //[Lance] /** - * �S�Ă�NPC��On*�C�x���g���s + * Exec name (NPC events) on player or global + * Do on all NPC when called with foreach * @see DBApply */ int npc_event_doall_sub(DBKey key, DBData *data, va_list ap) @@ -363,11 +366,13 @@ return c; } + // runs the specified event (global only) int npc_event_doall(const char* name) { return npc_event_doall_id(name, 0); } + // runs the specified event, with a RID attached (global only) int npc_event_doall_id(const char* name, int rid) { @@ -388,7 +393,8 @@ /*========================================== - * ���v�C�x���g���s + * Clock event execution + * OnMinute/OnClock/OnHour/OnDay/OnDDHHMM *------------------------------------------*/ int npc_event_do_clock(int tid, unsigned int tick, int id, intptr_t data) { @@ -435,7 +441,7 @@ } /*========================================== - * OnInit�C�x���g���s(&���v�C�x���g�J�n) + * OnInit Event execution (the start of the event and watch) *------------------------------------------*/ void npc_event_do_oninit(void) { @@ -445,7 +451,7 @@ } /*========================================== - * �^�C�}�[�C�x���g�p���x���̎�荞�� + * Incorporation of the label for the timer event * called from npc_parse_script *------------------------------------------*/ int npc_timerevent_export(struct npc_data *nd, int i) @@ -454,7 +460,7 @@ char *lname = nd->u.scr.label_list[i].name; int pos = nd->u.scr.label_list[i].pos; if (sscanf(lname, "OnTimer%d%n", &t, &k) == 1 && lname[k] == '\0') { - // �^�C�}�[�C�x���g + // Timer event struct npc_timerevent_list *te = nd->u.scr.timer_event; int j, k = nd->u.scr.timeramount; if (te == NULL) @@ -783,7 +789,7 @@ } /*========================================== - * �C�x���g�^��NPC���� + * NPC processing event type *------------------------------------------*/ int npc_event(struct map_session_data* sd, const char* eventname, int ontouch) { @@ -813,6 +819,9 @@ return npc_event_sub(sd,ev,eventname); } +/*========================================== + * Sub chk then execute area event type + *------------------------------------------*/ int npc_touch_areanpc_sub(struct block_list *bl, va_list ap) { struct map_session_data *sd; @@ -835,6 +844,9 @@ return 1; } +/*========================================== + * If player leave map or get out take next player in area event then exec OnTouch_ + *------------------------------------------*/ int npc_touchnext_areanpc(struct map_session_data* sd, bool leavemap) { struct npc_data *nd = map_id2nd(sd->touching_id); @@ -861,7 +873,7 @@ } /*========================================== - * �ڐG�^��NPC���� + * Exec OnTouch for player if in range of area event *------------------------------------------*/ int npc_touch_areanpc(struct map_session_data* sd, int m, int x, int y) { @@ -1048,6 +1060,12 @@ return (map[m].npc[i]->bl.id); } +/*========================================== + * Chk if player not too far to acces the npc + * return + * npc_data : succes + * NULL : fail + *------------------------------------------*/ struct npc_data* npc_checknear(struct map_session_data* sd, struct block_list* bl) { struct npc_data *nd; @@ -1072,7 +1090,7 @@ } /*========================================== - * NPC�̃I�[�v���`���b�g���� + * Make NPC talk in global chat (like npctalk) *------------------------------------------*/ int npc_globalmessage(const char* name, const char* mes) { @@ -1114,7 +1132,8 @@ } /*========================================== - * �N���b�N����NPC���� + * NPC 1st call when clicking on npc + * Do specific action for npc type (openshop, run scripts...) *------------------------------------------*/ int npc_click(struct map_session_data* sd, struct npc_data* nd) { @@ -1194,7 +1213,7 @@ } /*========================================== - * + * Chk if valid call then open buy or selling list *------------------------------------------*/ int npc_buysellsel(struct map_session_data* sd, int id, int type) { @@ -1211,7 +1230,7 @@ sd->npc_id=0; return 1; } - if (nd->sc.option&OPTION_INVISIBLE) // ������Ă��� + if (nd->sc.option & OPTION_INVISIBLE) // can't buy if npc is not visible (hack?) return 1; if( nd->class_ < 0 && !sd->state.callshop ) {// not called through a script and is not a visible NPC so an invalid call @@ -1310,6 +1329,7 @@ return 0; } + //npc_buylist for script-controlled shops. static int npc_buylist_sub(struct map_session_data* sd, int n, unsigned short* item_list, struct npc_data* nd) { @@ -1335,6 +1355,7 @@ return 0; } + /*========================================== * Cash Shop Buy *------------------------------------------*/ @@ -1693,6 +1714,8 @@ return 0; } +//Atempt to remove an npc from a map +//This doesn't remove it from map_db int npc_remove_map(struct npc_data* nd) { int m,i; @@ -1729,6 +1752,8 @@ return 0; } +//Chk if npc match src_id then unload +//Sub fonction used to found duplicate static int npc_unload_dup_sub(struct npc_data* nd, va_list args) { int src_id; @@ -1745,6 +1770,8 @@ map_foreachnpc(npc_unload_dup_sub,nd->bl.id); } +//Remove an npc from map and db +//single is to free name (for duplicate one I suppose) int npc_unload(struct npc_data* nd, bool single) { nullpo_ret(nd); @@ -1957,7 +1984,7 @@ ShowWarning("npc_parsename: Duplicate unique name in file '%s', line'%d'. Renaming '%s' to '%s'.\n", filepath, strline(buffer,start-buffer), nd->exname, newname); ShowDebug("this npc:\n display name '%s'\n unique name '%s'\n map=%s, x=%d, y=%d\n", nd->name, nd->exname, this_mapname, nd->bl.x, nd->bl.y); - ShowDebug("other npc:\n display name '%s'\n unique name '%s'\n map=%s, x=%d, y=%d\n", dnd->name, dnd->exname, other_mapname, dnd->bl.x, dnd->bl.y); + ShowDebug("other npc in '%s' :\n display name '%s'\n unique name '%s'\n map=%s, x=%d, y=%d\n",dnd->path, dnd->name, dnd->exname, other_mapname, dnd->bl.x, dnd->bl.y); safestrncpy(nd->exname, newname, sizeof(nd->exname)); } @@ -1987,6 +2014,7 @@ } } +//Add then display an npc warp on map struct npc_data* npc_add_warp(short from_mapid, short from_x, short from_y, short xs, short ys, unsigned short to_mapindex, short to_x, short to_y) { int i; @@ -2208,7 +2236,8 @@ } /** - * NPC�̃��x���f�[�^�R���o�[�g + * NPCのラベルデータコンバート + * Not sure, seem to add label in a chainlink * @see DBApply */ int npc_convertlabel_db(DBKey key, DBData *data, va_list ap) @@ -2671,6 +2700,7 @@ return 0; } +//Set mapcell CELL_NPC to trigger event later void npc_setcells(struct npc_data* nd) { int m = nd->bl.m, x = nd->bl.x, y = nd->bl.y, xs, ys; @@ -2690,7 +2720,7 @@ return; // Other types doesn't have touch area } - if (m < 0 || xs < 0 || ys < 0) + if (m < 0 || xs < 0 || ys < 0) //invalid range or map return; for (i = y-ys; i <= y+ys; i++) { @@ -3052,7 +3082,9 @@ } /*========================================== - * �}�b�v�t���O�s�̉�� + * Set or disable mapflag on map + * eg : bat_c01 mapflag battleground 2 + * also chking if mapflag conflict with another *------------------------------------------*/ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char* start, const char* buffer, const char* filepath) { @@ -3317,6 +3349,8 @@ return strchr(start,'\n');// continue } +//Read file and create npc/func/mapflag/monster.. accordly +//@runOnInit should we exec OnInit when it's done ? void npc_parsesrcfile(const char* filepath, bool runOnInit) { int m, lines = 0; @@ -3538,11 +3572,11 @@ ShowInfo("%s: %d '%s' events.\n", config[i].name, script_event[i].event_count, config[i].event_name); } } + void npc_clear_pathlist(void) { struct npc_path_data *npd = NULL; DBIterator *path_list = db_iterator(npc_path_db); - /* free all npc_path_data filepaths */ for( npd = dbi_first(path_list); dbi_exists(path_list); npd = dbi_next(path_list) ) { if( npd->path ) @@ -3551,6 +3585,8 @@ dbi_destroy(path_list); } + +//Clear then reload npcs files int npc_reload(void) { struct npc_src_list *nsl; int m, i; @@ -3646,6 +3682,8 @@ } return 0; } + +//Unload all npc in the given file bool npc_unloadfile( const char* path ) { DBIterator * iter = db_iterator(npcname_db); struct npc_data* nd = NULL; @@ -3666,12 +3704,14 @@ return found; } + void do_clear_npc(void) { db_clear(npcname_db); db_clear(ev_db); } + /*========================================== - * �I�� + * Destructor *------------------------------------------*/ int do_final_npc(void) { npc_clear_pathlist(); Index: src/map/party.c --- src/map/party.c Base (BASE) +++ src/map/party.c Locally Modified (Based On LOCAL) @@ -103,14 +103,15 @@ } /*========================================== - * �I�� + * Destructor + * Called in map shutdown, cleanup var *------------------------------------------*/ void do_final_party(void) { party_db->destroy(party_db,NULL); party_booking_db->destroy(party_booking_db,NULL); // Party Booking [Spiria] } -// ���� +// Constructor, init vars void do_init_party(void) { party_db = idb_alloc(DB_OPT_RELEASE_DATA); @@ -650,7 +651,7 @@ if( map[sd->bl.m].flag.partylock ) { - clif_displaymessage(sd->fd, "You cannot change party leaders on this map."); + clif_displaymessage(sd->fd, msg_txt(287)); return false; } Index: src/map/party.h --- src/map/party.h Base (BASE) +++ src/map/party.h Locally Modified (Based On LOCAL) Index: src/map/path.c --- src/map/path.c Base (BASE) +++ src/map/path.c Locally Modified (Based On LOCAL) @@ -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: src/map/pc.c --- src/map/pc.c Base (BASE) +++ src/map/pc.c Locally Modified (Based On LOCAL) @@ -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]; @@ -289,7 +289,7 @@ memset(b_sd, 0, sizeof(b_sd)); i = party_foreachsamemap(pc_check_banding,sd,range,&sd->bl,&c,&b_sd); - if( c < 1 ) + if( c < 1 ) //just recalc status no need to recalc hp { // No more Royal Guards in Banding found. if( (sc = status_get_sc(&sd->bl)) != NULL && sc->data[SC_BANDING] ) { @@ -559,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) { @@ -833,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); @@ -917,8 +922,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) { @@ -1037,7 +1042,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); @@ -1272,7 +1277,7 @@ /*========================================== - * ?������X�L���̌v�Z + * Calculation of Skills lvls *------------------------------------------*/ int pc_calc_skilltree(struct map_session_data *sd) { @@ -3438,7 +3443,7 @@ return 1; } /*========================================== - * �J?�h?�� + * Append a card to an item ? *------------------------------------------*/ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) { @@ -3493,18 +3498,18 @@ } // -// �A�C�e���� +// Items // /*========================================== - * �X�L���ɂ�锃���l�C�� + * Update 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) @@ -3516,12 +3521,12 @@ } /*========================================== - * �X�L���ɂ��?��l�C�� + * Update 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.); @@ -3532,8 +3537,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 30k as limit (for client I guess) *------------------------------------------*/ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount) { @@ -3566,7 +3571,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) { @@ -3726,7 +3732,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) { @@ -3738,7 +3744,16 @@ } /*========================================== - * �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 + 3 = ? + 4 = no free place found + 5 = max amount reached + 6 = ? + 7 = stack limitation *------------------------------------------*/ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) { @@ -3821,7 +3836,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) { @@ -3849,7 +3867,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) { @@ -3890,7 +3911,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) { @@ -3903,7 +3927,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); @@ -3957,6 +3981,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; @@ -3975,7 +4005,7 @@ if( !item->script ) //if it has no script, you can't really consume it! return 0; - switch( nameid ) + switch( nameid ) //@TODO, lot oh harcoded nameid here { case 605: // Anodyne if( map_flag_gvg(sd->bl.m) ) @@ -4117,7 +4147,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) { @@ -4240,7 +4273,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) { @@ -4306,7 +4342,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) { @@ -4333,7 +4372,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) { @@ -4356,7 +4398,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) { @@ -4372,7 +4417,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) { @@ -4396,7 +4444,7 @@ } /*========================================== - * �X�e�B���i���J + * Display item stolen msg to player sd *------------------------------------------*/ int pc_show_steal(struct block_list *bl,va_list ap) { @@ -4418,7 +4466,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) { @@ -4499,7 +4550,10 @@ } /*========================================== - * + * Stole zeny from bl (mob) + * return + * 0 = fail + * 1 = success *------------------------------------------*/ int pc_steal_coin(struct map_session_data *sd,struct block_list *target) { @@ -4699,7 +4753,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) { @@ -4710,7 +4768,7 @@ m=sd->bl.m; - if (map[sd->bl.m].flag.noteleport) // �e���|?�g�֎~ + if (map[sd->bl.m].flag.noteleport) //Teleport forbiden return 0; do{ @@ -4774,10 +4832,10 @@ } // -// ����?? +// Skills // /*========================================== - * �X�L����?�� ���L���Ă����ꍇLv���Ԃ� + * Return player sd skilllv learned for given skill *------------------------------------------*/ int pc_checkskill(struct map_session_data *sd,int skill_id) { @@ -4859,7 +4917,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) { @@ -5562,7 +5621,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) { @@ -5655,8 +5714,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); @@ -5667,6 +5728,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) @@ -5677,8 +5739,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); @@ -5688,6 +5755,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) @@ -5857,7 +5925,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) { @@ -6353,6 +6422,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; @@ -6684,10 +6756,10 @@ guild_guildaura_refresh(sd,GD_HAWKEYES,guild_checkskill(sd->state.gmaster_flag,GD_HAWKEYES)); } } -// script? �A +// script // /*========================================== - * script�pPC�X�e?�^�X?�ݏo�� + * script reading pc status registry *------------------------------------------*/ int pc_readparam(struct map_session_data* sd,int type) { @@ -6733,7 +6805,7 @@ } /*========================================== - * script�pPC�X�e?�^�X�ݒ� + * script set pc status registry *------------------------------------------*/ int pc_setparam(struct map_session_data *sd,int type,int val) { @@ -6901,7 +6973,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) { @@ -6967,7 +7041,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) { @@ -7005,9 +7080,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) @@ -7099,7 +7172,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); // unequip invalid item for class } //Change look, if disguised, you need to undisguise @@ -7170,7 +7243,7 @@ } /*========================================== - * ������?�X + * Tell client player sd has change equipement *------------------------------------------*/ int pc_equiplookall(struct map_session_data *sd) { @@ -7187,7 +7260,7 @@ } /*========================================== - * ������?�X + * Tell client player sd has change look (hair,equip...) *------------------------------------------*/ int pc_changelook(struct map_session_data *sd,int type,int val) { @@ -7247,7 +7320,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) { @@ -7364,7 +7437,7 @@ } /*========================================== - * �J?�g�ݒ� + * Give player a cart *------------------------------------------*/ int pc_setcart(struct map_session_data *sd,int type) { #ifndef NEW_CARTS @@ -7414,7 +7487,7 @@ } /*========================================== - * ��ݒ� + * Give player a falcon *------------------------------------------*/ int pc_setfalcon(TBL_PC* sd, int flag) { @@ -7429,7 +7502,7 @@ } /*========================================== - * �y�R�y�R�ݒ� + * Set player riding *------------------------------------------*/ int pc_setriding(TBL_PC* sd, int flag) { @@ -7444,7 +7517,7 @@ } /*========================================== - * + * Give player a mado *------------------------------------------*/ int pc_setmadogear(TBL_PC* sd, int flag) { @@ -7459,7 +7532,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) { @@ -7471,7 +7544,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) { @@ -7483,7 +7557,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) { @@ -7511,7 +7586,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) { @@ -7523,7 +7599,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) { @@ -7803,7 +7880,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) { @@ -7828,7 +7905,7 @@ } /*========================================== - * �C�x���g�^�C�}?�lj� + * Add eventtimer for player sd ? *------------------------------------------*/ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) { @@ -7846,7 +7923,7 @@ } /*========================================== - * �C�x���g�^�C�}?�폜 + * Del eventtimer for player sd ? *------------------------------------------*/ int pc_deleventtimer(struct map_session_data *sd,const char *name) { @@ -7876,7 +7953,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) { @@ -7895,7 +7972,7 @@ } /*========================================== - * �C�x���g�^�C�}?�S�폜 + * Remove all eventtimer for player sd *------------------------------------------*/ int pc_cleareventtimer(struct map_session_data *sd) { @@ -8068,7 +8145,7 @@ return ret; } /*========================================== - * Attempt to equip item in inventory index 'n' in the EQP_ 'req_pos' + * 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) { @@ -8269,7 +8346,7 @@ } /*========================================== - * ? �����������O�� + * Called when attemting to unequip an item from player * type: * 0 - only unequip * 1 - calculate status after unequipping @@ -8432,8 +8509,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) { @@ -8513,7 +8590,7 @@ } /*========================================== - * PVP���ʌv�Z�p(foreachinarea) + * Update PVP rank for sd1 in cmp to sd2 *------------------------------------------*/ int pc_calc_pvprank_sub(struct block_list *bl,va_list ap) { @@ -8532,7 +8609,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) { @@ -8547,7 +8625,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) { @@ -8569,7 +8647,10 @@ } /*========================================== - * sd�͌������Ă��邩(?���̏ꍇ�͑����char_id��Ԃ�) + * Checking if sd is married + * Return + * partner_id = yes, + * 0 = no *------------------------------------------*/ int pc_ismarried(struct map_session_data *sd) { @@ -8581,7 +8662,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) { @@ -8596,6 +8680,9 @@ /*========================================== * Divorce sd from its partner + * return + * -1 = fail + * 0 = success *------------------------------------------*/ int pc_divorce(struct map_session_data *sd) { @@ -8634,7 +8721,7 @@ } /*========================================== - * sd�̑����map_session_data��Ԃ� + * Get sd partner charid. (Married partner) *------------------------------------------*/ struct map_session_data *pc_get_partner(struct map_session_data *sd) { @@ -8645,6 +8732,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) @@ -8654,6 +8744,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) @@ -8663,6 +8756,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) @@ -8672,6 +8768,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; @@ -8733,7 +8832,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) { @@ -8747,7 +8846,7 @@ } /*========================================== - * �����Z?�u (timer??) + * Save 1 player data at autosave intervalle *------------------------------------------*/ int pc_autosave(int tid, unsigned int tick, int id, intptr_t data) { @@ -8864,7 +8963,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 @@ -9067,11 +9166,8 @@ } /*========================================== - * DB reading. - * exp.txt - required experience values - * skill_tree.txt - skill tree for every class - * attr_fix.txt - elemental adjustment table - * statpoint.txt - status points per base level + * sub DB reading. + * fonction used to read skill_tree.txt *------------------------------------------*/ static bool pc_readdb_skilltree(char* fields[], int columns, int current) { @@ -9121,13 +9217,19 @@ return true; } +/*========================================== + * pc DB reading. + * exp.txt - required experience values + * skill_tree.txt - skill tree for every class + * attr_fix.txt - elemental adjustment table + *------------------------------------------*/ int pc_readdb(void) { int i,j,k; FILE *fp; char line[24000],*p; - // �K�v??�l?��?�� + //reset memset(exp_table,0,sizeof(exp_table)); memset(max_level,0,sizeof(max_level)); @@ -9212,12 +9314,11 @@ } ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt"); - // �X�L���c��? + // Reset and read skilltree 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�� + // Reset then read attr_fix for(i=0;i<4;i++) for(j=0;jloot->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; //prevent picked up during 10*1000ms if (dlist->item) add_timer(gettick()+540,pet_delay_item_drop,0,(intptr_t)dlist); @@ -1195,7 +1195,9 @@ } /*========================================== - *�y�b�g�f�[�^�ǂݍ��� + * Pet read db data + * pet_db.txt + * pet_db2.txt *------------------------------------------*/ int read_petdb() { @@ -1343,7 +1345,7 @@ } /*========================================== - * �X�L���֌W������ + * Initialization process relationship skills *------------------------------------------*/ int do_init_pet(void) { Index: src/map/script.c --- src/map/script.c Base (BASE) +++ src/map/script.c Locally Modified (Based On LOCAL) @@ -12441,7 +12441,7 @@ status_revive(&sd->bl, 100, 100); else status_percent_heal(&sd->bl, 100, 100); - clif_displaymessage(sd->fd,"You have been recovered!"); + clif_displaymessage(sd->fd,msg_txt(680)); } mapit_free(iter); return 0; Index: src/map/skill.c --- src/map/skill.c Base (BASE) +++ src/map/skill.c Locally Modified (Based On LOCAL) @@ -5959,7 +5959,8 @@ break; } if(!battle_config.duel_allow_teleport && sd->duel_group && skilllv <= 2) { // duel restriction [LuzZza] - clif_displaymessage(sd->fd, "Duel: Can't use teleport in duel."); + char output[128]; sprintf(output, msg_txt(365), skill_get_name(AL_TELEPORT)); + clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel." break; } @@ -7861,7 +7862,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; } @@ -12207,7 +12208,8 @@ break; case AL_WARP: if(!battle_config.duel_allow_teleport && sd->duel_group) { // duel restriction [LuzZza] - clif_displaymessage(sd->fd, "Duel: Can't use warp in duel."); + char output[128]; sprintf(output, msg_txt(365), skill_get_name(AL_WARP)); + clif_displaymessage(sd->fd, output); //"Duel: Can't use %s in duel." return 0; } break; @@ -13401,12 +13403,12 @@ time += time * sc->data[SC_SLOWCAST]->val2 / 100; if (sc->data[SC_SUFFRAGIUM]) { time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100; - status_change_end(bl, SC_SUFFRAGIUM, -1); + status_change_end(bl, SC_SUFFRAGIUM, INVALID_TIMER); } if (sc->data[SC_MEMORIZE]) { time>>=1; if ((--sc->data[SC_MEMORIZE]->val2) <= 0) - status_change_end(bl, SC_MEMORIZE, -1); + status_change_end(bl, SC_MEMORIZE, INVALID_TIMER); } if (sc->data[SC_POEMBRAGI]) time -= time * sc->data[SC_POEMBRAGI]->val2 / 100; Index: src/map/skill.h --- src/map/skill.h Base (BASE) +++ src/map/skill.h Locally Modified (Based On LOCAL) @@ -87,7 +87,8 @@ 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 +117,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; @@ -195,7 +196,8 @@ 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; @@ -203,14 +205,16 @@ }; 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; @@ -227,7 +231,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 ); @@ -277,13 +282,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); @@ -321,7 +326,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); @@ -335,7 +340,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); @@ -343,13 +348,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); @@ -365,7 +370,7 @@ ((id) >= BD_ADAPTATION && (id) <= DC_SERVICEFORYOU) || ((id) >= CG_ARROWVULCAN && (id) <= CG_MARIONETTE) || \ ((id) >= CG_LONGINGFREEDOM && (id) <= CG_TAROTCARD) || ((id) >= WA_SWING_DANCE && (id) <= WM_UNLIMITED_HUMMING_VOICE)) -// �X�L���U?�ꊇ?�� +// Skill action, (return dmg,heal) int skill_attack( int attack_type, struct block_list* src, struct block_list *dsrc,struct block_list *bl,int skillid,int skilllv,unsigned int tick,int flag ); void skill_reload(void); Index: src/map/status.c --- src/map/status.c Base (BASE) +++ src/map/status.c Locally Modified (Based On LOCAL) @@ -66,7 +66,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 weapon modification for size (size_fix.txt) static char job_bonus[CLASS_COUNT][MAX_LEVEL]; static struct eri *sc_data_ers; //For sc_data entries @@ -2059,7 +2059,7 @@ if (flag&2) { // change for sized monsters [Valaris] - if (md->special_state.size==1) { + if (md->special_state.size==SZ_MEDIUM) { status->max_hp>>=1; status->max_sp>>=1; if (!status->max_hp) status->max_hp = 1; @@ -2078,7 +2078,7 @@ if (!status->int_) status->int_ = 1; if (!status->dex) status->dex = 1; if (!status->luk) status->luk = 1; - } else if (md->special_state.size==2) { + } else if (md->special_state.size==SZ_BIG) { status->max_hp<<=1; status->max_sp<<=1; status->hp=status->max_hp; @@ -10888,6 +10888,13 @@ return true; } +/* +* Read status db +* job1.txt +* job2.txt +* size_fixe.txt +* refine_db.txt +*/ int status_readdb(void) { int i, j; @@ -10895,13 +10902,13 @@ // initialize databases to default // - // job_db1.txt + // reset job_db1.txt data memset(max_weight_base, 0, sizeof(max_weight_base)); memset(hp_coefficient, 0, sizeof(hp_coefficient)); memset(hp_coefficient2, 0, sizeof(hp_coefficient2)); memset(sp_coefficient, 0, sizeof(sp_coefficient)); memset(aspd_base, 0, sizeof(aspd_base)); - // job_db2.txt + // reset job_db2.txt data memset(job_bonus,0,sizeof(job_bonus)); // Job-specific stats bonus // size_fix.txt @@ -10937,7 +10944,7 @@ } /*========================================== - * �X�L���֌W������ + * Status db init and destroy. *------------------------------------------*/ int do_init_status(void) { Index: src/map/storage.c --- src/map/storage.c Base (BASE) +++ src/map/storage.c Locally Modified (Based On LOCAL) @@ -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) { @@ -43,6 +43,7 @@ return i1->nameid - i2->nameid; } +//Sort item by storage_comp_item (nameid) static void storage_sortitem(struct item* items, unsigned int size) { nullpo_retv(items); @@ -54,9 +55,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,7 +111,9 @@ return 0; } -// helper function +/* helper function + * checking if 2 item structure are identique + */ int compare_item(struct item *a, struct item *b) { if( a->nameid == b->nameid && @@ -202,6 +205,10 @@ /*========================================== * Add an item to the storage from the inventory. + * @index : inventory idx + * return + * 0 : fail + * 1 : success *------------------------------------------*/ int storage_storageadd(struct map_session_data* sd, int index, int amount) { @@ -226,7 +233,11 @@ } /*========================================== - * Retrieve an item from the storage. + * Retrieve an item from the storage into inventory + * @index : storage idx + * return + * 0 : fail + * 1 : success *------------------------------------------*/ int storage_storageget(struct map_session_data* sd, int index, int amount) { @@ -251,6 +262,10 @@ /*========================================== * Move an item from cart to storage. + * @index : cart inventory index + * return + * 0 : fail + * 1 : success *------------------------------------------*/ int storage_storageaddfromcart(struct map_session_data* sd, int index, int amount) { @@ -275,7 +290,11 @@ } /*========================================== - * Get from Storage to the Cart + * Get from Storage to the Cart inventory + * @index : storage index + * return + * 0 : fail + * 1 : success *------------------------------------------*/ int storage_storagegettocart(struct map_session_data* sd, int index, int amount) { @@ -344,8 +363,9 @@ return gs; } +//For just locating a storage without creating one. [Skotlex] struct guild_storage *guild2storage2(int guild_id) -{ //For just locating a storage without creating one. [Skotlex] +{ return (struct guild_storage*)idb_get(guild_storage_db,guild_id); } @@ -355,6 +375,13 @@ return 0; } +/*========================================== +* Attempt to open guild storage for sd +* return +* 0 : success (open or req to create a new one) +* 1 : fail +* 2 : no guild for sd + *------------------------------------------*/ int storage_guild_storageopen(struct map_session_data* sd) { struct guild_storage *gstor; @@ -387,6 +414,12 @@ return 0; } +/*========================================== +* Attempt to add an item in guild storage, then refresh it +* return +* 0 : success +* 1 : fail + *------------------------------------------*/ int guild_storage_additem(struct map_session_data* sd, struct guild_storage* stor, struct item* item_data, int amount) { struct item_data *data; @@ -439,6 +472,12 @@ return 0; } +/*========================================== +* Attempt to delete an item in guild storage, then refresh it +* return +* 0 : success +* 1 : fail + *------------------------------------------*/ int guild_storage_delitem(struct map_session_data* sd, struct guild_storage* stor, int n, int amount) { nullpo_retr(1, sd); @@ -458,6 +497,13 @@ return 0; } +/*========================================== +* Attempt to add an item in guild storage from inventory, then refresh it +* @index : inventory idx +* return +* 0 : fail +* 1 : succes + *------------------------------------------*/ int storage_guild_storageadd(struct map_session_data* sd, int index, int amount) { struct guild_storage *stor; @@ -483,6 +529,13 @@ return 1; } +/*========================================== +* Attempt to retrieve an item from guild storage to inventory, then refresh it +* @index : storage idx +* return +* 0 : fail +* 1 : succes + *------------------------------------------*/ int storage_guild_storageget(struct map_session_data* sd, int index, int amount) { struct guild_storage *stor; @@ -505,13 +558,20 @@ if((flag = pc_additem(sd,&stor->items[index],amount,LOG_TYPE_GSTORAGE)) == 0) guild_storage_delitem(sd,stor,index,amount); - else + else //inform fail clif_additem(sd,0,0,flag); // log_fromstorage(sd, index, 1); return 0; } +/*========================================== +* Attempt to add an item in guild storage from cart, then refresh it +* @index : cart inventory idx +* return +* 0 : fail +* 1 : succes + *------------------------------------------*/ int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int amount) { struct guild_storage *stor; @@ -537,6 +597,13 @@ return 1; } +/*========================================== +* Attempt to retrieve an item from guild storage to cart, then refresh it +* @index : storage idx +* return +* 0 : fail +* 1 : succes + *------------------------------------------*/ int storage_guild_storagegettocart(struct map_session_data* sd, int index, int amount) { struct guild_storage *stor; @@ -562,6 +629,12 @@ return 1; } +/*========================================== +* Request to save guild storage +* return +* 0 : fail (no storage) +* 1 : succes + *------------------------------------------*/ int storage_guild_storagesave(int account_id, int guild_id, int flag) { struct guild_storage *stor = guild2storage2(guild_id); @@ -577,6 +650,12 @@ return 0; } +/*========================================== +* ACK save of guild storage +* return +* 0 : fail (no storage) +* 1 : succes + *------------------------------------------*/ int storage_guild_storagesaved(int guild_id) { struct guild_storage *stor; @@ -591,6 +670,7 @@ return 0; } +//Close storage for sd and save it int storage_guild_storageclose(struct map_session_data* sd) { struct guild_storage *stor; Index: src/map/trade.c --- src/map/trade.c Base (BASE) +++ src/map/trade.c Locally Modified (Based On LOCAL) @@ -510,7 +510,7 @@ } /*========================================== - * ����(trade����) + * lock sd and tsd trade data, execute the trade, clear, then save players *------------------------------------------*/ void trade_tradecommit(struct map_session_data *sd) { Index: src/map/unit.c --- src/map/unit.c Base (BASE) +++ src/map/unit.c Locally Modified (Based On LOCAL) @@ -137,7 +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; @@ -156,8 +156,7 @@ if(map_getcell(bl->m,x+dx,y+dy,CELL_CHKNOPASS)) return unit_walktoxy_sub(bl); - // �o�V���J���� - + //Refresh view for all those we lose sight map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, sd?BL_ALL:BL_PC, bl); x += dx; @@ -347,8 +346,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���ĂԂ悤�ɂ��� + // When you come to the center of the grid because the change of destination while you're walking right now + // Call a function from a timer unit_walktoxy_sub ud->state.change_walk_target = 1; return 1; } @@ -1023,7 +1022,7 @@ nullpo_ret(src); if(status_isdead(src)) - return 0; // ����ł��Ȃ��� + return 0; //Do not continue source is dead sd = BL_CAST(BL_PC, src); ud = unit_bl2ud(src); @@ -1112,7 +1111,7 @@ return 0; tstatus = status_get_status_data(target); - //���O�̃X�L���󋵂̋L�^ + // Record the status of the previous skill) if(sd) { switch(skill_num){ case SA_CASTCANCEL: @@ -1362,7 +1361,7 @@ nullpo_ret(src); - if(!src->prev) return 0; // map ��ɑ��݂��邩 + if (!src->prev) return 0; // not on the map if(status_isdead(src)) return 0; sd = BL_CAST(BL_PC, src); @@ -1399,7 +1398,7 @@ return 0; } - /* �˒��Ə�Q���`�F�b�N */ + /* Check range and obstacle */ bl.type = BL_NUL; bl.m = src->m; bl.x = skill_x; @@ -1522,8 +1521,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) { @@ -1604,7 +1603,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); @@ -1648,7 +1647,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) { @@ -1706,7 +1705,7 @@ } /*========================================== - * PC�̍U�� (timer�֐�) + * Continuous Attack (function timer) *------------------------------------------*/ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick) { @@ -1908,7 +1907,7 @@ return 1; } -// unit_data �̏����� +// unit_data initialization process void unit_dataset(struct block_list *bl) { struct unit_data *ud; @@ -1949,7 +1948,7 @@ } /*========================================== - * �����ڂ̃T�C�Y��ύX���� + * To change the size of the char (player or mob only) *------------------------------------------*/ int unit_changeviewsize(struct block_list *bl,short size) { Index: src/map/vending.c --- src/map/vending.c Base (BASE) +++ src/map/vending.c Locally Modified (Based On LOCAL) @@ -279,7 +279,7 @@ clif_skill_fail(sd, MC_VENDING, USESKILL_FAIL_LEVEL, 0); return; } - + //check if nearby npc, (perhaps we should check for nearby shop too if( vending_checknearnpc(&sd->bl) ) { char output[150]; sprintf(output,"You're too close to a NPC, you must be at least %d cells away from any NPC.",battle_config.min_npc_vending_distance); Index: src/map/vending.h --- src/map/vending.h Base (BASE) +++ src/map/vending.h Locally Modified (Based On LOCAL) @@ -10,9 +10,9 @@ struct s_search_store_search; struct s_vending { - short index; - short amount; - unsigned int value; + short index; //cart index (return item data) + short amount; //amout of the item for vending + unsigned int value; //at wich price }; void vending_closevending(struct map_session_data* sd);