
public skill_cherry_blossoms(id)
{
	new victim = random_target(id);

	if (victim == -1)
	{
		print_hud_status(id,"%L",id,"L_STATUS_NO_TARGETS");
		return PLUGIN_HANDLED;
	}

	static origin[3],parm[10];
	get_user_origin(id,origin);
	
	parm[0] = id;
	parm[1] = victim;
	parm[2] = origin[0];
	parm[3] = origin[1];
	parm[4] = origin[2];

	skill_cherry_blossoms_effect(parm);

	return PLUGIN_HANDLED;
}

public skill_cherry_blossoms_effect(parm[])
{
	new attacker = parm[0];
	new victim = parm[1];

	if (!is_user_alive(victim))
	{
		new victim = random_target(attacker);

		if (victim == -1)
		{
			print_hud_status(attacker,"%L",attacker,"L_STATUS_NO_TARGETS");
			return PLUGIN_HANDLED;
		}

		static origin[3];
		get_user_origin(attacker,origin);
		parm[1] = victim;
		parm[2] = origin[0];
		parm[3] = origin[1];
		parm[4] = origin[2];

		client_print(attacker,print_chat,"%L",attacker,"L_SKILL_CB_TARGETABLE",PLUGIN_TAG);
		
		return PLUGIN_HANDLED;
	}

	new multiplier = 150;

	new victim_origin[3], funnel[3];
	get_user_origin(victim,victim_origin);

	funnel[0] = parm[2];
	funnel[1] = parm[3];
	funnel[2] = parm[4];
	
	create_te_largefunnel(funnel,g_sprite_pflare,random_num(0,1));
	
	static dist[3];
	dist[0] = get_num_diff(victim_origin[0],funnel[0]);
	dist[1] = get_num_diff(victim_origin[1],funnel[1]);
	dist[2] = get_num_diff(victim_origin[2],funnel[2]);	
	
	for (new i = 0; i < 3; i++)
	{
		
		if(get_num_diff(victim_origin[i],funnel[i] - multiplier) < dist[i])
		{
			funnel[i] -= multiplier;
		}
		else if (get_num_diff(victim_origin[i],funnel[0] + multiplier) < dist[i])
		{
			funnel[i] += multiplier;
		}
		else
		{
			funnel[i] = victim_origin[i];
		}
	}

	parm[2] = funnel[0];
	parm[3] = funnel[1];
	parm[4] = funnel[2];

	if (!(dist[0] < 50 && dist[1] < 50 && dist[2] < 50))
	{
		static Float:time;
		time = 0.2;
		
		set_task(time,"skill_cherry_blossoms_effect",attacker + BLEACH_TASK_BLOSSOMS,parm,5);
	}
	else
	{
		new players[32],origin_victim[3],distance,Float:damage;
		static radius,num;
		radius = 75;
		
		get_players(players,num,"ah");
		for(new i = 0; i < num; i++)
		{
			if(get_user_team(attacker)==get_user_team(players[i]) && attacker==players[i])
			{
				continue;
			}
			
			get_user_origin(players[i],origin_victim);
			distance = get_entity_distance(victim,players[i]);
			
			if(distance < radius)
			{
				damage=radius_calucation(funnel,origin_victim,radius,BLEACH_SKILL_MASTER_DAMAGE/2,BLEACH_SKILL_MASTER_DAMAGE*g_skill[attacker][P_SKILL_5]);
				set_bleach_damage(attacker,players[i],damage);
				create_screen_fade(players[i],(1<<10),(1<<10),(1<<12),255,156,255,floatround(damage));
			}
		}
		
		g_player_last_event[attacker][0]=get_gametime();
		spirit_set(attacker,g_player_spirit[attacker]-BLEACH_SKILL_MASTER_COST);
	}
	
	return PLUGIN_CONTINUE;
}
