use of com.solinia.solinia.Interfaces.ISoliniaAAAbility in project solinia3-core by mixxit.
the class ConfigurationManager method editAAAbility.
@Override
public void editAAAbility(int aaid, String setting, String value) throws InvalidAASettingException {
ISoliniaAAAbility aaability = getAAAbility(aaid);
aaability.editSetting(setting, value);
}
use of com.solinia.solinia.Interfaces.ISoliniaAAAbility in project solinia3-core by mixxit.
the class ConfigurationManager method resetAARankRepository.
@Override
public void resetAARankRepository() {
this.aarankcache.clear();
this.spellaarankcache.clear();
for (ISoliniaAAAbility ability : getAAAbilities()) {
for (ISoliniaAARank rank : ability.getRanks()) {
this.aarankcache.put(rank.getId(), rank);
if (this.spellaarankcache.get(rank.getSpell()) == null)
this.spellaarankcache.put(rank.getSpell(), new ArrayList<Integer>());
if (this.spellaarankcache.get(rank.getSpell()).contains(rank.getId()))
continue;
this.spellaarankcache.get(rank.getSpell()).add(rank.getId());
}
}
System.out.println("* AA Rank and SpelltoAARank cache has been reset");
}
use of com.solinia.solinia.Interfaces.ISoliniaAAAbility in project solinia3-core by mixxit.
the class SoliniaLivingEntity method getMaxStat.
@Override
public int getMaxStat(String skillname) {
int baseMaxStat = 255;
ISoliniaAAAbility aa = null;
try {
aa = StateManager.getInstance().getConfigurationManager().getFirstAAAbilityBySysname("PLANARPOWER");
} catch (CoreStateInitException e) {
}
int rank = 0;
if (aa != null) {
rank = Utils.getRankOfAAAbility(getBukkitLivingEntity(), aa);
}
if (rank == 0) {
return baseMaxStat;
} else {
return baseMaxStat + (rank * 5);
}
}
use of com.solinia.solinia.Interfaces.ISoliniaAAAbility in project solinia3-core by mixxit.
the class PlayerRegenTickTimer method grantPlayerRegenBonuses.
private void grantPlayerRegenBonuses(Player player) {
if (player.isDead())
return;
// Apply Crouch Mana Regen Bonus
int manaregen = 1;
ISoliniaPlayer solplayer = null;
try {
solplayer = SoliniaPlayerAdapter.Adapt(player);
} catch (CoreStateInitException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (solplayer == null)
return;
// a players mana regen based on if they are meditating (sneaking)
manaregen += getPlayerMeditatingManaBonus(solplayer);
ISoliniaAAAbility aa = null;
try {
if (solplayer.getAARanks().size() > 0)
aa = StateManager.getInstance().getConfigurationManager().getFirstAAAbilityBySysname("MENTALCLARITY");
} catch (CoreStateInitException e) {
}
int aamanaregenrank = 0;
if (aa != null) {
if (solplayer.getAARanks().size() > 0)
aamanaregenrank = Utils.getRankOfAAAbility(player, aa);
manaregen += aamanaregenrank;
}
ISoliniaAAAbility emaa = null;
try {
if (solplayer.getAARanks().size() > 0)
emaa = StateManager.getInstance().getConfigurationManager().getFirstAAAbilityBySysname("MENTALCLARITY");
} catch (CoreStateInitException e) {
}
int emaamanaregenrank = 0;
if (emaa != null) {
if (solplayer.getAARanks().size() > 0)
emaamanaregenrank = Utils.getRankOfAAAbility(player, emaa);
manaregen += emaamanaregenrank;
}
manaregen += solplayer.getItemMpRegenBonuses();
// Hp and Mana Regen from Items
int hpregen = 0;
ISoliniaAAAbility hpaa = null;
try {
hpaa = StateManager.getInstance().getConfigurationManager().getFirstAAAbilityBySysname("INNATEREGENERATION");
} catch (CoreStateInitException e) {
}
int aahpregenrank = 0;
if (hpaa != null) {
aahpregenrank = Utils.getRankOfAAAbility(player, hpaa);
hpregen += aahpregenrank;
}
hpregen += solplayer.getItemHpRegenBonuses();
// Process HP Regeneration
if (hpregen > 0) {
int amount = (int) Math.round(player.getHealth()) + hpregen;
if (amount > player.getMaxHealth()) {
amount = (int) Math.round(player.getMaxHealth());
}
if (amount < 0)
amount = 0;
player.setHealth(amount);
}
// Process Mana Regeneration
// System.out.println(player.getName() + " was found to have " + manaregen + " mana regen");
solplayer.increasePlayerMana(manaregen);
}
use of com.solinia.solinia.Interfaces.ISoliniaAAAbility in project solinia3-core by mixxit.
the class SoliniaSpell method getActSpellCost.
@Override
public int getActSpellCost(ISoliniaLivingEntity solEntity) {
// TODO Frenzied Devastation
// TODO Clairevoyance
int cost = getMana();
int spec = 0;
if (solEntity.isPlayer()) {
try {
String skillName = (Utils.getSkillType(getSkill()).name().toUpperCase());
ISoliniaPlayer player = SoliniaPlayerAdapter.Adapt((Player) solEntity.getBukkitLivingEntity());
if (player != null)
if (Utils.getSpecialisationSkills().contains(skillName.toUpperCase()))
if (player.getSpecialisation() != null && player.getSpecialisation().equals(skillName.toUpperCase()))
spec = solEntity.getSkill("SPECIALISE" + skillName.toUpperCase());
} catch (CoreStateInitException e) {
// skip
}
}
float bonus = 1;
int rank = 0;
int advancedrank = 0;
ISoliniaAAAbility aa = null;
try {
aa = StateManager.getInstance().getConfigurationManager().getFirstAAAbilityBySysname("SPELLCASTINGMASTERY");
} catch (CoreStateInitException e) {
}
if (aa != null) {
rank = Utils.getRankOfAAAbility(solEntity.getBukkitLivingEntity(), aa);
switch(rank) {
case 1:
bonus += 0.05;
break;
case 2:
bonus += 0.15;
break;
case 3:
bonus += 0.30;
break;
}
// TODO advanced rank
// bonus += (0.05 * advancedrank);
}
int SuccessChance = Utils.RandomBetween(0, 100);
double PercentManaReduction = 0;
if (SuccessChance <= (spec * 0.3 * bonus)) {
PercentManaReduction = (1 + 0.05 * spec);
switch(rank) {
case 1:
PercentManaReduction += 2.5;
break;
case 2:
PercentManaReduction += 5.0;
break;
case 3:
PercentManaReduction += 10.0;
break;
}
/* TODO Advanced Spell Casting Mastery
switch(advancedrank) {
case 1:
PercentManaReduction += 2.5;
break;
case 2:
PercentManaReduction += 5.0;
break;
case 3:
PercentManaReduction += 10.0;
break;
}
*/
}
// TODO Spell Reduction effects on items/buffs
// TODO Focus Effects
cost -= cost * PercentManaReduction / 100;
if (cost < 0)
cost = 0;
return cost;
}
Aggregations