Index: src/map/pc.c
===================================================================
--- src/map/pc.c (revision 22)
+++ src/map/pc.c (revision 24)
@@ -133,5 +133,5 @@
 }
 
-void pc_setinvincibletimer(struct map_session_data* sd, int val)
+void pc_setinvincibletimer(struct map_session_data* sd, int val) 
 {
 	nullpo_retv(sd);
@@ -258,5 +258,5 @@
 		case MAPID_TAEKWON: // Taekwon
 			clif_fame_taekwon(sd,count);
-			break;
+			break;	
 	}
 	chrif_updatefamelist(sd);
@@ -267,5 +267,5 @@
 {
 	int i;
-
+	
 	switch(job){
 		case MAPID_BLACKSMITH: // Blacksmith
@@ -330,8 +330,8 @@
 		sd->status.clothes_color=0;
 
-  	//Only copy the Cart/Peco/Falcon options, the rest are handled via
+  	//Only copy the Cart/Peco/Falcon options, the rest are handled via 
 	//status change load/saving. [Skotlex]
 	sd->status.option = sd->sc.option&(OPTION_CART|OPTION_FALCON|OPTION_RIDING);
-
+		
 	if (sd->sc.data[SC_JAILED])
 	{	//When Jailed, do not move last point.
@@ -403,5 +403,5 @@
 	if (!itemdb_isequip2(sd->inventory_data[n]))
 		return 0; //Not equippable by players.
-
+	
 	ep = sd->inventory_data[n]->equip;
 	if(sd->inventory_data[n]->look == W_DAGGER	||
@@ -518,5 +518,5 @@
 	if (itemdb_isspecial(item->card[0]))
 		return 1;
-
+	
 	ARR_FIND( 0, s, i, item->card[i] && (data = itemdb_exists(item->card[i])) != NULL && data->flag.no_equip&flag );
 	return( i < s ) ? 0 : 1;
@@ -535,5 +535,5 @@
 		if( i == EQI_HEAD_MID && sd->equip_index[EQI_HEAD_LOW] == index ) continue;
 		if( i == EQI_HEAD_TOP && (sd->equip_index[EQI_HEAD_MID] == index || sd->equip_index[EQI_HEAD_LOW] == index) ) continue;
-
+	
 		if( !sd->inventory_data[index] ) continue;
 
@@ -568,5 +568,5 @@
 	// Parents need to have their ring equipped
 	if( !pc_isequipped(p1_sd, WEDDING_RING_M) && !pc_isequipped(p1_sd, WEDDING_RING_F) )
-		return false;
+		return false; 
 
 	if( !pc_isequipped(p2_sd, WEDDING_RING_M) && !pc_isequipped(p2_sd, WEDDING_RING_F) )
@@ -603,5 +603,5 @@
 	int job, joblevel;
 	unsigned int jobexp;
-
+	
 	if( !pc_can_Adopt(p1_sd, p2_sd, b_sd) )
 		return false;
@@ -632,5 +632,5 @@
 		pc_skill(p1_sd, WE_CALLBABY, 1, 0);
 		pc_skill(p2_sd, WE_CALLBABY, 1, 0);
-
+		
 		return true;
 	}
@@ -660,5 +660,5 @@
 		return 0;
 	if(map_flag_gvg(sd->bl.m) && ((item->flag.no_equip&2) || !pc_isAllowedCardOn(sd,item->slot,n,2)))
-		return 0;
+		return 0; 
 	if(map[sd->bl.m].flag.restricted)
 	{
@@ -669,5 +669,5 @@
 
 	if (sd->sc.count) {
-
+			
 		if(item->equip & EQP_ARMS && item->type == IT_WEAPON && sd->sc.data[SC_STRIPWEAPON]) // Also works with left-hand weapons [DracoRPG]
 			return 0;
@@ -698,5 +698,5 @@
 	if (!(1<<(sd->class_&MAPID_BASEMASK)&item->class_base[(sd->class_&JOBL_2_1)?1:((sd->class_&JOBL_2_2)?2:0)]))
 		return 0;
-
+	
 	//Not equipable by upper class. [Skotlex]
 	if(!(1<<((sd->class_&JOBL_UPPER)?1:((sd->class_&JOBL_BABY)?2:0))&item->class_upper))
@@ -730,5 +730,5 @@
 		sd->class_ = MAPID_NOVICE;
 	} else
-		sd->class_ = i;
+		sd->class_ = i; 
 	//Initializations to null/0 unneeded since map_session_data was filled with 0 upon allocation.
 	if(!sd->status.hp) pc_setdead(sd);
@@ -739,5 +739,5 @@
 	sd->npc_timer_id = -1;
 	sd->pvp_timer = -1;
-
+	
 	sd->canuseitem_tick = tick;
 	sd->cantalk_tick = tick;
@@ -754,15 +754,18 @@
 	if (battle_config.disp_zeny)
 		sd->state.showzeny = 1;
+//Checks the battleflags to see if player has selected to see summon's stats.
+//I see nothing wrong here.
 	//Vanaheim settings [Brainstorm]
 	if (battle_config.disp_summon_stats) // Battle Flag to Show Summoned Monster Stats [Brain]
-	sd->state.showsummon = 1;
-
+		sd->state.showsummon = 1;
+
+	
 	if (!(battle_config.display_skill_fail&2))
 		sd->state.showdelay = 1;
-
+		
 	// ACe`FbN
 	pc_setinventorydata(sd);
 	pc_checkitem(sd);
-
+	
 	status_change_init(&sd->bl);
 	if ((battle_config.atc_gmonly == 0 || pc_isGM(sd)) && (pc_isGM(sd) >= get_atcommand_level(atcommand_hide)))
@@ -819,5 +822,5 @@
 				sd->packet_ver, CONVIP(ip));
 	}
-
+	
 	// Send friends list
 	clif_friendslist_send(sd);
@@ -866,5 +869,5 @@
 }
 
-//Attempts to set a mob.
+//Attempts to set a mob. 
 int pc_set_hate_mob(struct map_session_data *sd, int pos, struct block_list *bl)
 {
@@ -898,5 +901,5 @@
 {
 	int i,j;
-
+	
 	sd->change_level = pc_readglobalreg(sd,"jobchange_level");
 	sd->die_counter = pc_readglobalreg(sd,"PC_DIE_COUNTER");
@@ -932,5 +935,5 @@
 			if (i < sd->status.skill[sd->cloneskill_id].lv)
 				sd->status.skill[sd->cloneskill_id].lv = i;
-			sd->status.skill[sd->cloneskill_id].flag = 13;	//cloneskill flag
+			sd->status.skill[sd->cloneskill_id].flag = 13;	//cloneskill flag			
 		}
 	}
@@ -945,5 +948,5 @@
 	if (sd->status.guild_id)
 		guild_member_joined(sd);
-
+	
 	// pet
 	if (sd->status.pet_id > 0)
@@ -1016,11 +1019,11 @@
 	}
 	c = pc_class2idx(c);
-	for(i=0;i<MAX_SKILL;i++){
+	for(i=0;i<MAX_SKILL;i++){ 
 		if (sd->status.skill[i].flag != 13) //Don't touch plagiarized skills
 			sd->status.skill[i].id=0; //First clear skills.
 	}
 
-	for(i=0;i<MAX_SKILL;i++){
-		if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills.
+	for(i=0;i<MAX_SKILL;i++){ 
+		if (sd->status.skill[i].flag && sd->status.skill[i].flag != 13){ //Restore original level of skills after deleting earned skills.	
 			sd->status.skill[i].lv=(sd->status.skill[i].flag==1)?0:sd->status.skill[i].flag-2;
 			sd->status.skill[i].flag=0;
@@ -1111,5 +1114,5 @@
 				sd->status.skill[id].flag=1; //So it is not saved, and tagged as a "bonus" skill.
 			} else
-				sd->status.skill[id].flag=sd->status.skill[id].lv+2;
+				sd->status.skill[id].flag=sd->status.skill[id].lv+2; 
 			sd->status.skill[id].lv= skill_tree_get_max(id, sd->status.class_);
 		}
@@ -1127,5 +1130,5 @@
 	if(battle_config.skillfree)
 		return; //Function serves no purpose if this is set
-
+	
 	i = pc_calc_skilltree_normalize_job(sd);
 	c = pc_mapid2jobid(i, sd->status.sex);
@@ -1142,5 +1145,5 @@
 			if(sd->status.skill[id].id) //Already learned
 				continue;
-
+			
 			for(j=0;j<5;j++) {
 				if((k=skill_tree[c][i].need[j].id))
@@ -1163,5 +1166,5 @@
 			if (sd->status.job_level < skill_tree[c][i].joblv)
 				continue;
-
+			
 			j = skill_get_inf2(id);
 			if(!sd->status.skill[id].lv && (
@@ -1202,8 +1205,8 @@
 	int skill_point;
 	int c = sd->class_;
-
+	
 	if (!battle_config.skillup_limit)
 		return c;
-
+	
 	skill_point = pc_calc_skillpoint(sd);
 	if(pc_checkskill(sd, NV_BASIC) < 9) //Consider Novice Tree when you don't have NV_BASIC maxed.
@@ -1611,10 +1614,10 @@
 			break;
 		val += (int)status->max_hp;
-		//Negative bonuses will underflow, this will be handled in status_calc_pc through casting
+		//Negative bonuses will underflow, this will be handled in status_calc_pc through casting 
 		//If this is called outside of status_calc_pc, you'd better pray they do not underflow and end with UINT_MAX max_hp.
 		status->max_hp = (unsigned int)val;
 		break;
 	case SP_MAXSP:
-		if(sd->state.lr_flag == 2)
+		if(sd->state.lr_flag == 2) 
 			break;
 		val += (int)status->max_sp;
@@ -1658,13 +1661,7 @@
 		}
 		break;
-	case SP_ADD_SPEED:	//Raw increase
-		if(sd->state.lr_flag != 2) {
-			bonus = status->speed - val;
-			status->speed = cap_value(bonus, 0, USHRT_MAX);
-		}
-		break;
 	case SP_SPEED_RATE:	//Non stackable increase
-		if(sd->state.lr_flag != 2 && sd->speed_rate > 100-val)
-			sd->speed_rate = 100-val;
+		if(sd->state.lr_flag != 2)
+			sd->speed_rate = min(sd->speed_rate, -val);
 		break;
 	case SP_SPEED_ADDRATE:	//Stackable increase
@@ -2674,8 +2671,8 @@
 	if(idx_card < 0 || idx_card >= MAX_INVENTORY || !sd->inventory_data[idx_card])
 		return 0; //Invalid card index.
-
+			
 	if(idx_equip < 0 || idx_equip >= MAX_INVENTORY || !sd->inventory_data[idx_equip])
 		return 0; //Invalid item index.
-
+	
 	nameid=sd->status.inventory[idx_equip].nameid;
 	cardid=sd->status.inventory[idx_card].nameid;
@@ -2902,5 +2899,5 @@
 	if(amount > MAX_AMOUNT)
 		return 5;
-
+	
 	data = itemdb_search(item_data->nameid);
 	w = data->weight*amount;
@@ -2997,10 +2994,10 @@
 		return 0; //Can't drop items in nodrop mapflag maps.
 	}
-
+	
 	if (!pc_candrop(sd,&sd->status.inventory[n])) {
 		clif_displaymessage (sd->fd, msg_txt(263));
 		return 0;
 	}
-
+	
 	//Logs items, dropped by (P)layers [Lupus]
 	if(log_config.enable_logs&0x8)
@@ -3010,5 +3007,5 @@
 	if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2))
 		return 0;
-
+	
 	pc_delitem(sd, n, amount, 0);
 	return 1;
@@ -3033,5 +3030,5 @@
 	if (sd->status.party_id)
 		p = party_search(sd->status.party_id);
-
+	
 	if(fitem->first_get_charid > 0 && fitem->first_get_charid != sd->status.char_id)
   	{
@@ -3123,5 +3120,5 @@
 	if ((nameid == 605 || nameid == 606) && pc_issit(sd))
 		return 0;
-
+	  
 	//added item_noequip.txt items check by Maya&[Lupus]
 	if (
@@ -3145,5 +3142,5 @@
 	))
 		return 0;
-
+	
 	//Not usable by upper class. [Skotlex]
 	if(!(
@@ -3329,5 +3326,5 @@
 	if (idx < 0 || idx >= MAX_INVENTORY) //Invalid index check [Skotlex]
 		return 1;
-
+	
 	item_data = &sd->status.inventory[idx];
 
@@ -3369,5 +3366,5 @@
 	if (idx < 0 || idx >= MAX_CART) //Invalid index check [Skotlex]
 		return 1;
-
+	
 	item_data=&sd->status.cart[idx];
 
@@ -3421,5 +3418,5 @@
 	if(md->state.steal_flag == UCHAR_MAX || md->sc.opt1) //already stolen from / status change check
 		return 0;
-
+	
 	sd_status= status_get_status_data(&sd->bl);
 	md_status= status_get_status_data(bl);
@@ -3438,5 +3435,5 @@
 	rate = (sd_status->dex - md_status->dex)/2 + lv*6 + 4;
 	rate += sd->add_steal_rate;
-
+		
 	if( rate < 1 )
 		return 0;
@@ -3464,5 +3461,5 @@
 		return 0;
 	}
-
+	
 	if(battle_config.show_steal_in_same_party)
 		party_foreachsamemap(pc_show_steal,sd,AREA_SIZE,sd,tmp_item.nameid);
@@ -3473,5 +3470,5 @@
 		log_pick_pc(sd, "P", itemid, 1, NULL);
 	}
-
+		
 	//A Rare Steal Global Announce by Lupus
 	if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) {
@@ -3604,5 +3601,5 @@
 		//Tag player for rewarping after map-loading is done. [Skotlex]
 		sd->state.rewarp = 1;
-
+	
 	sd->mapindex =  mapindex;
 	sd->bl.m = m;
@@ -3762,5 +3759,5 @@
 	if(!sd->sc.count)
 		return 0;
-
+	
 	for (i = 0; i < ARRAYLENGTH(scw_list); i++)
 	{	// Skills requiring specific weapon types
@@ -3769,9 +3766,9 @@
 			status_change_end(&sd->bl,scw_list[i],-1);
 	}
-
+	
 	if(sd->sc.data[SC_SPURT] && sd->status.weapon)
 		// Spurt requires bare hands (feet, in fact xD)
 		status_change_end(&sd->bl,SC_SPURT,-1);
-
+	
 	if(sd->status.shield <= 0) { // Skills requiring a shield
 		for (i = 0; i < ARRAYLENGTH(scs_list); i++)
@@ -3861,10 +3858,10 @@
 			class_ |= MAPID_THIEF;
 			break;
-
+			
 		case JOB_STAR_GLADIATOR:
 		case JOB_STAR_GLADIATOR2:
 			class_ |= JOBL_2_1;
 			class_ |= MAPID_TAEKWON;
-			break;
+			break;	
 		case JOB_SOUL_LINKER:
 			class_ |= JOBL_2_2;
@@ -3890,9 +3887,9 @@
 			class_ = MAPID_SUMMER;
 			break;
-			//Possible to be in the wrong spot?
+//This is where your errors begin.
 		case JOB_NECROMANCER: // Necromancer [Brain]
 			class_ |= JOBL_2_1;
 			class_ |= MAPID_ADEPT;
-			break;
+			break;	
 		case JOB_WARLOCK: // Warlock [Brain]
 			class_ |= JOBL_2_2;
@@ -3923,4 +3920,5 @@
 		case MAPID_XMAS:            return JOB_XMAS;
 		case MAPID_SUMMER:          return JOB_SUMMER;
+		// double check this too.
 		case MAPID_ADEPT:			return JOB_ADEPT; // Adept [Brain]
 	//2_1 classes
@@ -3933,4 +3931,5 @@
 		case MAPID_ASSASSIN:        return JOB_ASSASSIN;
 		case MAPID_STAR_GLADIATOR:  return JOB_STAR_GLADIATOR;
+		//and this
 		case MAPID_NECROMANCER:		return JOB_NECROMANCER; // Necromancer [Brain]
 	//2_2 classes
@@ -3942,4 +3941,5 @@
 		case MAPID_ROGUE:           return JOB_ROGUE;
 		case MAPID_SOUL_LINKER:     return JOB_SOUL_LINKER;
+		//this too
 		case MAPID_WARLOCK:			return JOB_WARLOCK; // Warlock [Brain]
 	//1-1: advanced
@@ -4007,5 +4007,5 @@
 	case JOB_THIEF:
 		return msg_txt(550 - JOB_NOVICE+class_);
-
+		
 	case JOB_KNIGHT:
 	case JOB_PRIEST:
@@ -4015,8 +4015,8 @@
 	case JOB_ASSASSIN:
 		return msg_txt(557 - JOB_KNIGHT+class_);
-
+		
 	case JOB_KNIGHT2:
 		return msg_txt(557);
-
+		
 	case JOB_CRUSADER:
 	case JOB_MONK:
@@ -4027,8 +4027,8 @@
 	case JOB_DANCER:
 		return msg_txt(563 - JOB_CRUSADER+class_);
-
+			
 	case JOB_CRUSADER2:
 		return msg_txt(563);
-
+		
 	case JOB_WEDDING:
 	case JOB_SUPER_NOVICE:
@@ -4056,8 +4056,8 @@
 	case JOB_ASSASSIN_CROSS:
 		return msg_txt(582 - JOB_LORD_KNIGHT+class_);
-
+		
 	case JOB_LORD_KNIGHT2:
 		return msg_txt(582);
-
+		
 	case JOB_PALADIN:
 	case JOB_CHAMPION:
@@ -4068,5 +4068,5 @@
 	case JOB_GYPSY:
 		return msg_txt(588 - JOB_PALADIN + class_);
-
+		
 	case JOB_PALADIN2:
 		return msg_txt(588);
@@ -4080,5 +4080,5 @@
 	case JOB_BABY_THIEF:
 		return msg_txt(595 - JOB_BABY + class_);
-
+		
 	case JOB_BABY_KNIGHT:
 	case JOB_BABY_PRIEST:
@@ -4088,8 +4088,8 @@
 	case JOB_BABY_ASSASSIN:
 		return msg_txt(602 - JOB_BABY_KNIGHT + class_);
-
+		
 	case JOB_BABY_KNIGHT2:
 		return msg_txt(602);
-
+		
 	case JOB_BABY_CRUSADER:
 	case JOB_BABY_MONK:
@@ -4100,11 +4100,11 @@
 	case JOB_BABY_DANCER:
 		return msg_txt(608 - JOB_BABY_CRUSADER +class_);
-
+		
 	case JOB_BABY_CRUSADER2:
 		return msg_txt(608);
-
+		
 	case JOB_SUPER_BABY:
 		return msg_txt(615);
-
+		
 	case JOB_TAEKWON:
 		return msg_txt(616);
@@ -4114,11 +4114,12 @@
 	case JOB_SOUL_LINKER:
 		return msg_txt(618);
-
+		
 	case JOB_GUNSLINGER:
 		return msg_txt(619);
 	case JOB_NINJA:
 		return msg_txt(620);
+//message display for job change?
 	case JOB_ADEPT: // Adept [Brain]
-		return msg_txt(1000);
+		return msg_txt(1000);//have to add these to the msg_txt in the conf?
 	case JOB_NECROMANCER: // Necromancer [Brain]
 		return msg_txt(1001);
@@ -4126,4 +4127,5 @@
 		return msg_txt(1002);
 
+	
 	default:
 		return msg_txt(650);
@@ -4219,5 +4221,5 @@
 		if (sd->status.status_point > USHRT_MAX - next)
 			sd->status.status_point = USHRT_MAX;
-		else
+		else	
 			sd->status.status_point += next;
 
@@ -4226,5 +4228,5 @@
 	if (battle_config.pet_lv_rate && sd->pd)	//<Skotlex> update pet's level
 		status_calc_pet(sd->pd,0);
-
+	
 	clif_updatestatus(sd,SP_STATUSPOINT);
 	clif_updatestatus(sd,SP_BASELEVEL);
@@ -4296,10 +4298,10 @@
 
 	if (sd->expaddrace[status->race])
-		bonus += sd->expaddrace[status->race];
+		bonus += sd->expaddrace[status->race];	
 	bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS];
-
-	if (battle_config.pk_mode &&
+	
+	if (battle_config.pk_mode && 
 		(int)(status_get_lv(src) - sd->status.base_level) >= 20)
-		bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]
+		bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris]	
 
 	if (sd->sc.data[SC_EXPBOOST])
@@ -4308,5 +4310,5 @@
 	if (!bonus)
 	  	return;
-
+	
 	*base_exp += (unsigned int) cap_value((double)*base_exp * bonus/100., 1, UINT_MAX);
 	*job_exp += (unsigned int) cap_value((double)*job_exp * bonus/100., 1, UINT_MAX);
@@ -4337,5 +4339,5 @@
 	nextb = pc_nextbaseexp(sd);
 	nextj = pc_nextjobexp(sd);
-
+		
 	if(sd->state.showexp || battle_config.max_exp_gain_rate){
 		if (nextb > 0)
@@ -4359,5 +4361,5 @@
 		}
 	}
-
+	
 	//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]
 	if (base_exp) {
@@ -4525,5 +4527,5 @@
 
 	max = pc_maxparameter(sd);
-
+	
 	switch(type){
 	case SP_STR: sd->status.str = cap_value(sd->status.str + val, 1, max); break;
@@ -4625,5 +4627,5 @@
 	}
 	status_calc_pc(sd,0);
-	//Required because if you could level up all skills previously,
+	//Required because if you could level up all skills previously, 
 	//the update will not be sent as only the lv variable changes.
 	clif_skillinfoblock(sd);
@@ -4722,5 +4724,5 @@
 {
 	nullpo_retr(0, sd);
-
+	
 	if (battle_config.use_statpoint_table)
 	{	// New statpoint table used here - Dexity
@@ -4735,5 +4737,5 @@
 		if (sd->class_&JOBL_UPPER)
 			stat+=52;	// extra 52+48=100 stat points
-
+		
 		if (stat > USHRT_MAX)
 			sd->status.status_point = USHRT_MAX;
@@ -4775,5 +4777,5 @@
 	clif_updatestatus(sd,SP_UDEX);
 	clif_updatestatus(sd,SP_ULUK);	// End Addition
-
+	
 	clif_updatestatus(sd,SP_STATUSPOINT);
 	status_calc_pc(sd,0);
@@ -4810,5 +4812,5 @@
 			merc_hom_vaporize(sd, 0);
 	}
-
+	
 	for (i = 1; i < MAX_SKILL; i++) {
 		lv= sd->status.skill[i].lv;
@@ -4839,5 +4841,5 @@
 		}
 	}
-
+	
 	if (flag&2 || !skill_point) return skill_point;
 
@@ -4945,5 +4947,5 @@
 	if(!src || src == &sd->bl)
 		return;
-
+	
 	if(sd->status.pet_id > 0 && sd->pd && battle_config.pet_damage_support)
 		pet_target_check(sd,src,1);
@@ -4957,5 +4959,5 @@
 	int i=0,j=0,k=0;
 	unsigned int tick = gettick();
-
+		
 	if(sd->vender_id)
 		vending_closevending(sd);
@@ -4981,5 +4983,5 @@
 	}
 
-	if(sd->status.hom_id > 0)	//orn
+	if(sd->status.hom_id > 0 && battle_config.homunculus_auto_vapor)	//orn
 		merc_hom_vaporize(sd, 0);
 
@@ -5052,5 +5054,5 @@
 			// karma going down = more 'good' / more honourable.
 			// The Karma System way...
-
+		
 			if (sd->status.karma > ssd->status.karma) {	// If player killed was more evil
 				sd->status.karma--;
@@ -5059,12 +5061,12 @@
 			else if (sd->status.karma < ssd->status.karma)	// If player killed was more good
 				ssd->status.karma++;
-
+	
 
 			// or the PK System way...
-
+	
 			if (sd->status.karma > 0)	// player killed is dishonourable?
 				ssd->status.karma--; // honour points earned
 			sd->status.karma++;	// honour points lost
-
+		
 			// To-do: Receive exp on certain occasions
 #endif
@@ -5313,5 +5315,5 @@
 				stat += (sd->status.base_level + i + 14) / 5 ;
 			if (sd->status.status_point > USHRT_MAX - stat)
-
+				
 				sd->status.status_point = USHRT_MAX;
 			else
@@ -5515,5 +5517,5 @@
 			status_percent_damage(NULL, &sd->bl, hp, 0, hp==-100);
 	}
-
+	
 	if(sp) {
 		if(sp > 0)
@@ -5547,5 +5549,5 @@
 	switch (upper) {
 		case 1:
-			b_class|= JOBL_UPPER;
+			b_class|= JOBL_UPPER; 
 			break;
 		case 2:
@@ -5554,9 +5556,9 @@
 	}
 	//This will automatically adjust bard/dancer classes to the correct gender
-	//That is, if you try to jobchange into dancer, it will turn you to bard.
+	//That is, if you try to jobchange into dancer, it will turn you to bard.	
 	job = pc_mapid2jobid(b_class, sd->status.sex);
 	if (job == -1)
 		return 1;
-
+	
 	if ((unsigned short)b_class == sd->class_)
 		return 1; //Nothing to change.
@@ -5586,5 +5588,5 @@
 		}
 	}
-
+	
 	sd->status.class_ = job;
 	fame_flag = pc_famerank(sd->status.char_id,sd->class_&MAPID_UPPERMASK);
@@ -5602,5 +5604,5 @@
 	}
 
-	//Change look, if disguised, you need to undisguise
+	//Change look, if disguised, you need to undisguise 
 	//to correctly calculate new job sprite without
 	if (sd->disguise)
@@ -5630,5 +5632,5 @@
 	if(merc_is_hom_active(sd->hd) && !pc_checkskill(sd, AM_CALLHOMUN))
 		merc_hom_vaporize(sd, 0);
-
+	
 	if(sd->status.manner < 0)
 		clif_changestatus(&sd->bl,SP_MANNER,sd->status.manner);
@@ -5789,5 +5791,5 @@
 	else if (!(type&OPTION_FLYING) && p_type&OPTION_FLYING)
 		new_look = -1;
-
+	
 	if (type&OPTION_WEDDING && !(p_type&OPTION_WEDDING))
 		new_look = JOB_WEDDING;
@@ -6023,5 +6025,5 @@
 	struct global_reg *sd_reg;
 	int i,max;
-
+	
 	nullpo_retr(0, sd);
 	switch (type) {
@@ -6100,5 +6102,5 @@
 		return 1;
 	}
-
+	
 	// delete reg
 	if (val == 0) {
@@ -6172,5 +6174,5 @@
 		return 0;
 	}
-
+	
 	// delete reg
 	if (!val || strcmp(val,"")==0)
@@ -6366,5 +6368,5 @@
 	if(pos == EQP_ACC) { //Accesories should only go in one of the two,
 		pos = req_pos&EQP_ACC;
-		if (pos == EQP_ACC) //User specified both slots..
+		if (pos == EQP_ACC) //User specified both slots.. 
 			pos = sd->equip_index[EQI_ACC_R] >= 0 ? EQP_ACC_L : EQP_ACC_R;
 	}
@@ -6551,5 +6553,5 @@
 	clif_unequipitemack(sd,n,sd->status.inventory[n].equip,1);
 
-	if((sd->status.inventory[n].equip & EQP_ARMS) &&
+	if((sd->status.inventory[n].equip & EQP_ARMS) && 
 		sd->weapontype1 == 0 && sd->weapontype2 == 0 && (!sd->sc.data[SC_SEVENWIND] || sd->sc.data[SC_ASPERSIO])) //Check for seven wind (but not level seven!)
 		skill_enchant_elemental_end(&sd->bl,-1);
@@ -6607,5 +6609,5 @@
 	if (sd->vender_id) //Avoid reorganizing items when we are vending, as that leads to exploits (pointed out by End of Exam)
 		return 0;
-
+	
 	// ió«lß
 	for(i=j=0;i<MAX_INVENTORY;i++){
@@ -6852,5 +6854,5 @@
 			hp = sd->battle_status.hp-1; //Script drains cannot kill you.
 	}
-
+	
 	if (sd->sp_loss.value) {
 		sd->sp_loss.tick += diff_tick;
@@ -6881,5 +6883,5 @@
 		}
 	}
-
+	
 	if (sd->sp_regen.value) {
 		sd->sp_regen.tick += diff_tick;
@@ -6987,8 +6989,8 @@
 	if (data == 0 && battle_config.day_duration <= 0)	// if we want a day
 		return 0;
-
+	
 	if (!night_flag)
 		return 0; //Already day.
-
+	
 	night_flag = 0; // 0=day, 1=night [Yor]
 	map_foreachpc(pc_daynight_timer_sub);
@@ -7008,5 +7010,5 @@
 	if (data == 0 && battle_config.night_duration <= 0)	// if we want a night
 		return 0;
-
+	
 	if (night_flag)
 		return 0; //Already nigth.
@@ -7037,9 +7039,9 @@
 	time_t timer;
 	struct tm *t;
-
+	
 	time(&timer);
 	t = localtime(&timer);
-
-	pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);
+	
+	pc_setglobalreg(sd, "PC_LAST_DUEL_TIME", t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min);	
 	return;
 }
@@ -7050,10 +7052,10 @@
 	time_t timer;
 	struct tm *t;
-
+	
 	time(&timer);
     t = localtime(&timer);
-
+	
 	diff = t->tm_mday*24*60 + t->tm_hour*60 + t->tm_min - pc_readglobalreg(sd, "PC_LAST_DUEL_TIME");
-
+	
 	return !(diff >= 0 && diff < battle_config.duel_time_interval);
 }
@@ -7065,5 +7067,5 @@
 
 	if (sd->duel_group != ssd->duel_group) return 0;
-
+	
 	sprintf(output, "      %d. %s", ++(*p), sd->status.name);
 	clif_disp_onlyself(ssd, output, strlen(output));
@@ -7097,8 +7099,8 @@
 	int i=1;
 	char output[256];
-
+	
 	while(duel_list[i].members_count > 0 && i < MAX_DUEL) i++;
 	if(i == MAX_DUEL) return 0;
-
+	
 	duel_count++;
 	sd->duel_group = i;
@@ -7106,8 +7108,8 @@
 	duel_list[i].invites_count = 0;
 	duel_list[i].max_players_limit = maxpl;
-
+	
 	strcpy(output, msg_txt(372)); // " -- Duel has been created (@invite/@leave) --"
 	clif_disp_onlyself(sd, output, strlen(output));
-
+	
 	clif_set0199(sd, 1);
 	//clif_misceffect2(&sd->bl, 159);
@@ -7125,5 +7127,5 @@
 	target_sd->duel_invite = did;
 	duel_list[did].invites_count++;
-
+	
 	// "Blue -- Player %s invites you to PVP duel (@accept/@reject) --"
 	sprintf(output, msg_txt(374), sd->status.name);
@@ -7143,16 +7145,16 @@
 {
 	char output[256];
-
+	
 	// " <- Player %s has left duel --"
 	sprintf(output, msg_txt(375), sd->status.name);
 	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
+	
 	duel_list[did].members_count--;
-
+	
 	if(duel_list[did].members_count == 0) {
-		map_foreachpc(duel_leave_sub, did);
+		map_foreachpc(duel_leave_sub, did); 
 		duel_count--;
 	}
-
+	
 	sd->duel_group = 0;
 	duel_savetime(sd);
@@ -7164,10 +7166,10 @@
 {
 	char output[256];
-
+	
 	duel_list[did].members_count++;
 	sd->duel_group = sd->duel_invite;
 	duel_list[did].invites_count--;
 	sd->duel_invite = 0;
-
+	
 	// " -> Player %s has accepted duel --"
 	sprintf(output, msg_txt(376), sd->status.name);
@@ -7182,9 +7184,9 @@
 {
 	char output[256];
-
+	
 	// " -- Player %s has rejected duel --"
 	sprintf(output, msg_txt(377), sd->status.name);
 	clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
-
+	
 	duel_list[did].invites_count--;
 	sd->duel_invite = 0;
@@ -7284,5 +7286,5 @@
 		if (pc_split_str(line,split,4) < 4)
 			continue;
-
+		
 		job_count = pc_split_atoi(split[1],jobs,':',CLASS_COUNT);
 		if (job_count < 1)
@@ -7303,5 +7305,5 @@
 			maxlv = MAX_LEVEL;
 		}
-
+		
 		job = jobs[0] = pc_class2idx(job_id);
 		//We send one less and then one more because the last entry in the exp array should hold 0.
@@ -7464,5 +7466,5 @@
 			if (i > MAX_LEVEL)
 				break;
-			statp[i]=j;
+			statp[i]=j;			
 			i++;
 		}
@@ -7473,5 +7475,5 @@
 	for (; i <= MAX_LEVEL; i++) {
 		j += (i+15)/5;
-		statp[i] = j;
+		statp[i] = j;		
 	}
 
@@ -7505,5 +7507,5 @@
 	else
 		ShowWarning("In function pc_read_motd() -> File '"CL_WHITE"%s"CL_RESET"' not found.\n", motd_txt);
-
+	
 	return 0;
 }
