
public skill_cero_discharge(parm[1])
{
	static id;
	id=parm[0];

	g_player_cero_charged[id]=false;
	set_user_rendering(id);
	print_hud_status(id,"%L",id,"L_STATUS_SKILL_CERO_DISCHARGED");
}

public skill_cero(id)
{	
	static task,parm[1];
	
	task = BLEACH_TASK_CERO + id;
	remove_task(task,0);
	
	g_player_last_event[id][4]=get_gametime();
	g_player_cero_charged[id]=true;
	validate_max_speed(id);
	
	set_user_rendering(id,kRenderFxGlowShell,255,0,0,kRenderNormal,50); 
	
	parm[0] = id;
	
	set_task(BLEACH_SKILL_CERO_DISCHARGE_TIME,"skill_cero_discharge",task,parm,1);
	create_bartime(id,2,0);
	
	return PLUGIN_HANDLED;
}

public skill_cero_fire(id)
{
	new players[MAXPLAYERS],origin_victim[3],distance,Float:damage;
	static origin[3],radius,num;
	radius=300;
	
	get_user_origin(id,origin,3);
	
	create_te_beampoint(id,origin,g_sprite_beam,1,5,4,250,0,255,0,0,100,200);
	create_te_beampoint(id,origin,g_sprite_beam,1,5,4,125,0,255,255,255,255,200);
	
	emit_sound(id,CHAN_STATIC,g_sound[BLEACH_SOUND_CERO],VOL_NORM,ATTN_NORM,0,PITCH_NORM);
	
	create_te_explosion(origin,g_sprite_explosion,40,30,TE_EXPLFLAG_NONE);
	create_te_tarexplosiom(origin);
	create_te_gunshotdecal(origin,28);
	
	get_players(players,num,"ah");
	for(new i = 0; i < num; i++)
	{
		if(get_user_team(id)==get_user_team(players[i]) && id!=players[i])
		{
			continue;
		}
		
		get_user_origin(players[i],origin_victim);
		distance = get_distance(origin,origin_victim);
		
		if(distance < radius)
		{
			damage=radius_calucation(origin,origin_victim,radius,BLEACH_SKILL_MASTER_DAMAGE/2,BLEACH_SKILL_MASTER_DAMAGE*g_skill[id][P_SKILL_4]);
			set_bleach_damage(id,players[i],damage);
		}            
	}
	
	return PLUGIN_CONTINUE;
}

public skill_cero_activate(id)
{
	static Float:time;
	time=get_gametime();
	
	if (time >= g_player_last_event[id][4]+BLEACH_SKILL_CERO_CHARGE_TIME && g_player_cero_charged[id] && is_user_alive(id) && !g_player_in_skill[id])
	{
		skill_cero_fire(id);
		g_player_last_event[id][2]=time;
		spirit_set(id,g_player_spirit[id]-BLEACH_SKILL_MASTER_COST);
	}
	
	remove_task(BLEACH_TASK_CERO + id,0);
	set_user_rendering(id);
	create_bartime(id,0,0);
	g_player_cero_charged[id]=false;
	validate_max_speed(id);
	
	return PLUGIN_HANDLED;
}
