Index: src/map/battle.c
===================================================================
--- src/map/battle.c (revision 1)
+++ src/map/battle.c (revision 5)
@@ -373,4 +373,31 @@
 		}
 
+		//Begin Custom Jobs (blackmagic)
+			
+	//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 [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;
+	}
+//End Custom Jobs
+
 		if (((sce=sc->data[SC_UTSUSEMI]) || sc->data[SC_BUNSINJYUTSU])
 		&& 
@@ -624,4 +651,9 @@
 			damage += sd->status.str;
 	}
+	//Begin Custom Jobs (blackmagic)	
+	//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));
+	//end custom job
 
 	if(type == 0)
@@ -1299,4 +1331,9 @@
 			switch( skill_num )
 			{
+			//Begin Custom Job (blackmagic)
+				case NC_DEATHHAND: // Necro Death Hand [Brain]
+				skillratio += -25+25*skill_lv;
+				break;
+			//End Black Magic Custom Jobs
 				case SM_BASH:
 					skillratio += 30*skill_lv;
@@ -1575,4 +1612,13 @@
 					skillratio += 100 *(skill_lv-1);
 					break;
+					//Begin Custom Jobs (blackmagic)
+					//Mercenary Skills [Brainstorm]
+				case MS_BASH:
+					skillratio += 30*skill_lv;
+					break;
+				case MER_CRASH:
+					skillratio += 10*skill_lv;
+					break;
+					//end custom jobs
 			}
 
@@ -2188,4 +2234,7 @@
 			case AL_HEAL:
 			case PR_BENEDICTIO:
+				//Begin Custom Job (blackmagic)
+			case AD_DARKHEAL: // Adept Dark Heal
+				//end custom job
 				ad.damage = skill_calc_heal(src, target, skill_lv)/2;
 				break;
@@ -2306,5 +2355,32 @@
 						skillratio += 100 +100*skill_lv +100*(skill_lv/2);
 						break;
-				}
+				//Begin Custom Job (blackmagic)
+					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;
+	//End Custom Job
+			}
 
 				MATK_RATE(skillratio);
@@ -2376,5 +2452,13 @@
 		if (!(nk&NK_NO_ELEFIX))
 			ad.damage=battle_attr_fix(src, target, ad.damage, s_ele, tstatus->def_ele, tstatus->ele_lv);
-
+	//Begin Custom Job (blackmagic)		
+	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;
+	}
+	//End Custom Job
 		if (sd && !(nk&NK_NO_CARDFIX_ATK)) {
 			short t_class = status_get_class(target);
@@ -2576,4 +2660,9 @@
 	case NPC_EVILLAND:
 		md.damage = (skill_lv>6)?666:skill_lv*100;
+	//Begin Custom Job (blackmagic)
+	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
+	//End Custom Job
 		break;
 	}
@@ -2763,4 +2852,20 @@
 	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);
+	//begin custom job (blackmagic	
+	// 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 ) {
+	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
+	}
+	//end custom job
 	if (!thp && !tsp) return;
 
@@ -2986,4 +3091,19 @@
 	return wd.dmg_lv;
 }
+
+//Begin custom Job (blackmagic)
+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;
+	}
+}
+//end custom job
 
 int battle_check_undead(int race,int element)
@@ -3712,4 +3832,9 @@
 	{ "auction_feeperhour",                 &battle_config.auction_feeperhour,              12000,  0,      INT_MAX,        },
 	{ "auction_maximumprice",               &battle_config.auction_maximumprice,            500000000, 0,   MAX_ZENY,       },
+	//Begin Custom Job (blackmagic)	
+	//Vanaheim battle settings [Brainstorm]
+	{ "necro_retaliation",		  &battle_config.necro_retaliation,		   1,	  0,	  1,		  },
+	{ "disp_summon_stats",		  &battle_config.disp_summon_stats,
+	//End Custom Job
 	{ "gm_viewequip_min_lv",                &battle_config.gm_viewequip_min_lv,             0,      0,      99,             },
 };
