Added "lucky" donor perk - abilities have 25% better chance to activate

This commit is contained in:
GJ
2012-07-02 11:09:55 -04:00
parent 246961887e
commit 819b6fcacb
14 changed files with 226 additions and 28 deletions

View File

@ -41,7 +41,13 @@ public class TamingManager {
}
if (skillLevel >= Taming.FAST_FOOD_SERVICE_ACTIVATION_LEVEL) {
if (Taming.getRandom().nextInt(100) < Taming.FAST_FOOD_SERVICE_ACTIVATION_CHANCE) {
int randomChance = 100;
if (player.hasPermission("mcmmo.perks.lucky.taming")) {
randomChance = (int) (randomChance * 0.75);
}
if (Taming.getRandom().nextInt(randomChance) < Taming.FAST_FOOD_SERVICE_ACTIVATION_CHANCE) {
FastFoodServiceEventHandler eventHandler = new FastFoodServiceEventHandler(wolf);
eventHandler.modifyHealth(damage);
@ -78,7 +84,13 @@ public class TamingManager {
GoreEventHandler eventHandler = new GoreEventHandler(this, event);
if (Taming.getRandom().nextInt(1000) < eventHandler.skillModifier) {
int randomChance = 1000;
if (player.hasPermission("mcmmo.perks.lucky.taming")) {
randomChance = (int) (randomChance * 0.75);
}
if (Taming.getRandom().nextInt(randomChance) < eventHandler.skillModifier) {
eventHandler.modifyEventDamage();
eventHandler.applyBleed();
eventHandler.sendAbilityMessage();