Changeset 24 for src/map/pc.c

Show
Ignore:
Timestamp:
07/07/08 22:48:26 (17 years ago)
Author:
jinshiro
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/map/pc.c

    r22 r24  
    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//Checks the battleflags to see if player has selected to see summon's stats. 
     757//I see nothing wrong here. 
    756758        //Vanaheim settings [Brainstorm] 
    757759        if (battle_config.disp_summon_stats) // Battle Flag to Show Summoned Monster Stats [Brain] 
    758         sd->state.showsummon = 1; 
    759  
     760                sd->state.showsummon = 1; 
     761 
     762         
    760763        if (!(battle_config.display_skill_fail&2)) 
    761764                sd->state.showdelay = 1; 
    762  
     765                 
    763766        // ƒAƒCƒeƒ€ƒ`ƒFƒbƒN 
    764767        pc_setinventorydata(sd); 
    765768        pc_checkitem(sd); 
    766  
     769         
    767770        status_change_init(&sd->bl); 
    768771        if ((battle_config.atc_gmonly == 0 || pc_isGM(sd)) && (pc_isGM(sd) >= get_atcommand_level(atcommand_hide))) 
     
    819822                                sd->packet_ver, CONVIP(ip)); 
    820823        } 
    821  
     824         
    822825        // Send friends list 
    823826        clif_friendslist_send(sd); 
     
    866869} 
    867870 
    868 //Attempts to set a mob. 
     871//Attempts to set a mob.  
    869872int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl) 
    870873{ 
     
    898901{ 
    899902        int i,j; 
    900  
     903         
    901904        sd->change_level = pc_readglobalreg(sd,"jobchange_level"); 
    902905        sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER"); 
     
    932935                        if (i < sd->status.skill[sd->cloneskill_id].lv) 
    933936                                sd->status.skill[sd->cloneskill_id].lv = i; 
    934                         sd->status.skill[sd->cloneskill_id].flag = 13;  //cloneskill flag 
     937                        sd->status.skill[sd->cloneskill_id].flag = 13;  //cloneskill flag                        
    935938                } 
    936939        } 
     
    945948        if (sd->status.guild_id) 
    946949                guild_member_joined(sd); 
    947  
     950         
    948951        // pet 
    949952        if (sd->status.pet_id > 0) 
     
    10161019        } 
    10171020        c = pc_class2idx(c); 
    1018         for(i=0;i<MAX_SKILL;i++){ 
     1021        for(i=0;i<MAX_SKILL;i++){  
    10191022                if (sd->status.skill[i].flag != 13) //Don't touch plagiarized skills 
    10201023                        sd->status.skill[i].id=0; //First clear skills. 
    10211024        } 
    10221025 
    1023         for(i=0;i<MAX_SKILL;i++){ 
    1024                 if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills. 
     1026        for(i=0;i<MAX_SKILL;i++){  
     1027                if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills.        
    10251028                        sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2; 
    10261029                        sd->status.skill[i].flag=0; 
     
    11111114                                sd->status.skill[id].flag=1; //So it is not saved, and tagged as a "bonus" skill. 
    11121115                        } else 
    1113                                 sd->status.skill[id].flag=sd->status.skill[id].lv+2; 
     1116                                sd->status.skill[id].flag=sd->status.skill[id].lv+2;  
    11141117                        sd->status.skill[id].lv= skill_tree_get_max(id, sd->status.class_); 
    11151118                } 
     
    11271130        if(battle_config.skillfree) 
    11281131                return; //Function serves no purpose if this is set 
    1129  
     1132         
    11301133        i = pc_calc_skilltree_normalize_job(sd); 
    11311134        c = pc_mapid2jobid(i, sd->status.sex); 
     
    11421145                        if(sd->status.skill[id].id) //Already learned 
    11431146                                continue; 
    1144  
     1147                         
    11451148                        for(j=0;j<5;j++) { 
    11461149                                if((k=skill_tree[c][i].need[j].id)) 
     
    11631166                        if (sd->status.job_level < skill_tree[c][i].joblv) 
    11641167                                continue; 
    1165  
     1168                         
    11661169                        j = skill_get_inf2(id); 
    11671170                        if(!sd->status.skill[id].lv && ( 
     
    12021205        int skill_point; 
    12031206        int c = sd->class_; 
    1204  
     1207         
    12051208        if (!battle_config.skillup_limit) 
    12061209                return c; 
    1207  
     1210         
    12081211        skill_point = pc_calc_skillpoint(sd); 
    12091212        if(pc_checkskill(sd, NV_BASIC) < 9) //Consider Novice Tree when you don't have NV_BASIC maxed. 
     
    16111614                        break; 
    16121615                val += (int)status->max_hp; 
    1613                 //Negative bonuses will underflow, this will be handled in status_calc_pc through casting 
     1616                //Negative bonuses will underflow, this will be handled in status_calc_pc through casting  
    16141617                //If this is called outside of status_calc_pc, you'd better pray they do not underflow and end with UINT_MAX max_hp. 
    16151618                status->max_hp = (unsigned int)val; 
    16161619                break; 
    16171620        case SP_MAXSP: 
    1618                 if(sd->state.lr_flag == 2) 
     1621                if(sd->state.lr_flag == 2)  
    16191622                        break; 
    16201623                val += (int)status->max_sp; 
     
    16581661                } 
    16591662                break; 
    1660         case SP_ADD_SPEED:      //Raw increase 
    1661                 if(sd->state.lr_flag != 2) { 
    1662                         bonus = status->speed - val; 
    1663                         status->speed = cap_value(bonus, 0, USHRT_MAX); 
    1664                 } 
    1665                 break; 
    16661663        case SP_SPEED_RATE:     //Non stackable increase 
    1667                 if(sd->state.lr_flag != 2 && sd->speed_rate > 100-val) 
    1668                         sd->speed_rate = 100-val; 
     1664                if(sd->state.lr_flag != 2) 
     1665                        sd->speed_rate = min(sd->speed_rate, -val); 
    16691666                break; 
    16701667        case SP_SPEED_ADDRATE:  //Stackable increase 
     
    26742671        if(idx_card < 0 || idx_card >= MAX_INVENTORY || !sd->inventory_data[idx_card]) 
    26752672                return 0; //Invalid card index. 
    2676  
     2673                         
    26772674        if(idx_equip < 0 || idx_equip >= MAX_INVENTORY || !sd->inventory_data[idx_equip]) 
    26782675                return 0; //Invalid item index. 
    2679  
     2676         
    26802677        nameid=sd->status.inventory[idx_equip].nameid; 
    26812678        cardid=sd->status.inventory[idx_card].nameid; 
     
    29022899        if(amount > MAX_AMOUNT) 
    29032900                return 5; 
    2904  
     2901         
    29052902        data = itemdb_search(item_data->nameid); 
    29062903        w = data->weight*amount; 
     
    29972994                return 0; //Can't drop items in nodrop mapflag maps. 
    29982995        } 
    2999  
     2996         
    30002997        if (!pc_candrop(sd,&sd->status.inventory[n])) { 
    30012998                clif_displaymessage (sd->fd, msg_txt(263)); 
    30022999                return 0; 
    30033000        } 
    3004  
     3001         
    30053002        //Logs items, dropped by (P)layers [Lupus] 
    30063003        if(log_config.enable_logs&0x8) 
     
    30103007        if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2)) 
    30113008                return 0; 
    3012  
     3009         
    30133010        pc_delitem(sd, n, amount, 0); 
    30143011        return 1; 
     
    30333030        if (sd->status.party_id) 
    30343031                p = party_search(sd->status.party_id); 
    3035  
     3032         
    30363033        if(fitem->first_get_charid > 0 && fitem->first_get_charid != sd->status.char_id) 
    30373034        { 
     
    31233120        if ((nameid == 605 || nameid == 606) && pc_issit(sd)) 
    31243121                return 0; 
    3125  
     3122           
    31263123        //added item_noequip.txt items check by Maya&[Lupus] 
    31273124        if ( 
     
    31453142        )) 
    31463143                return 0; 
    3147  
     3144         
    31483145        //Not usable by upper class. [Skotlex] 
    31493146        if(!( 
     
    33293326        if (idx < 0 || idx >= MAX_INVENTORY) //Invalid index check [Skotlex] 
    33303327                return 1; 
    3331  
     3328         
    33323329        item_data = &sd->status.inventory[idx]; 
    33333330 
     
    33693366        if (idx < 0 || idx >= MAX_CART) //Invalid index check [Skotlex] 
    33703367                return 1; 
    3371  
     3368         
    33723369        item_data=&sd->status.cart[idx]; 
    33733370 
     
    34213418        if(md->state.steal_flag == UCHAR_MAX || md->sc.opt1) //already stolen from / status change check 
    34223419                return 0; 
    3423  
     3420         
    34243421        sd_status= status_get_status_data(&sd->bl); 
    34253422        md_status= status_get_status_data(bl); 
     
    34383435        rate = (sd_status->dex - md_status->dex)/2 + lv*6 + 4; 
    34393436        rate += sd->add_steal_rate; 
    3440  
     3437                 
    34413438        if( rate < 1 ) 
    34423439                return 0; 
     
    34643461                return 0; 
    34653462        } 
    3466  
     3463         
    34673464        if(battle_config.show_steal_in_same_party) 
    34683465                party_foreachsamemap(pc_show_steal,sd,AREA_SIZE,sd,tmp_item.nameid); 
     
    34733470                log_pick_pc(sd, "P", itemid, 1, NULL); 
    34743471        } 
    3475  
     3472                 
    34763473        //A Rare Steal Global Announce by Lupus 
    34773474        if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) { 
     
    36043601                //Tag player for rewarping after map-loading is done. [Skotlex] 
    36053602                sd->state.rewarp = 1; 
    3606  
     3603         
    36073604        sd->mapindex =  mapindex; 
    36083605        sd->bl.m = m; 
     
    37623759        if(!sd->sc.count) 
    37633760                return 0; 
    3764  
     3761         
    37653762        for (i = 0; i < ARRAYLENGTH(scw_list); i++) 
    37663763        {       // Skills requiring specific weapon types 
     
    37693766                        status_change_end(&sd->bl,scw_list[i],-1); 
    37703767        } 
    3771  
     3768         
    37723769        if(sd->sc.data[SC_SPURT] && sd->status.weapon) 
    37733770                // Spurt requires bare hands (feet, in fact xD) 
    37743771                status_change_end(&sd->bl,SC_SPURT,-1); 
    3775  
     3772         
    37763773        if(sd->status.shield <= 0) { // Skills requiring a shield 
    37773774                for (i = 0; i < ARRAYLENGTH(scs_list); i++) 
     
    38613858                        class_ |= MAPID_THIEF; 
    38623859                        break; 
    3863  
     3860                         
    38643861                case JOB_STAR_GLADIATOR: 
    38653862                case JOB_STAR_GLADIATOR2: 
    38663863                        class_ |= JOBL_2_1; 
    38673864                        class_ |= MAPID_TAEKWON; 
    3868                         break; 
     3865                        break;   
    38693866                case JOB_SOUL_LINKER: 
    38703867                        class_ |= JOBL_2_2; 
     
    38903887                        class_ = MAPID_SUMMER; 
    38913888                        break; 
    3892                         //Possible to be in the wrong spot? 
     3889//This is where your errors begin. 
    38933890                case JOB_NECROMANCER: // Necromancer [Brain] 
    38943891                        class_ |= JOBL_2_1; 
    38953892                        class_ |= MAPID_ADEPT; 
    3896                         break; 
     3893                        break;   
    38973894                case JOB_WARLOCK: // Warlock [Brain] 
    38983895                        class_ |= JOBL_2_2; 
     
    39233920                case MAPID_XMAS:            return JOB_XMAS; 
    39243921                case MAPID_SUMMER:          return JOB_SUMMER; 
     3922                // double check this too. 
    39253923                case MAPID_ADEPT:                       return JOB_ADEPT; // Adept [Brain] 
    39263924        //2_1 classes 
     
    39333931                case MAPID_ASSASSIN:        return JOB_ASSASSIN; 
    39343932                case MAPID_STAR_GLADIATOR:  return JOB_STAR_GLADIATOR; 
     3933                //and this 
    39353934                case MAPID_NECROMANCER:         return JOB_NECROMANCER; // Necromancer [Brain] 
    39363935        //2_2 classes 
     
    39423941                case MAPID_ROGUE:           return JOB_ROGUE; 
    39433942                case MAPID_SOUL_LINKER:     return JOB_SOUL_LINKER; 
     3943                //this too 
    39443944                case MAPID_WARLOCK:                     return JOB_WARLOCK; // Warlock [Brain] 
    39453945        //1-1: advanced 
     
    40074007        case JOB_THIEF: 
    40084008                return msg_txt(550 - JOB_NOVICE+class_); 
    4009  
     4009                 
    40104010        case JOB_KNIGHT: 
    40114011        case JOB_PRIEST: 
     
    40154015        case JOB_ASSASSIN: 
    40164016                return msg_txt(557 - JOB_KNIGHT+class_); 
    4017  
     4017                 
    40184018        case JOB_KNIGHT2: 
    40194019                return msg_txt(557); 
    4020  
     4020                 
    40214021        case JOB_CRUSADER: 
    40224022        case JOB_MONK: 
     
    40274027        case JOB_DANCER: 
    40284028                return msg_txt(563 - JOB_CRUSADER+class_); 
    4029  
     4029                         
    40304030        case JOB_CRUSADER2: 
    40314031                return msg_txt(563); 
    4032  
     4032                 
    40334033        case JOB_WEDDING: 
    40344034        case JOB_SUPER_NOVICE: 
     
    40564056        case JOB_ASSASSIN_CROSS: 
    40574057                return msg_txt(582 - JOB_LORD_KNIGHT+class_); 
    4058  
     4058                 
    40594059        case JOB_LORD_KNIGHT2: 
    40604060                return msg_txt(582); 
    4061  
     4061                 
    40624062        case JOB_PALADIN: 
    40634063        case JOB_CHAMPION: 
     
    40684068        case JOB_GYPSY: 
    40694069                return msg_txt(588 - JOB_PALADIN + class_); 
    4070  
     4070                 
    40714071        case JOB_PALADIN2: 
    40724072                return msg_txt(588); 
     
    40804080        case JOB_BABY_THIEF: 
    40814081                return msg_txt(595 - JOB_BABY + class_); 
    4082  
     4082                 
    40834083        case JOB_BABY_KNIGHT: 
    40844084        case JOB_BABY_PRIEST: 
     
    40884088        case JOB_BABY_ASSASSIN: 
    40894089                return msg_txt(602 - JOB_BABY_KNIGHT + class_); 
    4090  
     4090                 
    40914091        case JOB_BABY_KNIGHT2: 
    40924092                return msg_txt(602); 
    4093  
     4093                 
    40944094        case JOB_BABY_CRUSADER: 
    40954095        case JOB_BABY_MONK: 
     
    41004100        case JOB_BABY_DANCER: 
    41014101                return msg_txt(608 - JOB_BABY_CRUSADER +class_); 
    4102  
     4102                 
    41034103        case JOB_BABY_CRUSADER2: 
    41044104                return msg_txt(608); 
    4105  
     4105                 
    41064106        case JOB_SUPER_BABY: 
    41074107                return msg_txt(615); 
    4108  
     4108                 
    41094109        case JOB_TAEKWON: 
    41104110                return msg_txt(616); 
     
    41144114        case JOB_SOUL_LINKER: 
    41154115                return msg_txt(618); 
    4116  
     4116                 
    41174117        case JOB_GUNSLINGER: 
    41184118                return msg_txt(619); 
    41194119        case JOB_NINJA: 
    41204120                return msg_txt(620); 
     4121//message display for job change? 
    41214122        case JOB_ADEPT: // Adept [Brain] 
    4122                 return msg_txt(1000); 
     4123                return msg_txt(1000);//have to add these to the msg_txt in the conf? 
    41234124        case JOB_NECROMANCER: // Necromancer [Brain] 
    41244125                return msg_txt(1001); 
     
    41264127                return msg_txt(1002); 
    41274128 
     4129         
    41284130        default: 
    41294131                return msg_txt(650); 
     
    42194221                if (sd->status.status_point > USHRT_MAX - next) 
    42204222                        sd->status.status_point = USHRT_MAX; 
    4221                 else 
     4223                else     
    42224224                        sd->status.status_point += next; 
    42234225 
     
    42264228        if (battle_config.pet_lv_rate && sd->pd)        //<Skotlex> update pet's level 
    42274229                status_calc_pet(sd->pd,0); 
    4228  
     4230         
    42294231        clif_updatestatus(sd,SP_STATUSPOINT); 
    42304232        clif_updatestatus(sd,SP_BASELEVEL); 
     
    42964298 
    42974299        if (sd->expaddrace[status->race]) 
    4298                 bonus += sd->expaddrace[status->race]; 
     4300                bonus += sd->expaddrace[status->race];   
    42994301        bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS]; 
    4300  
    4301         if (battle_config.pk_mode && 
     4302         
     4303        if (battle_config.pk_mode &&  
    43024304                (int)(status_get_lv(src) - sd->status.base_level) >= 20) 
    4303                 bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris] 
     4305                bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]   
    43044306 
    43054307        if (sd->sc.data[SC_EXPBOOST]) 
     
    43084310        if (!bonus) 
    43094311                return; 
    4310  
     4312         
    43114313        *base_exp += (unsigned int) cap_value((double)*base_exp * bonus/100., 1, UINT_MAX); 
    43124314        *job_exp += (unsigned int) cap_value((double)*job_exp * bonus/100., 1, UINT_MAX); 
     
    43374339        nextb = pc_nextbaseexp(sd); 
    43384340        nextj = pc_nextjobexp(sd); 
    4339  
     4341                 
    43404342        if(sd->state.showexp || battle_config.max_exp_gain_rate){ 
    43414343                if (nextb > 0) 
     
    43594361                } 
    43604362        } 
    4361  
     4363         
    43624364        //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] 
    43634365        if (base_exp) { 
     
    45254527 
    45264528        max = pc_maxparameter(sd); 
    4527  
     4529         
    45284530        switch(type){ 
    45294531        case SP_STR: sd->status.str = cap_value(sd->status.str + val, 1, max); break; 
     
    46254627        } 
    46264628        status_calc_pc(sd,0); 
    4627         //Required because if you could level up all skills previously, 
     4629        //Required because if you could level up all skills previously,  
    46284630        //the update will not be sent as only the lv variable changes. 
    46294631        clif_skillinfoblock(sd); 
     
    47224724{ 
    47234725        nullpo_retr(0, sd); 
    4724  
     4726         
    47254727        if (battle_config.use_statpoint_table) 
    47264728        {       // New statpoint table used here - Dexity 
     
    47354737                if (sd->class_&JOBL_UPPER) 
    47364738                        stat+=52;       // extra 52+48=100 stat points 
    4737  
     4739                 
    47384740                if (stat > USHRT_MAX) 
    47394741                        sd->status.status_point = USHRT_MAX; 
     
    47754777        clif_updatestatus(sd,SP_UDEX); 
    47764778        clif_updatestatus(sd,SP_ULUK);  // End Addition 
    4777  
     4779         
    47784780        clif_updatestatus(sd,SP_STATUSPOINT); 
    47794781        status_calc_pc(sd,0); 
     
    48104812                        merc_hom_vaporize(sd, 0); 
    48114813        } 
    4812  
     4814         
    48134815        for (i = 1; i < MAX_SKILL; i++) { 
    48144816                lv= sd->status.skill[i].lv; 
     
    48394841                } 
    48404842        } 
    4841  
     4843         
    48424844        if (flag&2 || !skill_point) return skill_point; 
    48434845 
     
    49454947        if(!src || src == &sd->bl) 
    49464948                return; 
    4947  
     4949         
    49484950        if(sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support) 
    49494951                pet_target_check(sd,src,1); 
     
    49574959        int i=0,j=0,k=0; 
    49584960        unsigned int tick = gettick(); 
    4959  
     4961                 
    49604962        if(sd->vender_id) 
    49614963                vending_closevending(sd); 
     
    49814983        } 
    49824984 
    4983         if(sd->status.hom_id > 0)       //orn 
     4985        if(sd->status.hom_id > 0 && battle_config.homunculus_auto_vapor)        //orn 
    49844986                merc_hom_vaporize(sd, 0); 
    49854987 
     
    50525054                        // karma going down = more 'good' / more honourable. 
    50535055                        // The Karma System way... 
    5054  
     5056                 
    50555057                        if (sd->status.karma > ssd->status.karma) {     // If player killed was more evil 
    50565058                                sd->status.karma--; 
     
    50595061                        else if (sd->status.karma < ssd->status.karma)  // If player killed was more good 
    50605062                                ssd->status.karma++; 
    5061  
     5063         
    50625064 
    50635065                        // or the PK System way... 
    5064  
     5066         
    50655067                        if (sd->status.karma > 0)       // player killed is dishonourable? 
    50665068                                ssd->status.karma--; // honour points earned 
    50675069                        sd->status.karma++;     // honour points lost 
    5068  
     5070                 
    50695071                        // To-do: Receive exp on certain occasions 
    50705072#endif 
     
    53135315                                stat += (sd->status.base_level + i + 14) / 5 ; 
    53145316                        if (sd->status.status_point > USHRT_MAX - stat) 
    5315  
     5317                                 
    53165318                                sd->status.status_point = USHRT_MAX; 
    53175319                        else 
     
    55155517                        status_percent_damage(NULL, &sd->bl, hp, 0, hp==-100); 
    55165518        } 
    5517  
     5519         
    55185520        if(sp) { 
    55195521                if(sp > 0) 
     
    55475549        switch (upper) { 
    55485550                case 1: 
    5549                         b_class|= JOBL_UPPER; 
     5551                        b_class|= JOBL_UPPER;  
    55505552                        break; 
    55515553                case 2: 
     
    55545556        } 
    55555557        //This will automatically adjust bard/dancer classes to the correct gender 
    5556         //That is, if you try to jobchange into dancer, it will turn you to bard. 
     5558        //That is, if you try to jobchange into dancer, it will turn you to bard.        
    55575559        job = pc_mapid2jobid(b_class, sd->status.sex); 
    55585560        if (job == -1) 
    55595561                return 1; 
    5560  
     5562         
    55615563        if ((unsigned short)b_class == sd->class_) 
    55625564                return 1; //Nothing to change. 
     
    55865588                } 
    55875589        } 
    5588  
     5590         
    55895591        sd->status.class_ = job; 
    55905592        fame_flag = pc_famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK); 
     
    56025604        } 
    56035605 
    5604         //Change look, if disguised, you need to undisguise 
     5606        //Change look, if disguised, you need to undisguise  
    56055607        //to correctly calculate new job sprite without 
    56065608        if (sd->disguise) 
     
    56305632        if(merc_is_hom_active(sd->hd) && !pc_checkskill(sd, AM_CALLHOMUN)) 
    56315633                merc_hom_vaporize(sd, 0); 
    5632  
     5634         
    56335635        if(sd->status.manner < 0) 
    56345636                clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner); 
     
    57895791        else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING) 
    57905792                new_look = -1; 
    5791  
     5793         
    57925794        if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING)) 
    57935795                new_look = JOB_WEDDING; 
     
    60236025        struct global_reg *sd_reg; 
    60246026        int i,max; 
    6025  
     6027         
    60266028        nullpo_retr(0, sd); 
    60276029        switch (type) { 
     
    61006102                return 1; 
    61016103        } 
    6102  
     6104         
    61036105        // delete reg 
    61046106        if (val == 0) { 
     
    61726174                return 0; 
    61736175        } 
    6174  
     6176         
    61756177        // delete reg 
    61766178        if (!val || strcmp(val,"")==0) 
     
    63666368        if(pos == EQP_ACC) { //Accesories should only go in one of the two, 
    63676369                pos = req_pos&EQP_ACC; 
    6368                 if (pos == EQP_ACC) //User specified both slots.. 
     6370                if (pos == EQP_ACC) //User specified both slots..  
    63696371                        pos = sd->equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R; 
    63706372        } 
     
    65516553        clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1); 
    65526554 
    6553         if((sd->status.inventory[n].equip & EQP_ARMS) && 
     6555        if((sd->status.inventory[n].equip & EQP_ARMS) &&  
    65546556                sd->weapontype1 == 0 && sd->weapontype2 == 0 && (!sd->sc.data[SC_SEVENWIND] || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!) 
    65556557                skill_enchant_elemental_end(&sd->bl,-1); 
     
    66076609        if (sd->vender_id) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam) 
    66086610                return 0; 
    6609  
     6611         
    66106612        // ŠŽ•i‹ó‚«‹l‚ß 
    66116613        for(i=j=0;i<MAX_INVENTORY;i++){ 
     
    68526854                        hp = sd->battle_status.hp-1; //Script drains cannot kill you. 
    68536855        } 
    6854  
     6856         
    68556857        if (sd->sp_loss.value) { 
    68566858                sd->sp_loss.tick += diff_tick; 
     
    68816883                } 
    68826884        } 
    6883  
     6885         
    68846886        if (sd->sp_regen.value) { 
    68856887                sd->sp_regen.tick += diff_tick; 
     
    69876989        if (data == 0 && battle_config.day_duration <= 0)       // if we want a day 
    69886990                return 0; 
    6989  
     6991         
    69906992        if (!night_flag) 
    69916993                return 0; //Already day. 
    6992  
     6994         
    69936995        night_flag = 0; // 0=day, 1=night [Yor] 
    69946996        map_foreachpc(pc_daynight_timer_sub); 
     
    70087010        if (data == 0 && battle_config.night_duration <= 0)     // if we want a night 
    70097011                return 0; 
    7010  
     7012         
    70117013        if (night_flag) 
    70127014                return 0; //Already nigth. 
     
    70377039        time_t timer; 
    70387040        struct tm *t; 
    7039  
     7041         
    70407042        time(&timer); 
    70417043        t = localtime(&timer); 
    7042  
    7043         pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min); 
     7044         
     7045        pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);  
    70447046        return; 
    70457047} 
     
    70507052        time_t timer; 
    70517053        struct tm *t; 
    7052  
     7054         
    70537055        time(&timer); 
    70547056    t = localtime(&timer); 
    7055  
     7057         
    70567058        diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "PC_LAST_DUEL_TIME"); 
    7057  
     7059         
    70587060        return !(diff >= 0 && diff < battle_config.duel_time_interval); 
    70597061} 
     
    70657067 
    70667068        if (sd->duel_group != ssd->duel_group) return 0; 
    7067  
     7069         
    70687070        sprintf(output, "      %d. %s", ++(*p), sd->status.name); 
    70697071        clif_disp_onlyself(ssd, output, strlen(output)); 
     
    70977099        int i=1; 
    70987100        char output[256]; 
    7099  
     7101         
    71007102        while(duel_list[i].members_count > 0 && i < MAX_DUEL) i++; 
    71017103        if(i == MAX_DUEL) return 0; 
    7102  
     7104         
    71037105        duel_count++; 
    71047106        sd->duel_group = i; 
     
    71067108        duel_list[i].invites_count = 0; 
    71077109        duel_list[i].max_players_limit = maxpl; 
    7108  
     7110         
    71097111        strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --" 
    71107112        clif_disp_onlyself(sd, output, strlen(output)); 
    7111  
     7113         
    71127114        clif_set0199(sd, 1); 
    71137115        //clif_misceffect2(&sd->bl, 159); 
     
    71257127        target_sd->duel_invite = did; 
    71267128        duel_list[did].invites_count++; 
    7127  
     7129         
    71287130        // "Blue -- Player %s invites you to PVP duel (@accept/@reject) --" 
    71297131        sprintf(output, msg_txt(374), sd->status.name); 
     
    71437145{ 
    71447146        char output[256]; 
    7145  
     7147         
    71467148        // " <- Player %s has left duel --" 
    71477149        sprintf(output, msg_txt(375), sd->status.name); 
    71487150        clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); 
    7149  
     7151         
    71507152        duel_list[did].members_count--; 
    7151  
     7153         
    71527154        if(duel_list[did].members_count == 0) { 
    7153                 map_foreachpc(duel_leave_sub, did); 
     7155                map_foreachpc(duel_leave_sub, did);  
    71547156                duel_count--; 
    71557157        } 
    7156  
     7158         
    71577159        sd->duel_group = 0; 
    71587160        duel_savetime(sd); 
     
    71647166{ 
    71657167        char output[256]; 
    7166  
     7168         
    71677169        duel_list[did].members_count++; 
    71687170        sd->duel_group = sd->duel_invite; 
    71697171        duel_list[did].invites_count--; 
    71707172        sd->duel_invite = 0; 
    7171  
     7173         
    71727174        // " -> Player %s has accepted duel --" 
    71737175        sprintf(output, msg_txt(376), sd->status.name); 
     
    71827184{ 
    71837185        char output[256]; 
    7184  
     7186         
    71857187        // " -- Player %s has rejected duel --" 
    71867188        sprintf(output, msg_txt(377), sd->status.name); 
    71877189        clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS); 
    7188  
     7190         
    71897191        duel_list[did].invites_count--; 
    71907192        sd->duel_invite = 0; 
     
    72847286                if (pc_split_str(line,split,4) < 4) 
    72857287                        continue; 
    7286  
     7288                 
    72877289                job_count = pc_split_atoi(split[1],jobs,':',CLASS_COUNT); 
    72887290                if (job_count < 1) 
     
    73037305                        maxlv = MAX_LEVEL; 
    73047306                } 
    7305  
     7307                 
    73067308                job = jobs[0] = pc_class2idx(job_id); 
    73077309                //We send one less and then one more because the last entry in the exp array should hold 0. 
     
    74647466                        if (i > MAX_LEVEL) 
    74657467                                break; 
    7466                         statp[i]=j; 
     7468                        statp[i]=j;                      
    74677469                        i++; 
    74687470                } 
     
    74737475        for (; i <= MAX_LEVEL; i++) { 
    74747476                j += (i+15)/5; 
    7475                 statp[i] = j; 
     7477                statp[i] = j;            
    74767478        } 
    74777479 
     
    75057507        else 
    75067508                ShowWarning("In function pc_read_motd() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt); 
    7507  
     7509         
    75087510        return 0; 
    75097511}