package me.TehGoldyLockz.OlympicHeroes.listeners;

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;

import me.TehGoldyLockz.OlympicHeroes.OlympicHeroes;
import me.TehGoldyLockz.OlympicHeroes.player.OHPlayer;

public class PlayerListener implements Listener{

	public PlayerListener(OlympicHeroes plugin) {
		plugin.getServer().getPluginManager().registerEvents(this, plugin);
	}
	
	@EventHandler
	public void onDamage(EntityDamageEvent e) {
		if(e.getEntity() instanceof Player) {
			Player player = (Player) e.getEntity();
			OHPlayer ohPlayer = new OHPlayer(player);
			
			if(e.getCause() == DamageCause.FALL) {
				if(ohPlayer.getLevel("Zeus") >= 2) {
					e.setDamage(e.getFinalDamage() / 2.0);
					player.sendMessage("Your fall damage has been reduced thanks to Zeus");
				}
			}
		}
	}
	
}

@@ -800,13 +800,10 @@
 .get
-Level
+XP
 (%22Ze
@@ -812,11 +812,10 @@
 %22) %3E
-= 2
+ 0
 ) %7B%0A
@@ -856,11 +856,11 @@
 ) / 
-2.0
+1.5
 );%0A%09

Change zeus power