viewing paste pc.c raw doc | C

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