#scope server
{ [shared]
	const REAVER_NAME "a|Fire Reaver"
	const REAVER_MAXHP 4000
	const REAVER_XP 1500
	const REAVER_SKIN 0
	const FREQ_ERRUPT 20.0

	const BLOOD_COLOR red

	const FIREBALL1_SCRIPT monsters/summon/fire_ball_guided
	const FIREBALL2_SCRIPT monsters/summon/fire_ball_guided
	const FIREBALL1_DURATION 15.0
	const FIREBALL2_DURATION 15.0

	const BOMB_DMG_TYPE blunt
}

{ game_precache

	precachefile monsters/summon/fire_ball_guided
	precache xfireball3.spr
}

#include monsters/swamp_reaver

{ npc_post_spawn
	setvard DOT_EFFECT effects/effect_burn 
	setvard DOT_DURATION 5.0 
	setvard DOT_DMG 45.0 
	setvard ERRUPT_TYPE fire
	setvard BREATH_TYPE fire
	setvard PROJECTILE_SCRIPT proj_fire_bomb
	setvard DOT_ACID_BOMB 200
	setvard EFFECT_ACID_BOMB effects/effect_burn
}



//OLD VERSION
////Fire Reaver, from Ice Reaver by Thothie
//
//{
//	const FREQ_FIRE_BALL 10.0
//	const DMG_FIRE_BALL 100
//
//	//volcano bits
//	const ROCK_START_HEIGHT 96
//	setvard DMG_VOLCANO 200
//	setvard DMG_VOLCANO_DOT 1
//	const DMG_VOLCANO_DART 25
//	const FREQ_VOLC_SOUND 7.0 //check this
//	const FREQ_VOLCANO 0.5
//	const FREQ_SMASH 10.0
//
//	const SOUND_WALK1 common/npc_step1.wav
//	const SOUND_WALK2 common/npc_step2.wav
//	const SOUND_WALK3 common/npc_step3.wav
//	const SOUND_WALK4 common/npc_step4.wav
//	const SOUND_RUN1 gonarch/gon_step1.wav
//	const SOUND_RUN2 gonarch/gon_step2.wav
//	const SOUND_RUN3 gonarch/gon_step3.wav //optional
//	const SOUND_DEATH gonarch/gon_die1.wav
//	const SOUND_WARCRY gonarch/gon_alert1.wav //check
//	const SOUND_STRUCK1 gonarch/gon_sack1.wav //check
//	const SOUND_STRUCK2 gonarch/gon_sack2.wav //check
//	const SOUND_PAIN_STRONG gonarch/gon_pain2.wav
//	const SOUND_PAIN_WEAK gonarch/gon_pain4.wav
//	const SOUND_PAIN_NEAR_DEATH gonarch/gon_pain5.wav
//	const SOUND_SLASHHIT zombie/claw_strike1.wav //overused, look for alternates
//	const SOUND_SMASHHIT zombie/claw_strike2.wav //overused, look for alternates
//	const SOUND_SLASHMISS zombie/claw_miss1.wav //overused, look for alternates
//	const SOUND_SMASHMISS zombie/claw_miss2.wav //overused, look for alternates
//	const SOUND_SEARCH1 gonarch/gon_childdie3.wav
//	const SOUND_SEARCH2 gonarch/gon_childdie2.wav
//	const SOUND_SEARCH3 gonarch/gon_childdie1.wav
//	setvard SOUND_ATTACKHIT unset
//	setvard SOUND_ATTACKMISS unset
//
//	//called indirectly, so need precache
//	precache SOUND_SLASHMISS
//	precache SOUND_SLASHHIT
//	precache SOUND_SMASHMISS
//	precache SOUND_SMASHHIT
//	precache SOUND_PAIN_STRONG 
//	precache SOUND_PAIN_WEAK
//	precache SOUND_PAIN_NEAR_DEATH
//
//	//defaults are a little too far, prob cuz of large model
//	setvard ATTACK_RANGE 140
//	setvard ATTACK_HITRANGE 200
//	setvard ATTACK_MOVERANGE 100
//	setvard MOVE_RANGE 100
//
//	const STRONG_THRESHOLD 2500
//	const WEAK_THRESHOLD 2000
//	const NEAR_DEATH_THRESHOLD 750
//
//	const SLASH_DAMAGE '$rand(100,200)'
//	const SMASH_DAMAGE 500
//	const SLASH_HITCHANCE 90%
//
//	const FREQ_MISSILE 20.0
//	const DMG_MISSILE 600
//	const FREQ_VOLC 1.0
//
//	setvar ANIM_WALK walk
//	setvar ANIM_RUN run
//	setvar ANIM_IDLE idle1
//	const ANIM_SEARCH idle2
//	setvard ANIM_FLINCH turnl
//	const ANIM_SMASH mattack3
//	const ANIM_SLASH mattack2
//	const ANIM_PROJECTILE distanceattack
//	const ANIM_ALERT distanceattack
//	setvard ANIM_DEATH1 dieforward
//	setvard ANIM_DEATH2 diesimple
//	setvard ANIM_DEATH3 diesideways
//	const ANIM_VICTORY1 victoryeat
//	const ANIM_VICTORY2 victorysniff
//	setvard ANIM_VICTORY victoryeat
//	setvard ANIM_DEATH dieforward
//	setvard ANIM_ATTACK mattack3
//
//	setvard CAN_FLINCH 1
//	setvard FLINCH_HEALTH 1000
//	setvard FLINCH_CHANCE 30
//
//	const DOSMASH_CHANCE 30
//
//	precache SOUND_DEATH //handled by base_npc
//}
//
//#include monsters/base_monster_new
//
//{ game_precache
//
//	precachefile monsters/summon/fire_ball_guided
//}
//
//{ npc_spawn
//
//	name a|Fire Reaver
//	hp 4000
//	roam 1
//	takedmg cold 0.5 //just that hot
//	takedmg fire 0.0
//	takedmg holy 0.5 //some magic involved in creation
//	width 72
//	height 64
//	setvard NPC_GIVE_EXP 1200
//	race demon
//	hearingsensitivity 3
//	setmodel monsters/firereaver.mdl
//	setmoveanim ANIM_WALK
//
//	setvard SLASH_COUNT 0
//}
//
//{ npcatk_validatetarget //first spot
//
//	if $get(PARAM1,isplayer)
//	if !DID_WARCRY
//
//	////dbg temp Spotted Target $get(NPCATK_TARGET,name)
//
//	playsound 0 10 SOUND_WARCRY
//	setvard DID_WARCRY 1	
//	setvard FIRST_ATTACK 1
//}
//
//{ my_target_died
//
//	if !$cansee(enemy)
//
//	local RAND_VICT $rand(1,2)
//	if ( RAND_VICT == 1 ) setvard ANIM_VICTORY ANIM_VICTORY1
//	if ( RAND_VICT == 2 ) setvard ANIM_VICTORY ANIM_VICTORY2
//	playanim critical ANIM_VICTORY
//	playrandomsound 0 10 SOUND_SEARCH1 SOUND_SEARCH2 SOUND_SEARCH3
//}
//
//{ cycle_up
//	callevent start_volcano
//}
//
////moved to npc_targetsighted
////{ attack_ranged //called from model ANIM_PROJECTILE ("distanceattack") @ frame 40
////
////	//toss projectiles here
////}
//
//{ npc_targetsighted
//	if ( $get(NPCATK_TARGET,range) > ATTACK_RANGE )
//	{
//		local LAST_FIRE REAVER_LAST_FIRE_BALL
//		add LAST_FIRE FREQ_FIRE_BALL
//		if ( game.time > LAST_FIRE ) callevent do_fireballs
//	}
//}
//
////slash (right hook)
//{ attack_mele1 //called from model ANIM_SLASH (mattack2) @ frame 30
//
//	local RANDOM_PUSH $rand(100,175)
//	setvard PUSH_VEL $relvel(-200,RANDOM_PUSH,120)
//	setvard SOUND_ATTACKHIT SOUND_SLASHHIT
//	setvard SOUND_ATTACKMISS SOUND_SLASHMISS
//	callevent npcatk_dodamage NPCATK_TARGET ATTACK_HITRANGE SLASH_DAMAGE SLASH_HITCHANCE
//	setvard PUSH_ATTACK 1
//
//	add SLASH_COUNT 1
//	if ( SLASH_COUNT > $rand(9,15) ) setvard ANIM_ATTACK ANIM_SMASH
//}
//
////smash (overhead strike)
//{ attack_mele2 //called from model ANIM_SMASH (mattack3) @ frame 30
//
//	setvard SOUND_ATTACKHIT SOUND_SMASHHIT
//	setvard SOUND_ATTACKMISS SOUND_SMASHMISS
//	setvard ANIM_ATTACK ANIM_SLASH
//
//	createnpc monsters/summon/stun_burst $relpos(0,0,0) $get(ent_me,id) 256 1 SMASH_DAMAGE
//	setvard SLASH_COUNT 0
//	setvard ANIM_ATTACK ANIM_SLASH
//}
//
//{ npcatk_search_init_advanced
//
//	if !SEARCH_ANIM_DELAY
//	setvard NPC_DELAYING_UNSTUCK 10.0
//	playanim critical ANIM_SEARCH
//	playrandomsound 0 10 SOUND_SEARCH1 SOUND_SEARCH2 SOUND_SEARCH3
//	setvard SEARCH_ANIM_DELAY 1
//	callevent 5.0 reset_search_anim
//}
//
//{ reset_search_anim
//	setvard SEARCH_ANIM_DELAY 0
//}
//
//{ game_dodamage //1: Attack Hit (1/0)  2: Entity Attack hit  3:  Start Position  4:  End Position
//
//	if ( !PARAM1 )
//	{
//		if ( SOUND_ATTACKMISS isnot unset ) playsound 0 10 SOUND_ATTACKMISS
//	}
//
//	if ( PARAM1 )
//	{
//		if ( SOUND_ATTACKHIT isnot unset )
//		{
//			playsound 0 10 SOUND_ATTACKHIT
//			if PUSH_ATTACK
//			addvelocity ent_laststruckbyme PUSH_VEL
//		}
//	}
//	setvard PUSH_ATTACK 0
//}
//
//{ game_struck
//
//	setvard HP_STORAGE game.monster.hp //anti-heal
//
//	if ( game.monster.hp >= 1500 ) local PAIN_SOUND SOUND_PAIN_STRONG
//	if ( game.monster.hp < 1500 ) local PAIN_SOUND SOUND_PAIN_WEAK
//	if ( game.monster.hp < 500 ) local PAIN_SOUND SOUND_PAIN_NEAR_DEATH
//	playrandomsound 0 10 SOUND_STRUCK1 SOUND_STRUCK2 SOUND_STRUCK1 SOUND_STRUCK2 PAIN_SOUND
//}
//
//{ monster_walk_step //called from model anim walk at various frames
//
//	playrandomsound 0 5 SOUND_WALK1 SOUND_WALK2 SOUND_WALK3 SOUND_WALK4
//}
//
//{ monster_run_step //called from model anim run at various frames
//
//   	effect screenshake $relpos(0,0,0) 64 10 0.5 128
//	playrandomsound 0 8 SOUND_RUN1 SOUND_RUN2 SOUND_RUN3
//}
//
//{ npc_death //called from base_npc
//
//	//death anims
//	local RAND_DEATH $rand(2,3)
//	//if ( RAND_DEATH == 1 ) setvard ANIM_DEATH ANIM_DEATH1 //use for volcano anim instead
//	if ( RAND_DEATH == 2 ) setvard ANIM_DEATH ANIM_DEATH2
//	if ( RAND_DEATH == 3 ) setvard ANIM_DEATH ANIM_DEATH3
//
//	setvard SUSPEND_AI 1
//	setmovedest none
//	setmoveanim ANIM_DEATH
//}
//
////potentially problematic
////{ game_reached_destination
////
////	//idle anims
////	if NPCATK_TARGET equals unset
////	if NPC_LOST_TARGET equals unset
////	if !$cansee(enemy)
////	local RAND_VICT $rand(1,2)
////	if ( RAND_VICT == 1 ) setvard ANIM_VICTORY ANIM_VICTORY1
////	if ( RAND_VICT == 2 ) setvard ANIM_VICTORY ANIM_VICTORY2
////	playanim critical ANIM_VICTORY
////}
//
//{ start_volcano
//	if ( VOLCANO_ID isnot 'VOLCANO_ID' ) clientevent update all VOLCANO_ID volcano_die
//	clientevent new all monsters/fire_reaver_cl $get(ent_me,origin) $get(ent_me,index) 45.0
//	setvard VOLCANO_ID game.script.last_sent_id
//	callevent 45.0 start_volcano
//	if !VOLCANO_ON
//	setvard VOLCANO_ON 1
//	callevent 0.1 volcano_shoot
//}
//
//{ game_death
//	clientevent update all VOLCANO_ID end_fx
//	playsound 2 0 magic/volcano_loop.wav
//}
//
//{ npcatk_clear_targets
//	setvard VOLCANO_ON 0
//	playsound 2 0 magic/volcano_loop.wav
//}
//
//{ volcano_shoot
//
//	//if ( G_DEVELOPER_MODE ) messageall green firereaver: volcano_shoot alv: $get(ent_me,isalive) on: VOLCANO_ON see: $cansee(enemy)
//
//	if $get(ent_me,isalive)
//	if VOLCANO_ON
//	callevent FREQ_VOLCANO volcano_shoot
//
//	if $cansee(enemy)
//
//	if ( !VOLC_SOUND_DELAY )
//	{
//		setvard VOLC_SOUND_DELAY 1
//		playsound 2 5 magic/volcano_loop.wav
//		callevent FREQ_VOLC_SOUND reset_volc_sound_delay
//	}
//
//   local xangle $rand(50,90)
//   local yangle $rand(-180,180)
//   setangle view (xangle,yangle,0)
//
//   //dodamage $relpos(0,0,0) 128 ATTACK_DAMAGE 100% 0 //exploits
//	local ROCK_START_POS $relpos(0,-40,100)
//   tossprojectile view 500 DMG_VOLCANO_DART 0 proj_volcano (0,-40,100)
//   clientevent update all VOLCANO_ID volcono_shoot_rock $get(ent_lastprojectile,velocity) $get(ent_lastprojectile,gravity) $get(ent_lastprojectile,origin) //ROCK_START_POS
//}
//
//{ do_fireballs
//	setvard AS_ATTACKING 20
//	setvard REAVER_LAST_FIRE_BALL game.time
//	playanim critical ANIM_PROJECTILE
//	createnpc monsters/summon/fire_ball_guided $relpos(-64,96,64) $get(ent_me,id) DMG_FIRE_BALL 20.0 200
//	callevent 0.2 do_fireballs2
//}
//
//{ do_fireballs2
//	createnpc monsters/summon/fire_ball_guided $relpos(64,96,64) $get(ent_me,id) DMG_FIRE_BALL 20.0 200
//	//callevent 0.2 do_fireballs3
//}
//
////{ do_fireballs3
////	createnpc monsters/summon/fire_ball_guided $relpos(0,96,64) $get(ent_me,id) DMG_FIRE_BALL 20.0 200
////}
//
//{ game_death
//	clientevent update all VOLCANO_ID volcano_die
//
//	if ( $lcase(game.map.name) equals mscave )
//	{
//		//spawn some treasurez
//		local CHEST_ID $get_by_name(fire_cave_chest2)
//		if $get(CHEST_ID,exists)
//		createnpc mscave/firecave2 $relpos(0,0,0) "fire_reaver"
//	}
//}