Advertisement
Lighta

pc.c raw doc

Mar 24th, 2012
155
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 28.02 KB
  1. # This patch file was generated by NetBeans IDE
  2. # It uses platform neutral UTF-8 encoding and \n newlines.
  3. --- Base (BASE)
  4. +++ Locally Modified (Based On LOCAL)
  5. @@ -46,7 +46,7 @@
  6.  #include <time.h>
  7.  
  8.  
  9. -#define PVP_CALCRANK_INTERVAL 1000 // PVP���ʌv�Z�̊Ԋu
  10. +#define PVP_CALCRANK_INTERVAL 1000 // PVP calculation interval
  11.  static unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL];
  12.  static unsigned int max_level[CLASS_COUNT][2];
  13.  static unsigned int statp[MAX_LEVEL+1];
  14. @@ -556,7 +556,7 @@
  15.  }
  16.  
  17.  /*==========================================
  18. - * ��?�b̏���?
  19. + * Initial player Connection?
  20.   *------------------------------------------*/
  21.  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)
  22.  {
  23. @@ -824,10 +824,15 @@
  24.     return false; // Job Change Fail
  25.  }
  26.  
  27. +/*=================================================
  28. +* Can the player equip the item at index n in inventory
  29. +* return
  30. +*  0 = no
  31. +*  1 = yes
  32. +*------------------------------------------------*/
  33.  int pc_isequip(struct map_session_data *sd,int n)
  34.  {
  35.     struct item_data *item;
  36. -   //?����{�q�̏ꍇ�̌��̐E�Ƃ��Z�o����
  37.  
  38.     nullpo_ret(sd);
  39.  
  40. @@ -902,8 +907,8 @@
  41.  }
  42.  
  43.  /*==========================================
  44. - * session id�ɖ�薳��
  45. - * char�I���瑗���Ă����X�e?�^�X��ݒ�
  46. + * No problem with the session id
  47. + * set the status that has been sent from char server
  48.   *------------------------------------------*/
  49.  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)
  50.  {
  51. @@ -1017,7 +1022,7 @@
  52.     for( i = 0; i < 3; i++ )
  53.         sd->hate_mob[i] = -1;
  54.  
  55. -   // �ʒu�̐ݒ�
  56. +   //warp player
  57.     if ((i=pc_setpos(sd,sd->status.last_point.map, sd->status.last_point.x, sd->status.last_point.y, CLR_OUTSIGHT)) != 0) {
  58.         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);
  59.  
  60. @@ -1255,7 +1260,7 @@
  61.  
  62.  
  63.  /*==========================================
  64. - * ?������X�L���̌v�Z
  65. + * Calculation of Skills lvls
  66.   *------------------------------------------*/
  67.  int pc_calc_skilltree(struct map_session_data *sd)
  68.  {
  69. @@ -3317,7 +3322,7 @@
  70.     return 1;
  71.  }
  72.  /*==========================================
  73. - * �J?�h?��
  74. + * Append a cart to an item ?
  75.   *------------------------------------------*/
  76.  int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip)
  77.  {
  78. @@ -3372,18 +3377,18 @@
  79.  }
  80.  
  81.  //
  82. -// �A�C�e����
  83. +// Items
  84.  //
  85.  
  86.  /*==========================================
  87. - * �X�L���ɂ�锃���l�C��
  88. + * Correction buying value by skills
  89.   *------------------------------------------*/
  90.  int pc_modifybuyvalue(struct map_session_data *sd,int orig_value)
  91.  {
  92.     int skill,val = orig_value,rate1 = 0,rate2 = 0;
  93. -   if((skill=pc_checkskill(sd,MC_DISCOUNT))>0) // �f�B�X�J�E���g
  94. +   if((skill=pc_checkskill(sd,MC_DISCOUNT))>0) // merchant discount
  95.         rate1 = 5+skill*2-((skill==10)? 1:0);
  96. -   if((skill=pc_checkskill(sd,RG_COMPULSION))>0)   // �R���p���V�����f�B�X�J�E���g
  97. +   if((skill=pc_checkskill(sd,RG_COMPULSION))>0)   // rogue discount
  98.         rate2 = 5+skill*4;
  99.     if(rate1 < rate2) rate1 = rate2;
  100.     if(rate1)
  101. @@ -3395,12 +3400,12 @@
  102.  }
  103.  
  104.  /*==========================================
  105. - * �X�L���ɂ��?��l�C��
  106. + * Correction selling value by skills
  107.   *------------------------------------------*/
  108.  int pc_modifysellvalue(struct map_session_data *sd,int orig_value)
  109.  {
  110.     int skill,val = orig_value,rate = 0;
  111. -   if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)   // �I?�o?�`��?�W
  112. +   if((skill=pc_checkskill(sd,MC_OVERCHARGE))>0)   //OverCharge ?
  113.         rate = 5+skill*2-((skill==10)? 1:0);
  114.     if(rate)
  115.         val = (int)((double)orig_value*(double)(100+rate)/100.);
  116. @@ -3411,8 +3416,8 @@
  117.  }
  118.  
  119.  /*==========================================
  120. - * �A�C�e���𔃂����bɁA�V�����A�C�e�������g�����A
  121. - * 3�������ɂ����邩�m�F
  122. + * Checking if we have enough place on inventory for new item
  123. + * Make sure to take 30,000 limit
  124.   *------------------------------------------*/
  125.  int pc_checkadditem(struct map_session_data *sd,int nameid,int amount)
  126.  {
  127. @@ -3439,7 +3444,8 @@
  128.  }
  129.  
  130.  /*==========================================
  131. - * �󂫃A�C�e�����̌�?
  132. + * Return number of available place in inventory
  133. + * Each non stackable item will reduce place by 1
  134.   *------------------------------------------*/
  135.  int pc_inventoryblank(struct map_session_data *sd)
  136.  {
  137. @@ -3599,7 +3605,7 @@
  138.  }
  139.  
  140.  /*==========================================
  141. - * �A�C�e����T���āA�C���f�b�N�X��Ԃ�
  142. + * Searching a specified itemid in inventory and return his stored index
  143.   *------------------------------------------*/
  144.  int pc_search_inventory(struct map_session_data *sd,int item_id)
  145.  {
  146. @@ -3611,7 +3617,14 @@
  147.  }
  148.  
  149.  /*==========================================
  150. - * �A�C�e���lj��B��?�̂�item�\��?��?���𖳎�
  151. + * Attempt tp add a new item in inventory
  152. + * return
  153. +   0 = success
  154. +   1 = invalid itemid not found or negative amount
  155. +   2 = overweight
  156. +   4 = no free place found
  157. +   5 = max amount reached
  158. +  
  159.   *------------------------------------------*/
  160.  int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
  161.  {
  162. @@ -3682,7 +3695,10 @@
  163.  }
  164.  
  165.  /*==========================================
  166. - * �A�C�e�������炷
  167. + * Remove an item at index n from inventory by amount
  168. + * return
  169. + * 0 = succes
  170. + * 1 = invalid itemid or negative amount  
  171.   *------------------------------------------*/
  172.  int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason, e_log_pick_type log_type)
  173.  {
  174. @@ -3710,7 +3726,10 @@
  175.  }
  176.  
  177.  /*==========================================
  178. - * �A�C�e���𗎂�
  179. + * Attempt to drop an item
  180. + * return
  181. + * 0 = fail
  182. + * 1 = success
  183.   *------------------------------------------*/
  184.  int pc_dropitem(struct map_session_data *sd,int n,int amount)
  185.  {
  186. @@ -3751,7 +3770,10 @@
  187.  }
  188.  
  189.  /*==========================================
  190. - * �A�C�e�����E��
  191. + * Attempt to pickup an item
  192. + * return
  193. + * 0 = fail
  194. + * 1 = success
  195.   *------------------------------------------*/
  196.  int pc_takeitem(struct map_session_data *sd,struct flooritem_data *fitem)
  197.  {
  198. @@ -3764,7 +3786,7 @@
  199.     nullpo_ret(fitem);
  200.  
  201.     if(!check_distance_bl(&fitem->bl, &sd->bl, 2) && sd->ud.skillid!=BS_GREED)
  202. -       return 0;   // ����������
  203. +       return 0;   // Distance is too far
  204.  
  205.     if (sd->status.party_id)
  206.         p = party_search(sd->status.party_id);
  207. @@ -3818,6 +3840,12 @@
  208.     return 1;
  209.  }
  210.  
  211. +/*==========================================
  212. + * Can we use the item  ?
  213. + * Return
  214. + * 0 = no
  215. + * 1 = yes
  216. + *------------------------------------------*/
  217.  int pc_isUseitem(struct map_session_data *sd,int n)
  218.  {
  219.     struct item_data *item;
  220. @@ -3836,7 +3864,7 @@
  221.     if( !item->script ) //if it has no script, you can't really consume it!
  222.         return 0;
  223.  
  224. -   switch( nameid )
  225. +   switch( nameid ) //FIXME harcoded itemid [Lighta]
  226.     {
  227.         case 605: // Anodyne
  228.             if( map_flag_gvg(sd->bl.m) )
  229. @@ -3973,7 +4001,10 @@
  230.  }
  231.  
  232.  /*==========================================
  233. - * �A�C�e�����g��
  234. + * Last checks et use item
  235. + * return
  236. + * 0 = fail
  237. + * 1 = success
  238.   *------------------------------------------*/
  239.  int pc_useitem(struct map_session_data *sd,int n)
  240.  {
  241. @@ -3995,6 +4026,7 @@
  242.     )
  243.         return 0;
  244.  
  245. +        //Check if status forbid us
  246.     if( sd->sc.count && (
  247.         sd->sc.data[SC_BERSERK] ||
  248.         (sd->sc.data[SC_GRAVITATION] && sd->sc.data[SC_GRAVITATION]->val3 == BCT_SELF) ||
  249. @@ -4087,7 +4119,10 @@
  250.  }
  251.  
  252.  /*==========================================
  253. - * �J?�g�A�C�e���lj��B��?�̂�item�\��?��?���𖳎�
  254. + * Add item on cart for given index
  255. + * return
  256. + * 0 = success
  257. + * 1 = fail
  258.   *------------------------------------------*/
  259.  int pc_cart_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type)
  260.  {
  261. @@ -4147,7 +4182,10 @@
  262.  }
  263.  
  264.  /*==========================================
  265. - * �J?�g�A�C�e�������炷
  266. + * Delete item on cart for given index
  267. + * return
  268. + * 0 = success
  269. + * 1 = fail
  270.   *------------------------------------------*/
  271.  int pc_cart_delitem(struct map_session_data *sd,int n,int amount,int type,e_log_pick_type log_type)
  272.  {
  273. @@ -4174,7 +4212,10 @@
  274.  }
  275.  
  276.  /*==========================================
  277. - * �J?�g�փA�C�e���ړ�
  278. + * Transfert item from inventory to cart
  279. + * return
  280. + * 0 = fail
  281. + * 1 = succes
  282.   *------------------------------------------*/
  283.  int pc_putitemtocart(struct map_session_data *sd,int idx,int amount)
  284.  {
  285. @@ -4197,7 +4238,10 @@
  286.  }
  287.  
  288.  /*==========================================
  289. - * �J?�g?�̃A�C�e��?�m�F(��?�̍�����Ԃ�)
  290. + * Get number of item on cart
  291. + * return
  292. +   -1 = itemid not found or no amount found
  293. +   x = remaining itemid on cart after get
  294.   *------------------------------------------*/
  295.  int pc_cartitem_amount(struct map_session_data* sd, int idx, int amount)
  296.  {
  297. @@ -4213,7 +4257,10 @@
  298.  }
  299.  
  300.  /*==========================================
  301. - * �J?�g����A�C�e���ړ�
  302. + * Retrieve an item at index idx from cart
  303. + * return
  304. + * 0 = player not found or (FIXME) succes (from pc_cart_delitem)
  305. + * 1 = failure
  306.   *------------------------------------------*/
  307.  int pc_getitemfromcart(struct map_session_data *sd,int idx,int amount)
  308.  {
  309. @@ -4237,7 +4284,7 @@
  310.  }
  311.  
  312.  /*==========================================
  313. - * �X�e�B���i���J
  314. + *  Display item stolen msg to player sd
  315.   *------------------------------------------*/
  316.  int pc_show_steal(struct block_list *bl,va_list ap)
  317.  {
  318. @@ -4259,7 +4306,10 @@
  319.     return 0;
  320.  }
  321.  /*==========================================
  322. - *
  323. + * Stole an item from bl (mob)
  324. + * return
  325. + * 0 = fail
  326. + * 1 = succes
  327.   *------------------------------------------*/
  328.  int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
  329.  {
  330. @@ -4340,7 +4390,10 @@
  331.  }
  332.  
  333.  /*==========================================
  334. - *
  335. + * Stole zeny from bl (mob)
  336. + * return
  337. + * 0 = fail
  338. + * 1 = success
  339.   *------------------------------------------*/
  340.  int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
  341.  {
  342. @@ -4524,7 +4577,11 @@
  343.  }
  344.  
  345.  /*==========================================
  346. - * PC�̃����_����?�v
  347. + * Warp player sd to random location on current map
  348. + * may fail if no Cell walkable found (1000 attempt)
  349. + * return
  350. + * 0 = fail or FIXME succes (from pc_setpos)
  351. + *  x(1|2) = fail
  352.   *------------------------------------------*/
  353.  int pc_randomwarp(struct map_session_data *sd, clr_type type)
  354.  {
  355. @@ -4535,7 +4592,7 @@
  356.  
  357.     m=sd->bl.m;
  358.  
  359. -   if (map[sd->bl.m].flag.noteleport)  // �e���|?�g�֎~
  360. +   if (map[sd->bl.m].flag.noteleport) //Teleport forbiden
  361.         return 0;
  362.  
  363.     do{
  364. @@ -4599,10 +4656,10 @@
  365.  }
  366.  
  367.  //
  368. -// ����??
  369. +// Skills
  370.  //
  371.  /*==========================================
  372. - * �X�L����?�� ���L���Ă����ꍇLv���Ԃ�
  373. + * Return player sd skilllv learned for given skill
  374.   *------------------------------------------*/
  375.  int pc_checkskill(struct map_session_data *sd,int skill_id)
  376.  {
  377. @@ -4628,13 +4685,7 @@
  378.  }
  379.  
  380.  /*==========================================
  381. - * ����?�X�ɂ��X�L����??�`�F�b�N
  382. - * ��?�F
  383. - *   struct map_session_data *sd   �Z�b�V�����f?�^
  384. - *   int nameid                        ?���iID
  385. - * �Ԃ�l�F
  386. - *   0     ?�X�Ȃ�
  387. - *   -1        �X�L��������
  388. + * Checking if player match condition for given skill and kill status if not
  389.   *------------------------------------------*/
  390.  int pc_checkallowskill(struct map_session_data *sd)
  391.  {
  392. @@ -4680,7 +4731,8 @@
  393.  }
  394.  
  395.  /*==========================================
  396. - * ? ���i�̃`�F�b�N
  397. + * Return equiped itemid? on player sd at pos
  398. + * if -1 mean nothing equiped
  399.   *------------------------------------------*/
  400.  int pc_checkequip(struct map_session_data *sd,int pos)
  401.  {
  402. @@ -5290,7 +5342,7 @@
  403.     return;
  404.  }
  405.  /*==========================================
  406. - * ??�l�擾
  407. + * Give x exp at sd player and calculate remaining exp for next lvl
  408.   *------------------------------------------*/
  409.  int pc_gainexp(struct map_session_data *sd, struct block_list *src, unsigned int base_exp,unsigned int job_exp,bool quest)
  410.  {
  411. @@ -5385,8 +5437,10 @@
  412.  };
  413.  
  414.  /*==========================================
  415. - * base level���K�v??�l�v�Z
  416. + * base level exp lookup.
  417.   *------------------------------------------*/
  418. +
  419. +///How much bexp do player need for next level
  420.  unsigned int pc_nextbaseexp(struct map_session_data *sd)
  421.  {
  422.     nullpo_ret(sd);
  423. @@ -5397,6 +5451,7 @@
  424.     return exp_table[pc_class2idx(sd->status.class_)][0][sd->status.base_level-1];
  425.  }
  426.  
  427. +///How much bexp do player need for this level
  428.  unsigned int pc_thisbaseexp(struct map_session_data *sd)
  429.  {
  430.     if(sd->status.base_level>pc_maxbaselv(sd) || sd->status.base_level<=1)
  431. @@ -5407,8 +5462,13 @@
  432.  
  433.  
  434.  /*==========================================
  435. - * job level���K�v??�l�v�Z
  436. + * job level exp lookup
  437. + * return
  438. + * 0 = not found
  439. + * x = exp for level
  440.   *------------------------------------------*/
  441. +
  442. +///How much jexp do player need for next level
  443.  unsigned int pc_nextjobexp(struct map_session_data *sd)
  444.  {
  445.     nullpo_ret(sd);
  446. @@ -5418,6 +5478,7 @@
  447.     return exp_table[pc_class2idx(sd->status.class_)][1][sd->status.job_level-1];
  448.  }
  449.  
  450. +///How much jexp do player need for next level
  451.  unsigned int pc_thisjobexp(struct map_session_data *sd)
  452.  {
  453.     if(sd->status.job_level>pc_maxjoblv(sd) || sd->status.job_level<=1)
  454. @@ -5583,7 +5644,8 @@
  455.  }
  456.  
  457.  /*==========================================
  458. - * �X�L���|�C���g����U��
  459. + * Update skilllv for player sd
  460. + * Skill point allocation
  461.   *------------------------------------------*/
  462.  int pc_skillup(struct map_session_data *sd,int skill_num)
  463.  {
  464. @@ -6069,6 +6131,9 @@
  465.     sd->canlog_tick = gettick();
  466.  }
  467.  
  468. +/*==========================================
  469. + * Invoked when a player have negative current hp
  470. + *------------------------------------------*/
  471.  int pc_dead(struct map_session_data *sd,struct block_list *src)
  472.  {
  473.     int i=0,j=0,k=0;
  474. @@ -6389,10 +6454,11 @@
  475.     if(battle_config.pc_invincible_time > 0)
  476.         pc_setinvincibletimer(sd, battle_config.pc_invincible_time);
  477.  }
  478. -// script? �A
  479.  //
  480. +// script
  481. +//
  482.  /*==========================================
  483. - * script�pPC�X�e?�^�X?�ݏo��
  484. + * script reading pc status registry
  485.   *------------------------------------------*/
  486.  int pc_readparam(struct map_session_data* sd,int type)
  487.  {
  488. @@ -6438,7 +6504,7 @@
  489.  }
  490.  
  491.  /*==========================================
  492. - * script�pPC�X�e?�^�X�ݒ�
  493. + * script set pc status registry
  494.   *------------------------------------------*/
  495.  int pc_setparam(struct map_session_data *sd,int type,int val)
  496.  {
  497. @@ -6606,7 +6672,9 @@
  498.  }
  499.  
  500.  /*==========================================
  501. - * HP/SP��
  502. + * HP/SP Recovery
  503. + * Heal player hp nad/or sp linearly
  504. + * Calculate bonus by status
  505.   *------------------------------------------*/
  506.  int pc_itemheal(struct map_session_data *sd,int itemid, int hp,int sp)
  507.  {
  508. @@ -6664,7 +6732,8 @@
  509.  }
  510.  
  511.  /*==========================================
  512. - * HP/SP��
  513. + * HP/SP Recovery
  514. + * Heal player hp nad/or sp by rate
  515.   *------------------------------------------*/
  516.  int pc_percentheal(struct map_session_data *sd,int hp,int sp)
  517.  {
  518. @@ -6702,9 +6771,7 @@
  519.  }
  520.  
  521.  /*==========================================
  522. - * �E?�X
  523. - * ��? job �E�� 0�`23
  524. - *     upper �ʏ� 0, ?�� 1, �{�q 2, ���̂܂� -1
  525. + * Called when player changing job
  526.   * Rewrote to make it tidider [Celest]
  527.   *------------------------------------------*/
  528.  int pc_jobchange(struct map_session_data *sd,int job, int upper)
  529. @@ -6861,7 +6928,7 @@
  530.  }
  531.  
  532.  /*==========================================
  533. - * ������?�X
  534. + * Tell client player sd has change equipement
  535.   *------------------------------------------*/
  536.  int pc_equiplookall(struct map_session_data *sd)
  537.  {
  538. @@ -6883,7 +6950,7 @@
  539.  }
  540.  
  541.  /*==========================================
  542. - * ������?�X
  543. + * Tell client player sd has change look (hair,equip...)
  544.   *------------------------------------------*/
  545.  int pc_changelook(struct map_session_data *sd,int type,int val)
  546.  {
  547. @@ -6943,7 +7010,7 @@
  548.  }
  549.  
  550.  /*==========================================
  551. - * �t?�i(��,�y�R,�J?�g)�ݒ�
  552. + * Give an option (type) to player (sd) and display it to client
  553.   *------------------------------------------*/
  554.  int pc_setoption(struct map_session_data *sd,int type)
  555.  {
  556. @@ -7061,7 +7128,7 @@
  557.  }
  558.  
  559.  /*==========================================
  560. - * �J?�g�ݒ�
  561. + * Give player a cart
  562.   *------------------------------------------*/
  563.  int pc_setcart(struct map_session_data *sd,int type)
  564.  {
  565. @@ -7086,12 +7153,12 @@
  566.  }
  567.  
  568.  /*==========================================
  569. - * ��ݒ�
  570. + * Give player a falcon
  571.   *------------------------------------------*/
  572.  int pc_setfalcon(TBL_PC* sd, int flag)
  573.  {
  574.     if( flag ){
  575. -       if( pc_checkskill(sd,HT_FALCON)>0 ) // �t�@���R���}�X�^��?�X�L������
  576. +       if( pc_checkskill(sd,HT_FALCON)>0 ) // // You cannot get falcon while riding warg or while you have warg.
  577.             pc_setoption(sd,sd->sc.option|OPTION_FALCON);
  578.     } else if( pc_isfalcon(sd) ){
  579.         pc_setoption(sd,sd->sc.option&~OPTION_FALCON); // remove falcon
  580. @@ -7101,12 +7168,12 @@
  581.  }
  582.  
  583.  /*==========================================
  584. - * �y�R�y�R�ݒ�
  585. + * Give player a wug (wolf)
  586.   *------------------------------------------*/
  587.  int pc_setriding(TBL_PC* sd, int flag)
  588.  {
  589.     if( flag ){
  590. -       if( pc_checkskill(sd,KN_RIDING) > 0 ) // ���C�f�B���O�X�L������
  591. +       if( pc_checkskill(sd,KN_RIDING) > 0 ) //Have riding skill
  592.             pc_setoption(sd, sd->sc.option|OPTION_RIDING);
  593.     } else if( pc_isriding(sd) ){
  594.             pc_setoption(sd, sd->sc.option&~OPTION_RIDING);
  595. @@ -7116,7 +7183,10 @@
  596.  }
  597.  
  598.  /*==========================================
  599. - * �A�C�e���h���b�v�•s�”���
  600. + * Check if player can drop an item
  601. + * return
  602. + * 0 = no
  603. + *
  604.   *------------------------------------------*/
  605.  int pc_candrop(struct map_session_data *sd, struct item *item)
  606.  {
  607. @@ -7128,7 +7198,8 @@
  608.  }
  609.  
  610.  /*==========================================
  611. - * script�p??�̒l��?��
  612. + * Read ram register for player sd
  613. + * get val (int) from reg for player sd
  614.   *------------------------------------------*/
  615.  int pc_readreg(struct map_session_data* sd, int reg)
  616.  {
  617. @@ -7140,7 +7211,8 @@
  618.     return ( i < sd->reg_num ) ? sd->reg[i].data : 0;
  619.  }
  620.  /*==========================================
  621. - * script�p??�̒l��ݒ�
  622. + * Set ram register for player sd
  623. + * memo val(int) at reg for player sd
  624.   *------------------------------------------*/
  625.  int pc_setreg(struct map_session_data* sd, int reg, int val)
  626.  {
  627. @@ -7168,7 +7240,8 @@
  628.  }
  629.  
  630.  /*==========================================
  631. - * script�p������??�̒l��?��
  632. + * Read ram register for player sd
  633. + * get val (str) from reg for player sd
  634.   *------------------------------------------*/
  635.  char* pc_readregstr(struct map_session_data* sd, int reg)
  636.  {
  637. @@ -7180,7 +7253,8 @@
  638.     return ( i < sd->regstr_num ) ? sd->regstr[i].data : NULL;
  639.  }
  640.  /*==========================================
  641. - * script�p������??�̒l��ݒ�
  642. + * Set ram register for player sd
  643. + * memo val(str) at reg for player sd
  644.   *------------------------------------------*/
  645.  int pc_setregstr(struct map_session_data* sd, int reg, const char* str)
  646.  {
  647. @@ -7460,7 +7534,7 @@
  648.  }
  649.  
  650.  /*==========================================
  651. - * �C�x���g�^�C�}??��
  652. + * Exec eventtimer for player sd (retrieved from map_session (id))
  653.   *------------------------------------------*/
  654.  static int pc_eventtimer(int tid, unsigned int tick, int id, intptr_t data)
  655.  {
  656. @@ -7485,7 +7559,7 @@
  657.  }
  658.  
  659.  /*==========================================
  660. - * �C�x���g�^�C�}?�lj�
  661. + * Add eventtimer for player sd ?
  662.   *------------------------------------------*/
  663.  int pc_addeventtimer(struct map_session_data *sd,int tick,const char *name)
  664.  {
  665. @@ -7503,7 +7577,7 @@
  666.  }
  667.  
  668.  /*==========================================
  669. - * �C�x���g�^�C�}?�폜
  670. + * Del eventtimer for player sd ?
  671.   *------------------------------------------*/
  672.  int pc_deleventtimer(struct map_session_data *sd,const char *name)
  673.  {
  674. @@ -7533,7 +7607,7 @@
  675.  }
  676.  
  677.  /*==========================================
  678. - * �C�x���g�^�C�}?�J�E���g�l�lj�
  679. + * Update eventtimer count for player sd
  680.   *------------------------------------------*/
  681.  int pc_addeventtimercount(struct map_session_data *sd,const char *name,int tick)
  682.  {
  683. @@ -7552,7 +7626,7 @@
  684.  }
  685.  
  686.  /*==========================================
  687. - * �C�x���g�^�C�}?�S�폜
  688. + * Remove all eventtimer for player sd
  689.   *------------------------------------------*/
  690.  int pc_cleareventtimer(struct map_session_data *sd)
  691.  {
  692. @@ -7575,10 +7649,10 @@
  693.  }
  694.  
  695.  //
  696. -// ? ����
  697. +// Equipment
  698.  //
  699.  /*==========================================
  700. - * �A�C�e����?������
  701. + * Equip item on player sd at req_pos from inventory index n
  702.   *------------------------------------------*/
  703.  int pc_equipitem(struct map_session_data *sd,int n,int req_pos)
  704.  {
  705. @@ -7761,7 +7835,7 @@
  706.  }
  707.  
  708.  /*==========================================
  709. - * ? �����������O��
  710. + * Called when attemting to unequip an item from player
  711.   * type:
  712.   * 0 - only unequip
  713.   * 1 - calculate status after unequipping
  714. @@ -7890,8 +7964,8 @@
  715.  }
  716.  
  717.  /*==========================================
  718. - * �A�C�e����index��?���l�߂���
  719. - * ? ���i��?���”\�`�F�b�N���s�Ȃ�
  720. + * Checking if player (sd) have unauthorize, invalide item
  721. + * on inventory, cart, equiped for the map (item_noequip)
  722.   *------------------------------------------*/
  723.  int pc_checkitem(struct map_session_data *sd)
  724.  {
  725. @@ -7971,7 +8045,7 @@
  726.  }
  727.  
  728.  /*==========================================
  729. - * PVP���ʌv�Z�p(foreachinarea)
  730. + * Update PVP rank for sd1 to sd2
  731.   *------------------------------------------*/
  732.  int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
  733.  {
  734. @@ -7990,7 +8064,8 @@
  735.     return 0;
  736.  }
  737.  /*==========================================
  738. - * PVP���ʌv�Z
  739. + * Calculate new rank beetween all present players (map_foreachinarea)
  740. + * and display result
  741.   *------------------------------------------*/
  742.  int pc_calc_pvprank(struct map_session_data *sd)
  743.  {
  744. @@ -8005,7 +8080,7 @@
  745.     return sd->pvp_rank;
  746.  }
  747.  /*==========================================
  748. - * PVP���ʌv�Z(timer)
  749. + * Calculate next sd ranking calculation from config
  750.   *------------------------------------------*/
  751.  int pc_calc_pvprank_timer(int tid, unsigned int tick, int id, intptr_t data)
  752.  {
  753. @@ -8027,7 +8102,10 @@
  754.  }
  755.  
  756.  /*==========================================
  757. - * sd�͌������Ă��邩(?���̏ꍇ�͑����char_id��Ԃ�)
  758. + * Checking if sd is married
  759. + * Return
  760. + * partner_id = yes,
  761. + * 0 = no
  762.   *------------------------------------------*/
  763.  int pc_ismarried(struct map_session_data *sd)
  764.  {
  765. @@ -8039,7 +8117,10 @@
  766.         return 0;
  767.  }
  768.  /*==========================================
  769. - * sd��dstsd�ƌ���(dstsd��sd�̌���?�������bɍs��)
  770. + * Marry player sd to player dstsd
  771. + * return
  772. + * -1 = fail
  773. + * 0 = success
  774.   *------------------------------------------*/
  775.  int pc_marriage(struct map_session_data *sd,struct map_session_data *dstsd)
  776.  {
  777. @@ -8054,6 +8135,9 @@
  778.  
  779.  /*==========================================
  780.   * Divorce sd from its partner
  781. + * return
  782. + * -1 = fail
  783. + * 0 = success
  784.   *------------------------------------------*/
  785.  int pc_divorce(struct map_session_data *sd)
  786.  {
  787. @@ -8092,7 +8176,7 @@
  788.  }
  789.  
  790.  /*==========================================
  791. - * sd�̑����map_session_data��Ԃ�
  792. + * Get sd partner charid. (Married partner)
  793.   *------------------------------------------*/
  794.  struct map_session_data *pc_get_partner(struct map_session_data *sd)
  795.  {
  796. @@ -8103,6 +8187,9 @@
  797.     return NULL;
  798.  }
  799.  
  800. +/*==========================================
  801. + * Get sd father charid. (Need to be baby)
  802. + *------------------------------------------*/
  803.  struct map_session_data *pc_get_father (struct map_session_data *sd)
  804.  {
  805.     if (sd && sd->class_&JOBL_BABY && sd->status.father > 0)
  806. @@ -8112,6 +8199,9 @@
  807.     return NULL;
  808.  }
  809.  
  810. +/*==========================================
  811. + * Get sd mother charid. (Need to be baby)
  812. + *------------------------------------------*/
  813.  struct map_session_data *pc_get_mother (struct map_session_data *sd)
  814.  {
  815.     if (sd && sd->class_&JOBL_BABY && sd->status.mother > 0)
  816. @@ -8121,6 +8211,9 @@
  817.     return NULL;
  818.  }
  819.  
  820. +/*==========================================
  821. + * Get sd children charid. (Need to be married)
  822. + *------------------------------------------*/
  823.  struct map_session_data *pc_get_child (struct map_session_data *sd)
  824.  {
  825.     if (sd && pc_ismarried(sd) && sd->status.child > 0)
  826. @@ -8130,6 +8223,9 @@
  827.     return NULL;
  828.  }
  829.  
  830. +/*==========================================
  831. + * Set player sd to bleed. (losing hp and/or sp each diff_tick)
  832. + *------------------------------------------*/
  833.  void pc_bleeding (struct map_session_data *sd, unsigned int diff_tick)
  834.  {
  835.     int hp = 0, sp = 0;
  836. @@ -8191,7 +8287,7 @@
  837.  }
  838.  
  839.  /*==========================================
  840. - * �Z?�u�|�C���g�̕ۑ�
  841. + * Memo player sd savepoint. (map,x,y)
  842.   *------------------------------------------*/
  843.  int pc_setsavepoint(struct map_session_data *sd, short mapindex,int x,int y)
  844.  {
  845. @@ -8205,7 +8301,7 @@
  846.  }
  847.  
  848.  /*==========================================
  849. - * �����Z?�u (timer??)
  850. + * Save 1 player data  at autosave intervalle
  851.   *------------------------------------------*/
  852.  int pc_autosave(int tid, unsigned int tick, int id, intptr_t data)
  853.  {
  854. @@ -8489,13 +8585,20 @@
  855.     return true;
  856.  }
  857.  
  858. +/*==========================================
  859. + * pc DB reading.
  860. + * exp.txt        - required experience values
  861. + * skill_tree.txt - skill tree for every class
  862. + * attr_fix.txt   - elemental adjustment table
  863. + * statpoint.txt - status point per level
  864. + *------------------------------------------*/
  865.  int pc_readdb(void)
  866.  {
  867.     int i,j,k;
  868.     FILE *fp;
  869.     char line[24000],*p;
  870.  
  871. -   // �K�v??�l?��?��
  872. +   //reset
  873.     memset(exp_table,0,sizeof(exp_table));
  874.     memset(max_level,0,sizeof(max_level));
  875.  
  876. @@ -8580,12 +8683,12 @@
  877.     }
  878.     ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","exp.txt");
  879.  
  880. -   // �X�L���c��?
  881. +   // reset skilltree
  882.     memset(skill_tree,0,sizeof(skill_tree));
  883.  
  884.     sv_readdb(db_path, DBPATH"skill_tree.txt", ',', 3+MAX_PC_SKILL_REQUIRE*2, 4+MAX_PC_SKILL_REQUIRE*2, -1, &pc_readdb_skilltree);
  885.  
  886. -   // ?���C���e?�u��
  887. +   // Table of correction ?
  888.     for(i=0;i<4;i++)
  889.         for(j=0;j<ELE_MAX;j++)
  890.             for(k=0;k<ELE_MAX;k++)
  891. @@ -8637,7 +8740,7 @@
  892.     fclose(fp);
  893.     ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","attr_fix.txt");
  894.  
  895. -   // �X�L���c��?
  896. +   // reset statspoint
  897.     memset(statp,0,sizeof(statp));
  898.     i=1;
  899.  
  900. @@ -8768,7 +8871,7 @@
  901.     return;
  902.  }
  903.  /*==========================================
  904. - * pc? �W����
  905. + * pc Init/Terminate
  906.   *------------------------------------------*/
  907.  void do_final_pc(void) {
Advertisement
RAW Paste Data Copied
Advertisement