Index: src/map/status.c
===================================================================
--- src/map/status.c (revision 24)
+++ src/map/status.c (revision 1)
@@ -130,6 +130,4 @@
 	set_sc( NPC_SILENCEATTACK , SC_SILENCE   , SI_BLANK    , SCB_NONE );
 	set_sc( DC_WINKCHARM      , SC_CONFUSION , SI_BLANK    , SCB_NONE );
-	//the visual effect is HALLUCINATION?!
-	set_sc( AD_PWFEAR         , SC_FEAR      , SI_HALLUCINATION , SCB_SPEED ); //Fear Status by [Brainstorm]
 	set_sc( NPC_BLINDATTACK   , SC_BLIND     , SI_BLANK    , SCB_HIT|SCB_FLEE );
 	set_sc( LK_HEADCRUSH      , SC_BLEEDING  , SI_BLEEDING , SCB_REGEN );
@@ -409,31 +407,4 @@
 	set_sc( GD_BATTLEORDER       , SC_BATTLEORDERS    , SI_BLANK           , SCB_STR|SCB_INT|SCB_DEX );
 	set_sc( GD_REGENERATION      , SC_REGENERATION    , SI_BLANK           , SCB_REGEN );
-	//Are we sure about this?
-	// Custom Jobs Skills [Brain]
-	add_sc( AD_PWBLIND           , SC_BLIND);
-	add_sc( AD_PWFEAR            , SC_FEAR);
-	set_sc( AD_LUST              , SC_LUST            , SI_JOINTBEAT       , SCB_ASPD|SCB_BATK|SCB_WATK|SCB_REGEN); 
-	set_sc( NC_DECREPIFY         , SC_DECREPIFY       , SI_BLEEDING        , SCB_SPEED|SCB_BATK|SCB_WATK|SCB_DEF2|SCB_MDEF2);
-	set_sc( NC_DARKMOON          , SC_DARKMOON        , SI_MOON_COMFORT    , SCB_FLEE|SCB_HIT);
-	add_sc( NC_DARKMOON          , SC_BLIND);
-	set_sc( NC_REQUIEM           , SC_REQUIEM         , SI_KAIZEL          , SCB_BATK|SCB_WATK);
-	add_sc( NC_GHOULTOUCH        , SC_POISON);
-	set_sc( NC_PWSUFFER          , SC_SUFFER          , SI_BLANK           , SCB_DEF|SCB_DEF2);
-	set_sc( NC_DEATHPACT         , SC_DEATHPACT       , SI_BIOMOBTRICKDEAD , SCB_DEF_ELE|SCB_REGEN);
-	
-	set_sc( WL_SEARING           , SC_SEARING         , SI_BLANK           , SCB_NONE);
-	set_sc( WL_IMMOLATE          , SC_IMMOLATE        , SI_BLANK           , SCB_NONE);
-	add_sc( WL_SHADOWBURN        , SC_STUN);
-	set_sc( WL_PWAGONY           , SC_AGONY           , SI_BLANK           , SCB_MDEF|SCB_MDEF2);
-	set_sc( WL_CURSETONGUES      , SC_CURSETONGUES    , SI_SLOWCAST        , SCB_NONE);
-	set_sc( WL_CURSEDOOM         , SC_DOOM            , SI_BLANK           , SCB_NONE);
-	set_sc( WL_CURSEWEAKNESS     , SC_CURSEWEAKNESS   , SI_STRIPWEAPON     , SCB_BATK|SCB_WATK);
-	set_sc( WL_CURSEEXHAUST      , SC_CURSEEXHAUST    , SI_CRITICALWOUND   , SCB_DEF|SCB_MDEF);
-	add_sc( WL_HOWLOFTERROR      , SC_FEAR);
-	set_sc( WL_HOWLOFPAIN        , SC_PROVOKE         , SI_PROVOKE         , SCB_DEF|SCB_DEF2|SCB_BATK|SCB_WATK);
-	set_sc( WL_OVERWHELMING      , SC_OVERWHELMING    , SI_ENERGYCOAT      , SCB_DEF|SCB_MDEF|SCB_MATK|SCB_REGEN|SCB_DEF_ELE);
-//WTF IS THIS DOING HERE AT ALL?!	
-	set_sc( ALL_ATFIELD          , SC_ATFIELD         , SI_UTSUSEMI        ,SCB_NONE);
-
 
 	// Storing the target job rather than simply SC_SPIRIT simplifies code later on.
@@ -675,8 +646,4 @@
 			status_change_end(target,SC_WINKCHARM,-1);
 			status_change_end(target,SC_CONFUSION,-1);
-/*+			if (sc->data[SC_FEAR]) //Fear Status by [Brainstorm]
-+				status_change_end(target, SC_FEAR, -1);*/
-//Modifying the above...
-            status_change_end(target,SC_FEAR,-1);
 			status_change_end(target,SC_TRICKDEAD,-1);
 			status_change_end(target,SC_HIDING,-1);
@@ -690,7 +657,4 @@
 					status_change_end(target, SC_ENDURE, -1);
 			}
-			//May also work here... MAYBE
-//			if (sc->data[SC_FEAR]) //Fear Status by [Brainstorm]
-//				status_change_end(target, SC_FEAR, -1);
 			if ((sce=sc->data[SC_GRAVITATION]) && sce->val3 == BCT_SELF)
 			{
@@ -1230,4 +1194,6 @@
 }
 
+void status_calc_bl(struct block_list *bl, unsigned long flag);
+
 // Basic ASPD value
 int status_base_amotion_pc(struct map_session_data* sd, struct status_data* status)
@@ -1374,7 +1340,5 @@
 	if (md->master_id && md->special_state.ai>1)
 		flag|=16;
-// a flag o_O
-	if (md->master_id && md->special_state.ai)
-		flag|=32; //Adept/Necro/Warlock Summon Stats Bonus [Brainstorm]
+
 	if (!flag)
 	{ //No special status required.
@@ -1493,67 +1457,5 @@
 		status->aspd_rate -= 100*md->guardian_data->guardup_lv;
 	}
-//Gentlemen, prepare to error your ass off! =O Unless I fixed that thing wayyyy up thar ^
-	//Summon Bonus from Skills [Brainstorm]
-	if(flag&32)
-	{
-		mbl = map_id2bl(md->master_id); //WTF?! Your mom! It's there you liar compiling bastard!
-		if(mbl)
-		{
-			struct unit_data *ud = unit_bl2ud(mbl);
-			//Remove special AI when this is used by regular mobs.
-			if (mbl->type == BL_MOB && !((TBL_MOB*)mbl)->special_state.ai)
-				md->special_state.ai = 0;
-			
-			int master_lv = status_get_lv(mbl);
-			int skill_mastery = pc_checkskill((TBL_PC*)mbl,AD_SUMMONS);
-			int undead_mastery = pc_checkskill((TBL_PC*)mbl,NC_UNDEAD);
-	
-			if (ud->skillid == AD_FAMILIAR)
-			{
-				status->max_hp += (skill_mastery*10) + (master_lv*10);
-				status->str += (master_lv) + (skill_mastery);
-				status->dex += (master_lv) + (skill_mastery);
-				status->agi += (master_lv) + (skill_mastery);
-				status->int_ += (master_lv) + (skill_mastery);
-				status->vit += (master_lv) + (skill_mastery);
-				status->luk += (master_lv) + (skill_mastery);
-				status->rhw.atk += (skill_mastery*3)
-					+ (status->str+((status->str/10)*(status->str/10))+(status->dex/5)+(status->luk/10));
-				status->rhw.atk2 += (skill_mastery*3)
-					+ (status->str+((status->str/10)*(status->str/10))+(status->dex/5)+(status->luk/10));
-				status->speed -= skill_mastery;
-				status->def += (master_lv)/10 + (skill_mastery);
-				status->mdef += (master_lv)/10 + (skill_mastery);
-				//These are not automatically recalculated
-				status->hit += (master_lv*2) + (skill_mastery);
-				status->flee += (master_lv*2) + (skill_mastery);
-				status->def2 += (master_lv) + (skill_mastery);
-				status->mdef2 += (master_lv) + (skill_mastery);
-			}	
-			else if(status->race==RC_UNDEAD)
-			{
-				status->max_hp += (undead_mastery*10) + (master_lv*2);
-				status->str += (undead_mastery*3) + (skill_mastery);
-				status->dex += (undead_mastery*3) + (skill_mastery);
-				status->agi += (undead_mastery*3) + (skill_mastery);
-				status->int_ += (undead_mastery*3) + (skill_mastery);
-				status->vit += (undead_mastery*3) + (skill_mastery);
-				status->luk += (undead_mastery*3) + (skill_mastery);
-				status->rhw.atk += (undead_mastery*3) + (skill_mastery*3)
-					+ (status->str+((status->str/10)*(status->str/10))+(status->dex/5)+(status->luk/10));
-				status->rhw.atk2 += (undead_mastery*3) + (skill_mastery*3)
-					+ (status->str+((status->str/10)*(status->str/10))+(status->dex/5)+(status->luk/10));
-				status->speed -= undead_mastery;
-				status->def += undead_mastery;
-				status->mdef += undead_mastery;
-				//These are not automatically recalculated
-				status->hit += (undead_mastery*3) + (skill_mastery);
-				status->flee += (undead_mastery*3) + (skill_mastery);
-				status->def2 += (undead_mastery*3) + (skill_mastery);
-				status->mdef2 += (undead_mastery*3) + (skill_mastery);
-			}
-		}
-		else ShowError("status_calc_mob: Monster summoned without a master at %s\n", map[md->bl.m].name);
-	}
+
 	//Initial battle status
 	if (!first)
@@ -1744,4 +1646,5 @@
 	sd->delayrate=100;
 	sd->dsprate=100;
+	sd->speed_rate = 100;
 	sd->hprecov_rate = 100;
 	sd->sprecov_rate = 100;
@@ -1802,8 +1705,5 @@
 	status->aspd_rate = 1000;
 	status->ele_lv = 1;
-//	status->race = RC_DEMIHUMAN;
-	status->race = RC_DEMIHUMAN;// This define players default race to DEMIHUMAN [Brain]
-	if(pc_checkskill(sd,NC_PHYLACTERY)>0) status->def_ele = ELE_UNDEAD; //Phylactery turns you UNDEAD 1 instead of NEUTRAL
-
+	status->race = RC_DEMIHUMAN;
 
 	//zero up structures...
@@ -1860,5 +1760,4 @@
 		+ sizeof(sd->crit_atk_rate)
 		+ sizeof(sd->classchange)
-		+ sizeof(sd->speed_rate)
 		+ sizeof(sd->speed_add_rate)
 		+ sizeof(sd->aspd_add)
@@ -2043,4 +1942,6 @@
 	sd->perfect_hit += sd->perfect_hit_add;
 	sd->splash_range += sd->splash_add_range;
+	if(sd->speed_add_rate)	
+		sd->speed_rate += sd->speed_add_rate;
 
 	// Damage modifiers from weapon type
@@ -2094,6 +1995,4 @@
 	if((skill=pc_checkskill(sd,AC_OWL))>0)
 		status->dex += skill;
-	if((skill=pc_checkskill(sd,WL_DEMONOLOGY))>0) //Warlock Demonology [Brain]
-		status->str += skill/2; //+1 str per 2 skill points
 
 	// Bonuses from cards and equipment as well as base stat, remember to avoid overflows.
@@ -2133,6 +2032,4 @@
 	if((skill=pc_checkskill(sd,CR_TRUST))>0)
 		status->max_hp += skill*200;
-	if((skill=pc_checkskill(sd,AD_PROFANE))>0) // Adept Profane Soul [Brain]
-		status->max_hp += status->max_hp * (skill*3)/100;
 
 	// Apply relative modifiers from equipment
@@ -2164,6 +2061,5 @@
 	if((skill=pc_checkskill(sd,HW_SOULDRAIN))>0)
 		status->max_sp += status->max_sp * 2*skill/100;
-	if((skill=pc_checkskill(sd,AD_PROFANE))>0) // Adept Profane Soul [Brain]
-		status->max_sp += sd->status.max_sp * (skill*3)/100;
+
 	// Apply relative modifiers from equipment
 	if(sd->sprate < 0)
@@ -2258,7 +2154,4 @@
 		}
 	}
-	//right place?
-	if((skill=pc_checkskill(sd,AD_FERVOR))>0) // Adept Unholy Fevor [Brain]
-		status->hit += skill*2;
 
 // ----- FLEE CALCULATION -----
@@ -2269,6 +2162,4 @@
 	if((skill=pc_checkskill(sd,MO_DODGE))>0)
 		status->flee += (skill*3)>>1;
-	if((skill=pc_checkskill(sd,AD_FERVOR))>0) // Adept Unholy Fevor [Brain]
-		status->flee += skill*2;
 
 // ----- EQUIPMENT-DEF CALCULATION -----
@@ -2297,9 +2188,4 @@
 		status->mdef = cap_value(i, CHAR_MIN, CHAR_MAX);
 	}
-	//AMIDOINITRITE?
-	// Absolute modifiers from passive skills
-	if((skill=pc_checkskill(sd,AD_DARKFAITH))>0) // Adept Dark Faith [Brain]
-		status->mdef += 1*skill;
-
 
 	if (!battle_config.magic_defense_type && status->mdef > battle_config.max_def)
@@ -2311,6 +2197,8 @@
 // ----- WALKING SPEED CALCULATION -----
 
-	sd->speed_rate += sd->speed_add_rate;
-	status->speed += status->speed * sd->speed_rate/100;
+	if(sd->speed_rate < 0)
+		sd->speed_rate = 0;
+	if(sd->speed_rate != 100)
+		status->speed = status->speed*sd->speed_rate/100;
 
 	// Relative modifiers from passive skills
@@ -2406,18 +2294,4 @@
 		sd->subrace[RC_DRAGON]+=skill;
 	}
-// Racial slurs =O
-	if((skill=pc_checkskill(sd,AD_DARKFAITH))>0) // Adept Dark Faith [Brain]
-		sd->subele[ELE_DARK] += skill*5;
-	if((skill=pc_checkskill(sd,WL_DEMONOLOGY))>0 ){ //Warlock Demonology [Brain]
-		skill = skill*5;
-		sd->right_weapon.addrace[RC_DEMON]+=skill;
-		sd->magic_addrace[RC_DEMON]+=skill;
-		sd->subrace[RC_DEMON]+=skill;
-	}
-	if((pc_checkskill(sd,NC_PHYLACTERY))>0){ // Necro Phylactery [Brain]
-		sd->subele[ELE_NEUTRAL] += 10;	//And increases neutral resistance by 10%
-	}
-
-
 
 	if(sc->count){
@@ -2443,6 +2317,4 @@
 			sd->subrace[RC_DEMON] += sc->data[SC_PROVIDENCE]->val2;
 		}
-		if(sd->sc.data[SC_DEATHPACT]) //Necro Death Pact [Brain]
-			sd->subele[ELE_NEUTRAL] += sd->sc.data[SC_DEATHPACT]->val2;
 		if(sc->data[SC_ARMOR_ELEMENT])
 		{	//This status change should grant card-type elemental resist.
@@ -2766,7 +2638,4 @@
 		|| sc->data[SC_TRICKDEAD]
 		|| sc->data[SC_BLEEDING]
-		|| sc->data[SC_LUST]		// Adept Blood Lust, stops hp regen [Brain]
-		|| sc->data[SC_DEATHPACT]	// Necro Death Pact
-
 	)	//No regen
 		regen->flag = 0;
@@ -2777,6 +2646,4 @@
 		|| (sc->data[SC_EXPLOSIONSPIRITS]
 			&& (!sc->data[SC_SPIRIT] || sc->data[SC_SPIRIT]->val2 != SL_MONK))
-		|| sc->data[SC_OVERWHELMING]	// Warlock Overwhelming Evil, stops sp regen [Brain]
-
 	)	//No natural SP regen
 		regen->flag &=~RGN_SP;
@@ -2875,6 +2742,15 @@
 		if(status->speed < battle_config.max_walk_speed)
 			status->speed = battle_config.max_walk_speed;
-	}
-
+
+		if ((skill=pc_checkskill(sd,SA_FREECAST))>0) {
+			//Store casting walk speed for quick restoration. [Skotlex]
+			sd->prev_speed = status->speed * (175-5*skill)/100;
+			if(sd->ud.skilltimer != -1) { //Swap speed.
+				skill = status->speed;
+				status->speed = sd->prev_speed;
+				sd->prev_speed = skill;
+			}
+		}
+	}
 	if(flag&(SCB_ASPD|SCB_AGI|SCB_DEX)) {
 		flag|=SCB_ASPD;
@@ -2888,5 +2764,16 @@
 
 		status->amotion = cap_value(skill,battle_config.max_aspd,2000);
+
 		status->adelay = 2*status->amotion;
+		if ((skill=pc_checkskill(sd,SA_FREECAST))>0) {
+			//Store casting adelay for quick restoration. [Skotlex]
+			sd->prev_adelay = status->adelay*(150-5*skill)/100;
+			if(sd->ud.skilltimer != -1) { //Swap adelay.
+				skill = status->adelay;
+				status->adelay = sd->prev_adelay;
+				sd->prev_adelay = skill;
+			}
+		}
+
 	}
 
@@ -3527,11 +3414,4 @@
 	if(sc->data[SC_MADNESSCANCEL])
 		batk += 100;
-	if(sc->data[SC_LUST]) // Adept Blood Lust [Brain]
-		batk += batk * sc->data[SC_LUST]->val2/100;
-	if(sc->data[SC_CURSEWEAKNESS]) // Warlock Curse of Weakness [Brain]
-		batk -= batk * sc->data[SC_CURSEWEAKNESS]->val2/100;
-	if(sc->data[SC_DECREPIFY]) // Necromancer Decrepify [Brain]
-		if(sc->data[SC_DECREPIFY]->val2>=2)
-			batk -= batk * 25/100;
 	return (unsigned short)cap_value(batk,0,USHRT_MAX);
 }
@@ -3568,5 +3448,5 @@
 		}
 	}
-	if(sc->data[SC_BLOODLUST])//WTF?!
+	if(sc->data[SC_BLOODLUST])
 		watk += watk * sc->data[SC_BLOODLUST]->val2/100;
 	if(sc->data[SC_FLEET])
@@ -3576,17 +3456,4 @@
 	if(sc->data[SC_STRIPWEAPON])
 		watk -= watk * sc->data[SC_STRIPWEAPON]->val2/100;
-	if(sc->data[SC_LUST]) // Adept Blood Lust [Brain]
-		watk += watk * sc->data[SC_LUST]->val2/100;
-	if(sc->data[SC_REQUIEM]){	//Necro Requiem [Brain]
-		if(sc->data[SC_REQUIEM]->val2)
-			watk += sc->data[SC_REQUIEM]->val2*10;
-		if(sc->data[SC_REQUIEM]->val3)
-			watk -= sc->data[SC_REQUIEM]->val3*10;
-	}//????
-	if(sc->data[SC_CURSEWEAKNESS]) // Warlock Curse of Weakness [Brain]
-		watk -= watk * sc->data[SC_CURSEWEAKNESS]->val2/100;
-	if(sc->data[SC_DECREPIFY]) // Necromancer Decrepify [Brain]
-		if(sc->data[SC_DECREPIFY]->val2>=2)
-			watk -= watk * 25/100;
 
 	return (unsigned short)cap_value(watk,0,USHRT_MAX);
@@ -3608,6 +3475,4 @@
 	if(sc->data[SC_INCMATKRATE])
 		matk += matk * sc->data[SC_INCMATKRATE]->val1/100;
-	if(sc->data[SC_OVERWHELMING]) // Warlock Overwhelming Evil [Brain]
-		matk += matk * sc->data[SC_OVERWHELMING]->val2/100;
 
 	return (unsigned short)cap_value(matk,0,USHRT_MAX);
@@ -3657,10 +3522,4 @@
 	if(sc->data[SC_INCREASING])
 		hit += 20; // RockmanEXE; changed based on updated [Reddozen]
-	if(sc->data[SC_DARKMOON]){	//Necro Dark Moon [Brain]
-		if(sc->data[SC_DARKMOON]->val2)
-			hit += sc->data[SC_DARKMOON]->val2;
-		if(sc->data[SC_DARKMOON]->val3)
-			hit -= sc->data[SC_DARKMOON]->val3;
-	}
 	
 	return (short)cap_value(hit,1,SHRT_MAX);
@@ -3703,10 +3562,4 @@
 	if(sc->data[SC_SPEED])
 		flee += 10 + sc->data[SC_SPEED]->val1 * 10 ;
-	if(sc->data[SC_DARKMOON]){	//Necro Dark Moon [Brain]
-		if(sc->data[SC_DARKMOON]->val2)
-			flee += sc->data[SC_DARKMOON]->val2;
-		if(sc->data[SC_DARKMOON]->val3)
-			flee -= sc->data[SC_DARKMOON]->val3;
-	}
 
 	return (short)cap_value(flee,1,SHRT_MAX);
@@ -3767,11 +3620,4 @@
 	if (sc->data[SC_FLING])
 		def -= def * (sc->data[SC_FLING]->val2)/100;
-	if(sc->data[SC_SUFFER])	// Necro Power Word: Suffer [Brain]
-		def <<=1; // -25% def
-	if (sc->data[SC_CURSEEXHAUST]) // Warlock Curse of Exhaustion [Brain]
-		def -= sc->data[SC_CURSEEXHAUST]->val2;
-	if (sc->data[SC_OVERWHELMING]) // Warlock Overwhelming Evil [Brain]
- 		def += sc->data[SC_OVERWHELMING]->val1;
-
 
 	return (signed char)cap_value(def,CHAR_MIN,CHAR_MAX);
@@ -3808,10 +3654,4 @@
 	if(sc->data[SC_FLING])
 		def2 -= def2 * (sc->data[SC_FLING]->val3)/100;
-	if(sc->data[SC_SUFFER])	// Necro Power Word: Suffer [Brain]
-		def2 -= def2 * 25/100; // -25% def
-	if(sc->data[SC_DECREPIFY]) // Necromancer Decrepify [Brain]
-		if(sc->data[SC_DECREPIFY]->val2>=4)
-			def2 -= def2 * 25/100;
-
 
 	return (short)cap_value(def2,1,SHRT_MAX);
@@ -3841,10 +3681,4 @@
 	if(sc->data[SC_CONCENTRATION])
 		mdef += 1; //Skill info says it adds a fixed 1 Mdef point.
-	if(sc->data[SC_AGONY])	 // Warlock Power Word: Agony [Brain]
-		mdef -= 25*mdef/100; // -25% mdef
-	if (sc->data[SC_CURSEEXHAUST]) // Warlock Curse of Exhaustion [Brain]
-		mdef -= sc->data[SC_CURSEEXHAUST]->val2;
-	if (sc->data[SC_OVERWHELMING]) // Warlock Overwhelming Evil [Brain]
-		mdef += sc->data[SC_OVERWHELMING]->val1;
 
 	return (signed char)cap_value(mdef,CHAR_MIN,CHAR_MAX);
@@ -3860,10 +3694,4 @@
 	if(sc->data[SC_MINDBREAKER])
 		mdef2 -= mdef2 * sc->data[SC_MINDBREAKER]->val3/100;
-	if(sc->data[SC_AGONY])	 // Warlock Power Word: Agony [Brain]
-		mdef2 -= mdef2 * 25/100; // -25% mdef
-	if(sc->data[SC_DECREPIFY]) // Necromancer Decrepify [Brain]
-		if(sc->data[SC_DECREPIFY]->val2>=5)
-			mdef2 -= mdef2 * 25/100;
-
 
 	return (short)cap_value(mdef2,1,SHRT_MAX);
@@ -3872,12 +3700,7 @@
 static unsigned short status_calc_speed(struct block_list *bl, struct status_change *sc, int speed)
 {
-	TBL_PC* sd = BL_CAST(BL_PC, bl);
-
 	//Default speed coming in means there's no speed_rate adjustments. 
 	int new_speed = speed;
 	bool default_speed = (speed == DEFAULT_WALK_SPEED);
-
-	if( sd && sd->ud.skilltimer != -1 && pc_checkskill(sd,SA_FREECAST) > 0 )
-		speed = speed * (175 - 5 * pc_checkskill(sd,SA_FREECAST))/100;
 
 	if(!sc || !sc->count)
@@ -3924,7 +3747,4 @@
 			else if(sc->data[SC_WINDWALK])
 				new_speed -= new_speed * sc->data[SC_WINDWALK]->val3/100;
-			else if(sc->data[SC_FEAR]) //Fear Status by [Brainstorm]
-				new_speed -= new_speed * 25/100;
-
 		}
 
@@ -3970,6 +3790,4 @@
 	if(sc->data[SC_SLOWDOWN])
 		speed = speed * 100/75;
-	if(sc->data[SC_DECREPIFY]) // Necromancer Decrepify [Brain]
-		speed = speed * 100/75; //-25% walkspeed
 	
 	return (short)cap_value(speed,10,USHRT_MAX);
@@ -4042,7 +3860,4 @@
 		else if(sc->data[SC_MADNESSCANCEL])
 			aspd_rate -= 200;
-		else if(sc->data[SC_LUST]) // Adept Blood Lust [Brain]
-			aspd_rate -= sc->data[SC_LUST]->val2*10;
-
 	}
 
@@ -4138,8 +3953,4 @@
 	if(sc->data[SC_ELEMENTALCHANGE])
 		return sc->data[SC_ELEMENTALCHANGE]->val2;
-	if( sc->data[SC_DEATHPACT]) // Necro Death Pact [Brain]
-		return ELE_UNDEAD;
-	if( sc->data[SC_OVERWHELMING]) // Warlock Overwhelming Evil [Brain]
-		return ELE_DARK;
 	return (unsigned char)cap_value(element,0,UCHAR_MAX);
 }
@@ -4160,9 +3971,4 @@
 	if(sc->data[SC_ELEMENTALCHANGE])
 		return sc->data[SC_ELEMENTALCHANGE]->val1;
-	if( sc->data[SC_DEATHPACT]) // Necro Death Pact [Brain]
-		return 1;
-	if( sc->data[SC_OVERWHELMING]) // Warlock Overwhelming Evil [Brain]
-		return 1;
-
 
 	return (unsigned char)cap_value(lv,1,4);
@@ -4208,4 +4014,28 @@
 	}
 	return cap_value(mode,0,USHRT_MAX);
+}
+
+/*==========================================
+ * Quick swap of adelay/speed when starting ending SA_FREECAST
+ *------------------------------------------*/
+void status_freecast_switch(struct map_session_data *sd)
+{
+	struct status_data *status;
+	unsigned short b_speed,tmp;
+
+	status = &sd->battle_status;
+
+	b_speed = status->speed;
+
+	tmp = status->speed;
+	status->speed = sd->prev_speed;
+	sd->prev_speed = tmp;
+
+	tmp = status->adelay;
+	status->adelay = sd->prev_adelay;
+	sd->prev_adelay = tmp;
+
+	if(b_speed != status->speed)
+		clif_updatestatus(sd,SP_SPEED);
 }
 
@@ -4878,5 +4708,4 @@
 	case SC_CARTBOOST:
 	case SC_ASSNCROS:
-	case SC_LUST: // Adept Blood Lust [Brain]
 		if (sc->data[SC_QUAGMIRE])
 			return 0;
@@ -4982,5 +4811,5 @@
 		 switch (type) {
 			case SC_BLESSING:
-			  if (!undead_flag && status->race!=RC_DEMON)
+			  if (status->race!=RC_UNDEAD && status->race!=RC_DEMON)
 				  break;
 			case SC_QUAGMIRE:
@@ -4996,14 +4825,4 @@
 			case SC_RICHMANKIM:
 			case SC_ROKISWEIL:
- //Not sure if its the right place.
-			//New status [Brainstorm]
-			case SC_FEAR:
-			case SC_DECREPIFY:
-			case SC_DARKMOON:
-			case SC_REQUIEM:
-			case SC_CURSETONGUES:
-			case SC_CURSEWEAKNESS:
-			case SC_CURSEEXHAUST:
-//SC Fogwall Must have been added after he did this?
 			case SC_FOGWALL:
 				return 0;
@@ -5017,51 +4836,10 @@
 		//TO-DO Blessing and Agi up should do 1 damage against players on Undead Status, even on PvM
 		//but cannot be plagiarized (this requires aegis investigation on packets and official behavior) [Brainstorm]
-		if ((!undead_flag && status->race!=RC_DEMON) || bl->type == BL_PC) {
+		if (status->race!=RC_UNDEAD && status->race!=RC_DEMON) {
 			if (sc->data[SC_CURSE])
 				status_change_end(bl,SC_CURSE,-1);
 			if (sc->data[SC_STONE] && sc->opt1 == OPT1_STONE)
 				status_change_end(bl,SC_STONE,-1);
-//hell of a time finding this
-			// Warlock Curses are canceled by blessing [Brain]
-			if (sc->data[SC_CURSEWEAKNESS])
-				status_change_end(bl,SC_CURSEWEAKNESS,-1);
-			if (sc->data[SC_CURSETONGUES])
-				status_change_end(bl,SC_CURSETONGUES,-1);
-			if (sc->data[SC_CURSEEXHAUST])
-				status_change_end(bl,SC_CURSEEXHAUST,-1);
-			if (sc->data[SC_DOOM]) // This skill would be way funnier if we could igore this concept, no?
-				status_change_end(bl,SC_DOOM,-1);//But then people would abuse on WoEs
-		}
-		break;
-	case SC_CURSEWEAKNESS: // Warlock Curse of Weakness removes Impositio Manus [Brain]
-		if (sc->data[SC_IMPOSITIO])
-			status_change_end(bl,SC_IMPOSITIO,-1);
-		if (sc->data[SC_BLESSING]) //The opposite is also valid, curses cancel blessing [Brain]
-			status_change_end(bl,SC_BLESSING,-1);
-		break;
-	case SC_CURSETONGUES: // Warlock Curse of Tongues removes Suffragium [Brain]
-		if (sc->data[SC_SUFFRAGIUM])
-			status_change_end(bl,SC_SUFFRAGIUM,-1);
-		if (sc->data[SC_BLESSING])
-			status_change_end(bl,SC_BLESSING,-1);
-		break;
-	case SC_CURSEEXHAUST: // Warlock Curse of Exhaustion removes angelus [Brain]
-		if (sc->data[SC_ANGELUS])
-			status_change_end(bl,SC_ANGELUS,-1);
-	case SC_DOOM:
-		if (sc->data[SC_BLESSING])
-			status_change_end(bl,SC_BLESSING,-1);
-		break;
-	case SC_IMPOSITIO: // Impositio Manus removes Curse of Weakness [Brain]
-		if (sc->data[SC_CURSEWEAKNESS])
-			status_change_end(bl,SC_CURSEWEAKNESS,-1);
-		break;
-	case SC_SUFFRAGIUM: // Suffragium removes Curse of Tongues [Brain]
-		if (sc->data[SC_CURSETONGUES])
-			status_change_end(bl,SC_CURSETONGUES,-1);
-		break;
-	case SC_ANGELUS: // Angelus removes Curse of Exhaustion [Brain]
-		if (sc->data[SC_CURSEEXHAUST])
-			status_change_end(bl,SC_CURSEEXHAUST,-1);
+		}
 		break;
 	case SC_INCREASEAGI:
@@ -5083,9 +4861,5 @@
 		status_change_end(bl,SC_TWOHANDQUICKEN,-1);
 		status_change_end(bl,SC_ONEHAND,-1);
-// may need tinkering
-		if(sc->data[SC_LUST])	// Adept Blood Lust [Brain]
-			status_change_end(bl,SC_LUST,-1);
-		break;
-//may be in the wrong place.
+		break;
 	case SC_ONEHAND:
 	  	//Removes the Aspd potion effect, as reported by Vicious. [Skotlex]
@@ -5153,12 +4927,5 @@
 		status_change_end(bl,SC_INCREASEAGI,-1);
 		break;
-//Code has changed since this
-	case SC_FREEZE: //Frozen status ends immolating AND searing status [Brain]
-		if(sc->data[SC_IMMOLATE])
-			status_change_end(bl,SC_IMMOLATE,-1);
-	case SC_IMMOLATE: // Warlock Immolate [Brain]
-		if(sc->data[SC_SEARING]) //Immolating status ends searing status
-			status_change_end(bl,SC_SEARING,-1);
-		break;
+		
 	}
 
@@ -5183,6 +4950,4 @@
 			case SC_SILENCE:
 			case SC_CONFUSION:
-   //Should Edit depending on the one that will work for the modified ver.
-			case SC_FEAR: //Fear Status by [Brainstorm]
 			case SC_BLIND:
 			case SC_BLEEDING:
@@ -5493,8 +5258,4 @@
 		case SC_CONFUSION:
 			clif_emotion(bl,1);
-			break;
-		case SC_FEAR: //Fear Status by [Brainstorm]
-			clif_emotion(bl,16); // e_wah
-			if(sd) tick /= 2;
 			break;
 		case SC_BLEEDING:
@@ -5874,14 +5635,5 @@
 			}
 			break;
-			
-//WHAT RELEVENCE DOES THIS HAVE AT ALL DAMNIT?!
-		case SC_ATFIELD: // AT-Field [Brainstorm]
-			val2 = 100; // 100% Block chance
-			val3 = 100; // Dodge 100 attacks total.
-			val4 = tick/1000;
-			tick = 1000;
-			break;
-			
-			
+
 		case SC_COMBO:
 		{
@@ -5926,25 +5678,9 @@
 			break;
 		case SC_BLESSING:
-			if ((!undead_flag && status->race!=RC_DEMON) || bl->type == BL_PC)
+			if (status->race!=RC_UNDEAD && status->race!=RC_DEMON)
 				val2 = val1;
 			else
 				val2 = 0; //0 -> Half stat.
 			break;
-		case SC_REQUIEM: //Necro Requiem and Dark Moon [Brain]
-		case SC_DARKMOON:
-			if (undead_flag || status->race==RC_UNDEAD || status->race==RC_DEMON)
-				val2 = val1; //Demon and Undead get buffed
-			else if(status->race==RC_FORMLESS || status->def_ele==ELE_GHOST || bl->type == BL_PC)
-			{
-				val1 = 0; //No status change for Formless and Ghosts, and non-undead players
-				tick = 0; //Cancel status to not show requiem icon without a reason
-			}
-			else
-				val3 = val1; //Everything else (living) get negative status (requiem only)
-			break;
-		case SC_DECREPIFY: //Necro Decrepify [Brain]
-			val2 = val1;
-		break;
-
 		case SC_TRICKDEAD:
 			if (vd) vd->dead_sit = 1;
@@ -5987,13 +5723,4 @@
 			val2 = 5*val1; //watk increase
 			break;
-		case SC_CURSEWEAKNESS: // Warlock Curse of Weakness [Brain]
-			val2 = 5*val1; //batk/watk decrease
-			break;
-		case SC_CURSEEXHAUST: // Warlock Curse of Exhaustion [Brain]
-			val2 = 2*val1; //def/mdef decrease
-			break;
-		case SC_CURSETONGUES: // Warlock Curse of Tongues [Brain]
-			val2 = 10*val1; //casttime increase
-			break;
 		case SC_MELTDOWN:
 			val2 = 100*val1; //Chance to break weapon
@@ -6050,16 +5777,4 @@
 			val2 = 30*val1; //Aspd change
 			val3 = 5+5*val1; //bAtk/wAtk rate change
-			break;
-		case SC_LUST: // Adept Blood Lust [Brain]
-			val2 = 5+3*val1; //Aspd/bAtk/wAtk change
-			val3 = tick>0?tick:1000; //Interval at which HP is drained.
-			break;
-		case SC_DEATHPACT: // Necro Death Pact [Brain]
-			val2 = 5*val1; //Neutral property resistance
-			val3 = tick>0?tick:10000; //Interval at which HP is drained.
-			break;
-		case SC_OVERWHELMING: // Warlock Overwhelming Evil [Brain]
-			val2 = 2*val1; //matk bonus
-			val3 = tick>0?tick:1000; //Interval at which SP is drained.
 			break;
 		case SC_MINDBREAKER:
@@ -6246,7 +5961,4 @@
 				unit_skillcastcancel(bl, 0);
 		break;
-		case SC_FEAR: //Fear Status by [Brainstorm]
-			unit_stop_attack(bl);
-		break;
 	}
 
@@ -6683,5 +6395,5 @@
 				clif_status_change(bl,SI_MOONLIT,0);
 
-			status_change_end(bl,SC_LONGING,-1);
+			status_change_end(bl,SC_LONGING,-1);				
 			break;
 		case SC_NOCHAT:
@@ -6694,7 +6406,5 @@
 			}
 			break;
-		case SC_SPLASHER:
-//Why is Doom here?
-		case SC_DOOM: // Warlock Curse of Doom [Brain]	
+		case SC_SPLASHER:	
 			{
 				struct block_list *src=map_id2bl(sce->val3);
@@ -7064,19 +6774,4 @@
 		sc_timer_next(sce->val2+tick, status_change_timer, bl->id, data);
 		return 0;
-	case SC_LUST:	// Adept Blood Lust [Brain]
-		if(!status_charge(bl, status->max_hp/100, 0))
-			break; //Not enough HP to continue.
-		sc_timer_next(sce->val3+tick, status_change_timer, bl->id, data);
-		return 0;
-	case SC_DEATHPACT:	// Necro Death Pact [Brain]
-		 // Drains 1 HP every second (status wont kill, but dying will cancel it)
-		status_charge(bl, 1, 0);
-		sc_timer_next(sce->val3+tick, status_change_timer, bl->id, data);
-		return 0;
-	case SC_OVERWHELMING:	// Warlock Overwhelming Evil [Brain]
-		if(!status_charge(bl, 0, status->max_sp/100))
-			break; //Not enough SP to continue.
-		sc_timer_next(sce->val3+tick, status_change_timer, bl->id, data);
-		return 0; 
 
 	case SC_CHASEWALK:
@@ -7313,10 +7008,4 @@
 		}
 		break;
-	case SC_DOOM: // Warlock Curse of Doom [Brain]
-		if((sce->val4 -= 500) > 0) {
-			sc_timer_next(500 + tick, status_change_timer, bl->id, data);
-			return 0;
-		}
-		break;
 
 	case SC_MARIONETTE:
@@ -7486,5 +7175,4 @@
 			case SC_WATKFOOD:
 			case SC_MATKFOOD:
-			case SC_DOOM: // Warlock Curse of Doom [Brain]
 				continue;
 				
