
public skill_spirit_release_reset(id)
{
	static task;
	task = BLEACH_TASK_SPIRITRELEASE + id;
	remove_task(task,0);
	
	g_player_spirit_releasing[id]=false;
	
	return PLUGIN_HANDLED;
}

public skill_spirit_release_start(id)
{
	static task;
	task = BLEACH_TASK_SPIRITRELEASE + id;
	remove_task(task,0);
	
	new parm_spirit[2];
	parm_spirit[0] = id;

	set_task(0.2,"skill_spirit_release",task,parm_spirit,1,"b");
	
	return PLUGIN_HANDLED;
}

public skill_spirit_release(parm_spirit[1])
{
	static id,button;
	id=parm_spirit[0];
	
	button=pev(id,pev_button);

	if(g_player_spirit[id] < BLEACH_SKILL_NOVICE_COST)
	{
		skill_spirit_release_reset(id);
		return PLUGIN_HANDLED;
	}
	else if((button & IN_FORWARD) || (button & IN_BACK) || (button &  IN_MOVELEFT) || (button & IN_MOVERIGHT))
	{
		print_hud_status(id,"%L",id,"L_STATUS_SKILL_SR_CONCENTRATE");
		skill_spirit_release_reset(id);
		return PLUGIN_HANDLED;
	}
	else
	{
		spirit_set(id,g_player_spirit[id]-BLEACH_SKILL_NOVICE_COST);
		g_player_spirit_releasing[id]=true;
	}
	

	g_player_spirit_releasing[id]=true;
		
	new players[32],origin_victim[3],distance;
	new center[3],axis[3];
	static origin[3],num,radius;
		
	radius=40*g_player_level[id];
		
	get_players(players,num,"a");
	get_user_origin(id,origin);
		
	center[0]=origin[0];
	center[1]=origin[1];
	center[2]=origin[2]-25;
		
	axis[0]=origin[0];
	axis[1]=origin[1];
	axis[2]=origin[2]+10;
		
	for (new i = 0; i < 300; i += 10)
	{
		create_te_beamtorus(origin,center,axis,g_sprite_shockwave,0,0,3,60,1,50,50,random_num(50,150),255,0);	
		center[2]+=10;
	}
		
	for(new i = 0; i < num; i++)
	{
		if(get_user_team(id)==get_user_team(players[i]))
		{
			continue;
		}
			
		get_user_origin(players[i],origin_victim);
		distance = get_distance(origin,origin_victim);
		    
		if(distance < radius && random_chance(g_player_level[id],g_player_level[players[i]]*10))
		{
			create_screen_shake(players[i],(255<<14),(10<<14),(255<<14));
			create_screen_fade(players[i],(1<<10),(1<<10),(1<<12),0,0,0,200);
		}            
	}

	return PLUGIN_HANDLED;
}
