2012-01-25 16:32:34 +01:00
|
|
|
package com.Acrobot.ChestShop.Utils;
|
|
|
|
|
|
|
|
import com.Acrobot.ChestShop.Config.Config;
|
|
|
|
import com.Acrobot.ChestShop.Config.Property;
|
2012-03-06 19:41:14 +01:00
|
|
|
import com.herocraftonline.heroes.Heroes;
|
|
|
|
import com.herocraftonline.heroes.characters.Hero;
|
|
|
|
import com.herocraftonline.heroes.characters.classes.HeroClass;
|
2012-01-25 16:32:34 +01:00
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @author Acrobot
|
|
|
|
*/
|
|
|
|
public class uHeroes {
|
|
|
|
public static Heroes heroes;
|
|
|
|
|
|
|
|
public static void addHeroExp(Player p) {
|
2012-03-06 19:41:14 +01:00
|
|
|
if (heroes != null) {
|
2012-03-17 15:00:25 +01:00
|
|
|
Hero hero = heroes.getCharacterManager().getHero(p);
|
2012-01-25 16:32:34 +01:00
|
|
|
if (hero.hasParty()) {
|
|
|
|
hero.getParty().gainExp(Config.getDouble(Property.HEROES_EXP), HeroClass.ExperienceType.EXTERNAL, p.getLocation());
|
|
|
|
} else {
|
|
|
|
hero.gainExp(Config.getDouble(Property.HEROES_EXP), HeroClass.ExperienceType.EXTERNAL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|