for (i = 0; arrowA [i] != undefined && arrowA [i] [0] != false; i++) {}

for (i = 0; arrowA [i] != undefined; i++) {
	if (arrowA [i] [4] == true) {
		if (arrowA [i] [1] > arrowA [i] [2]) 							{arrowA [i] [2] = Math.min(5 + arrowA [i] [2], arrowA [i] [1]);} 
		if (arrowA [i] [1] < arrowA [i] [2]) 							{arrowA [i] [2] = 0; arrowA [i] [4] = false;} 
		if (arrowA [i] [1] == arrowA [i] [2] && arrowA [i] [2] != 0) 	{arrowShoot(); arrowA [i] [4] = false;}
		if (arrowA [i] [1] == 0 && arrowA [i] [0] == false) 			{arrowA [i] = [false, 0, 0, 0, false, 0, 0];}
	}
	
	if (arrowA [i] [0] == true && (arrowA [i] [3] == 0 || arrowA [i] [3].isAlive() == false))
		arrowA [i] = [false, 0, 0, 0, false, 0, 0];
				
	if (arrowA [i] [0] == true && arrowA [i] [3] != 0) {
		vel = arrowA [i] [3].velocity; dist = arrowA [i] [3].position.distance(pos); 
		target = arrowA [i] [3].velocity.scale(0.5).add(arrowA [i] [3].position); 
		results = player.rayTrace(arrowA [i] [3].position, target); entityHit = results[2];
		
		if (entityHit != null && arrowA [i] [6] != entityHit) {
			j = entityHit.getClassType(); arrowA [i] [6] = entityHit;
			if (j != "Player" && j != "Arrow" && j != "Item" && Math.abs(vel) > 0.1) {
				power = vel * (Math.sqrt(range_lvl)/5 + 1); 

				critical = Math.round((1 + Math.sqrt(100 - arrowA [i] [7])/4) * 10)/10;
				if (critical > 1.4) {chat.print("Critical hit = " + critical + "x");}

				entityHit.attackEntityFrom(arrowA [i] [3], power*2*critical); 
				range_xp += (Math.sqrt(entityHit.maxHealth/5)+power)*Math.sqrt(dist)/2*critical;
				arrowA [i] = [false, 0, 0, 0, false, 0, 0];
			}
		}
		
		if (results[0] != null)
			arrowA [i] = [false, 0, 0, 0, false, 0, 0];
	}
}