Fishing in the rain gives you a higher chance of getting magical items!

This commit is contained in:
TfT_02 2013-01-12 23:09:42 +01:00
parent 6f29e475ee
commit 54ef85e1a3
3 changed files with 15 additions and 2 deletions

View File

@ -16,6 +16,7 @@ public class FishingCommand extends SkillCommand {
private int lootTier; private int lootTier;
private String magicChance; private String magicChance;
private String magicChanceLucky; private String magicChanceLucky;
private String chanceRaining;
private int shakeUnlockLevel; private int shakeUnlockLevel;
private String shakeChance; private String shakeChance;
private String shakeChanceLucky; private String shakeChanceLucky;
@ -30,6 +31,7 @@ public class FishingCommand extends SkillCommand {
private boolean canShake; private boolean canShake;
private boolean canFishermansDiet; private boolean canFishermansDiet;
private boolean lucky; private boolean lucky;
private boolean raining;
public FishingCommand() { public FishingCommand() {
super(SkillType.FISHING); super(SkillType.FISHING);
@ -37,9 +39,15 @@ public class FishingCommand extends SkillCommand {
@Override @Override
protected void dataCalculations() { protected void dataCalculations() {
raining = player.getWorld().hasStorm();
chanceRaining = "";
//Treasure Hunter //Treasure Hunter
lootTier = Fishing.getFishingLootTier(profile); lootTier = Fishing.getFishingLootTier(profile);
int magicChanceInt = (lootTier * magicHunterMultiplier); int magicChanceInt = (lootTier * magicHunterMultiplier);
if (raining) {
chanceRaining = LocaleLoader.getString("Fishing.Chance.Raining");
magicChanceInt = (int) (magicChanceInt * 1.1D);
}
magicChance = percent.format(magicChanceInt / 100D); magicChance = percent.format(magicChanceInt / 100D);
if (magicChanceInt + (magicChanceInt * 0.3333D) >= 100D) magicChanceLucky = percent.format(1D); if (magicChanceInt + (magicChanceInt * 0.3333D) >= 100D) magicChanceLucky = percent.format(1D);
else magicChanceLucky = percent.format((magicChanceInt + (magicChanceInt * 0.3333D)) / 100D); else magicChanceLucky = percent.format((magicChanceInt + (magicChanceInt * 0.3333D)) / 100D);
@ -107,9 +115,9 @@ public class FishingCommand extends SkillCommand {
if (canMagicHunt) { if (canMagicHunt) {
if (lucky) if (lucky)
player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance }) + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { magicChanceLucky })); player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance}) + chanceRaining + LocaleLoader.getString("Perks.lucky.bonus", new Object[] { magicChanceLucky }));
else else
player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance })); player.sendMessage(LocaleLoader.getString("Fishing.Enchant.Chance", new Object[] { magicChance}) + chanceRaining);
} }
if (canShake) { if (canShake) {

View File

@ -150,6 +150,10 @@ public class Fishing {
randomChance = (int) (randomChance * 0.75); randomChance = (int) (randomChance * 0.75);
} }
if (player.getWorld().hasStorm()) {
randomChance = (int) (randomChance * 0.909);
}
/* CHANCE OF ITEM BEING ENCHANTED /* CHANCE OF ITEM BEING ENCHANTED
* 5% - Tier 1 * 5% - Tier 1
* 10% - Tier 2 * 10% - Tier 2

View File

@ -113,6 +113,7 @@ Fishing.Effect.5=Shake items off of mobs w/ fishing pole
Fishing.Effect.6=Fisherman's Diet Fishing.Effect.6=Fisherman's Diet
Fishing.Effect.7=Improves hunger restored from fished foods Fishing.Effect.7=Improves hunger restored from fished foods
Fishing.Enchant.Chance=[[RED]]Magic Hunter Chance: [[YELLOW]]{0} Fishing.Enchant.Chance=[[RED]]Magic Hunter Chance: [[YELLOW]]{0}
Fishing.Chance.Raining=[[BLUE]] Rain Bonus
Fishing.ItemFound=[[GRAY]]Treasure found! Fishing.ItemFound=[[GRAY]]Treasure found!
Fishing.Listener=Fishing: Fishing.Listener=Fishing:
Fishing.MagicFound=[[GRAY]]You feel a touch of magic with this catch... Fishing.MagicFound=[[GRAY]]You feel a touch of magic with this catch...