package smudgecraft.notheroes.notskills.revitalizingword; import com.herocraftonline.heroes.Heroes; import com.herocraftonline.heroes.api.SkillResult; import com.herocraftonline.heroes.characters.Hero; import com.herocraftonline.heroes.characters.effects.Effect; import com.herocraftonline.heroes.characters.effects.Expirable; import com.herocraftonline.heroes.characters.effects.ExpirableEffect; import com.herocraftonline.heroes.characters.skill.*; import com.herocraftonline.heroes.util.Messaging; import org.bukkit.configuration.ConfigurationSection; public class SkillRevitalizingWord extends ActiveSkill{ public SkillRevitalizingWord(Heroes plugin) { super(plugin, "RevitalizingWord"); setDescription("You whisper the revitalizing word in the wind, healing every ally close to you"); setUsage("/skill revitalizingword"); setArgumentRange(0,0); setIdentifiers("skill revitalizingword"); setTypes(SkillType.HEAL, SkillType.BUFF); } public ConfigurationSection getDefaultConfig(){ ConfigurationSection node = super.getDefaultConfig(); node.set(SkillSetting.HEALTH.node(), 50); node.set(SkillSetting.RADIUS.node(), 10); node.set(SkillSetting.HEALTH_INCREASE.node(), 1); return node; } @Override public SkillResult use(Hero hero, String[] strings) { // Ensure that the hero is both in a party, and said party has members in it if(!hero.hasParty() || hero.getParty() == null){ Messaging.send(hero.getPlayer(), "You need to be in a party with members to cast that"); return SkillResult.CANCELLED; } for(Hero iHero : hero.getParty().getMembers()){ // Do not heal the caster, only the party members. if(iHero == hero){ continue; } int healAmount = SkillConfigManager.getUseSetting(hero, this, SkillSetting.HEALTH, 50, false); // I was unsure about "HEALTH_INCREASE" - currently this increases healing by one every level, meaning a level 50 would heal for 100hp. healAmount = (healAmount + (SkillConfigManager.getUseSetting(hero, this, SkillSetting.HEALTH_INCREASE, 1, false) * hero.getLevel())); // DO NOT TOUCH .setHealth() EVER. iHero.heal(healAmount); Messaging.send(iHero.getPlayer(), "You were healed by " + hero.getName() + " for " + healAmount); } return SkillResult.NORMAL; } @Override public String getDescription(Hero hero) { // TODO: Complete description return null; //To change body of implemented methods use File | Settings | File Templates. } @Override public void init() { super.init(); } }