//----Fire, Ice, Light Arrows v1.1 - Renounce4----//

var Arrows = player.getEntitiesWithinRange(1)
for(e = 0;e < Arrows.length;e++) {
	if(Arrows[e].getClassType() == "Arrow" && Arrows[e].isPlayersArrow) {
		if(player.inventory.getOffhandItem() != null && player.inventory.getOffhandItem().getItemID() == 410) {
			if(FireArrow_Cost <= 0) {
				FireArrows.splice(FireArrows.length,0,Arrows[e])
			}
			else {
				if(magdly >= FireArrow_Cost) {
					magdly = magdly-FireArrow_Cost
					FireArrows.splice(FireArrows.length,0,Arrows[e])
				}
				else {
					sound.playSoundUI("sound.Error")
				}
			}
		}
		if(player.inventory.getOffhandItem() != null && player.inventory.getOffhandItem().getItemID() == 411) {
			if(IceArrow_Cost <= 0) {
				IceArrows.splice(IceArrows.length,0,Arrows[e])
			}
			else {
				if(magdly >= IceArrow_Cost) {
					magdly = magdly-IceArrow_Cost
					IceArrows.splice(IceArrows.length,0,Arrows[e])
				}
				else {
					sound.playSoundUI("sound.Error")
				}
			}
		}
		if(player.inventory.getOffhandItem() != null && player.inventory.getOffhandItem().getItemID() == 412) {
			if(LightArrow_Cost <= 0) {
				LightArrows.splice(LightArrows.length,0,Arrows[e])
			}
			else {
				if(magdly >= LightArrow_Cost) {
					magdly = magdly-LightArrow_Cost
					LightArrows.splice(LightArrows.length,0,Arrows[e])
				}
				else {
					sound.playSoundUI("sound.Error")
				}
			}
		}
	}
}