//Push
//Any npc
//Param1 - Duration
//Param2 - Push velocity
//Param3 - 1 == Do screenshake
//Param4 - 1 - called by stun, no resist check


{ 	[server]
	const EFFECT_ID			effect_push
	const EFFECT_NAME		"Push"
	const EFFECT_ACTIONTYPE		normal
	const EFFECT_SCRIPT		$currentscript

	setvard game.effect.id		EFFECT_ID
	setvard game.effect.displayname	EFFECT_NAME
	setvard game.effect.type	EFFECT_ACTIONTYPE

	const SOUND_RESIST body/armour3.wav
}

#include effects/effect_base	allowduplicate

{ 	[server] game_activate

	local CALLED_BY_STUN PARAM4
	if ( $get(ent_me,nopush) ) callevent be_resist_effect
	if ( $get(ent_me,scriptvar,'IMMUNE_PUSH') ) callevent be_resist_effect
	
	//if ( !CALLED_BY_STUN ) callevent resist_check stun //cant get attacker on standard stun, need way to pull
	if !RESISTED_EFFECT

	setvard local.effect.duration 	PARAM1
	setvard local.effect.force 	PARAM2
	setvard local.effect.scrnshake 	PARAM3


	setvard game.effect.movespeed 0%
	addvelocity ent_me local.effect.force
   	if( local.effect.scrnshake ) effect screenshake $relpos(0,0,0) 64 15 1 1

	callevent local.effect.duration effect_die
}
