Change bonus enchantment applied percentages from being additive to

multiplicative.
anvil_rework
sigonasr2 11 years ago
parent 2babc66a85
commit 124ec993ea
  1. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
  2. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
  3. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
  4. 2
      BankEconomyMod/plugin.yml
  5. 84
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -1,6 +1,6 @@
name: BankEconomy
main: me.kaZep.Base.Main
version: 256
version: 257
description: Bank plugin which stores money.
commands:
bankeconomy:

@ -5534,10 +5534,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
}
}
}
@ -5589,10 +5597,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
}
}
}
@ -5635,10 +5651,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
}
}
}
@ -5681,10 +5705,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
}
}
}
@ -5958,16 +5990,28 @@ public ItemStack getGoodie() {
if (item.getType()!=Material.BOW && item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { //Make sure this isn't a ranged weapon.
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (critical_chance==0) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
critical_chance+=critical_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Armor Penetration")) {
armor_pen+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Life Steal")) {
life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (life_steal==0) {
life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
life_steal+=life_steal*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Attack Speed")) {
attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (attack_speed==0) {
attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
attack_speed+=attack_speed*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Damage")) {
dmg+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
@ -6109,16 +6153,28 @@ public ItemStack getGoodie() {
if (item.getType()==Material.BOW && item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { //Make sure we are using a ranged weapon.
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (critical_chance==0) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
critical_chance+=critical_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Armor Penetration")) {
armor_pen+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Life Steal")) {
life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (life_steal==0) {
life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
life_steal+=life_steal*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Attack Speed")) {
attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
if (attack_speed==0) {
attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
attack_speed+=attack_speed*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
}
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Damage")) {
dmg+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));

Loading…
Cancel
Save