Index: src/common/mmo.h
===================================================================
--- src/common/mmo.h (revision 24)
+++ src/common/mmo.h (revision 1)
@@ -526,7 +526,4 @@
 	JOB_XMAS,
 	JOB_SUMMER,
-    JOB_ADEPT = 30, // [Brain] 
-    JOB_NECROMANCER, // [Brain]
-    JOB_WARLOCK, // Warlock [Brain]
 	JOB_MAX_BASIC,
 
Index: src/map/atcommand.c
===================================================================
--- src/map/atcommand.c (revision 24)
+++ src/map/atcommand.c (revision 1)
@@ -1213,11 +1213,15 @@
 		if (sd->disguise)
 			status_set_viewdata(&sd->bl, sd->disguise);
-		else
-			status_set_viewdata(&sd->bl, sd->status.class_);
-		clif_displaymessage(fd, msg_txt(10)); // Invisible: Off
+  else
+            clif_specialeffect(&sd->bl, 587, 1); // [Temperis]
+            clif_specialeffect(&sd->bl, 589, 1); // [Temperis]
+            status_set_viewdata(&sd->bl, sd->status.class_);
+        clif_displaymessage(fd, msg_txt(10)); // Invisible: Off
 	} else {
-		sd->sc.option |= OPTION_INVISIBLE;
-		sd->vd.class_ = INVISIBLE_CLASS;
-		clif_displaymessage(fd, msg_txt(11)); // Invisible: On
+        clif_specialeffect(&sd->bl, 587, 1); // [Temperis]
+        clif_specialeffect(&sd->bl, 589, 1); // [Temperis]
+        sd->sc.option |= OPTION_INVISIBLE;
+        sd->vd.class_ = INVISIBLE_CLASS;
+        clif_displaymessage(fd, msg_txt(11)); // Invisible: On
 	}
 	clif_changeoption(&sd->bl);
@@ -1265,8 +1269,4 @@
 			{ "gunner",	24 },
 			{ "ninja",	25 },
-			{ "adept",	30 },//New job classes [Brainstorm]
-			{ "necromancer",	31 },
-			{ "necro",	31 },
-			{ "warlock",	32 },
 			{ "high novice",	4001 },
 			{ "swordsman high",	4002 },
@@ -4372,4 +4372,6 @@
 	if (map[m_id].flag.guildlock)
 		strcat(atcmd_output, "GuildLock | ");
+	if (map[m_id].flag.hostile)
+	strcat(atcmd_output, "Hostile | ");
 	clif_displaymessage(fd, atcmd_output);
 
@@ -7814,17 +7816,5 @@
 	return 0;
 }
-//@showsummon [Brainstorm]
-int atcommand_showsummon(const int fd, struct map_session_data* sd, const char* command, const char* message)
-{
-	if (sd->state.showsummon) {
-		sd->state.showsummon = 0;
-		clif_displaymessage(fd, "Summon Stats will not be shown.");
-		return 0;
-	}
-
-	sd->state.showsummon = 1;
-	clif_displaymessage(fd, "Summon Stats is now shown.");
-	return 0;
-}
+
 /*==========================================
  * Barricade Build
@@ -8294,4 +8284,48 @@
 }
 
+/*==========================================
+* @alliance by SketchyPhoenix
+*------------------------------------------*/
+int atcommand_god(const int fd, struct map_session_data* sd, const char* command, const char* message)
+{
+nullpo_retr(-1, sd);
+
+if(sd->state.demon) {
+clif_displaymessage(fd, "You're tainted, you cannot change your ways.");
+return 0;
+}
+
+sd->state.god = !sd->state.god;
+
+if(sd->state.god)
+clif_displaymessage(fd, "You have joined the holy union.");
+else {
+clif_displaymessage(fd, "You have become tainted.");
+map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
+}
+return 0;
+}
+
+/*==========================================
+* @horde by SketchyPhoenix
+*------------------------------------------*/
+int atcommand_demon(const int fd, struct map_session_data* sd, const char* command, const char* message)
+{
+nullpo_retr(-1, sd);
+
+if(sd->state.god) {
+clif_displaymessage(fd, "You are of the light, darkness cannot consume you.");
+return 0;
+}
+sd->state.demon = !sd->state.demon;
+
+if(sd->state.demon)
+clif_displaymessage(fd, "Your sould is consumed by the darkness, you've gained demonic power.");
+else {
+clif_displaymessage(fd, "You have repented, the darkness has left your soul.");
+map_foreachinrange(atcommand_stopattack,&sd->bl, AREA_SIZE, BL_CHAR, sd->bl.id);
+}
+return 0;
+}
 /*==========================================
  * atcommand_info[] structure definition
@@ -8589,6 +8623,6 @@
 	{ "barricade",         60,     atcommand_barricade },
 	{ "killbarricade",     60,     atcommand_barricade_destroy },
-	//Vanaheim Commands
-	{ "showsummon",         0, atcommand_showsummon}, //Brainstorm
+	{ "god",				60,		atcommand_god },
+	{ "demon",				60,		atcommand_demon },
 };
 
Index: src/map/itemdb.c
===================================================================
--- src/map/itemdb.c (revision 24)
+++ src/map/itemdb.c (revision 1)
@@ -242,12 +242,4 @@
 	if (jobmask & 1<<JOB_NINJA)
 		bclass[0] |= 1<<MAPID_NINJA;
-//why does it have job masks as 26 27 28? wasnt it 29 30 31 or something?
-	//Custom Classes
-	if (jobmask & 1<<26) // Adept [Brain]
-		bclass[0] |= 1<<MAPID_ADEPT;
-	if (jobmask & 1<<27) // Necromancer [Brain]
-		bclass[1] |= 1<<MAPID_ADEPT;
-	if (jobmask & 1<<28) // Warlock [Brain]
-		bclass[2] |= 1<<MAPID_ADEPT;
 }
 
Index: src/map/script.c
===================================================================
--- src/map/script.c (revision 24)
+++ src/map/script.c (revision 1)
@@ -329,7 +329,7 @@
 	MF_NOCHAT,
 	MF_NOEXPPENALTY,
-	MF_GUILDLOCK
+	MF_GUILDLOCK,
+	MF_HOSTILE
 };
-
 const char* script_op2name(int op)
 {
@@ -4324,5 +4324,6 @@
 		return 0;
 
-	map_foreachinarea(buildin_areawarp_sub, m,x0,y0,x1,y1,BL_PC, index,x,y);
+	map_foreachinarea(buildin_areawarp_sub,
+		m,x0,y0,x1,y1,BL_PC,	index,x,y );
 	return 0;
 }
@@ -7486,5 +7487,5 @@
 	int allflag=va_arg(ap,int);
 
-	md->state.npc_killmonster = 1;
+	md->npc_killmonster = 1;
 	
 	if(!allflag){
@@ -7495,5 +7496,5 @@
 			status_kill(bl);
 	}
-	md->state.npc_killmonster = 0;
+	md->npc_killmonster = 0;
 	return 0;
 }
@@ -7570,5 +7571,6 @@
 	}
 		
-	map_foreachinmap(buildin_killmonsterall_sub_strip,m,BL_MOB);
+	map_foreachinmap(buildin_killmonsterall_sub_strip,
+		m,BL_MOB);
 	return 0;
 }
@@ -9027,4 +9029,5 @@
 			case MF_PARTYLOCK:		script_pushint(st,map[m].flag.partylock); break;
 			case MF_GUILDLOCK:		script_pushint(st,map[m].flag.guildlock); break;
+			case MF_HOSTILE:		script_pushint(st,map[m].flag.hostile); break;//Sketchy
 		}
 	}
@@ -9091,4 +9094,5 @@
 			case MF_PARTYLOCK:     map[m].flag.partylock=1; break;
 			case MF_GUILDLOCK:     map[m].flag.guildlock=1; break;
+			case MF_HOSTILE:		map[m].flag.hostile=1; break;//Sketchy
 		}
 	}
@@ -9152,4 +9156,5 @@
 			case MF_PARTYLOCK:     map[m].flag.partylock=0; break;
 			case MF_GUILDLOCK:     map[m].flag.guildlock=0; break;
+			case MF_HOSTILE:		map[m].flag.hostile=0; break;//Sketchy
 		}
 	}
@@ -11805,8 +11810,8 @@
 	data = script_getdata(st,3);
 
+	if( script_hasdata(st,5) )
+		size = script_getnum(st,5);
 	if( script_hasdata(st,4) )
 		class_ = script_getnum(st,4);
-	if( script_hasdata(st,5) )
-		size = script_getnum(st,5);
 
 	get_val(st, data);
@@ -12145,6 +12150,5 @@
 		flag = script_getnum(st,3);
 	nd = npc_name2id(shopname);
-	if( !nd || nd->bl.type != BL_NPC || (nd->subtype != SHOP && nd->subtype != CASHSHOP) )
-	{
+	if (!nd || nd->bl.type!=BL_NPC || nd->subtype!=SHOP) {
 		ShowError("buildin_callshop: Shop [%s] not found (or NPC is not shop type)\n", shopname);
 		script_pushint(st,0);
@@ -12152,16 +12156,15 @@
 	}
 	
-	if( nd->subtype == SHOP )
-	{
-		switch( flag )
-		{
-			case 1: npc_buysellsel(sd,nd->bl.id,0); break; //Buy window
-			case 2: npc_buysellsel(sd,nd->bl.id,1); break; //Sell window
-			default: clif_npcbuysell(sd,nd->bl.id); break; //Show menu
-		}
-	}
-	else
-		clif_cashshop_show(sd, nd);
-
+	switch (flag) {
+		case 1: //Buy window
+			npc_buysellsel(sd,nd->bl.id,0);
+		break;
+		case 2: //Sell window
+			npc_buysellsel(sd,nd->bl.id,1);
+		break;
+		default: //Show menu
+			clif_npcbuysell(sd,nd->bl.id);
+		break;
+	}
 	sd->npc_shopid = nd->bl.id;
 	script_pushint(st,1);
@@ -13378,4 +13381,47 @@
 }
 
+/// Changes invoking character to alliance [sketchy]
+/// usage: alliance;
+BUILDIN_FUNC(god)
+{
+TBL_PC* sd;
+sd = script_rid2sd(st);
+if( sd == NULL )
+return 0;
+
+sd->state.demon = 0;
+sd->state.god = 1;
+return 0;
+}
+
+/// Changes invoking character to horde [sketchy]
+/// usage: horde;
+BUILDIN_FUNC(demon)
+{
+TBL_PC* sd;
+
+sd = script_rid2sd(st);
+if( sd == NULL )
+return 0;
+
+sd->state.god = 0;
+sd->state.demon = 1;
+return 0;
+}
+
+/// Clears faction [sketchy]
+/// usage: factionclear;
+BUILDIN_FUNC(factionclear)
+{
+TBL_PC* sd;
+
+sd = script_rid2sd(st);
+if( sd == NULL )
+return 0;
+
+sd->state.god = 0;
+sd->state.demon = 0;
+return 0;
+}
 
 // declarations that were supposed to be exported from npc_chat.c
@@ -13651,5 +13697,5 @@
 	BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris]
 	BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris]
-	BUILDIN_DEF(setnpcdisplay,"sv??"),
+	BUILDIN_DEF(setnpcdisplay,"sv?"),
 	BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine.
 	BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info
@@ -13728,4 +13774,7 @@
 	BUILDIN_DEF(setquestobjective, "iisi"),
 	BUILDIN_DEF(setqueststatus, "ii"),
+	BUILDIN_DEF(god,""), // sets invoking character to alliance [Sketchy]
+	BUILDIN_DEF(demon,""), // sets invoking character to horde [Sketchy]
+	BUILDIN_DEF(factionclear,""), // clears invoking character's factions [Sketchy]
 	BUILDIN_DEF(hasquest, "i"),
 	{NULL,NULL,NULL},
Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 24)
+++ src/map/battle.c (revision 1)
@@ -138,5 +138,5 @@
 }
 
-// _??[WÌx
+// _E?[WÌx
 struct delay_damage {
 	struct block_list *src;
@@ -265,5 +265,5 @@
 
 /*==========================================
- * _??[W?Å?IvZ
+ * _E?[W?Å?IvZ
  *------------------------------------------*/
 int battle_calc_damage(struct block_list *src,struct block_list *bl,int damage,int div_,int skill_num,int skill_lv,int flag)
@@ -370,28 +370,4 @@
 				if (--(sce->val3) <= 0) //We make it work like Safety Wall, even though it only blocks 1 time.
 					status_change_end(bl, SC_KAUPE, -1);
-			return 0;
-		}
-		
-		//Display red flashing aura effect of Adept Blood Lust [Brain]
-		if(sc->data[SC_LUST] && damage > 0){
-			clif_specialeffect(bl, 548, AREA);
-			if(rand()%100 < 10) clif_specialeffect(bl, 455, AREA); //Red Lightnings, 1/10 attacks will show to prevent spam
-		};
-		//Display blue flashing aura effect of Warlock Overwhelming Evil [Brain]
-		if(sc->data[SC_OVERWHELMING] && damage > 0)
-			clif_specialeffect(bl, 73, AREA);
- //AT Field is Irrelevant, I believe.
-		// AT-Field [Brainstorm]
-		if(sc->data[SC_ATFIELD] &&
-			rand()%100 < sc->data[SC_ATFIELD]->val2)
-		{	//Blocks all skills.
-			clif_specialeffect(bl, 438, AREA);
-			//Shouldn't end until Breaker's non-weapon part connects.
-			if (skill_num == ASC_BREAKER ||
-				skill_num == LK_SPIRALPIERCE ||
-				skill_num == CG_ARROWVULCAN ||
-				skill_num == SN_SHARPSHOOTING)
-				if (--sc->data[SC_ATFIELD]->val3 <= 0) //We make it work like Safety Wall
-				status_change_end(bl, SC_ATFIELD, -1);
 			return 0;
 		}
@@ -627,5 +603,5 @@
 
 /*==========================================
- * ?Cû_??[W
+ * ?Cû_E?[W
  *------------------------------------------*/
 int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type)
@@ -639,6 +615,5 @@
 
 	if((skill = pc_checkskill(sd,AL_DEMONBANE)) > 0 &&
-		target->type == BL_MOB && //This bonus doesnt work against players.
-		(battle_check_undead(status->race,status->def_ele) || status->race==RC_DEMON) )
+		(status->race==RC_UNDEAD || status->race==RC_DEMON) )
 		damage += (skill*(int)(3+(sd->status.base_level+1)*0.05));	// submitted by orn
 		//damage += (skill * 3);
@@ -649,8 +624,4 @@
 			damage += sd->status.str;
 	}
-//AMIDOINITRITE?! V seems okay.	
-	//Warlock Touch of Corruption (Mage-Monster Killer passive skill) [Brainstorm]
-	if((skill = pc_checkskill(sd,WL_CORRUPTION)) > 0 && target->type==BL_MOB )
-		damage += (skill * (status->int_/10));
 
 	if(type == 0)
@@ -1328,7 +1299,4 @@
 			switch( skill_num )
 			{
-				case NC_DEATHHAND: // Necro Death Hand [Brain]
-					skillratio += -25+25*skill_lv; //I wonder if it will accept that?
-					break;
 				case SM_BASH:
 					skillratio += 30*skill_lv;
@@ -1746,5 +1714,5 @@
 				vit_def = def2/2 + (vit_def>0?rand()%vit_def:0);
 				
-				if((battle_check_undead(sstatus->race,sstatus->def_ele) || sstatus->race==RC_DEMON) && //This bonus already doesnt work vs players
+				if((sstatus->race==RC_UNDEAD || sstatus->race==RC_DEMON) &&
 					src->type == BL_MOB && (skill=pc_checkskill(tsd,AL_DP)) > 0)
 					vit_def += skill*(int)(3 +(tsd->status.base_level+1)*0.04);   // submitted by orn
@@ -2219,7 +2187,5 @@
 		{	//Calc base damage according to skill
 			case AL_HEAL:
-			case PR_BENEDICTIO: //Accidentally deleted the :, replaced it. No difference, so dont worry about this.
-			case AD_DARKHEAL: // Adept Dark Heal
-			//Is this a good place for dark heal, i wonder? Seems fine though.
+			case PR_BENEDICTIO:
 				ad.damage = skill_calc_heal(src, target, skill_lv)/2;
 				break;
@@ -2340,32 +2306,4 @@
 						skillratio += 100 +100*skill_lv +100*(skill_lv/2);
 						break;
-						
-//NOTE: All the skills below here did NOT work before, may have been a stupid mistake but this is for reference.
-					case NC_DRAINLIFE: // Necro Drain Life [Brain]
-						skillratio += 25*skill_lv;
-						break;
-					case WL_HELLFIRE: // Warlock Hellfire [Brain]
-						skillratio += 25*skill_lv;
-						break;
-					case WL_SHADOWBURN: // Warlock Shadow Burn [Brain]
-						skillratio += 20*skill_lv;
-						break;
-					case WL_CURSEDOOM: // Warlock Curse of Doom [Brain]
-						skillratio += 400 + 300*skill_lv; //max 20*matk dmg after 60 seconds
-						break;
-					case WL_SEARING: // Warlock Searing Pain [Brain]
-						if(status_get_sc(target)->data[SC_SEARING])
-							skillratio = 10*pc_checkskill(sd,WL_SEARING);//10% * skilllv
-						break; //Else 100% Matk
-					case WL_IMMOLATE: // Warlock Immolate [Brain]
-						if(status_get_sc(target)->data[SC_IMMOLATE])
-							skillratio += 10*pc_checkskill(sd,WL_SEARING);//100% +10 * searing lv
-						else skillratio += -20 + 20*skill_lv;// Else 80% + 20% * skill lv
-						break;
-					case WL_CONFLAGRATE: // Warlock Conflagrate [Brain]
-						skillratio += 100 + 60*skill_lv + //damage bonus from other fire skills
-							10*pc_checkskill(sd,WL_SEARING) + 10*pc_checkskill(sd,WL_IMMOLATE);
-						break;
-
 				}
 
@@ -2438,12 +2376,5 @@
 		if (!(nk&NK_NO_ELEFIX))
 			ad.damage=battle_attr_fix(src, target, ad.damage, s_ele, tstatus->def_ele, tstatus->ele_lv);
-//Take this into account for errors. It looks out of place/outdated but I will not look further into it until I know.
-		if(skill_num == WL_SHADOWBURN) { // Warlock Shadow Burn [Brain]
-			// This is where we calculate the secondary damage
-			if(ad.damage<1) ad.damage=1;
-			struct Damage md = battle_calc_misc_attack(src,target,skill_num,skill_lv, mflag);
-			if(md.damage<1) md.damage=1;
-			ad.damage += md.damage;
-		}
+
 		if (sd && !(nk&NK_NO_CARDFIX_ATK)) {
 			short t_class = status_get_class(target);
@@ -2511,5 +2442,5 @@
 
 /*==========================================
- * »ÌŒ_??[WvZ
+ * »ÌŒ_E?[WvZ
  *------------------------------------------*/
 struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,int skill_num,int skill_lv,int mflag)
@@ -2645,16 +2576,5 @@
 	case NPC_EVILLAND:
 		md.damage = (skill_lv>6)?666:skill_lv*100;
-//Why the hell is this supposed to be above the break?
-	case WL_SHADOWBURN: // Warlock ShadowBurn dark element damage [Brain]
-		s_ele = ELE_DARK;
-		md.damage = ((300 + 20*skill_lv)/100)*((sstatus->int_*(rand()%300+500))/100); //Fixed between min and max matk for now
 		break;
-		
-// Wouldn't this work better?
-
-/*	case WL_SHADOWBURN: // Warlock ShadowBurn dark element damage [Brain]
-		s_ele = ELE_DARK;
-		md.damage = ((300 + 20*skill_lv)/100)*((sstatus->int_*(rand()%300+500))/100); //Fixed between min and max matk for now
-break;*/
 	}
 
@@ -2750,5 +2670,5 @@
 }
 /*==========================================
- * _??[WvZê??p
+ * _E?[WvZê?E?p
  *------------------------------------------*/
 struct Damage battle_calc_attack(int attack_type,struct block_list *bl,struct block_list *target,int skill_num,int skill_lv,int count)
@@ -2843,20 +2763,4 @@
 	if (sd->sp_vanish_rate && rand()%1000 < sd->sp_vanish_rate)
 		status_percent_damage(&sd->bl, tbl, 0, (unsigned char)sd->sp_vanish_per, false);
-//I don't know about this. But it looks like it fits fine
-	// Adept Blood Pact drains 5% damage per hit [FlavioJS/Brain]
-	if( pc_checkskill(sd, AD_BLOODPACT) > 0 )
-		thp += battle_calc_drain(rdamage,1000,5);
-
-	// Warlock Soul Steal drains 1%*skilllv damage per hit [Brain]
-	if( pc_checkskill(sd, WL_SOULSTEAL) > 0 )
-		tsp += battle_calc_drain(rdamage,1000,pc_checkskill(sd,WL_SOULSTEAL));
-	// Warlock Touch of Corruption burns 1%*skilllv damage as SP per hit [Brain]
-	if( pc_checkskill(sd, WL_CORRUPTION) > 0 ) {// This is the opener, whoops lol.
-		int corrupt_sp;
-		corrupt_sp = battle_calc_drain(rdamage,1000,pc_checkskill(sd,WL_CORRUPTION));
-		if(status_damage(NULL, tbl, 0, corrupt_sp, 0, 3))
-			rhp += corrupt_sp;//If SP damage was caused, increase HP damage too
-	}// Where does this bracket open?
-
 	if (!thp && !tsp) return;
 
@@ -2868,5 +2772,5 @@
 
 /*==========================================
- * Ê?í?U??ÜÆß
+ * Ê?EU?E?ÜÆß
  *------------------------------------------*/
 enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* target, unsigned int tick, int flag)
@@ -3082,17 +2986,5 @@
 	return wd.dmg_lv;
 }
-//new battle check code, i speculate it. But it looks like it just calls other races and elements into one big one.
-int battle_check_living(int race,int element)// Living creature check [Brain]
-{
-	if(element == ELE_UNDEAD || race == RC_UNDEAD // Undead element and race check
-		|| race == RC_DEMON			// Demon race check
-		|| race == RC_FORMLESS			// Formless race check
-		|| element == ELE_GHOST){		// Ghost element check
-		return 0;
-	}
-	else {
-	return 1;
-	}
-}
+
 int battle_check_undead(int race,int element)
 {
@@ -3241,4 +3133,15 @@
 				strip_enemy = 0;
 			}
+			// Sketchy - begin
+		if (sd->state.god && t_bl != s_bl && s_bl->type == BL_PC && ((TBL_PC*)s_bl)->state.demon && map[m].flag.hostile) {
+		state |= BCT_ENEMY;
+		strip_enemy = 0;
+		}
+
+		if (sd->state.demon && t_bl != s_bl && s_bl->type == BL_PC && ((TBL_PC*)s_bl)->state.god && map[m].flag.hostile) {
+		state |= BCT_ENEMY;
+		strip_enemy = 0;
+		}
+		// Sketchy -end
 			break;
 		}
@@ -3809,10 +3712,5 @@
 	{ "auction_feeperhour",                 &battle_config.auction_feeperhour,              12000,  0,      INT_MAX,        },
 	{ "auction_maximumprice",               &battle_config.auction_maximumprice,            500000000, 0,   MAX_ZENY,       },
-//battle conf declarations, does this mean we add new lines to battle.conf?
-	//Vanaheim battle settings [Brainstorm]
-	{ "necro_retaliation",                  &battle_config.necro_retaliation,               1,      0,      1,              },
-	{ "disp_summon_stats",                  &battle_config.disp_summon_stats,               0,      0,      1,              },
 	{ "gm_viewequip_min_lv",                &battle_config.gm_viewequip_min_lv,             0,      0,      99,             },
-	{ "homunculus_auto_vapor",              &battle_config.homunculus_auto_vapor,           0,      0,      1,              },
 };
 
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 24)
+++ src/map/skill.c (revision 1)
@@ -42,5 +42,5 @@
 #define GD_SKILLRANGEMIN 900
 #define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL
-#define HM_SKILLRANGEMIN 1100 //I know for a fact this will cause authok problems where it is, but perhaps it's changed now.
+#define HM_SKILLRANGEMIN 800
 #define HM_SKILLRANGEMAX HM_SKILLRANGEMIN+MAX_HOMUNSKILL
 
@@ -610,6 +610,5 @@
 	case CR_GRANDCROSS:
 	case NPC_GRANDDARKNESS:
-		//Chance to cause blind status vs demon and undead element, but not against players
-		if(!dstsd && (battle_check_undead(tstatus->race,tstatus->def_ele) || tstatus->race == RC_DEMON))
+		if(tstatus->race == RC_UNDEAD || tstatus->race == RC_DEMON)
 			sc_start(bl,SC_BLIND,100,skilllv,skill_get_time2(skillid,skilllv));
 		break;
@@ -822,28 +821,4 @@
 		sc_start(bl,SC_CRITICALWOUND,100,skilllv,skill_get_time2(skillid,skilllv));
 		break;
-//This has weird Structure compared to the other stuff here.
-	case NC_GHOULTOUCH:	//Necro Ghoul Touch [Brain]
-		if (battle_check_living(tstatus->race, tstatus->def_ele)) //Check if target is a living creature before proceed
-			sc_start(bl,SC_POISON,10000,skilllv,skill_get_time2(skillid,skilllv));
-		break;
-	case NC_PWSUFFER:	//Necro Power Word: Suffer [Brain]
-	case WL_PWAGONY:	//Warlock Power Word: Agony [Brain]
-		if (battle_check_living(tstatus->race, tstatus->def_ele)) //Check if target is a living creature before proceed
-			sc_start(bl,skillid==NC_PWSUFFER?SC_SUFFER:SC_AGONY,1000,skilllv,skill_get_time2(skillid,skilllv));
-		break;
-	case WL_SEARING:	//Warlock Searing Pain [Brain]
-		//The DoT is only initiated if target isnt burning already.
-		if(!tsc->data[SC_SEARING] && !tsc->data[SC_IMMOLATE])
-			sc_start(bl,SC_SEARING,10000,skilllv,skill_get_time2(skillid,skilllv));
-		break;
-	case WL_IMMOLATE:	//Warlock Immolate [Brain]
-		//The DoT is only initiated if target isnt in immolate, but must be in searing pain status
-		if(tsc->data[SC_SEARING] && !tsc->data[SC_IMMOLATE])
-			sc_start(bl,SC_IMMOLATE,10000,skilllv,skill_get_time2(skillid,skilllv));
-		break;
-	case WL_SHADOWBURN:	//Warlock Shadow Burn [Brain]
-		sc_start(bl,SC_STUN,10000,skilllv,skill_get_time(skillid,skilllv));
-		break;
-
 	}
 
@@ -1042,15 +1017,4 @@
 		clif_skill_nodamage(src,bl,HW_SOULDRAIN,rate,1);
 		status_heal(src, 0, status_get_lv(bl)*(95+15*rate)/100, 2);
-	}
-//was hard to pinpoint this place.
-	// Warlock Soul Steal [Brain]
-	if(sd && skillid && attack_type&BF_MAGIC && status_isdead(bl) 
-		&& !(skill_get_inf(skillid)&(INF_GROUND_SKILL|INF_SELF_SKILL))
-		&& (rate=pc_checkskill(sd,WL_SOULSTEAL))>0){// Wont work with area/ground spells (hellfire)
-		if (pc_issit(sd)) pc_setstand(sd);
-		clif_skill_nodamage(src,bl,WL_SOULSTEAL,rate,1);
-		clif_specialeffect(src, 253, AREA); // Absorb Mana effect on caster
-		status_heal(src, 0, status_get_lv(bl)*(90+10*rate)/100, 2);
-		if(rand()%100 < rate) skill_additem(src,src,15020,1); //Chance to "steal" the target soul
 	}
 
@@ -1510,6 +1474,7 @@
 	damage = dmg.damage + dmg.damage2;
 	
-	if( (skillid == AL_INCAGI || skillid == AL_BLESSING) && tsd->sc.data[SC_CHANGEUNDEAD] )
-		damage = 1;
+	if (skillid == AL_INCAGI || skillid == AL_BLESSING)
+		if (tsd->sc.data[SC_CHANGEUNDEAD])
+			damage = 1;
 
 	if (damage > 0 && dmg.flag&BF_WEAPON && src != bl && src == dsrc &&
@@ -1800,11 +1765,9 @@
 	if(battle_check_target(src,bl,flag) > 0)
 	{
-		// several splash skills need this initial dummy packet to display correctly
-		if (flag&SD_PREAMBLE && skill_area_temp[2] == 0)
-			clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
-
-		if (flag&(SD_SPLASH|SD_PREAMBLE))
+		if (flag&(SD_SPLASH|SD_PREAMBLE)) {
+			if (flag&SD_PREAMBLE && !skill_area_temp[2])
+				clif_skill_damage(src,bl,tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6);
 			skill_area_temp[2]++;
-
+		}
 		return func(src,bl,skill_id,skill_lv,tick,flag);
 	}
@@ -2145,37 +2108,4 @@
 								sc->data[SC_SPIRIT]->val3 = 0; //Clear bounced spell check.
 						}
-					}
-					break;
-//Could be confusing to find the right place.
-				case NC_PWSUFFER: //Necro Power Word: Suffer [Brain]
-					if (!status_isdead(target) && status_get_sc(target)->data[SC_SUFFER]){
-						skill_attack(BF_MAGIC,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag|SD_ANIMATION|SD_LEVEL);
-						clif_specialeffect(target, 180, AREA); //Shadow Hit Effect on target
-						if (skl->type>1 && !status_isdead(target))
-							skill_addtimerskill(src,tick+3000,target->id,0,0,skl->skill_id,skl->skill_lv,skl->type-1,skl->flag|SD_ANIMATION);
-					}
-					break;
-				case WL_SEARING: //Warlock Searing Pain [Brain]
-					if (!status_isdead(target) && status_get_sc(target)->data[SC_SEARING]){
-						skill_attack(BF_MAGIC,src,target,target,skl->skill_id,skl->skill_lv,tick,skl->flag|SD_ANIMATION|SD_LEVEL);
-						clif_specialeffect(target, 49, AREA); //Fire Hit Effect on target
-						if (skl->type>1 && !status_isdead(target))
-							skill_addtimerskill(src,tick+3000,target->id,0,0,skl->skill_id,skl->skill_lv,skl->type-1,skl->flag|SD_ANIMATION);
-					}
-					break;
-				case WL_IMMOLATE: //Warlock Immolate [Brain]
-					if (!status_isdead(target) && status_get_sc(target)->data[SC_IMMOLATE]){
-						skill_attack(BF_MAGIC,src,target,target,skl->skill_id,skl->skill_lv,tick,skl->flag|SD_ANIMATION|SD_LEVEL);
-						clif_specialeffect(target, 97, AREA); //Firepillar Hit Effect on target
-						if (skl->type>1 && !status_isdead(target))
-							skill_addtimerskill(src,tick+3000,target->id,0,0,skl->skill_id,skl->skill_lv,skl->type-1,skl->flag|SD_ANIMATION);
-					}
-					break;
-				case WL_PWAGONY: //Warlock Power Word: Agony [Brain]
-					if (!status_isdead(target) && status_get_sc(target)->data[SC_AGONY]){
-						skill_attack(BF_MAGIC,src,target,target,skl->skill_id,skl->skill_lv,tick,skl->flag|SD_ANIMATION|SD_LEVEL);
-						clif_specialeffect(target, 587, AREA); //Big Purple Flame Effect on target
-						if (skl->type>1 && !status_isdead(target))
-							skill_addtimerskill(src,tick+3000,target->id,0,0,skl->skill_id,skl->skill_lv,skl->type-1,skl->flag|SD_ANIMATION);
 					}
 					break;
@@ -2394,23 +2324,4 @@
 		skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
 		break;
-		
-//... something doesn't fit about this. Seriously.
-	case NC_GHOULTOUCH:	//Necro Ghoul Touch [Brain]
-		skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag);
-		clif_specialeffect(bl, 124, AREA); //Venom Dust Effect on target
-		break;
-	case NC_DEATHHAND: 	//Necro Death Hand [Brain]
-		skill_attack(BF_WEAPON,src,src,bl,skillid,skilllv,tick,flag|SD_LEVEL);//Hide skill yell
-		clif_specialeffect(bl, 65, AREA); //Power absorb Effect on target
-		if (battle_check_living(tstatus->race, tstatus->def_ele)){ //Check if target is a living creature before proceed
-			int chance = (10+(skilllv*2)+(status_get_luk(src)-status_get_luk(bl))/5); 
-			//10% chance + 2% per skilllv + (caster luk - target luk)/5 %
-				if (rand()%100 < chance) {
-					clif_skill_nodamage(src,bl,skillid,-1,flag|SD_LEVEL);//Hide skill yell
-					status_percent_damage(src, bl, 100, 0, true); //Instant kill our target
-				} else clif_skill_fail(sd,skillid,0,0);
-		}
-		break;
-
 
 	case LK_JOINTBEAT: // decide the ailment first (affects attack damage and effect)
@@ -2748,81 +2659,4 @@
 		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
 		break;
-//another thing in a weird place.
-	case AD_DARKHEAL: // Adept Dark Heal [Brain]
-		clif_specialeffect(bl, 656, AREA); //Blinking Green Sprite Effect on target
-		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); //Exception because we must add the effect manually =/
-		break;
-	case NC_PWSUFFER: //Necro Power Word: Suffer [Brain]
-		if(battle_check_living(tstatus->race,tstatus->def_ele)){
-			skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
-			clif_specialeffect(bl, 180, AREA); //Shadow hit Effect on target
-			clif_specialeffect(src, 454, AREA); //Black Cast Effect on caster
-			//If target is on suffering status already, just cause damage, no extra DoT
-			if(!status_get_sc(bl)->data[SC_SUFFER])
-				skill_addtimerskill(src,tick+3000,bl->id,0,0,skillid,skilllv,skilllv,flag);
-		}
-		else clif_skill_fail(sd,skillid,0,0);
-		break;
-	case NC_DRAINLIFE: // Necromancer Drain Life [Brain]
-		{
-			int heal = skill_attack(BF_MAGIC, src, src, bl, skillid, skilllv, tick, flag)/2;
-			if (heal > 0 && (battle_check_living(tstatus->race,tstatus->def_ele))){
-				clif_skill_nodamage(NULL, src, AL_HEAL, heal, 1);
-				status_heal(src, heal, 0, 0);
-			}
-		}
-		clif_specialeffect(bl, 180, AREA); //Shadow hit Effect on target
-		clif_specialeffect(src, 454, AREA); //Black Cast Effect on caster
-		break;
-	case WL_SHADOWBOLT: // Warlock Shadowbolt [Brain]
-		clif_specialeffect(bl, 180, AREA); //Shadow hit Effect on target
-		clif_specialeffect(src, 454, AREA); //Black Cast Effect on caster
-		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag); //Again, the effect...cursed effects...
-		break;
-	case WL_SHADOWBURN: // Warlock Shadow Burn [Brain]
-		clif_specialeffect(bl, 180, AREA); //Shadow hit Effect on target
-		clif_specialeffect(bl, 32, AREA); //Flame Engulf Effect on target
-		clif_specialeffect(src, 454, AREA); //Black Cast Effect on caster
-		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
-		break;
-	case WL_SEARING: // Warlock Searing Pain [Brain]
-		clif_specialeffect(bl, 406, AREA); //Fire on Head Effect on target
-		clif_specialeffect(src, 55, AREA); //Red Cast Effect on caster
-		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
-		//if target is on searing status already, just cause damage, no extra DoT
-		if(!status_get_sc(bl)->data[SC_SEARING])
-			skill_addtimerskill(src,tick+3000,bl->id,0,0,skillid,skilllv,4,flag);
-		break;
-	case WL_CONFLAGRATE: // Warlock Conflagrate [Brain]
-		if(status_get_sc(bl)->data[SC_IMMOLATE]) { // Can only be casted if target is immolating status
-			clif_specialeffect(bl, 183, AREA); //Explosion Effect on target
-			clif_specialeffect(src, 55, AREA); //Red Cast Effect on caster
-			skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
-			status_change_end(bl,SC_IMMOLATE,-1); //End Immolating status
-		} else clif_skill_fail(sd,skillid,0,0);
-		break;
-	case WL_IMMOLATE: // Warlock Immolate [Brain]
-		clif_specialeffect(bl, 635, AREA); //Dragon Fire Effect on target
-		clif_specialeffect(src, 55, AREA); //Red Cast Effect on caster
-		skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
-		//If Target is on searing pain status, will change immolating status instead
-		if(!status_get_sc(bl)->data[SC_IMMOLATE])
-			skill_addtimerskill(src,tick+3000,bl->id,0,0,skillid,skilllv,5,flag);
-		break;
-	case WL_CURSEDOOM: // Warlock Curse of Doom [Brain]
-		clif_specialeffect(bl, 183, AREA); //Explosion Effect on target
-		skill_attack(BF_MAGIC,src,bl,bl,skillid,skilllv,tick,flag|SD_ANIMATION);
-		break;
-	case WL_PWAGONY: // Warlock Power Word: Agony [Brain]
-		if(battle_check_living(tstatus->race,tstatus->def_ele)){
-			skill_attack(BF_MAGIC,src,src,bl,skillid,skilllv,tick,flag);
-			clif_specialeffect(bl, 587, AREA); //Big Purple Flame Effect on target
-			clif_specialeffect(src, 454, AREA); //Black Cast Effect on caster
-			//If target is on Agonizing status already, just cause damage, no extra DoT
-			if(!status_get_sc(bl)->data[SC_AGONY])
-				skill_addtimerskill(src,tick+3000,bl->id,0,0,skillid,skilllv,skilllv,flag);
-		}
-		else clif_skill_fail(sd,skillid,0,0);
-		break;
 
 	case NPC_MAGICALATTACK:
@@ -3031,7 +2865,5 @@
 		return 1;
 
-	// Added DEATHPACT [Brain]
-	//if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
-	if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO && skillid != NC_DEATHPACT)
+	if(src!=bl && status_isdead(bl) && skillid != ALL_RESURRECTION && skillid != PR_REDEMPTIO)
 		return 1;
 
@@ -3059,19 +2891,4 @@
 			}
 			break;
-//right place?
-		case AD_DARKHEAL:	// Adept Dark Heal [Brain]
-			// Only player casted spells can be offensive (copyed from AL_HEAL code above)
-			if (sd && (battle_check_living(tstatus->race,tstatus->def_ele)) //Check if target is a living creature
-				&& !pc_checkskill(dstsd,NC_PHYLACTERY) //Or he doesnt have Phylactery (non-perma undead)
-				&& !status_get_sc(bl)->data[SC_OVERWHELMING]) { //Or Overwhelming Evil is off (most cases)
-				if (battle_check_target(src, bl, BCT_ENEMY) < 1) {
-				  	//Offensive heal does not works on non-enemies.
-					clif_skill_fail(sd,skillid,0,0);
-					return 0;
-				}
-				return skill_castend_damage_id(src, bl, skillid, skilllv, tick, flag);
-			}
-			break;
-
 		case NPC_SMOKING: //Since it is a self skill, this one ends here rather than in damage_id. [Skotlex]
 			return skill_castend_damage_id (src, bl, skillid, skilllv, tick, flag);
@@ -3103,11 +2920,4 @@
 			if (status_isimmune(bl) || (dstmd && dstmd->class_ == MOBID_EMPERIUM))
 				heal=0;
-//To not allow heal for joo
-			// Profane Soul reduces the healed recieved by 3% per skilllv [Brain]
-			if(dstsd) {
-				heal = heal * (100 - pc_checkskill(dstsd,AD_PROFANE)*3)/100;
-				//Wont heal even if he got elemental armors [Brain]
-				if(pc_checkskill(dstsd,NC_PHYLACTERY)) heal = skilllv;
-			}
 			if (sd) {
 				if ((i = pc_skillheal_bonus(sd, skillid)))
@@ -3145,22 +2955,4 @@
 		}
 		break;
-	case AD_DARKHEAL: // Adept Dark Heal [Brain]
-		{
-			int heal = skill_calc_heal(src, bl, skilllv);
-			if (status_isimmune(bl) || (dstmd && dstmd->class_ == MOBID_EMPERIUM))
-				heal=0;
-			if(battle_check_undead(tstatus->race,tstatus->def_ele) || tstatus->race==RC_UNDEAD // Check if our target is undead or demon
-				|| tstatus->race==RC_DEMON || pc_checkskill(dstsd,NC_PHYLACTERY)//Or has a phylactery
-				|| status_get_sc(bl)->data[SC_OVERWHELMING]) { //Or is on OverWhelm status, checking again...
-				clif_skill_nodamage(src, bl, skillid, heal, 1);
-				clif_skill_nodamage(NULL, bl, AL_HEAL, heal, 1); //Subtle way to show heal numbers AND effect =D
-				status_heal(bl, heal, 0, 0);
-			} else {
-				clif_skill_nodamage(src, bl, skillid, 0, 1);
-				clif_skill_nodamage(NULL, bl, AL_HEAL, 0, 1);
-			}
-		clif_specialeffect(bl, 656, AREA); //Blinking Green Sprite Effect on target
-		}
-		break;
 
 	case PR_REDEMPTIO:
@@ -3196,5 +2988,4 @@
 		
 	case ALL_RESURRECTION:
- 	case NC_DEATHPACT: // Necro Death Pact [Brain] (Seems fine)
 		if(sd && map_flag_gvg(bl->m))
 		{	//No reviving in WoE grounds!
@@ -3214,6 +3005,4 @@
 			case 3: per=50; break;
 			case 4: per=80; break;
-			case 5: per=100; break; //Added a 5th level because NC_DEATHPACT got 5 lvs [Brain]
-//above seems ok
 			}
 			if(dstsd && dstsd->special_state.restart_full_recover) 
@@ -3222,11 +3011,4 @@
 			{
 				clif_skill_nodamage(src,bl,ALL_RESURRECTION,skilllv,1); //Both Redemptio and Res show this skill-animation.
-//Seriously, how is this right? It just doesnt look right but i may be ignoring something.
-				if(skillid==NC_DEATHPACT) { // Necro Death Pact [Brain]
-					clif_skill_nodamage(src, bl, skillid, skilllv, 
-						sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-					break;
-				}
-
 				if(sd && dstsd && battle_config.resurrection_exp > 0) 
 				{
@@ -3247,94 +3029,4 @@
 		}
 		break;
-//Huge lump of code here.
-	case AD_PWBLIND: // Adept Power Word: Blind [Brain]
-		if(!tsc->data[type]) {
-			clif_skill_nodamage(src, bl, skillid, skilllv,1);
-			if(sc_start(bl, type,(30 + skilllv * 10 + (status_get_lv(src) - sstatus->int_)/5),
-				skilllv, skill_get_time(skillid,skilllv))) 
-			{
-				if(dstmd) mob_unlocktarget(dstmd,tick);  //Removes current target
-				clif_specialeffect(bl, 379, AREA); //379.Soul Drain (2nd Part)
-				break;
-			}
-		} else clif_skill_fail(sd,skillid,0,0);
-		break;
-	case AD_PWFEAR: // Adept Power Word: Fear [Brain]
-		if(!tsc->data[type]) {
-			clif_skill_nodamage(src, bl, skillid, skilllv,1);
-			if(dstsd)
-				type = SC_CONFUSION; //Players cant be affected by SC_FEAR
-			if(sc_start(bl, type, (30 + skilllv * 10), skilllv, skill_get_time(skillid,skilllv)))
-			{
-				clif_specialeffect(bl, 372, AREA); //372.Death
-				unit_escape(bl, bl, 30);
-			}
-		} else clif_skill_fail(sd,skillid,0,0);
-		break;
-	case WL_HOWLOFPAIN: // Warlock Howl of Pain [Brain]
-		//These must be here first or else the code wont execute them.
-		clif_specialeffect(src, 670, AREA); // Monster skill SCREAM effect on caster (no sound)
-		clif_soundeffectall(bl, "wraith_die.wav", 0, AREA); //Wraith Laugh Sound
-		if (flag & 1) {
-			//Check if target is a living creature AND a valid enemy
-			if (battle_check_target(src, bl, BCT_ENEMY) && battle_check_living(tstatus->race,tstatus->def_ele))
-			{
-				if(sc_start(bl,type,10+skilllv*10,skilllv,skill_get_time(skillid,skilllv)))
-				{
-					if(dstmd) //PROVOKE Effect on mobs
-						mob_target(dstmd,src,skill_get_range2(src,skillid,skilllv));
-					// Breaks Frozen and Sleep status
-					if(tsc && tsc->count){
-						if(tsc->data[SC_FREEZE])
-							status_change_end(bl,SC_FREEZE,-1);
-						if(tsc->data[SC_SLEEP])
-							status_change_end(bl,SC_SLEEP,-1);
-					}
-					clif_emotion(bl,6); //anger emote on target
-					break;
-				} else { //What will happen if the status fail:
-					{
-						if (sd) //If is a player
-							clif_skill_fail(sd,skillid,0,0);
-						map_freeblock_unlock(); //Else is a mob
-						return 0;
-					}
-					unit_skillcastcancel(bl, 2); //In any case, will cancel casting
-				}
-			}
-		} else {
-			map_foreachinrange(skill_area_sub, src,
-				skill_get_splash(skillid, skilllv), BL_CHAR,
-				src, skillid, skilllv, tick, flag|BCT_ENEMY|1,
-				skill_castend_nodamage_id);
-			clif_skill_nodamage(src, bl, skillid, skilllv, 1);
-			map_freeblock_unlock();
-			return 1;
-		}
-		break;
-	case WL_HOWLOFTERROR: // Warlock Howl of Terror [Brain]
-		if (flag & 1) {
-			int rate;
-			//Check if target is a living creature AND a valid enemy
-			if (battle_check_target(src, bl, BCT_ENEMY)
-				&& battle_check_living(tstatus->race,tstatus->def_ele)) {
-				rate = 10 + skilllv*5 + pc_checkskill(sd,AD_PWFEAR)*3;
-				if(dstsd) { 
-					rate -= 10; // 10% less chance on players
-					type = SC_CONFUSION; //Players cant be affected by SC_FEAR
-				}
-				if(sc_start(bl,type,rate,skilllv,skill_get_time(skillid,skilllv)))
-					clif_specialeffect(bl, 372, AREA); //Same as PW: Fear
-			}
-		} else {
-			map_foreachinrange(skill_area_sub, src,
-				skill_get_splash(skillid, skilllv), BL_CHAR,
-				src, skillid, skilllv, tick, flag|BCT_ENEMY|1,
-				skill_castend_nodamage_id);
-			clif_skill_nodamage(src, bl, skillid, skilllv, 1);
-		}
-		clif_specialeffect(src, 668, AREA); // Monster skill SCREAM effect on caster (with sound)
-		break;
-// Would be easy to screw up in that.
 
 	case AL_DECAGI:
@@ -3352,69 +3044,4 @@
 				src, skillid, skilllv, tick, flag|BCT_ENEMY|1, skill_castend_nodamage_id);
 			clif_skill_nodamage(src, bl, skillid, skilllv, 1);
-		}
-		break;
-//another huge lump
-	case NC_DARKMOON: //Necro Dark Moon [Brain]
-		if (flag&1) {
-			//Check my enemies
-			if (battle_check_target(src, bl, BCT_ENEMY) &&
-				battle_check_living(tstatus->race,tstatus->def_ele))
-			{
-				if(sc_start(bl,SC_BLIND,50,skilllv,skill_get_time(skillid,skilllv)))
-					clif_specialeffect(bl, 580, AREA); //Box of Rain effect on target
-			}
-			else { //Now my Party members
-				if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
-					clif_skill_nodamage(bl,bl,skillid,skilllv,
-					sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-					clif_specialeffect(bl, 521, AREA); //Red Flashing Aura Sprite effect on target
-				} else if (sd) {
-					party_foreachsamemap(skill_area_sub, sd,skill_get_splash(skillid, skilllv),
-						src,skillid,skilllv,tick, flag|BCT_ALL|1,skill_castend_nodamage_id);
-				}
-			}
-		} else {
-			map_foreachinrange(skill_area_sub, src, skill_get_splash(skillid, skilllv), BL_CHAR,
-				src, skillid, skilllv, tick, flag|BCT_ALL|1, skill_castend_nodamage_id);
-			clif_skill_nodamage(src, bl, skillid, skilllv, 1);
-		}
-		clif_specialeffect(src, 407, AREA); //Soul Change Effect on caster
-		clif_soundeffectall(bl, "se_wolf1.wav", 0, AREA); //Wolf Howl Sound
-		break;
-	case NC_REQUIEM: //Necro Requiem [Brain]
-		if (flag&1) {
-			//Check my enemies
-			if (battle_check_target(src, bl, BCT_ENEMY) &&
-					battle_check_living(tstatus->race,tstatus->def_ele))
-			{
-				if(sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)))
-					clif_specialeffect(bl, 578, AREA); //Box of Curse effect on target
-			}
-			else { //Now my Party members
-				if (sd == NULL || sd->status.party_id == 0 || (flag & 1)) {
-					clif_skill_nodamage(bl,bl,skillid,skilllv,
-					sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-					clif_specialeffect(bl, 572, AREA); //Warmth Soul effect on target
-				} else if (sd) {
-					party_foreachsamemap(skill_area_sub, sd,skill_get_splash(skillid, skilllv),
-						src,skillid,skilllv,tick, flag|BCT_ALL|1,skill_castend_nodamage_id);
-				}
-			}
-		} else {
-			map_foreachinrange(skill_area_sub, src, skill_get_splash(skillid, skilllv), BL_CHAR,
-				src, skillid, skilllv, tick, flag|BCT_ALL|1, skill_castend_nodamage_id);
-			clif_skill_nodamage(src, bl, skillid, skilllv, 1);
-		}
-		int rnds = rand()%3;
-		switch(rnds) {
-			case 1:
-				clif_soundeffectall(bl, "chant1.wav", 0, AREA); //Chanting Sound
-				break;
-			case 2:
-				clif_soundeffectall(bl, "chant2.wav", 0, AREA); //Chanting Sound
-				break;
-			case 3:
-				clif_soundeffectall(bl, "chant3.wav", 0, AREA); //Chanting Sound
-				break;
 		}
 		break;
@@ -3721,57 +3348,7 @@
 	case NPC_DEFENDER:
 	case NPC_MAGICMIRROR:
-	case ALL_ATFIELD:	//AT Field [Brain] ( still dont think this belongs.)
 		clif_skill_nodamage(src,bl,skillid,skilllv,
 			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
 		break;
-//ANOTHER large lump but it really doesnt feel like it fits here.
-	case AD_LUST:	// Adept Blood Lust [Brain]
-		clif_specialeffect(src, 220, AREA); //Berserk Pot effect
-		clif_specialeffect(src, 455, AREA); //Red Lightnings
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		break;
-	case NC_DECREPIFY: //Necro Decrepify [Brain]
-		if(battle_check_living(tstatus->race,tstatus->def_ele)){
-			clif_specialeffect(bl, 403, AREA); //Mind Breaker Effect on target
-			clif_specialeffect(src, 454, AREA); //Black Cast Effect on caster
-			clif_skill_nodamage(src,bl,skillid,skilllv,
-				sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		}
-		else clif_skill_fail(sd,skillid,0,0);
-		break;
-	case WL_CURSEWEAKNESS: // Warlock Curse of Weakness [Brain]
-		clif_specialeffect(bl, 656, AREA); //Blinking Green Sprite effect on target
-		clif_specialeffect(src, 59, AREA); //Purple Cast Effect on caster
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		break;
-	case WL_CURSEEXHAUST: // Warlock Curse of Exhaustion [Brain]
-		clif_specialeffect(bl, 135, AREA); //Ice Breaking effect on target
-		clif_specialeffect(src, 59, AREA); //Purple Cast Effect on caster
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		break;
-	case WL_CURSETONGUES: // Warlock Curse of Tongues [Brain]
-		clif_specialeffect(bl, 72, AREA); //Spinning Lights effect on target
-		clif_specialeffect(src, 59, AREA); //Purple Cast Effect on caster
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		break;
-	case WL_CURSEDOOM: // Warlock Curse of Doom (temp) [Brain]
-		if(!tsc->data[type]) {
-			clif_specialeffect(bl, 196, AREA); //Small Curse Reaper effect on target
-			clif_specialeffect(src, 59, AREA); //Purple Cast Effect on caster
-			clif_skill_nodamage(src,bl,skillid,skilllv,
-				sc_start4(bl,type,100,
-					skilllv,skillid,src->id,skill_get_time(skillid,skilllv),1000));
-		} else clif_skill_fail(sd,skillid,0,0);
-		break;
-	case WL_OVERWHELMING: // Warlock Overwhelming Evil [Brain]
-		clif_specialeffect(src, 348, AREA); //1000 Blades Trespassing effect on caster
-		clif_skill_nodamage(src,bl,skillid,skilllv,
-			sc_start(bl,type,100,skilllv,skill_get_time(skillid,skilllv)));
-		break;
-
 	case MG_SIGHT:
 	case AL_RUWACH:
@@ -3988,28 +3565,4 @@
 		}
 		if (i) status_heal(src, 0, i, 3);
-		clif_skill_nodamage(src,bl,skillid,skilllv,i?1:0);
-		break;
-//this feels more like it fits.
-	case WL_DRAINSOUL: // Warlock Drain Soul [Brain]
-		i = 0;
-		if (dstsd && (sd == dstsd || map_flag_vs(src->m)))
-		{	//check if target is a player and we are in versus map
-			i = tstatus->max_sp * skilllv/100;//i = SkillLv% of player Max SP
-			if(dstsd->spiritball && (dstsd->class_&MAPID_BASEMASK)!=MAPID_GUNSLINGER) {
-				i += dstsd->spiritball * 5;//will drain Monk Spirits and regain 5 SP per Spirit
-				pc_delspiritball(dstsd,dstsd->spiritball,0);
-			}
-		} else if (dstmd && !(tstatus->mode&MD_BOSS) && battle_check_living(tstatus->race,tstatus->def_ele))
-		{	// check if target is a monster and not a Boss
-			i = dstmd->level/5 * skilllv;//i = mob level/5 * Skill Lvl
-			mob_target(dstmd,src,0);//This will turn the mob agressive against the caster
-		}
-		if(i < skilllv) i = skilllv; //Minimum 1 sp per skill lvl
-		if (i) {
-			clif_specialeffect(src, 253, AREA); //Absorb Mana effect on caster
-			clif_specialeffect(bl, 52, AREA); //Lightning Hit effect on target
-			status_heal(src, 0, i, 3); //caster drains sp
-			status_zap(bl, 0, i*skilllv); //target lost sp equal to 1*SkillLv the amount drained
-		}
 		clif_skill_nodamage(src,bl,skillid,skilllv,i?1:0);
 		break;
@@ -5687,6 +5240,5 @@
 	}
 
-	if(ud->skillid != SA_CASTCANCEL )
-	{// otherwise handled in unit_skillcastcancel()
+	if(ud->skillid != SA_CASTCANCEL ) {
 		if( ud->skilltimer != tid ) {
 			ShowError("skill_castend_id: Timer mismatch %d!=%d!\n", ud->skilltimer, tid);
@@ -5694,12 +5246,7 @@
 			return 0;
 		}
-
-		if( sd && ud->skilltimer != -1 && pc_checkskill(sd,SA_FREECAST) > 0 )
-		{// restore original walk speed
-			ud->skilltimer = -1;
-			status_calc_bl(&sd->bl, SCB_SPEED);
-		}
-
-		ud->skilltimer = -1;
+		if( sd && ud->skilltimer != -1 && pc_checkskill(sd,SA_FREECAST))
+			status_freecast_switch(sd);
+		ud->skilltimer=-1;
 	}
 
@@ -5925,11 +5472,8 @@
 	}
 
-	if( sd && ud->skilltimer != -1 && pc_checkskill(sd,SA_FREECAST) > 0 )
-	{// restore original walk speed
-		ud->skilltimer=-1;
-		status_calc_bl(&sd->bl, SCB_SPEED);
-	}
+	if(sd && ud->skilltimer != -1 && pc_checkskill(sd,SA_FREECAST))
+		status_freecast_switch(sd);
+
 	ud->skilltimer=-1;
-
 	do {
 		if(status_isdead(src))
@@ -6091,11 +5635,5 @@
 			src->m, x-i, y-i, x+i,y+i,BL_SKILL);
 		break;
-//the code changed alot and jumped around.
-	case WL_HELLFIRE: // Warlock Hellfire [Brain]
-		//clif_specialeffect(sd, 92, AREA); //Meteor Effect on caster, cant set on ground
-		clif_skill_poseffect(src,WZ_METEOR,skilllv,x,y,tick); //Meteor Effect
-		clif_skill_nodamage(src, src, skillid, 0, 1); //Lalala, just to show the skill yell correctly
-		clif_specialeffect(src, 55, AREA); //Red Cast Effect on caster
-		// Continue reading because skill_unitsetting is bellow
+
 	case MG_SAFETYWALL:
 	case MG_FIREWALL:	
@@ -6256,121 +5794,7 @@
 				md->deletetimer = add_timer (gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, md->bl.id, 0);
 				mob_spawn (md); //Now it is ready for spawning.
-//Does this really belong here?
-				// @showsummon command implementation [Brainstorm]
-				if(sd->state.showsummon){
-					char output[256];
-					sprintf(output,
-						"[Summon] HP : %d | STR : %d DEX : %d VIT : %d INT : %d AGI : %d LUK : %d",
-						md->status.max_hp,md->status.str,md->status.dex,md->status.vit,md->status.int_,md->status.agi,md->status.luk);
-					clif_disp_onlyself(sd,output,strlen(output));
-					sprintf(output,
-						"[%s] ATK : %d~%d | DEF: %d+%d MDEF: %d+%d | HIT: %d FLEE: %d",
-						md->name,md->status.rhw.atk,md->status.rhw.atk2,md->status.def,md->status.def2,md->status.mdef,md->status.mdef2,md->status.hit,md->status.flee);
-					clif_disp_onlyself(sd,output,strlen(output));
-				}
-
-			}
-		}
-		break;
-		
-//HUGE lump of code!
-//Some of the code repeats itself, Unless it just recites it for other classes it may be a problem
-	case AD_FAMILIAR: // Adept Summon Familiar [Brain]
-		if( sd )
-		{
-			int id;
-			int mob_class;
-			struct mob_data* md;
-
-			mob_class = pc_readglobalreg(sd, "ADEPT_FAMILIAR");
-			if( mob_class == 0 )
-			{
-				mob_class = mob_get_random_id(4, 0x1, 0);
-				pc_setglobalreg(sd, "ADEPT_FAMILIAR", mob_class);
-			}
-			id = mob_once_spawn(sd,src->m,src->x,src->y,"--en--",mob_class,1,"");
-			md = (struct mob_data *)map_id2bl(id);
-			if( md != NULL )
-			{
-				md->master_id = sd->bl.id;
-				md->special_state.ai = 1;
-				md->status.mode = md->status.mode|MD_AGGRESSIVE;
-				status_calc_mob(md,0); //Recalc their stats based on passive bonus
-				md->status.hp = md->status.max_hp; //Must be here or the code wont update it
-				// @showsummon command implementation [Brainstorm]
-				if(sd->state.showsummon){
-					char output[256];
-					sprintf(output,
-						"[Summon] HP : %d | STR : %d DEX : %d VIT : %d INT : %d AGI : %d LUK : %d",
-						md->status.max_hp,md->status.str,md->status.dex,md->status.vit,md->status.int_,md->status.agi,md->status.luk);
-					clif_disp_onlyself(sd,output,strlen(output));
-					sprintf(output,
-						"[%s] ATK : %d~%d | DEF: %d+%d MDEF: %d+%d | HIT: %d FLEE: %d",
-						md->name,md->status.rhw.atk,md->status.rhw.atk2,md->status.def,md->status.def2,md->status.mdef,md->status.mdef2,md->status.hit,md->status.flee);
-					clif_disp_onlyself(sd,output,strlen(output));
-				}
-				md->deletetimer = add_timer(gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, id, 0);
-			}
-		}
-		break;
-	case NC_SKELETON: // Raise Skeleton [Brain]
-	case NC_ARCHER: // Raise Archer Skeleton
-	case NC_ZOMBIE: // Raise Zombie
-	case NC_MUMMY: // Raise Mummy
-	case NC_GHOST: // Raise Ghost
-	case NC_SHADOW: // Raise Shadow
-	case NC_WRAITH: // Raise Wraith
-		if( sd )
-		{
-			static const int mob_skeleton[5]={ 3201, 3202, 3203, 3204, 3205 }; // Skeleton, Orc Skeleton, Soldier Skeleton, Pirate Skeleton, Skeleton General
-			static const int mob_archer[5]={ 3206, 3207, 3208, 3209, 3210 }; // Archer Skeleton, Firelock Soldier
-			static const int mob_zombie[5]={ 3211, 3212, 3213, 3214, 3215 }; // Zombie, Ghoul, Zombie Master
-			static const int mob_mummy[5]={ 3216, 3217, 3218, 3219, 3220 }; // Mummy, Ancient Mummy
-			static const int mob_ghost[5]={ 3221, 3222, 3223, 3224, 3225 }; // Whisper, Nightmare, Nightmare Terror
-			static const int mob_shadow[5]={ 3226, 3227, 3228, 3229, 3230 }; // Injustice, Raydric, Dullahan
-			static const int mob_wraith[5]={ 3231, 3232, 3233, 3234, 3235 }; // Wraith, Wraith Dead
-			int id;
-			int mob_class;
-			struct mob_data *md;
-
-			switch( skillid )
-			{
-				case NC_SKELETON: mob_class = mob_skeleton[skilllv-1]; break;
-				case NC_ARCHER:   mob_class = mob_archer[skilllv-1]; break;
-				case NC_ZOMBIE:   mob_class = mob_zombie[skilllv-1]; break;
-				case NC_MUMMY:    mob_class = mob_mummy[skilllv-1]; break;
-				case NC_GHOST:    mob_class = mob_ghost[skilllv-1]; break;
-				case NC_SHADOW:   mob_class = mob_shadow[skilllv-1]; break;
-				case NC_WRAITH:   mob_class = mob_wraith[skilllv-1]; break;
-				default:
-					mob_class = 1002; // poring
-					ShowDebug("skill_castend_pos2: undefined skill #%d used to raise mobs, defaulting to poring\n");
-					break;
-			}
-			id = mob_once_spawn(sd,src->m,src->x,src->y,"--ja--",mob_class,1,"");
-			if((md=(struct mob_data *)map_id2bl(id)))
-			{
-				md->master_id=sd->bl.id;
-				md->special_state.ai=1;
-				md->status.mode=md->db->status.mode|MD_AGGRESSIVE;
-				status_calc_mob(md,0); //Recalc their stats based on passive bonus
-				md->status.hp = md->status.max_hp; //Must be here or the code wont update it
-//I bet this should NOT be here -- Critical
-				if(sd->state.showsummon){
-					char output[256];
-					sprintf(output,
-						"[Summon] HP : %d | STR : %d DEX : %d VIT : %d INT : %d AGI : %d LUK : %d",
-						md->status.max_hp,md->status.str,md->status.dex,md->status.vit,md->status.int_,md->status.agi,md->status.luk);
-					clif_disp_onlyself(sd,output,strlen(output));
-					sprintf(output,
-						"[%s] ATK : %d~%d | DEF: %d+%d MDEF: %d+%d | HIT: %d FLEE: %d",
-						md->name,md->status.rhw.atk,md->status.rhw.atk2,md->status.def,md->status.def2,md->status.mdef,md->status.mdef2,md->status.hit,md->status.flee);
-					clif_disp_onlyself(sd,output,strlen(output));
-				}
-				md->deletetimer = add_timer(gettick() + skill_get_time(skillid,skilllv), mob_timer_delete, id, 0);
-			}
-		}
-		break;
-
+			}
+		}
+		break;
 
 	// Slim Pitcher [Celest]
@@ -6785,8 +6209,5 @@
 	switch(skillid)
 	{
-//seems good.
-	case WL_HELLFIRE: // Warlock Hellfire [Brain]
-		if(map_flag_vs(src->m)) target = BCT_ALL;
-		break;
+
 	case MG_SAFETYWALL:
 		val2=skilllv+1;
@@ -7386,11 +6807,4 @@
 				if (status_isimmune(bl))
 					heal = 0;	/* é»éè²ã«ãŒãïŒããŒã«éïŒïŒ */
-//Okay?
-				// Profane Soul reduces the healed recieved by 3% per skilllv [Brain]
-				if(tsd) {
-					heal = heal * (100 - pc_checkskill(tsd,AD_PROFANE)*3)/100;
-					//Wont heal even if he got elemental armors [Brain]
-					if(pc_checkskill(tsd,NC_PHYLACTERY)) heal = sg->skill_lv;
-				}
 				clif_skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
 				status_heal(bl, heal, 0, 0);
@@ -7403,6 +6817,5 @@
 
 		case UNT_EVILLAND:
-			//Will heal demon and undead element monsters, but not players.
-			if (bl->type != BL_PC && !battle_check_undead(tstatus->race, tstatus->def_ele) && tstatus->race!=RC_DEMON)
+			if (tstatus->race!=RC_UNDEAD && tstatus->race!=RC_DEMON)
 			{	//Damage enemies
 				if(battle_check_target(&src->bl,bl,BCT_ENEMY)>0)
@@ -8451,52 +7864,4 @@
 		}
 		break;
-//Weird to me.
-	case AD_FAMILIAR: //Adept Familiar [Flavio]
-		{
-			short familiar[1] ={ pc_readglobalreg(sd, "ADEPT_FAMILIAR") };
-			int maxcount = skill_get_maxcount(skill,lv);
-			int count = 0;
-			count = mob_countslave_class(&sd->bl, 1, familiar );
-			if( count >= maxcount )
-			{
-				clif_skill_fail(sd,skill,0,0);
-				return 0;
-			}
-		}
-		break;
-	case NC_SKELETON: // Raise Skeleton [Brain]
-	case NC_ARCHER: // Raise Archer Skeleton
-	case NC_ZOMBIE: // Raise Zombie
-	case NC_MUMMY: // Raise Mummy
-	case NC_GHOST: // Raise Ghost
-	case NC_SHADOW: // Raise Shadow
-	case NC_WRAITH: // Raise Wraith
-		{// corrigido o limite de spawns [Flavio]
-			short summon1[5]={ 3201, 3202, 3203, 3204, 3205 }; // Skeleton, Orc Skeleton, Soldier Skeleton, Pirate Skeleton, Skeleton General
-			short summon2[5]={ 3206, 3207, 3208, 3209, 3210 }; // Archer Skeleton, Firelock Soldier
-			short summon3[5]={ 3211, 3212, 3213, 3214, 3215 }; // Zombie, Ghoul, Zombie Master
-			short summon4[5]={ 3216, 3217, 3218, 3219, 3220 }; // Mummy, Ancient Mummy
-			short summon5[5]={ 3221, 3222, 3223, 3224, 3225 }; // Whisper, Nightmare, Nightmare Terror
-			short summon6[5]={ 3226, 3227, 3228, 3229, 3230 }; // Injustice, Raydric, Dullahan
-			short summon7[5]={ 3231, 3232, 3233, 3234, 3235 }; // Wraith, Wraith Dead
-			int maxcount = skill_get_maxcount(skill,lv);
-			int count = 0;
-			switch( skill )
-			{
-			case NC_SKELETON: count = mob_countslave_class(&sd->bl, 5, summon1); break;
-			case NC_ARCHER: count = mob_countslave_class(&sd->bl, 5, summon2); break;
-			case NC_ZOMBIE: count = mob_countslave_class(&sd->bl, 5, summon3); break;
-			case NC_MUMMY: count = mob_countslave_class(&sd->bl, 5, summon4); break;
-			case NC_GHOST: count = mob_countslave_class(&sd->bl, 5, summon5); break;
-			case NC_SHADOW: count = mob_countslave_class(&sd->bl, 5, summon6); break;
-			case NC_WRAITH: count = mob_countslave_class(&sd->bl, 5, summon7); break;
-			}
-			if( count >= maxcount )
-			{
-				clif_skill_fail(sd,skill,0,0);
-				return 0;
-			}
-		}
-		break;
 	case WZ_FIREPILLAR: // celest
 		if (lv <= 5)	// no gems required at level 1-5
@@ -8930,12 +8295,4 @@
 			time -= time * sc->data[SC_SUFFRAGIUM]->val2 / 100;
 			status_change_end(bl, SC_SUFFRAGIUM, -1);
-		}
-//Curse skills...
-		if (sc->data[SC_DECREPIFY]) // Necro Decrepify [Brain]
-			if(sc->data[SC_DECREPIFY]->val2>=3)
-				time += time * 25/100; //+25% cast time
-		if (sc->data[SC_CURSETONGUES]) { //Warlock Curse of Tongues [Brain]
-			time += time * sc->data[SC_CURSETONGUES]->val2 / 100;
-			status_change_end(bl, SC_CURSETONGUES, -1);
 		}
 		if (sc->data[SC_MEMORIZE]) {
@@ -10766,20 +10123,28 @@
 			case AM_TWILIGHT2:
 			case AM_TWILIGHT3:
-				make_per = pc_checkskill(sd,AM_LEARNINGPOTION)*50
+				make_per = pc_checkskill(sd,AM_LEARNINGPOTION)*100
 					+ pc_checkskill(sd,AM_PHARMACY)*300 + sd->status.job_level*20
-					+ (status->int_/2)*10 + status->dex*10+status->luk*10;
-				if(merc_is_hom_active(sd->hd)) {//Player got a homun
-					int skill;
-					if((skill=merc_hom_checkskill(sd->hd,HVAN_INSTRUCT)) > 0) //His homun is a vanil with instruction change
-						make_per += skill*100; //+1% bonus per level
-				}
+					+ status->int_*5 + status->dex*10+status->luk*10;
 				switch(nameid){
 					case 501: // Red Potion
 					case 503: // Yellow Potion
 					case 504: // White Potion
-						make_per += (1+rand()%100)*10 + 2000;
+					case 605: // Anodyne
+					case 606: // Aloevera
+						make_per += 2000;
 						break;
-					case 970: // Alcohol
-						make_per += (1+rand()%100)*10 + 1000;
+					case 505: // Blue Potion
+						make_per -= 500;
+						break;
+					case 545: // Condensed Red Potion
+					case 546: // Condensed Yellow Potion
+					case 547: // Condensed White Potion
+						make_per -= 1000;
+					    break;
+				 	case 970: // Alcohol
+						make_per += 1000;
+						break;
+					case 7139: // Glistening Coat
+						make_per -= 1000;
 						break;
 					case 7135: // Bottle Grenade
@@ -10787,18 +10152,4 @@
 					case 7137: // Plant Bottle
 					case 7138: // Marine Sphere Bottle
-						make_per += (1+rand()%100)*10;
-						break;
-					case 546: // Condensed Yellow Potion
-						make_per -= (1+rand()%50)*10;
-						break;
-					case 547: // Condensed White Potion
-					case 7139: // Glistening Coat
-						make_per -= (1+rand()%100)*10;
-					    break;
-					//Common items, recieve no bonus or penalty, listed just because they are commonly produced
-					case 505: // Blue Potion
-					case 545: // Condensed Red Potion
-					case 605: // Anodyne
-					case 606: // Aloevera
 					default:
 						break;
@@ -10838,5 +10189,5 @@
 // - Baby Class Penalty = 80% (from adult's chance) ----//
 	if (sd->class_&JOBL_BABY) //if it's a Baby Class
-		make_per = (make_per * 70) / 100; //Baby penalty is 30%
+		make_per = (make_per * 80) / 100; //Lupus
 
 	if(make_per < 1) make_per = 1;
@@ -11740,40 +11091,2 @@
 	return 0;
 }
-//Why is this after the cleanup code?
-int skill_additem(struct block_list* src, struct block_list *bl, int itemid, int amount)// ITEM GIVER [Brain]
-{
-	struct map_session_data *sd = NULL, *tsd = NULL;
-
-	nullpo_retr(1, src);
-	nullpo_retr(1, bl);	
-
-	if (src->m != bl->m)
-		return 1;
-	if (bl->prev == NULL)
-		return 1;
-	if (src->type == BL_PC)
-		sd = (struct map_session_data *)src;
-	if (bl->type == BL_PC)
-		tsd = (struct map_session_data *)bl;
-	if (status_isdead(bl))
-		return 1;
-
-	int eflag;
-	struct item item_tmp;
-	struct block_list tbl;
-	
-	memset(&item_tmp,0,sizeof(item_tmp));
-	memset(&tbl,0,sizeof(tbl));
-
-	item_tmp.nameid = itemid;
-	item_tmp.identify = 1;
-	tbl.id = 0;
-
-	clif_takeitem(&sd->bl,&tbl);
-	eflag = pc_additem(sd,&item_tmp,amount);
-	if(eflag) {
-		clif_additem(sd,0,0,eflag);
-		map_addflooritem(&item_tmp,amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
-	}
-	return 0;
-}
Index: src/map/unit.c
===================================================================
--- src/map/unit.c (revision 24)
+++ src/map/unit.c (revision 1)
@@ -374,6 +374,4 @@
 	if (sc && sc->data[SC_CONFUSION]) //Randomize the target position
 		map_random_dir(bl, &ud->to_x, &ud->to_y);
-	if (sc && sc->data[SC_FEAR]) //Flee from my target [Brainstorm]
-		unit_escape(bl, tbl, 15);
 
 	if(ud->walktimer != -1) {
@@ -1089,6 +1087,6 @@
 	if(casttime > 0) {
 		ud->skilltimer = add_timer( tick+casttime, skill_castend_id, src->id, 0 );
-		if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )
-			status_calc_bl(&sd->bl, SCB_SPEED);
+		if(sd && pc_checkskill(sd,SA_FREECAST))
+			status_freecast_switch(sd);
 		else
 			unit_stop_walking(src,1);
@@ -1190,6 +1188,6 @@
 	if(casttime > 0) {
 		ud->skilltimer = add_timer( tick+casttime, skill_castend_pos, src->id, 0 );
-		if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )
-			status_calc_bl(&sd->bl, SCB_SPEED);
+		if(sd && pc_checkskill(sd,SA_FREECAST))
+			status_freecast_switch(sd);
 		else
 			unit_stop_walking(src,1);
@@ -1523,6 +1521,8 @@
 	}
 	
-	ud->canact_tick = tick;
-
+	ud->canact_tick=tick;
+	if(sd && pc_checkskill(sd,SA_FREECAST))
+		status_freecast_switch(sd);
+	
 	if(type&1 && sd)
 		skill = sd->skillid_old;
@@ -1536,12 +1536,8 @@
 	if(ret<0)
 		ShowError("delete timer error : skillid : %d\n",ret);
+	
+	if(bl->type==BL_MOB) ((TBL_MOB*)bl)->skillidx  = -1;
 
 	ud->skilltimer = -1;
-
-	if( sd && pc_checkskill(sd,SA_FREECAST) > 0 )
-		status_calc_bl(&sd->bl, SCB_SPEED);
-
-	if(bl->type==BL_MOB) ((TBL_MOB*)bl)->skillidx  = -1;
-
 	clif_skillcastcancel(bl);
 	return 1;
Index: src/map/npc.c
===================================================================
--- src/map/npc.c (revision 23)
+++ src/map/npc.c (revision 1)
@@ -783,5 +783,5 @@
 int npc_touch_areanpc2(struct mob_data *md)
 {
-	int i, m = md->bl.m, x = md->bl.x, y = md->bl.y, id;
+	int i, m = md->bl.m, x = md->bl.x, y = md->bl.y;
 	char eventname[NAME_LENGTH*2+3];
 	struct event_data* ev;
@@ -827,7 +827,5 @@
 						break; // No OnTouchNPC Event
 					md->areanpc_id = map[m].npc[i]->bl.id;
-					id = md->bl.id; // Stores Unique ID
 					run_script(ev->nd->u.scr.script, ev->pos, md->bl.id, ev->nd->bl.id);
-					if( map_id2md(id) == NULL ) return 1; // Not Warped, but killed
 					break;
 			}
@@ -2064,14 +2062,14 @@
 	switch(nd->subtype)
 	{
-	case WARP:
-		xs = nd->u.warp.xs;
-		ys = nd->u.warp.ys;
-		break;
-	case SCRIPT:
-		xs = nd->u.scr.xs;
-		ys = nd->u.scr.ys;
-		break;
-	default:
-		return; // Other types doesn't have touch area
+		case WARP:
+			xs = nd->u.warp.xs;
+			ys = nd->u.warp.ys;
+			break;
+		case SCRIPT:
+			xs = nd->u.scr.xs;
+			ys = nd->u.scr.ys;
+			break;
+                default:
+			return; // Other types doesn't have touch area
 	}
 
@@ -2627,4 +2625,6 @@
 	else if (!strcmpi(w3,"guildlock"))
 		map[m].flag.guildlock=state;
+	else if (!strcmpi(w3,"hostile"))
+	map[m].flag.hostile=state;//Sketchy
 	else
 		ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer));
@@ -2900,5 +2900,5 @@
 		"\t-'"CL_WHITE"%d"CL_RESET"' Shops\n"
 		"\t-'"CL_WHITE"%d"CL_RESET"' Scripts\n"
-		"\t-'"CL_WHITE"%d"CL_RESET"' Spawn sets\n"
+		"\t-'"CL_WHITE"%d"CL_RESET"' Mob sets\n"
 		"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Cached\n"
 		"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
@@ -3011,5 +3011,5 @@
 		"\t-'"CL_WHITE"%d"CL_RESET"' Shops\n"
 		"\t-'"CL_WHITE"%d"CL_RESET"' Scripts\n"
-		"\t-'"CL_WHITE"%d"CL_RESET"' Spawn sets\n"
+		"\t-'"CL_WHITE"%d"CL_RESET"' Mob sets\n"
 		"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Cached\n"
 		"\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n",
Index: src/map/battle.h
===================================================================
--- src/map/battle.h (revision 24)
+++ src/map/battle.h (revision 1)
@@ -88,6 +88,4 @@
 
 int battle_check_undead(int race,int element);
-// seems fine.
-int battle_check_living(int race,int element);	//Living Creature Check [Brain]
 int battle_check_target(struct block_list *src, struct block_list *target,int flag);
 bool battle_check_range(struct block_list *src,struct block_list *bl,int range);
@@ -454,10 +452,5 @@
 	int auction_feeperhour;
 	int auction_maximumprice;
-//Declares the conf reader should check for these
-	//Vanaheim battle settings [Brainstorm]
-	int necro_retaliation; //Battle flag to force monsters to attack adept/necro/warlock summons [Brain]
-	int disp_summon_stats; //Battle Flag to show summoned monster stats [Brain]
 	int gm_viewequip_min_lv;
-	int homunculus_auto_vapor; //Keep Homunculus from Vaporizing when master dies. [L0ne_W0lf]
 } battle_config;
 
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;
 				
Index: src/map/skill.h
===================================================================
--- src/map/skill.h (revision 24)
+++ src/map/skill.h (revision 1)
@@ -956,76 +956,4 @@
 
 	ALL_INCCARRY = 681,
-	
-//most skills are irrelevant, will block comment them out.
-/*+	GM_SANDMAN = 688,
-+	CASH_BLESSING,
-+	CASH_INCAGI,
-+	CASH_ASSUMPTIO,
-+	ALL_CATCRY,*/
-//Up there is irrelevant.
- 
-	AD_PWBLIND = 700,	// Custom Skills [Brainstorm]
-	AD_PWFEAR,
-	AD_DARKHEAL,
-	AD_BLOODPACT,
-	AD_LUST,
-	AD_FERVOR,
-	AD_PROFANE,
-	AD_DARKFAITH,
-	AD_FAMILIAR,
-	AD_SUMMONS,
-
-	NC_PHYLACTERY, //710
-	NC_UNDEAD,
-	NC_DEATHHAND,
-	NC_GHOULTOUCH,
-	NC_SKELETON,
-	NC_ZOMBIE,
-	NC_ARCHER,
-	NC_MUMMY,
-	NC_GHOST,
-	NC_SHADOW,
-	NC_WRAITH,
-	NC_REQUIEM,
-	NC_DARKMOON,
-	NC_PWSUFFER,
-	NC_DECREPIFY,
-	NC_DRAINLIFE,
-	NC_DEATHPACT,
-//Still no idea why that is there.
-	ALL_ATFIELD, //GM SKILL
-
-	WL_CURSETONGUES =732, //732
-	WL_CURSEDOOM,
-	WL_CURSEEXHAUST,
-	WL_CURSEWEAKNESS,
-	WL_SEARING,
-	WL_HELLFIRE,
-	WL_CONFLAGRATE,
-	WL_IMMOLATE,
-	WL_SHADOWBOLT,
-	WL_SHADOWBURN,
-	WL_HOWLOFPAIN,
-	WL_DEMONOLOGY,
-	WL_HOWLOFTERROR,
-	WL_PWAGONY,
-	WL_OVERWHELMING,
-	WL_SOULSTEAL,
-	WL_DRAINSOUL,
-	WL_CORRUPTION, //749
-
-//Irrelevant
-/*+	TD_FISHING = 750,
-+	TD_MINING,
-+	TD_HERBALISM,
-+	TD_LEATHERWORK,
-+	TD_TAILORING,
-+	TD_BLACKSMITHING,
-+	TD_SCRIBESCROLLA,
-+	TD_SCRIBESCROLLB,
-+	TD_SCRIBESCROLLC,
-+	TD_SHIELD,
-+	TD_WOODCUTTING,*/
-// STOP! Cant use 800 (homun skills) NOR 900 (guild skills)
 
 	KN_CHARGEATK = 1001,
Index: src/map/status.h
===================================================================
--- src/map/status.h (revision 24)
+++ src/map/status.h (revision 1)
@@ -296,20 +296,4 @@
 	SC_SPREGEN,
 	SC_WALKSPEED,
-	SC_DECREPIFY, // New status [brain]
-	SC_LUST,
-	SC_DARKMOON,
-	SC_REQUIEM,
-	SC_DEATHPACT,
-	SC_ATFIELD,
-	SC_SUFFER,
-	SC_SEARING,
-	SC_IMMOLATE,
-	SC_AGONY,
-	SC_CURSETONGUES,
-	SC_DOOM,
-	SC_CURSEWEAKNESS,
-	SC_CURSEEXHAUST,
-	SC_OVERWHELMING,
-	SC_FEAR,
 	SC_MAX, //Automatically updated max, used in for's to check we are within bounds.
 } sc_type;
@@ -466,5 +450,5 @@
 	SI_BOSSMAPINFO		= 253,
 	//SI_TURTLEGENERAL	= 260, //All mobs display as Turtle General
-	SI_BIOMOBTRICKDEAD	= 263, //Bio Mob effect on you and SI_TRICKDEAD
+	//SI_BIOMOBTRICKDEAD	= 263, //Bio Mob effect on you and SI_TRICKDEAD
 	//SI_BLURRY		= 264, //For short time blurry screen and get Gloria icon
 	//SI_FOODSTR		= 271, //Same as 241
@@ -823,4 +807,5 @@
 void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, struct status_change *sc);
 
+void status_freecast_switch(struct map_session_data *sd);
 int status_getrefinebonus(int lv,int type);
 int status_check_skilluse(struct block_list *src, struct block_list *target, int skill_num, int flag); // [Skotlex]
Index: src/map/pc.c
===================================================================
--- src/map/pc.c (revision 24)
+++ src/map/pc.c (revision 1)
@@ -754,10 +754,4 @@
 	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;
-
 	
 	if (!(battle_config.display_skill_fail&2))
@@ -1661,7 +1655,13 @@
 		}
 		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 = min(sd->speed_rate, -val);
+		if(sd->state.lr_flag != 2 && sd->speed_rate > 100-val)
+			sd->speed_rate = 100-val;
 		break;
 	case SP_SPEED_ADDRATE:	//Stackable increase
@@ -3887,14 +3887,4 @@
 			class_ = MAPID_SUMMER;
 			break;
-//This is where your errors begin.
-		case JOB_NECROMANCER: // Necromancer [Brain]
-			class_ |= JOBL_2_1;
-			class_ |= MAPID_ADEPT;
-			break;	
-		case JOB_WARLOCK: // Warlock [Brain]
-			class_ |= JOBL_2_2;
-		case JOB_ADEPT: // Adept [Brain]
-			class_ |= MAPID_ADEPT;
-			break;
 		default:
 			return -1;
@@ -3920,6 +3910,4 @@
 		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
 		case MAPID_SUPER_NOVICE:    return JOB_SUPER_NOVICE;
@@ -3931,6 +3919,4 @@
 		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
 		case MAPID_CRUSADER:        return JOB_CRUSADER;
@@ -3941,6 +3927,4 @@
 		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
 		case MAPID_NOVICE_HIGH:     return JOB_NOVICE_HIGH;
@@ -4119,12 +4103,4 @@
 	case JOB_NINJA:
 		return msg_txt(620);
-//message display for job change?
-	case JOB_ADEPT: // Adept [Brain]
-		return msg_txt(1000);//have to add these to the msg_txt in the conf?
-	case JOB_NECROMANCER: // Necromancer [Brain]
-		return msg_txt(1001);
-	case JOB_WARLOCK: // Warlock [Flavio]
-		return msg_txt(1002);
-
 	
 	default:
@@ -4983,5 +4959,5 @@
 	}
 
-	if(sd->status.hom_id > 0 && battle_config.homunculus_auto_vapor)	//orn
+	if(sd->status.hom_id > 0)	//orn
 		merc_hom_vaporize(sd, 0);
 
Index: src/map/pc.h
===================================================================
--- src/map/pc.h (revision 24)
+++ src/map/pc.h (revision 1)
@@ -114,8 +114,6 @@
 		unsigned short autolootid; // [Zephyrus]
 		unsigned noks : 3; // [Zeph Kill Steal Protection]
-		//Aside from a Space it's fine, but white space has no effect so it's fine.
-		//Vanaheim settings [Brainstorm]
-		unsigned showsummon : 1; //Show summoned monster stats [Brainstorm]
-
+		unsigned god :1; //[Sketchy]
+		unsigned demon :1; //[Sketchy]
 		bool changemap;
 		struct guild *gmaster_flag;
@@ -146,4 +144,5 @@
 	int fd;
 	unsigned short mapindex;
+	unsigned short prev_speed,prev_adelay;
 	unsigned char head_dir; //0: Look forward. 1: Look right, 2: Look left.
 	unsigned int client_tick;
@@ -252,5 +251,5 @@
 	int crit_atk_rate;
 	int classchange; // [Valaris]
-	int speed_rate, speed_add_rate, aspd_add;
+	int speed_add_rate, aspd_add;
 	unsigned int setitem_hash, setitem_hash2; //Split in 2 because shift operations only work on int ranges. [Skotlex]
 	
@@ -268,5 +267,5 @@
 	int castrate,delayrate,hprate,sprate,dsprate;
 	int atk_rate;
-	int hprecov_rate,sprecov_rate;
+	int speed_rate,hprecov_rate,sprecov_rate;
 	int matk_rate;
 	int critical_rate,hit_rate,flee_rate,flee2_rate,def_rate,def2_rate,mdef_rate,mdef2_rate;
Index: src/map/mob.c
===================================================================
--- src/map/mob.c (revision 24)
+++ src/map/mob.c (revision 1)
@@ -245,6 +245,4 @@
  * 1: poring list
  * 2: bloody branch list
- * 3: mob_pouch list
- * 4: familiar list // familiar by FlavioJS [Brain]
  * flag:
  * &1: Apply the summon success chance found in the list (otherwise get any monster from the db)
@@ -548,10 +546,6 @@
 	barricade->amount = 0;
 	barricade->killable = killable;
-	
-	// A protection just in case setting a walkable - non shootable
-	if( (barricade->walkable = walkable) == true )
-		barricade->shootable = true;
-	else
-		barricade->shootable = shootable;
+	barricade->shootable = shootable;
+	barricade->walkable = walkable;
 	
 	for( i = 0; i < count; i++ )
@@ -574,9 +568,6 @@
 		}
 
-		if( !barricade->walkable )
-		{
-			map_setcell(m, x1, y1, CELL_WALKABLE, false);
-			map_setcell(m, x1, y1, CELL_SHOOTABLE, barricade->shootable);
-		}
+		if( !barricade->walkable ) map_setcell(m, x1, y1, CELL_WALKABLE, false);
+		map_setcell(m, x1, y1, CELL_SHOOTABLE, barricade->shootable);
 
 		clif_changemapcell(0, m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
@@ -633,9 +624,6 @@
 		mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
 
-		if( !barricade->shootable )
-			map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, true);
-		if( !barricade->walkable )
-			map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
-
+		if( !barricade->walkable ) map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
+		map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, !barricade->shootable);
 		clif_changemapcell(0, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
 	}
@@ -698,9 +686,6 @@
 			mob_barricade_nextxy(barricade->x, barricade->y, barricade->dir, i, &x1, &y1);
 
-			if( !barricade->shootable )
-				map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, true);
-			if( !barricade->walkable )
-				map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
-
+			if( !barricade->walkable ) map_setcell(barricade->m, x1, y1, CELL_WALKABLE, true);
+			map_setcell(barricade->m, x1, y1, CELL_SHOOTABLE, !barricade->shootable);
 			clif_changemapcell(0, barricade->m, x1, y1, map_getcell(barricade->m, x1, y1, CELL_GETTYPE), ALL_SAMEMAP);
 		}
@@ -2027,12 +2012,5 @@
 		//Let players decide whether to retaliate versus the master or the mob. [Skotlex]
 		if (md2->master_id && battle_config.retaliate_to_master)
-//this is odd... does that mean if you have a pet out it will get attecked instead of you?
-		{
-			//necro_retaliation config (same as above, but only works for adept/necro/warlock summons) [Brainstorm]
-			if(!battle_config.necro_retaliation && (md2->class_ >= 3100 && md2->class_ <= 3235))
-				md->attacked_id = src->id;
-			else md->attacked_id = md2->master_id; //All normal summons
-		}
-
+			md->attacked_id = md2->master_id;
 		else
 			md->attacked_id = src->id;
@@ -2555,5 +2533,5 @@
 		mob_script_callback(md, src, CALLBACK_DEAD);
 	else
-	if(md->npc_event[0] && !md->state.npc_killmonster)
+	if(md->npc_event[0] && !md->npc_killmonster)
 	{
 		md->status.hp = 0; //So that npc_event invoked functions KNOW that I am dead.
@@ -2834,40 +2812,4 @@
 	return map_foreachinmap(mob_countslave_sub, bl->m, BL_MOB,bl->id);
 }
-
-//Weird structure, is this in the right place?
-/// Count slaves with a certain master and class. by FlavioJS [Brain]
-static int mob_countslave_class_sub(struct block_list* bl, va_list ap)
-{
-	int id;
-	int count;
-	short* classes;
-	TBL_MOB* md;
-
-	id = va_arg(ap, int);
-	count = va_arg(ap, int);
-	classes = va_arg(ap, short*);
-	md = (TBL_MOB*)bl;
-	
-	if( md->master_id == id )
-	{// has the correct master
-		int i;
-		for( i = 0; i < count; ++i )
-		{
-			if( md->class_ == classes[i] )
-				return 1;
-		}
-	}
-	return 0;
-}
-
-/// Returns the number of slaves of the specified classes. by FlavioJS [Brain]
-/// @param bl Master
-/// @param count Number of classes
-/// @param classes Array of classes
-int mob_countslave_class(struct block_list* bl, int count, short* classes)
-{
-	return map_foreachinmap(mob_countslave_class_sub, bl->m, BL_MOB, bl->id, count, classes);
-}
-
 
 /*==========================================
@@ -4032,7 +3974,5 @@
 		"mob_poring.txt",
 		"mob_boss.txt",
-		"mob_pouch.txt",
-		"mob_familiar.txt" // familiar By FlavioJS [Brain]
-		};//mob_familiar.txt make sure the name is right.
+		"mob_pouch.txt"};
 
 	memset(&summon, 0, sizeof(summon));
Index: src/map/clif.c
===================================================================
--- src/map/clif.c (revision 24)
+++ src/map/clif.c (revision 1)
@@ -7062,7 +7062,7 @@
 	clif_weather_check(sd);
 	if( pc_issit(sd) )
-		clif_sitting(&sd->bl); // FIXME: just send to self, not area
+		clif_sitting(&sd->bl);
 	if( pc_isdead(sd) ) //When you refresh, resend the death packet.
-		clif_clearunit_single(sd->bl.id,1,sd->fd);
+		clif_clearunit_area(&sd->bl,1);
 
 #ifndef TXT_ONLY
Index: src/map/map.h
===================================================================
--- src/map/map.h (revision 24)
+++ src/map/map.h (revision 1)
@@ -77,6 +77,4 @@
 	MAPID_XMAS,
 	MAPID_SUMMER,
-	//Bit masking is used here?
-	MAPID_ADEPT = 0x0E,	// Adept [Brain]
 //2_1 classes
 	MAPID_SUPER_NOVICE = JOBL_2_1|0x0,
@@ -88,6 +86,4 @@
 	MAPID_ASSASSIN,
 	MAPID_STAR_GLADIATOR,
-	//and here and down there
-	MAPID_NECROMANCER = JOBL_2_1|0x0E,	// Necromancer [Brain]
 //2_2 classes
 	MAPID_CRUSADER = JOBL_2_2|0x1,
@@ -98,6 +94,4 @@
 	MAPID_ROGUE,
 	MAPID_SOUL_LINKER,
-	//see. why are the bitmasks like this? Xray thing?
-	MAPID_WARLOCK = JOBL_2_2|0x0E, // Warlock [Flavio]
 //1-1, advanced
 	MAPID_NOVICE_HIGH = JOBL_UPPER|0x0,
@@ -296,5 +290,5 @@
 	SP_PERFECT_HIT_RATE,SP_PERFECT_HIT_ADD_RATE,SP_CRITICAL_RATE,SP_GET_ZENY_NUM,SP_ADD_GET_ZENY_NUM, // 1038-1042
 	SP_ADD_DAMAGE_CLASS,SP_ADD_MAGIC_DAMAGE_CLASS,SP_ADD_DEF_CLASS,SP_ADD_MDEF_CLASS, // 1043-1046
-	SP_ADD_MONSTER_DROP_ITEM,SP_DEF_RATIO_ATK_ELE,SP_DEF_RATIO_ATK_RACE,SP_FREE3, // 1047-1050
+	SP_ADD_MONSTER_DROP_ITEM,SP_DEF_RATIO_ATK_ELE,SP_DEF_RATIO_ATK_RACE,SP_ADD_SPEED, // 1047-1050
 	SP_HIT_RATE,SP_FLEE_RATE,SP_FLEE2_RATE,SP_DEF_RATE,SP_DEF2_RATE,SP_MDEF_RATE,SP_MDEF2_RATE, // 1051-1057
 	SP_SPLASH_RANGE,SP_SPLASH_ADD_RANGE,SP_AUTOSPELL,SP_HP_DRAIN_RATE,SP_SP_DRAIN_RATE, // 1058-1062
@@ -323,5 +317,4 @@
 	//2020 (SP_FREE) (previously SP_ADD_DAMAGE_BY_CLASS)
 	//2033 (SP_FREE2) (previously SP_ADDEFF_WHENHIT_SHORT)
-	//1050 (SP_FREE3) (previously SP_ADD_SPEED)
 };
 
@@ -461,4 +454,5 @@
 		unsigned partylock :1;
 		unsigned guildlock :1;
+		unsigned hostile : 1; //Sketchy
 	} flag;
 	struct point save;
Index: src/map/mail.c
===================================================================
--- src/map/mail.c (revision 24)
+++ src/map/mail.c (revision 1)
@@ -56,10 +56,6 @@
 
 	if (flag && sd->mail.zeny > 0)
-	{  //Zeny send
-		if(log_config.zeny)
-			log_zeny(sd, "E", sd, -sd->mail.zeny);
+		sd->status.zeny -= sd->mail.zeny;
 
-		sd->status.zeny -= sd->mail.zeny;
-	}
 	sd->mail.zeny = 0;
 	clif_updatestatus(sd, SP_ZENY);
@@ -151,9 +147,5 @@
 
 	if( zeny > 0 )
-	{  //Zeny recieve
-		if(log_config.zeny)
-			log_zeny(sd, "E", sd, zeny);
 		pc_getzeny(sd, zeny);
-	}
 }
 
@@ -175,16 +167,8 @@
 	nullpo_retv(msg);
 
-	// Item  recieve (due to failure)
-	if(log_config.enable_logs&0x2000)
-		log_pick_pc(sd, "E", msg->item.nameid, msg->item.amount, &msg->item);
-
 	pc_additem(sd, &msg->item, msg->item.amount);
 	
 	if( msg->zeny > 0 )
 	{
-		//Zeny recieve (due to failure)
-		if(log_config.zeny)
-			log_zeny(sd, "E", sd, msg->zeny);
-
 		sd->status.zeny += msg->zeny;
 		clif_updatestatus(sd, SP_ZENY);
Index: src/map/clif.h
===================================================================
--- src/map/clif.h (revision 24)
+++ src/map/clif.h (revision 1)
@@ -176,4 +176,5 @@
 void clif_divorced(struct map_session_data* sd, const char* name);
 //void clif_callpartner(struct map_session_data *sd);
+void clif_adopt_process(struct map_session_data *sd);
 void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type);
 int clif_soundeffectall(struct block_list* bl, const char *name, int type, enum send_target coverage);
Index: src/map/mob.h
===================================================================
--- src/map/mob.h (revision 24)
+++ src/map/mob.h (revision 1)
@@ -12,11 +12,11 @@
 
 
-#define MAX_RANDOMMONSTER 5 //seems okay. just makes it so you can hold 5 summons at once.
-#define MAX_MOB_RACE_DB 6 //should this be changed though? I assume since undead was only expanded it's fine but it may fix something later.
+#define MAX_RANDOMMONSTER 4
+#define MAX_MOB_RACE_DB 6
 
 // Change this to increase the table size in your mob_db to accomodate a larger mob database.
 // Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes.
 // Notice that the last 1000 entries are used for player clones, so always set this to desired value +1000
-#define MAX_MOB_DB 7000 //7000 should work fine.
+#define MAX_MOB_DB 3000
 
 //The number of drops all mobs have and the max drop-slot that the steal skill will attempt to steal from.
@@ -113,5 +113,4 @@
 		unsigned char attacked_count; //For rude attacked.
 		int provoke_flag; // Celest
-		unsigned npc_killmonster: 1; //for new killmonster behavior
 	} state;
 	struct guardian_data* guardian_data; 
@@ -143,4 +142,5 @@
 	unsigned int skilldelay[MAX_MOBSKILL];
 	char npc_event[50];
+	int npc_killmonster; //for new killmonster behavior
 };
 
@@ -270,7 +270,4 @@
 int mob_countslave(struct block_list *bl);
 int mob_convertslave(struct mob_data *md);
-// I really don't see the point in this...
-int mob_countslave_class(struct block_list* bl, int count, short* classes); // By FlavioJS [Brain]
-
 
 int mob_is_clone(int class_);
Index: src/map/chrif.c
===================================================================
--- src/map/chrif.c (revision 24)
+++ src/map/chrif.c (revision 1)
@@ -18,5 +18,4 @@
 #include "pc.h"
 #include "pet.h"
-#include "skill.h"
 #include "status.h"
 #include "mercenary.h"
@@ -912,7 +911,7 @@
 	{
 		sd->status.child = 0;
-		sd->status.skill[WE_CALLBABY].id = 0;
-		sd->status.skill[WE_CALLBABY].lv = 0;
-		sd->status.skill[WE_CALLBABY].flag = 0;
+		sd->status.skill[410].id = 0;
+		sd->status.skill[410].lv = 0;
+		sd->status.skill[410].flag = 0;
 		clif_skillinfoblock(sd);
 	}
@@ -921,7 +920,7 @@
 	{
 		sd->status.child = 0;
-		sd->status.skill[WE_CALLBABY].id = 0;
-		sd->status.skill[WE_CALLBABY].lv = 0;
-		sd->status.skill[WE_CALLBABY].flag = 0;
+		sd->status.skill[410].id = 0;
+		sd->status.skill[410].lv = 0;
+		sd->status.skill[410].flag = 0;
 		clif_skillinfoblock(sd);
 	}
