Changeset 19 for src/map/pc.c

Show
Ignore:
Timestamp:
07/02/08 12:20:18 (17 years ago)
Author:
jinshiro
Message:

Now Compiles with Cygwin GCC

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/map/pc.c

    r13 r19  
    1 // Copyright (c) Athena Dev Teams - Licensed under GNU GPL 
     1// Copyright (c) Athena Dev Teams - Licensed under GNU GPL =D 
    22// For more information, see LICENCE in the main folder 
    33 
     
    133133} 
    134134 
    135 void pc_setinvincibletimer(struct map_session_data* sd, int val)  
     135void pc_setinvincibletimer(struct map_session_data* sd, int val) 
    136136{ 
    137137        nullpo_retv(sd); 
     
    258258                case MAPID_TAEKWON: // Taekwon 
    259259                        clif_fame_taekwon(sd,count); 
    260                         break;   
     260                        break; 
    261261        } 
    262262        chrif_updatefamelist(sd); 
     
    267267{ 
    268268        int i; 
    269          
     269 
    270270        switch(job){ 
    271271                case MAPID_BLACKSMITH: // Blacksmith 
     
    330330                sd->status.clothes_color=0; 
    331331 
    332         //Only copy the Cart/Peco/Falcon options, the rest are handled via  
     332        //Only copy the Cart/Peco/Falcon options, the rest are handled via 
    333333        //status change load/saving. [Skotlex] 
    334334        sd->status.option = sd->sc.option&(OPTION_CART|OPTION_FALCON|OPTION_RIDING); 
    335                  
     335 
    336336        if (sd->sc.data[SC_JAILED]) 
    337337        {       //When Jailed, do not move last point. 
     
    403403        if (!itemdb_isequip2(sd->inventory_data[n])) 
    404404                return 0; //Not equippable by players. 
    405          
     405 
    406406        ep = sd->inventory_data[n]->equip; 
    407407        if(sd->inventory_data[n]->look == W_DAGGER      || 
     
    518518        if (itemdb_isspecial(item->card[0])) 
    519519                return 1; 
    520          
     520 
    521521        ARR_FIND( 0, s, i, item->card[i] && (data = itemdb_exists(item->card[i])) != NULL && data->flag.no_equip&flag ); 
    522522        return( i < s ) ? 0 : 1; 
     
    535535                if( i == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index ) continue; 
    536536                if( i == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index) ) continue; 
    537          
     537 
    538538                if( !sd->inventory_data[index] ) continue; 
    539539 
     
    568568        // Parents need to have their ring equipped 
    569569        if( !pc_isequipped(p1_sd, WEDDING_RING_M) && !pc_isequipped(p1_sd, WEDDING_RING_F) ) 
    570                 return false;  
     570                return false; 
    571571 
    572572        if( !pc_isequipped(p2_sd, WEDDING_RING_M) && !pc_isequipped(p2_sd, WEDDING_RING_F) ) 
     
    603603        int job, joblevel; 
    604604        unsigned int jobexp; 
    605          
     605 
    606606        if( !pc_can_Adopt(p1_sd, p2_sd, b_sd) ) 
    607607                return false; 
     
    632632                pc_skill(p1_sd, WE_CALLBABY, 1, 0); 
    633633                pc_skill(p2_sd, WE_CALLBABY, 1, 0); 
    634                  
     634 
    635635                return true; 
    636636        } 
     
    660660                return 0; 
    661661        if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&2) || !pc_isAllowedCardOn(sd,item->slot,n,2))) 
    662                 return 0;  
     662                return 0; 
    663663        if(map[sd->bl.m].flag.restricted) 
    664664        { 
     
    669669 
    670670        if (sd->sc.count) { 
    671                          
     671 
    672672                if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG] 
    673673                        return 0; 
     
    698698        if (!(1<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)])) 
    699699                return 0; 
    700          
     700 
    701701        //Not equipable by upper class. [Skotlex] 
    702702        if(!(1<<((sd->class_&JOBL_UPPER)?1:((sd->class_&JOBL_BABY)?2:0))&item->class_upper)) 
     
    730730                sd->class_ = MAPID_NOVICE; 
    731731        } else 
    732                 sd->class_ = i;  
     732                sd->class_ = i; 
    733733        //Initializations to null/0 unneeded since map_session_data was filled with 0 upon allocation. 
    734734        if(!sd->status.hp) pc_setdead(sd); 
     
    739739        sd->npc_timer_id = -1; 
    740740        sd->pvp_timer = -1; 
    741          
     741 
    742742        sd->canuseitem_tick = tick; 
    743743        sd->cantalk_tick = tick; 
     
    754754        if (battle_config.disp_zeny) 
    755755                sd->state.showzeny = 1; 
     756<<<<<<< .mine 
     757        //Vanaheim settings [Brainstorm] 
     758        if (battle_config.disp_summon_stats) // Battle Flag to Show Summoned Monster Stats [Brain] 
     759        sd->state.showsummon = 1; 
     760 
     761======= 
    756762        //Custom Job (blackmagick)       
    757763        //Vanaheim settings [Brainstorm] 
     
    759765                sd->state.showsummon = 1; 
    760766         
     767>>>>>>> .r18 
    761768        if (!(battle_config.display_skill_fail&2)) 
    762769                sd->state.showdelay = 1; 
    763                  
     770 
    764771        // ƒAƒCƒeƒ€ƒ`ƒFƒbƒN 
    765772        pc_setinventorydata(sd); 
    766773        pc_checkitem(sd); 
    767          
     774 
    768775        status_change_init(&sd->bl); 
    769776        if ((battle_config.atc_gmonly == 0 || pc_isGM(sd)) && (pc_isGM(sd) >= get_atcommand_level(atcommand_hide))) 
     
    820827                                sd->packet_ver, CONVIP(ip)); 
    821828        } 
    822          
     829 
    823830        // Send friends list 
    824831        clif_friendslist_send(sd); 
     
    867874} 
    868875 
    869 //Attempts to set a mob.  
     876//Attempts to set a mob. 
    870877int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl) 
    871878{ 
     
    899906{ 
    900907        int i,j; 
    901          
     908 
    902909        sd->change_level = pc_readglobalreg(sd,"jobchange_level"); 
    903910        sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER"); 
     
    933940                        if (i < sd->status.skill[sd->cloneskill_id].lv) 
    934941                                sd->status.skill[sd->cloneskill_id].lv = i; 
    935                         sd->status.skill[sd->cloneskill_id].flag = 13;  //cloneskill flag                        
     942                        sd->status.skill[sd->cloneskill_id].flag = 13;  //cloneskill flag 
    936943                } 
    937944        } 
     
    946953        if (sd->status.guild_id) 
    947954                guild_member_joined(sd); 
    948          
     955 
    949956        // pet 
    950957        if (sd->status.pet_id > 0) 
     
    10171024        } 
    10181025        c = pc_class2idx(c); 
    1019         for(i=0;i<MAX_SKILL;i++){  
     1026        for(i=0;i<MAX_SKILL;i++){ 
    10201027                if (sd->status.skill[i].flag != 13) //Don't touch plagiarized skills 
    10211028                        sd->status.skill[i].id=0; //First clear skills. 
    10221029        } 
    10231030 
    1024         for(i=0;i<MAX_SKILL;i++){  
    1025                 if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills.        
     1031        for(i=0;i<MAX_SKILL;i++){ 
     1032                if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills. 
    10261033                        sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2; 
    10271034                        sd->status.skill[i].flag=0; 
     
    11121119                                sd->status.skill[id].flag=1; //So it is not saved, and tagged as a "bonus" skill. 
    11131120                        } else 
    1114                                 sd->status.skill[id].flag=sd->status.skill[id].lv+2;  
     1121                                sd->status.skill[id].flag=sd->status.skill[id].lv+2; 
    11151122                        sd->status.skill[id].lv= skill_tree_get_max(id, sd->status.class_); 
    11161123                } 
     
    11281135        if(battle_config.skillfree) 
    11291136                return; //Function serves no purpose if this is set 
    1130          
     1137 
    11311138        i = pc_calc_skilltree_normalize_job(sd); 
    11321139        c = pc_mapid2jobid(i, sd->status.sex); 
     
    11431150                        if(sd->status.skill[id].id) //Already learned 
    11441151                                continue; 
    1145                          
     1152 
    11461153                        for(j=0;j<5;j++) { 
    11471154                                if((k=skill_tree[c][i].need[j].id)) 
     
    11641171                        if (sd->status.job_level < skill_tree[c][i].joblv) 
    11651172                                continue; 
    1166                          
     1173 
    11671174                        j = skill_get_inf2(id); 
    11681175                        if(!sd->status.skill[id].lv && ( 
     
    12031210        int skill_point; 
    12041211        int c = sd->class_; 
    1205          
     1212 
    12061213        if (!battle_config.skillup_limit) 
    12071214                return c; 
    1208          
     1215 
    12091216        skill_point = pc_calc_skillpoint(sd); 
    12101217        if(pc_checkskill(sd, NV_BASIC) < 9) //Consider Novice Tree when you don't have NV_BASIC maxed. 
     
    16121619                        break; 
    16131620                val += (int)status->max_hp; 
    1614                 //Negative bonuses will underflow, this will be handled in status_calc_pc through casting  
     1621                //Negative bonuses will underflow, this will be handled in status_calc_pc through casting 
    16151622                //If this is called outside of status_calc_pc, you'd better pray they do not underflow and end with UINT_MAX max_hp. 
    16161623                status->max_hp = (unsigned int)val; 
    16171624                break; 
    16181625        case SP_MAXSP: 
    1619                 if(sd->state.lr_flag == 2)  
     1626                if(sd->state.lr_flag == 2) 
    16201627                        break; 
    16211628                val += (int)status->max_sp; 
     
    26752682        if(idx_card < 0 || idx_card >= MAX_INVENTORY || !sd->inventory_data[idx_card]) 
    26762683                return 0; //Invalid card index. 
    2677                          
     2684 
    26782685        if(idx_equip < 0 || idx_equip >= MAX_INVENTORY || !sd->inventory_data[idx_equip]) 
    26792686                return 0; //Invalid item index. 
    2680          
     2687 
    26812688        nameid=sd->status.inventory[idx_equip].nameid; 
    26822689        cardid=sd->status.inventory[idx_card].nameid; 
     
    29032910        if(amount > MAX_AMOUNT) 
    29042911                return 5; 
    2905          
     2912 
    29062913        data = itemdb_search(item_data->nameid); 
    29072914        w = data->weight*amount; 
     
    29983005                return 0; //Can't drop items in nodrop mapflag maps. 
    29993006        } 
    3000          
     3007 
    30013008        if (!pc_candrop(sd,&sd->status.inventory[n])) { 
    30023009                clif_displaymessage (sd->fd, msg_txt(263)); 
    30033010                return 0; 
    30043011        } 
    3005          
     3012 
    30063013        //Logs items, dropped by (P)layers [Lupus] 
    30073014        if(log_config.enable_logs&0x8) 
     
    30113018        if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2)) 
    30123019                return 0; 
    3013          
     3020 
    30143021        pc_delitem(sd, n, amount, 0); 
    30153022        return 1; 
     
    30343041        if (sd->status.party_id) 
    30353042                p = party_search(sd->status.party_id); 
    3036          
     3043 
    30373044        if(fitem->first_get_charid > 0 && fitem->first_get_charid != sd->status.char_id) 
    30383045        { 
     
    31243131        if ((nameid == 605 || nameid == 606) && pc_issit(sd)) 
    31253132                return 0; 
    3126            
     3133 
    31273134        //added item_noequip.txt items check by Maya&[Lupus] 
    31283135        if ( 
     
    31463153        )) 
    31473154                return 0; 
    3148          
     3155 
    31493156        //Not usable by upper class. [Skotlex] 
    31503157        if(!( 
     
    33303337        if (idx < 0 || idx >= MAX_INVENTORY) //Invalid index check [Skotlex] 
    33313338                return 1; 
    3332          
     3339 
    33333340        item_data = &sd->status.inventory[idx]; 
    33343341 
     
    33703377        if (idx < 0 || idx >= MAX_CART) //Invalid index check [Skotlex] 
    33713378                return 1; 
    3372          
     3379 
    33733380        item_data=&sd->status.cart[idx]; 
    33743381 
     
    34223429        if(md->state.steal_flag == UCHAR_MAX || md->sc.opt1) //already stolen from / status change check 
    34233430                return 0; 
    3424          
     3431 
    34253432        sd_status= status_get_status_data(&sd->bl); 
    34263433        md_status= status_get_status_data(bl); 
     
    34393446        rate = (sd_status->dex - md_status->dex)/2 + lv*6 + 4; 
    34403447        rate += sd->add_steal_rate; 
    3441                  
     3448 
    34423449        if( rate < 1 ) 
    34433450                return 0; 
     
    34653472                return 0; 
    34663473        } 
    3467          
     3474 
    34683475        if(battle_config.show_steal_in_same_party) 
    34693476                party_foreachsamemap(pc_show_steal,sd,AREA_SIZE,sd,tmp_item.nameid); 
     
    34743481                log_pick_pc(sd, "P", itemid, 1, NULL); 
    34753482        } 
    3476                  
     3483 
    34773484        //A Rare Steal Global Announce by Lupus 
    34783485        if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) { 
     
    36053612                //Tag player for rewarping after map-loading is done. [Skotlex] 
    36063613                sd->state.rewarp = 1; 
    3607          
     3614 
    36083615        sd->mapindex =  mapindex; 
    36093616        sd->bl.m = m; 
     
    37633770        if(!sd->sc.count) 
    37643771                return 0; 
    3765          
     3772 
    37663773        for (i = 0; i < ARRAYLENGTH(scw_list); i++) 
    37673774        {       // Skills requiring specific weapon types 
     
    37703777                        status_change_end(&sd->bl,scw_list[i],-1); 
    37713778        } 
    3772          
     3779 
    37733780        if(sd->sc.data[SC_SPURT] && sd->status.weapon) 
    37743781                // Spurt requires bare hands (feet, in fact xD) 
    37753782                status_change_end(&sd->bl,SC_SPURT,-1); 
    3776          
     3783 
    37773784        if(sd->status.shield <= 0) { // Skills requiring a shield 
    37783785                for (i = 0; i < ARRAYLENGTH(scs_list); i++) 
     
    38623869                        class_ |= MAPID_THIEF; 
    38633870                        break; 
    3864                          
     3871 
    38653872                case JOB_STAR_GLADIATOR: 
    38663873                case JOB_STAR_GLADIATOR2: 
    38673874                        class_ |= JOBL_2_1; 
    38683875                        class_ |= MAPID_TAEKWON; 
    3869                         break;   
     3876                        break; 
    38703877                case JOB_SOUL_LINKER: 
    38713878                        class_ |= JOBL_2_2; 
     
    38913898                        class_ = MAPID_SUMMER; 
    38923899                        break; 
     3900<<<<<<< .mine 
     3901                        //Possible to be in the wrong spot? 
     3902                case JOB_NECROMANCER: // Necromancer [Brain] 
     3903                        class_ |= JOBL_2_1; 
     3904                        class_ |= MAPID_ADEPT; 
     3905======= 
    38933906                        //Custom Jobs (blackmagic) 
    38943907                        +               case JOB_NECROMANCER: // Necromancer [Brain] 
     
    39003913                case JOB_ADEPT: // Adept [Brain] 
    39013914                        class_ |= MAPID_ADEPT; 
    3902                         break; 
    3903 //Custom Job End 
     3915>>>>>>> .r18 
     3916                        break; 
     3917                case JOB_WARLOCK: // Warlock [Brain] 
     3918                        class_ |= JOBL_2_2; 
     3919                case JOB_ADEPT: // Adept [Brain] 
     3920                        class_ |= MAPID_ADEPT; 
     3921                        break; 
    39043922                default: 
    39053923                        return -1; 
     
    39253943                case MAPID_XMAS:            return JOB_XMAS; 
    39263944                case MAPID_SUMMER:          return JOB_SUMMER; 
    3927                 //Custom Jobs (blackmagic) 
    39283945                case MAPID_ADEPT:                       return JOB_ADEPT; // Adept [Brain] 
    3929                 //Custom Job End 
    3930  
    39313946        //2_1 classes 
    39323947                case MAPID_SUPER_NOVICE:    return JOB_SUPER_NOVICE; 
     
    39383953                case MAPID_ASSASSIN:        return JOB_ASSASSIN; 
    39393954                case MAPID_STAR_GLADIATOR:  return JOB_STAR_GLADIATOR; 
    3940                 //Custom Jobs (blackmagic) 
    39413955                case MAPID_NECROMANCER:         return JOB_NECROMANCER; // Necromancer [Brain] 
    3942                 //Custom Job End 
    3943  
    39443956        //2_2 classes 
    39453957                case MAPID_CRUSADER:        return JOB_CRUSADER; 
     
    39503962                case MAPID_ROGUE:           return JOB_ROGUE; 
    39513963                case MAPID_SOUL_LINKER:     return JOB_SOUL_LINKER; 
    3952                 //Custom Jobs (blackmagic) 
    39533964                case MAPID_WARLOCK:                     return JOB_WARLOCK; // Warlock [Brain] 
    3954                 //Custom Job End 
    3955  
    39563965        //1-1: advanced 
    39573966                case MAPID_NOVICE_HIGH:     return JOB_NOVICE_HIGH; 
     
    40184027        case JOB_THIEF: 
    40194028                return msg_txt(550 - JOB_NOVICE+class_); 
    4020                  
     4029 
    40214030        case JOB_KNIGHT: 
    40224031        case JOB_PRIEST: 
     
    40264035        case JOB_ASSASSIN: 
    40274036                return msg_txt(557 - JOB_KNIGHT+class_); 
    4028                  
     4037 
    40294038        case JOB_KNIGHT2: 
    40304039                return msg_txt(557); 
    4031                  
     4040 
    40324041        case JOB_CRUSADER: 
    40334042        case JOB_MONK: 
     
    40384047        case JOB_DANCER: 
    40394048                return msg_txt(563 - JOB_CRUSADER+class_); 
    4040                          
     4049 
    40414050        case JOB_CRUSADER2: 
    40424051                return msg_txt(563); 
    4043                  
     4052 
    40444053        case JOB_WEDDING: 
    40454054        case JOB_SUPER_NOVICE: 
     
    40674076        case JOB_ASSASSIN_CROSS: 
    40684077                return msg_txt(582 - JOB_LORD_KNIGHT+class_); 
    4069                  
     4078 
    40704079        case JOB_LORD_KNIGHT2: 
    40714080                return msg_txt(582); 
    4072                  
     4081 
    40734082        case JOB_PALADIN: 
    40744083        case JOB_CHAMPION: 
     
    40794088        case JOB_GYPSY: 
    40804089                return msg_txt(588 - JOB_PALADIN + class_); 
    4081                  
     4090 
    40824091        case JOB_PALADIN2: 
    40834092                return msg_txt(588); 
     
    40914100        case JOB_BABY_THIEF: 
    40924101                return msg_txt(595 - JOB_BABY + class_); 
    4093                  
     4102 
    40944103        case JOB_BABY_KNIGHT: 
    40954104        case JOB_BABY_PRIEST: 
     
    40994108        case JOB_BABY_ASSASSIN: 
    41004109                return msg_txt(602 - JOB_BABY_KNIGHT + class_); 
    4101                  
     4110 
    41024111        case JOB_BABY_KNIGHT2: 
    41034112                return msg_txt(602); 
    4104                  
     4113 
    41054114        case JOB_BABY_CRUSADER: 
    41064115        case JOB_BABY_MONK: 
     
    41114120        case JOB_BABY_DANCER: 
    41124121                return msg_txt(608 - JOB_BABY_CRUSADER +class_); 
    4113                  
     4122 
    41144123        case JOB_BABY_CRUSADER2: 
    41154124                return msg_txt(608); 
    4116                  
     4125 
    41174126        case JOB_SUPER_BABY: 
    41184127                return msg_txt(615); 
    4119                  
     4128 
    41204129        case JOB_TAEKWON: 
    41214130                return msg_txt(616); 
     
    41254134        case JOB_SOUL_LINKER: 
    41264135                return msg_txt(618); 
    4127                  
     4136 
    41284137        case JOB_GUNSLINGER: 
    41294138                return msg_txt(619); 
    41304139        case JOB_NINJA: 
    41314140                return msg_txt(620); 
     4141<<<<<<< .mine 
     4142        case JOB_ADEPT: // Adept [Brain] 
     4143                return msg_txt(1000); 
     4144        case JOB_NECROMANCER: // Necromancer [Brain] 
     4145                return msg_txt(1001); 
     4146        case JOB_WARLOCK: // Warlock [Flavio] 
     4147======= 
    41324148        //Custom Jobs (blackmagic) 
    41334149        case JOB_ADEPT: // Adept [Brain] 
     
    41364152                return msg_txt(1001); 
    41374153        case JOB_WARLOCK: // Warlock [Flavio] 
     4154>>>>>>> .r18 
    41384155                return msg_txt(1002); 
    4139         //Custom Job End 
    4140          
     4156 
    41414157        default: 
    41424158                return msg_txt(650); 
     
    42324248                if (sd->status.status_point > USHRT_MAX - next) 
    42334249                        sd->status.status_point = USHRT_MAX; 
    4234                 else     
     4250                else 
    42354251                        sd->status.status_point += next; 
    42364252 
     
    42394255        if (battle_config.pet_lv_rate && sd->pd)        //<Skotlex> update pet's level 
    42404256                status_calc_pet(sd->pd,0); 
    4241          
     4257 
    42424258        clif_updatestatus(sd,SP_STATUSPOINT); 
    42434259        clif_updatestatus(sd,SP_BASELEVEL); 
     
    43094325 
    43104326        if (sd->expaddrace[status->race]) 
    4311                 bonus += sd->expaddrace[status->race];   
     4327                bonus += sd->expaddrace[status->race]; 
    43124328        bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS]; 
    4313          
    4314         if (battle_config.pk_mode &&  
     4329 
     4330        if (battle_config.pk_mode && 
    43154331                (int)(status_get_lv(src) - sd->status.base_level) >= 20) 
    4316                 bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]   
     4332                bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris] 
    43174333 
    43184334        if (sd->sc.data[SC_EXPBOOST]) 
     
    43214337        if (!bonus) 
    43224338                return; 
    4323          
     4339 
    43244340        *base_exp += (unsigned int) cap_value((double)*base_exp * bonus/100., 1, UINT_MAX); 
    43254341        *job_exp += (unsigned int) cap_value((double)*job_exp * bonus/100., 1, UINT_MAX); 
     
    43504366        nextb = pc_nextbaseexp(sd); 
    43514367        nextj = pc_nextjobexp(sd); 
    4352                  
     4368 
    43534369        if(sd->state.showexp || battle_config.max_exp_gain_rate){ 
    43544370                if (nextb > 0) 
     
    43724388                } 
    43734389        } 
    4374          
     4390 
    43754391        //Cap exp to the level up requirement of the previous level when you are at max level, otherwise cap at UINT_MAX (this is required for some S. Novice bonuses). [Skotlex] 
    43764392        if (base_exp) { 
     
    45384554 
    45394555        max = pc_maxparameter(sd); 
    4540          
     4556 
    45414557        switch(type){ 
    45424558        case SP_STR: sd->status.str = cap_value(sd->status.str + val, 1, max); break; 
     
    46384654        } 
    46394655        status_calc_pc(sd,0); 
    4640         //Required because if you could level up all skills previously,  
     4656        //Required because if you could level up all skills previously, 
    46414657        //the update will not be sent as only the lv variable changes. 
    46424658        clif_skillinfoblock(sd); 
     
    47354751{ 
    47364752        nullpo_retr(0, sd); 
    4737          
     4753 
    47384754        if (battle_config.use_statpoint_table) 
    47394755        {       // New statpoint table used here - Dexity 
     
    47484764                if (sd->class_&JOBL_UPPER) 
    47494765                        stat+=52;       // extra 52+48=100 stat points 
    4750                  
     4766 
    47514767                if (stat > USHRT_MAX) 
    47524768                        sd->status.status_point = USHRT_MAX; 
     
    47884804        clif_updatestatus(sd,SP_UDEX); 
    47894805        clif_updatestatus(sd,SP_ULUK);  // End Addition 
    4790          
     4806 
    47914807        clif_updatestatus(sd,SP_STATUSPOINT); 
    47924808        status_calc_pc(sd,0); 
     
    48234839                        merc_hom_vaporize(sd, 0); 
    48244840        } 
    4825          
     4841 
    48264842        for (i = 1; i < MAX_SKILL; i++) { 
    48274843                lv= sd->status.skill[i].lv; 
     
    48524868                } 
    48534869        } 
    4854          
     4870 
    48554871        if (flag&2 || !skill_point) return skill_point; 
    48564872 
     
    49584974        if(!src || src == &sd->bl) 
    49594975                return; 
    4960          
     4976 
    49614977        if(sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support) 
    49624978                pet_target_check(sd,src,1); 
     
    49704986        int i=0,j=0,k=0; 
    49714987        unsigned int tick = gettick(); 
    4972                  
     4988 
    49734989        if(sd->vender_id) 
    49744990                vending_closevending(sd); 
     
    50655081                        // karma going down = more 'good' / more honourable. 
    50665082                        // The Karma System way... 
    5067                  
     5083 
    50685084                        if (sd->status.karma > ssd->status.karma) {     // If player killed was more evil 
    50695085                                sd->status.karma--; 
     
    50725088                        else if (sd->status.karma < ssd->status.karma)  // If player killed was more good 
    50735089                                ssd->status.karma++; 
    5074          
     5090 
    50755091 
    50765092                        // or the PK System way... 
    5077          
     5093 
    50785094                        if (sd->status.karma > 0)       // player killed is dishonourable? 
    50795095                                ssd->status.karma--; // honour points earned 
    50805096                        sd->status.karma++;     // honour points lost 
    5081                  
     5097 
    50825098                        // To-do: Receive exp on certain occasions 
    50835099#endif 
     
    53265342                                stat += (sd->status.base_level + i + 14) / 5 ; 
    53275343                        if (sd->status.status_point > USHRT_MAX - stat) 
    5328                                  
     5344 
    53295345                                sd->status.status_point = USHRT_MAX; 
    53305346                        else 
     
    55285544                        status_percent_damage(NULL, &sd->bl, hp, 0, hp==-100); 
    55295545        } 
    5530          
     5546 
    55315547        if(sp) { 
    55325548                if(sp > 0) 
     
    55605576        switch (upper) { 
    55615577                case 1: 
    5562                         b_class|= JOBL_UPPER;  
     5578                        b_class|= JOBL_UPPER; 
    55635579                        break; 
    55645580                case 2: 
     
    55675583        } 
    55685584        //This will automatically adjust bard/dancer classes to the correct gender 
    5569         //That is, if you try to jobchange into dancer, it will turn you to bard.        
     5585        //That is, if you try to jobchange into dancer, it will turn you to bard. 
    55705586        job = pc_mapid2jobid(b_class, sd->status.sex); 
    55715587        if (job == -1) 
    55725588                return 1; 
    5573          
     5589 
    55745590        if ((unsigned short)b_class == sd->class_) 
    55755591                return 1; //Nothing to change. 
     
    55995615                } 
    56005616        } 
    5601          
     5617 
    56025618        sd->status.class_ = job; 
    56035619        fame_flag = pc_famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK); 
     
    56155631        } 
    56165632 
    5617         //Change look, if disguised, you need to undisguise  
     5633        //Change look, if disguised, you need to undisguise 
    56185634        //to correctly calculate new job sprite without 
    56195635        if (sd->disguise) 
     
    56435659        if(merc_is_hom_active(sd->hd) && !pc_checkskill(sd, AM_CALLHOMUN)) 
    56445660                merc_hom_vaporize(sd, 0); 
    5645          
     5661 
    56465662        if(sd->status.manner < 0) 
    56475663                clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); 
     
    58025818        else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING) 
    58035819                new_look = -1; 
    5804          
     5820 
    58055821        if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING)) 
    58065822                new_look = JOB_WEDDING; 
     
    60366052        struct global_reg *sd_reg; 
    60376053        int i,max; 
    6038          
     6054 
    60396055        nullpo_retr(0, sd); 
    60406056        switch (type) { 
     
    61136129                return 1; 
    61146130        } 
    6115          
     6131 
    61166132        // delete reg 
    61176133        if (val == 0) { 
     
    61856201                return 0; 
    61866202        } 
    6187          
     6203 
    61886204        // delete reg 
    61896205        if (!val || strcmp(val,"")==0) 
     
    63796395        if(pos == EQP_ACC) { //Accesories should only go in one of the two, 
    63806396                pos = req_pos&EQP_ACC; 
    6381                 if (pos == EQP_ACC) //User specified both slots..  
     6397                if (pos == EQP_ACC) //User specified both slots.. 
    63826398                        pos = sd->equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R; 
    63836399        } 
     
    65646580        clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1); 
    65656581 
    6566         if((sd->status.inventory[n].equip & EQP_ARMS) &&  
     6582        if((sd->status.inventory[n].equip & EQP_ARMS) && 
    65676583                sd->weapontype1 == 0 && sd->weapontype2 == 0 && (!sd->sc.data[SC_SEVENWIND] || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!) 
    65686584                skill_enchant_elemental_end(&sd->bl,-1); 
     
    66206636        if (sd->vender_id) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam) 
    66216637                return 0; 
    6622          
     6638 
    66236639        // ŠŽ•i‹ó‚«‹l‚ß 
    66246640        for(i=j=0;i<MAX_INVENTORY;i++){ 
     
    68656881                        hp = sd->battle_status.hp-1; //Script drains cannot kill you. 
    68666882        } 
    6867          
     6883 
    68686884        if (sd->sp_loss.value) { 
    68696885                sd->sp_loss.tick += diff_tick; 
     
    68946910                } 
    68956911        } 
    6896          
     6912 
    68976913        if (sd->sp_regen.value) { 
    68986914                sd->sp_regen.tick += diff_tick; 
     
    70007016        if (data == 0 && battle_config.day_duration <= 0)       // if we want a day 
    70017017                return 0; 
    7002          
     7018 
    70037019        if (!night_flag) 
    70047020                return 0; //Already day. 
    7005          
     7021 
    70067022        night_flag = 0; // 0=day, 1=night [Yor] 
    70077023        map_foreachpc(pc_daynight_timer_sub); 
     
    70217037        if (data == 0 && battle_config.night_duration <= 0)     // if we want a night 
    70227038                return 0; 
    7023          
     7039 
    70247040        if (night_flag) 
    70257041                return 0; //Already nigth. 
     
    70507066        time_t timer; 
    70517067        struct tm *t; 
    7052          
     7068 
    70537069        time(&timer); 
    70547070        t = localtime(&timer); 
    7055          
    7056         pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);  
     7071 
     7072        pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min); 
    70577073        return; 
    70587074} 
     
    70637079        time_t timer; 
    70647080        struct tm *t; 
    7065          
     7081 
    70667082        time(&timer); 
    70677083    t = localtime(&timer); 
    7068          
     7084 
    70697085        diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "PC_LAST_DUEL_TIME"); 
    7070          
     7086 
    70717087        return !(diff >= 0 && diff < battle_config.duel_time_interval); 
    70727088} 
     
    70787094 
    70797095        if (sd->duel_group != ssd->duel_group) return 0; 
    7080          
     7096 
    70817097        sprintf(output, "      %d. %s", ++(*p), sd->status.name); 
    70827098        clif_disp_onlyself(ssd, output, strlen(output)); 
     
    71107126        int i=1; 
    71117127        char output[256]; 
    7112          
     7128 
    71137129        while(duel_list[i].members_count > 0 && i < MAX_DUEL) i++; 
    71147130        if(i == MAX_DUEL) return 0; 
    7115          
     7131 
    71167132        duel_count++; 
    71177133        sd->duel_group = i; 
     
    71197135        duel_list[i].invites_count = 0; 
    71207136        duel_list[i].max_players_limit = maxpl; 
    7121          
     7137 
    71227138        strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --" 
    71237139        clif_disp_onlyself(sd, output, strlen(output)); 
    7124          
     7140 
    71257141        clif_set0199(sd, 1); 
    71267142        //clif_misceffect2(&sd->bl, 159); 
     
    71387154        target_sd->duel_invite = did; 
    71397155        duel_list[did].invites_count++; 
    7140          
     7156 
    71417157        // "Blue -- Player %s invites you to PVP duel (@accept/@reject) --" 
    71427158        sprintf(output, msg_txt(374), sd->status.name); 
     
    71567172{ 
    71577173        char output[256]; 
    7158          
     7174 
    71597175        // " <- Player %s has left duel --" 
    71607176        sprintf(output, msg_txt(375), sd->status.name); 
    71617177        clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); 
    7162          
     7178 
    71637179        duel_list[did].members_count--; 
    7164          
     7180 
    71657181        if(duel_list[did].members_count == 0) { 
    7166                 map_foreachpc(duel_leave_sub, did);  
     7182                map_foreachpc(duel_leave_sub, did); 
    71677183                duel_count--; 
    71687184        } 
    7169          
     7185 
    71707186        sd->duel_group = 0; 
    71717187        duel_savetime(sd); 
     
    71777193{ 
    71787194        char output[256]; 
    7179          
     7195 
    71807196        duel_list[did].members_count++; 
    71817197        sd->duel_group = sd->duel_invite; 
    71827198        duel_list[did].invites_count--; 
    71837199        sd->duel_invite = 0; 
    7184          
     7200 
    71857201        // " -> Player %s has accepted duel --" 
    71867202        sprintf(output, msg_txt(376), sd->status.name); 
     
    71957211{ 
    71967212        char output[256]; 
    7197          
     7213 
    71987214        // " -- Player %s has rejected duel --" 
    71997215        sprintf(output, msg_txt(377), sd->status.name); 
    72007216        clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); 
    7201          
     7217 
    72027218        duel_list[did].invites_count--; 
    72037219        sd->duel_invite = 0; 
     
    72977313                if (pc_split_str(line,split,4) < 4) 
    72987314                        continue; 
    7299                  
     7315 
    73007316                job_count = pc_split_atoi(split[1],jobs,':',CLASS_COUNT); 
    73017317                if (job_count < 1) 
     
    73167332                        maxlv = MAX_LEVEL; 
    73177333                } 
    7318                  
     7334 
    73197335                job = jobs[0] = pc_class2idx(job_id); 
    73207336                //We send one less and then one more because the last entry in the exp array should hold 0. 
     
    74777493                        if (i > MAX_LEVEL) 
    74787494                                break; 
    7479                         statp[i]=j;                      
     7495                        statp[i]=j; 
    74807496                        i++; 
    74817497                } 
     
    74867502        for (; i <= MAX_LEVEL; i++) { 
    74877503                j += (i+15)/5; 
    7488                 statp[i] = j;            
     7504                statp[i] = j; 
    74897505        } 
    74907506 
     
    75187534        else 
    75197535                ShowWarning("In function pc_read_motd() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt); 
    7520          
     7536 
    75217537        return 0; 
    75227538}