diff options
author | glighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-10-29 06:33:43 +0000 |
---|---|---|
committer | glighta <glighta@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-10-29 06:33:43 +0000 |
commit | 07ff4adffb312e138502a83316dff13287a8d153 (patch) | |
tree | 4e4a9d6f582d20ea6ba1490fc31b2085453b9e1f /src/map/pc.c | |
parent | 08080a5fc10eb6a9fdc2f1285ba32fda57684d29 (diff) | |
download | hercules-07ff4adffb312e138502a83316dff13287a8d153.tar.gz hercules-07ff4adffb312e138502a83316dff13287a8d153.tar.bz2 hercules-07ff4adffb312e138502a83316dff13287a8d153.tar.xz hercules-07ff4adffb312e138502a83316dff13287a8d153.zip |
-Add some src basic documentation.
-Change some remaining -1 for status ending timer.
-Move some hardcoded msg in msg_athena
-Small optimisation on battle_attr_fix
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16835 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 309 |
1 files changed, 205 insertions, 104 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 414b38d58..328b9e07e 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -47,7 +47,7 @@ #include <time.h> -#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 @@ int pc_banding(struct map_session_data *sd, short skill_lv) { 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 @@ int pc_makesavestatus(struct map_session_data *sd) } /*========================================== - * ��?�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 @@ bool pc_adoption(struct map_session_data *p1_sd, struct map_session_data *p2_sd, 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 @@ int pc_isequip(struct map_session_data *sd,int n) } /*========================================== - * 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 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim 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 @@ static int pc_calc_skillpoint(struct map_session_data* sd) /*========================================== - * ?������X�L���̌v�Z + * Calculation of Skills lvls *------------------------------------------*/ int pc_calc_skilltree(struct map_session_data *sd) { @@ -2015,7 +2020,7 @@ int pc_bonus_subele(struct map_session_data* sd, unsigned char ele, short rate, } /*========================================== - * ? ���i�ɂ��\�͓��̃{?�i�X�ݒ� + * ? ���i�ɂ��\�͓��̃{?�i�X�ݒ� *------------------------------------------*/ int pc_bonus(struct map_session_data *sd,int type,int val) { @@ -2613,7 +2618,7 @@ int pc_bonus(struct map_session_data *sd,int type,int val) } /*========================================== - * ? ���i�ɂ��\�͓��̃{?�i�X�ݒ� + * ? ���i�ɂ��\�͓��̃{?�i�X�ݒ� *------------------------------------------*/ int pc_bonus2(struct map_session_data *sd,int type,int type2,int val) { @@ -3438,7 +3443,7 @@ int pc_skill(TBL_PC* sd, int id, int level, int flag) 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 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) } // -// �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 @@ int pc_modifybuyvalue(struct map_session_data *sd,int orig_value) } /*========================================== - * �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 @@ int pc_modifysellvalue(struct map_session_data *sd,int orig_value) } /*========================================== - * �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 @@ int pc_checkadditem(struct map_session_data *sd,int nameid,int amount) } /*========================================== - * �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 @@ int pc_getzeny(struct map_session_data *sd,int zeny) } /*========================================== - * �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 @@ int pc_search_inventory(struct map_session_data *sd,int item_id) } /*========================================== - * �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 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l } /*========================================== - * �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 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reas } /*========================================== - * �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 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) } /*========================================== - * �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 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem) 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 @@ int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem) 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 @@ int pc_isUseitem(struct map_session_data *sd,int n) 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 @@ int pc_isUseitem(struct map_session_data *sd,int n) } /*========================================== - * �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 @@ int pc_useitem(struct map_session_data *sd,int n) } /*========================================== - * �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 @@ int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amoun } /*========================================== - * �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 @@ int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_ } /*========================================== - * �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 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount) } /*========================================== - * �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 @@ int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount) } /*========================================== - * �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 @@ int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount) } /*========================================== - * �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 @@ int pc_show_steal(struct block_list *bl,va_list ap) 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 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv) } /*========================================== - * + * 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 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y } /*========================================== - * 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 @@ int pc_randomwarp(struct map_session_data *sd, clr_type type) 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 @@ int pc_memo(struct map_session_data* sd, int pos) } // -// ����?? +// Skills // /*========================================== - * �X�L����?�� ���L���Ă����ꍇLv���Ԃ� + * Return player sd skilllv learned for given skill *------------------------------------------*/ int pc_checkskill(struct map_session_data *sd,int skill_id) { @@ -4803,13 +4861,13 @@ int pc_checkskill(struct map_session_data *sd,int skill_id) } /*========================================== - * ����?�X�ɂ��X�L����??�`�F�b�N - * ��?�F - * struct map_session_data *sd �Z�b�V�����f?�^ - * int nameid ?���iID - * �Ԃ�l�F - * 0 ?�X�Ȃ� - * -1 �X�L�������� + * ����?�X�ɂ��X�L����??�`�F�b�N + * ��?�F + * struct map_session_data *sd �Z�b�V�����f?�^ + * int nameid ?���iID + * �Ԃ�l�F + * 0 ?�X�Ȃ� + * -1 �X�L�������� *------------------------------------------*/ int pc_checkallowskill(struct map_session_data *sd) { @@ -4859,7 +4917,8 @@ int pc_checkallowskill(struct map_session_data *sd) } /*========================================== - * ? ���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 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi 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 @@ unsigned int pc_maxjoblv(struct map_session_data *sd) } /*========================================== - * 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 @@ unsigned int pc_nextbaseexp(struct map_session_data *sd) 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 @@ unsigned int pc_thisbaseexp(struct map_session_data *sd) /*========================================== - * 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 @@ unsigned int pc_nextjobexp(struct map_session_data *sd) 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 @@ int pc_statusup2(struct map_session_data* sd, int type, int val) } /*========================================== - * �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 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h 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 @@ void pc_revive(struct map_session_data *sd,unsigned int hp, unsigned int sp) { 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 @@ int pc_readparam(struct map_session_data* sd,int type) } /*========================================== - * 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 @@ void pc_heal(struct map_session_data *sd,unsigned int hp,unsigned int sp, int ty } /*========================================== - * 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 @@ int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp) } /*========================================== - * 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 @@ int pc_percentheal(struct map_session_data *sd,int hp,int sp) } /*========================================== - * �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 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) for(i=0;i<EQI_MAX;i++) { if(sd->equip_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 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper) } /*========================================== - * ������?�X + * Tell client player sd has change equipement *------------------------------------------*/ int pc_equiplookall(struct map_session_data *sd) { @@ -7187,7 +7260,7 @@ int pc_equiplookall(struct map_session_data *sd) } /*========================================== - * ������?�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 @@ int pc_changelook(struct map_session_data *sd,int type,int val) } /*========================================== - * �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 @@ int pc_setoption(struct map_session_data *sd,int type) } /*========================================== - * �J?�g�ݒ� + * Give player a cart *------------------------------------------*/ int pc_setcart(struct map_session_data *sd,int type) { #ifndef NEW_CARTS @@ -7414,12 +7487,12 @@ int pc_setcart(struct map_session_data *sd,int type) { } /*========================================== - * ��ݒ� + * Give player a falcon *------------------------------------------*/ int pc_setfalcon(TBL_PC* sd, int flag) { if( flag ){ - if( pc_checkskill(sd,HT_FALCON)>0 ) // �t�@���R���}�X�^��?�X�L������ + if( pc_checkskill(sd,HT_FALCON)>0 ) // �t�@���R���}�X�^��?�X�L������ pc_setoption(sd,sd->sc.option|OPTION_FALCON); } else if( pc_isfalcon(sd) ){ pc_setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon @@ -7429,12 +7502,12 @@ int pc_setfalcon(TBL_PC* sd, int flag) } /*========================================== - * �y�R�y�R�ݒ� + * Set player riding *------------------------------------------*/ int pc_setriding(TBL_PC* sd, int flag) { if( flag ){ - if( pc_checkskill(sd,KN_RIDING) > 0 ) // ���C�f�B���O�X�L������ + if( pc_checkskill(sd,KN_RIDING) > 0 ) // ���C�f�B���O�X�L������ pc_setoption(sd, sd->sc.option|OPTION_RIDING); } else if( pc_isriding(sd) ){ pc_setoption(sd, sd->sc.option&~OPTION_RIDING); @@ -7444,7 +7517,7 @@ int pc_setriding(TBL_PC* sd, int flag) } /*========================================== - * + * Give player a mado *------------------------------------------*/ int pc_setmadogear(TBL_PC* sd, int flag) { @@ -7459,7 +7532,7 @@ int pc_setmadogear(TBL_PC* sd, int flag) } /*========================================== - * �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 @@ int pc_candrop(struct map_session_data *sd, struct item *item) } /*========================================== - * 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 @@ int pc_readreg(struct map_session_data* sd, int reg) 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 @@ int pc_setreg(struct map_session_data* sd, int reg, int val) } /*========================================== - * 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 @@ char* pc_readregstr(struct map_session_data* sd, int reg) 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 @@ int pc_setregistry_str(struct map_session_data *sd,const char *reg,const char *v } /*========================================== - * �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 @@ static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data) } /*========================================== - * �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 @@ int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name) } /*========================================== - * �C�x���g�^�C�}?�폜 + * Del eventtimer for player sd ? *------------------------------------------*/ int pc_deleventtimer(struct map_session_data *sd,const char *name) { @@ -7876,7 +7953,7 @@ int pc_deleventtimer(struct map_session_data *sd,const char *name) } /*========================================== - * �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 @@ int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick) } /*========================================== - * �C�x���g�^�C�}?�S�폜 + * Remove all eventtimer for player sd *------------------------------------------*/ int pc_cleareventtimer(struct map_session_data *sd) { @@ -8068,7 +8145,7 @@ int pc_load_combo(struct map_session_data *sd) { 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 @@ int pc_equipitem(struct map_session_data *sd,int n,int req_pos) } /*========================================== - * ? �����������O�� + * Called when attemting to unequip an item from player * type: * 0 - only unequip * 1 - calculate status after unequipping @@ -8432,8 +8509,8 @@ int pc_unequipitem(struct map_session_data *sd,int n,int flag) { } /*========================================== - * �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 @@ int pc_checkitem(struct map_session_data *sd) } /*========================================== - * 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 @@ int pc_calc_pvprank_sub(struct block_list *bl,va_list ap) 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 @@ int pc_calc_pvprank(struct map_session_data *sd) 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 @@ int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data) } /*========================================== - * 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 @@ int pc_ismarried(struct map_session_data *sd) 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 @@ int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd) /*========================================== * Divorce sd from its partner + * return + * -1 = fail + * 0 = success *------------------------------------------*/ int pc_divorce(struct map_session_data *sd) { @@ -8634,7 +8721,7 @@ int pc_divorce(struct map_session_data *sd) } /*========================================== - * 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 @@ struct map_session_data *pc_get_partner(struct map_session_data *sd) 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 @@ struct map_session_data *pc_get_father (struct map_session_data *sd) 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 @@ struct map_session_data *pc_get_mother (struct map_session_data *sd) 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 @@ struct map_session_data *pc_get_child (struct map_session_data *sd) 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 @@ void pc_regen (struct map_session_data *sd, unsigned int diff_tick) } /*========================================== - * �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 @@ int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y) } /*========================================== - * �����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 @@ void pc_overheat(struct map_session_data *sd, int val) { 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 @@ int pc_split_atoui(char* str, unsigned int* val, char sep, int max) } /*========================================== - * 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 @@ static bool pc_readdb_skilltree(char* fields[], int columns, int current) 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 @@ int pc_readdb(void) } 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;j<ELE_MAX;j++) for(k=0;k<ELE_MAX;k++) @@ -9269,7 +9370,7 @@ int pc_readdb(void) fclose(fp); ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt"); - // �X�L���c��? + // reset then read statspoint memset(statp,0,sizeof(statp)); i=1; @@ -9400,7 +9501,7 @@ void pc_itemcd_do(struct map_session_data *sd, bool load) { return; } /*========================================== - * pc? �W������ + * pc Init/Terminate *------------------------------------------*/ void do_final_pc(void) { |