
public skill_icering_reset(parm[1])
{
	static id;
	id=parm[0];
	
	create_screen_fade(id,0,0,0,0,0,0,0);
	remove_status_icon(id);
	g_player_in_skill[id] = false;
	g_player_frozen[id]=false;
	g_player_frosted[id]=0;
	validate_max_speed(id);
	set_user_rendering(id);
}

public skill_ice_ring(id)
{
	new players[MAXPLAYERS],victim,origin_victim[3],distance,Float:damage,life;
	static origin[3],center[3],axis[3],num,radius;
	
	radius=120+g_skill[id][P_SKILL_3]*15;

	get_user_origin(id,origin);
	
	center[0]=origin[0];
	center[1]=origin[1];
	center[2]=origin[2]-16;
	
	axis[0]=origin[0]+radius/3;
	axis[1]=origin[1]+radius/3;
	axis[2]=origin[2]+300;
	
	life=floatround(g_skill[id][P_SKILL_3]/3.0);
	create_te_beamcylinder(origin,center,axis,g_sprite_shockwave,0,0,3+life,60,0,0,206,209,100,0);

	life=floatround(g_skill[id][P_SKILL_3]/1.5);
	create_te_beamcylinder(origin,center,axis,g_sprite_streak,0,0,3+life,40,0,0,206,209,100,0);
	
	create_te_dlight(origin,radius/5,0,206,209,8,60);
	
	emit_sound(id,CHAN_STATIC,g_sound[BLEACH_SOUND_IRING],VOL_NORM,ATTN_NORM,0,PITCH_NORM);
	
	get_players(players,num,"ah");
	for(new i = 0; i < num; i++)
	{
		victim = players[i];
		if(get_user_team(id) == get_user_team(victim))
		{
			continue;
		}
		
		get_user_origin(victim,origin_victim);
		distance = get_distance(origin,origin_victim);
		
		if(distance < radius)
		{
			new task,parm[1];
			
			task = BLEACH_TASK_IRING + victim;
			remove_task(task,0);
			
			parm[0] = victim;
			
			remove_status_icon(victim);
			g_player_statusicon[victim]="dmg_cold";
			create_status_icon(victim,2,g_player_statusicon[victim],0,206,209);
			
			g_player_in_skill[victim] = true;
			
			if(random_chance(50,100))
			{
				g_player_frozen[victim]=true;
				set_user_rendering(victim,kRenderFxNone,0,206,209,kRenderTransAdd,128);
				create_screen_fade(victim,~0,~0,0x0004,0,206,209,100);
	
				static time;
				time=floatround(BLEACH_SKILL_GREATER_FR_TIME*10);
				create_te_elight(id,origin_victim,30,0,206,209,time,10);
			}
			else
			{
				set_user_rendering(victim,kRenderFxGlowShell,0,206,209,kRenderNormal,50); 
				create_screen_fade(victim,~0,~0,0x0004,0,206,209,50);
				g_player_frosted[victim]=3;
			}
			
			damage=radius_calucation(origin,origin_victim,radius,BLEACH_SKILL_GREATER_DAMAGE/2,BLEACH_SKILL_GREATER_DAMAGE*g_skill[id][P_SKILL_3]);
			set_bleach_damage(id,victim,damage);
			
			validate_max_speed(victim);
			set_task(BLEACH_SKILL_GREATER_FR_TIME,"skill_icering_reset",task,parm,1);
		}            
	}
	
	return PLUGIN_CONTINUE;
}
