From 5194f23df1af54ac306af5f928026ae881090760 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 9 Jul 2011 17:18:00 -0700 Subject: [PATCH] Version 1.0.33 --- mcMMO/Changelog.txt | 160 +- mcMMO/com/gmail/nossr50/Combat.java | 474 +++--- mcMMO/com/gmail/nossr50/Database.java | 1 - mcMMO/com/gmail/nossr50/Item.java | 10 +- mcMMO/com/gmail/nossr50/Leaderboard.java | 74 +- mcMMO/com/gmail/nossr50/Messages.java | 73 + mcMMO/com/gmail/nossr50/Mob.java | 76 + mcMMO/com/gmail/nossr50/Users.java | 37 +- mcMMO/com/gmail/nossr50/config/Config.java | 176 -- .../gmail/nossr50/config/LoadProperties.java | 534 +++++-- mcMMO/com/gmail/nossr50/config/Misc.java | 74 + .../gmail/nossr50/config/mcProperties.java | 91 -- .../nossr50/datatypes/PlayerProfile.java | 1418 +++++------------ .../gmail/nossr50/datatypes/PlayerStat.java | 3 +- mcMMO/com/gmail/nossr50/datatypes/Tree.java | 2 - .../com/gmail/nossr50/datatypes/TreeNode.java | 16 +- mcMMO/com/gmail/nossr50/m.java | 776 +++++---- mcMMO/com/gmail/nossr50/mcBlockListener.java | 170 +- mcMMO/com/gmail/nossr50/mcEntityListener.java | 124 +- mcMMO/com/gmail/nossr50/mcMMO.java | 175 +- mcMMO/com/gmail/nossr50/mcPermissions.java | 56 +- mcMMO/com/gmail/nossr50/mcPlayerListener.java | 904 +++++++---- mcMMO/com/gmail/nossr50/mcTimer.java | 71 +- mcMMO/com/gmail/nossr50/mcTimerSpells.java | 20 + .../com/gmail/nossr50/messages_de.properties | 321 ++++ .../gmail/nossr50/messages_en_us.properties | 323 ++++ .../com/gmail/nossr50/messages_fi.properties | 323 ++++ .../com/gmail/nossr50/messages_fr.properties | 321 ++++ .../com/gmail/nossr50/messages_pl.properties | 323 ++++ mcMMO/com/gmail/nossr50/party/Party.java | 20 +- .../com/gmail/nossr50/skills/Acrobatics.java | 7 +- mcMMO/com/gmail/nossr50/skills/Axes.java | 89 +- .../com/gmail/nossr50/skills/Excavation.java | 74 +- mcMMO/com/gmail/nossr50/skills/Herbalism.java | 138 +- mcMMO/com/gmail/nossr50/skills/Mining.java | 77 +- mcMMO/com/gmail/nossr50/skills/Repair.java | 65 +- mcMMO/com/gmail/nossr50/skills/Skills.java | 459 +++--- mcMMO/com/gmail/nossr50/skills/Sorcery.java | 115 ++ mcMMO/com/gmail/nossr50/skills/Swords.java | 234 +-- mcMMO/com/gmail/nossr50/skills/Taming.java | 56 +- mcMMO/com/gmail/nossr50/skills/Unarmed.java | 76 +- .../com/gmail/nossr50/skills/WoodCutting.java | 39 +- mcMMO/plugin.yml | 2 +- 43 files changed, 5414 insertions(+), 3163 deletions(-) create mode 100644 mcMMO/com/gmail/nossr50/Messages.java create mode 100644 mcMMO/com/gmail/nossr50/Mob.java delete mode 100644 mcMMO/com/gmail/nossr50/config/Config.java create mode 100644 mcMMO/com/gmail/nossr50/config/Misc.java delete mode 100644 mcMMO/com/gmail/nossr50/config/mcProperties.java create mode 100644 mcMMO/com/gmail/nossr50/mcTimerSpells.java create mode 100644 mcMMO/com/gmail/nossr50/messages_de.properties create mode 100644 mcMMO/com/gmail/nossr50/messages_en_us.properties create mode 100644 mcMMO/com/gmail/nossr50/messages_fi.properties create mode 100644 mcMMO/com/gmail/nossr50/messages_fr.properties create mode 100644 mcMMO/com/gmail/nossr50/messages_pl.properties create mode 100644 mcMMO/com/gmail/nossr50/skills/Sorcery.java diff --git a/mcMMO/Changelog.txt b/mcMMO/Changelog.txt index 06ea6638c..4377fa2db 100644 --- a/mcMMO/Changelog.txt +++ b/mcMMO/Changelog.txt @@ -1,11 +1,169 @@ Changelog: #Versions without changelogs probably had very small misc fixes, like tweaks to the source code +Version 1.0.33 +Fixed the toggle for the Excavation drop 'Cocoa Beans' +Fixed bug where Unarmed users could disarm without being bare handed +Cocoa Beans now have an XP modifier in config.yml +You can now toggle whether or not Mobspawners will give XP (in config.yml) +MySQL version now makes requests to the MySQL server less frequently (should help performance) +Fixed bug with Skull Splitter hitting the user + +Version 1.0.32 +Added "General.Performance.Print_Reports" node to config.yml to help identify causes of performance issues +Fixed bug of swords users hurting themselves with serrated strikes + +Version 1.0.31 +Fixed bug of trying to cast Animals to non-animals + +Version 1.0.30 +Mobs that spawn from spawners no longer give XP (for reals this time) + +Version 1.0.29 +Mobs that spawn from spawners no longer give XP (again) +Fixed bug where Serrated Strikes did not Bleed additional targets +Identified and solved a potential memory leak in Bleed Simulation +Renamed the Object Config to Misc and rewrote parts of it +Rewrote Party/Admin/God toggles +Added Polish language support (pl) + +Version 1.0.28 +Actually fixed /stats showing excavation values for swords +Made some improvements to how Bleed Simulation was handled for different entity types +Obsidian now does normal durability damage during Super Breaker + +Version 1.0.27 +Fixed /stats showing excavation values for swords +Hopefully fixed a wide range of NPE errors +Updated German (de) localization + +Version 1.0.26 +Fixed accidentally making power levels go above 9,000 + +Version 1.0.25 +Compatible with the latest CB +Beast Lore now functions correctly +Wolves are no longer invincible to players +Changed the look of Beast Lore +Skill info pages now show your stat in that skill (if you have permission) +/stats and /whois has been alphabetized and divided into three categories (Gathering/Combat/Misc) +Abilities will not trigger on Trap Doors + +Version 1.0.24 +Now compatible with latest RB (928) +Taming now receives XP from your wolves harming foes +Taming is now easier to level +Green Thumb now drops seeds when harvesting Wheat + +Version 1.0.23 +Modified Bleed Simulation to fix performance problems +Rewrote MySpawn to be more efficient when calculating time left +Rewrote Skills to be more efficient when calculating time left + +Version 1.0.22 +Added 'Name' nodes to commands for renaming them + +Version 1.0.21 +Fixed Skull Splitter length in /axes displaying incorrectly +Fire rate limiter now correctly uses the value in the config file +Stone XP now correctly uses the value in the config file +Cobble -> Mossy now correctly uses the value in the config file +Removed setmyspawn from config file as it serves no purpose +All commands now have an 'Enabled' node in the config file that when set to false disables the command completely +Fixed color scheme inconsistency for Mining in /whois results + +Version 1.0.20 +Fixed Array Index Out of Bounds error + +Version 1.0.19 +Removed a failsafe for the Timer that is no longer necessary (should improve performance) +Fixed /myspawn not working by rewriting it :3 +Fixed exploit where players could break a freshly placed mushroom for XP +MySQL User Passwords can now be blank (Although you really should have a password...) +Fixed a few NPE errors + +Version 1.0.18 +Fixed MySQL default TablePrefix +Fixed Wheat not being configurable + +Version 1.0.17 +Brand new YAML Configuration file +Ability to configure XP for all gathering skills in config file +German Language added to mcMMO +French Language added to mcMMO +MySpawn will no longer heal players +/ commands now also check for their localized names for displaying help +Added many more Strings to localization files +Added more safeguards to MySpawn for NPE +Fixed bug where Tree Feller Radius depended on WoodCutting XP rather than Skill Level +Fixed bug where Readying a Hoe returned a missing localization string +Added some safeguards into Bleed Simulation to prevent possible memory leaks +Performance improvements to storing/calling Skill/XP Values +Plugged a potential memory leak with PlayerProfiles not being removed correctly +Disabled the mob spawner camping anti-exploit in favor of performance + +Version 1.0.16 +Fixed bug where localization file failed to load +Changed en_US to lowercase +mcMMO now requires locale files to be in lowercase +Fixed a few strings missing from the localization file + +Version 1.0.15 +Removed leftover code that spammed SQL errors + +Version 1.0.14 +Added many missed strings into localization +Finnish Localization updated for the new strings +Green Thumb should respect Block Protection plugins now +Fixed Number Format Exception when loading a PlayerProfile + +Version 1.0.13 +Fixed bug/NPE where stats would not load and therefore 'reset' for players +Fixed NPE involving /ptp +Added "enableMOTD" setting to properties file + +Version 1.0.12 +Fixed another NPE error +Non-Gathering skills should correctly gain XP if PVP is set to false now +Localization will now support language codes that do not have two parts like "fi" +Fixed bug where Wiki MOTD message would not be loaded from localization file + +Version 1.0.11 +Fixed bug where players could not gain experience in several skills +Removed PVP flag from mcmmo.properties as its not needed anymore +Fixed a few NPE errors +Mushroom XP reduced from 25 to 15 +Fixed an exploit where players who just logged in could be farmed for experience because they were invulnerable + +Version 1.0.10 +Added Localization/String Customization +Mushroom XP reduced from 40 to 25 +Removed "clears inventory" warning in /mcc for /myspawn since this no longer happens + +Version 1.0.09 +Fixed the NPE that occurs when players gain experience (Sorry!) +Fixed bug where /myspawn & /clearmyspawn would work if MySpawn was disabled in the properties file +Changed strings containing "MMO" to read "mcMMO" +Removed a lot of unused or unnecessary variables from the PlayerProfiles in mcMMO, this should lower the memory footprint +Added getXpToLevel() for modders + +Version 1.0.08 +Added removeXP() for modders +Fixed bug where stone swords only repaired by 33% instead of 50% +Fixed bug where stone/wooden hoes wouldn't repair +Big overhaul to how skill values and xp values were handled in the code +Modifying the players skill levels now sets the corresponding skill xp to zero +Using Serrated Strikes/Skull Splitter on mobs should no longer harm nearby players when PVP is disabled +Switching to another weapon after firing your bow should no longer trigger procs for that weapon when the arrow hits +Slimes/Ghasts now give XP for combat skills +Added "EnableHpRegeneration" property setting +Added "EnableMySpawn" property setting + Version 1.0.07 +Added more repair customization by solarcloud7 Leaderboards ignore players with the respective stat at 0 Reconnecting to MySQL will reload player data Fixed a NPE with MySQL's Leaderboards Removed "Loop iteration" debug message from mcMMO -Added more repair customization by solarcloud7 Version 1.0.06 MySQL will attempt to reconnect if the connection is closed diff --git a/mcMMO/com/gmail/nossr50/Combat.java b/mcMMO/com/gmail/nossr50/Combat.java index 23f688f86..1944f8969 100644 --- a/mcMMO/com/gmail/nossr50/Combat.java +++ b/mcMMO/com/gmail/nossr50/Combat.java @@ -1,27 +1,14 @@ package com.gmail.nossr50; -import org.bukkit.ChatColor; import org.bukkit.Location; -import org.bukkit.entity.Animals; -import org.bukkit.entity.Creature; -import org.bukkit.entity.Creeper; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Monster; -import org.bukkit.entity.PigZombie; -import org.bukkit.entity.Player; -import org.bukkit.entity.Skeleton; -import org.bukkit.entity.Spider; -import org.bukkit.entity.Squid; -import org.bukkit.entity.Wolf; -import org.bukkit.entity.Zombie; +import org.bukkit.World; +import org.bukkit.entity.*; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; -import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.party.Party; @@ -33,151 +20,248 @@ import com.gmail.nossr50.skills.Taming; import com.gmail.nossr50.skills.Unarmed; public class Combat { - private static mcMMO plugin; - public Combat(mcMMO instance) { - plugin = instance; - } - public static void combatChecks(EntityDamageEvent event, Plugin pluginx){ + public static void combatChecks(EntityDamageEvent event, mcMMO pluginx) + { if(event.isCancelled() || event.getDamage() == 0) return; /* - * OFFENSIVE CHECKS FOR PLAYERS VERSUS ENTITIES + * CHANGE DAMAGE BASED ON DIFFICULTY */ - if(event instanceof EntityDamageByEntityEvent && ((EntityDamageByEntityEvent) event).getDamager() instanceof Player) + if(event instanceof EntityDamageByEntityEvent) { - //Declare Things - EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent) event; - Player attacker = (Player)((EntityDamageByEntityEvent) event).getDamager(); - PlayerProfile PPa = Users.getProfile(attacker); + EntityDamageByEntityEvent eventx = (EntityDamageByEntityEvent) event; + /* + * MOB DIFFICULTY STUFF + */ - //Damage modifiers - if(mcPermissions.getInstance().unarmed(attacker) && attacker.getItemInHand().getTypeId() == 0) //Unarmed - Unarmed.unarmedBonus(attacker, eventb); - if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker) && PPa.getAxesInt() >= 500) - event.setDamage(event.getDamage()+4); + /* + if(eventx.getDamager() instanceof Monster) + { + Integer theMob = eventx.getDamager().getEntityId(); + //System.out.println("FIRST STAGE"); + if(pluginx.mob.mobDiff.containsKey(theMob)) + { + //System.out.println("STAGE TWO"); + if(eventx.getEntity() instanceof Player) + { + Player player = (Player) eventx.getEntity(); + player.sendMessage("Mob Difficulty: "+((int) pluginx.mob.mobDiff.get(theMob)+1)); + //System.out.println("STAGE THREE"); + + //SETUP DMG + event.setDamage((pluginx.mob.mobDiff.get(theMob)+1) * event.getDamage()); + } + } else + { + pluginx.mob.assignDifficulty(eventx.getDamager()); + } + } + */ - //If there are any abilities to activate - combatAbilityChecks(attacker, PPa, pluginx); - - //Check for offensive procs - if(mcPermissions.getInstance().axes(attacker)) - Axes.axeCriticalCheck(attacker, eventb, pluginx); //Axe Criticals - if(!Config.getInstance().isBleedTracked(event.getEntity())) //Swords Bleed - Swords.bleedCheck(attacker, event.getEntity(), pluginx); - if(event.getEntity() instanceof Player && mcPermissions.getInstance().unarmed(attacker)){ - Player defender = (Player)event.getEntity(); - Unarmed.disarmProcCheck(attacker, defender); - } - - - //Modify the event damage if Attacker is Berserk - if(PPa.getBerserkMode()) - event.setDamage(event.getDamage() + (event.getDamage() / 2)); - - //Handle Ability Interactions - if(PPa.getSkullSplitterMode() && m.isAxes(attacker.getItemInHand())) - Axes.applyAoeDamage(attacker, eventb, pluginx); - if(PPa.getSerratedStrikesMode() && m.isSwords(attacker.getItemInHand())) - Swords.applySerratedStrikes(attacker, eventb, pluginx); - - //Experience - if(event.getEntity() instanceof Player) - { - Player defender = (Player)event.getEntity(); - PlayerProfile PPd = Users.getProfile(defender); - if(attacker != null && defender != null && LoadProperties.pvpxp) - { - if(System.currentTimeMillis() >= PPd.getRespawnATS() + 5000 && defender.getHealth() >= 1) - { - if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)) - PPa.addAxesXP((event.getDamage() * 3) * LoadProperties.pvpxprewardmodifier); - if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) - PPa.addSwordsXP((event.getDamage() * 3) * LoadProperties.pvpxprewardmodifier); - if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) - PPa.addUnarmedXP((event.getDamage() * 3) * LoadProperties.pvpxprewardmodifier); - } - } - } - - if(event.getEntity() instanceof Monster) - { - int xp = 0; - if(event.getEntity() instanceof Creeper) - xp = (event.getDamage() * 4) * LoadProperties.xpGainMultiplier; - if(event.getEntity() instanceof Spider) - xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; - if(event.getEntity() instanceof Skeleton) - xp = (event.getDamage() * 2) * LoadProperties.xpGainMultiplier; - if(event.getEntity() instanceof Zombie) - xp = (event.getDamage() * 2) * LoadProperties.xpGainMultiplier; - if(event.getEntity() instanceof PigZombie) - xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + /* + * OFFENSIVE CHECKS FOR PLAYERS VERSUS ENTITIES + */ + if(((EntityDamageByEntityEvent) event).getDamager() instanceof Player) + { + //Declare Things + EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent) event; + Player attacker = (Player)((EntityDamageByEntityEvent) event).getDamager(); + PlayerProfile PPa = Users.getProfile(attacker); - if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) - PPa.addSwordsXP(xp); - if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)) - PPa.addAxesXP(xp); - if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) - PPa.addUnarmedXP(xp); - } - Skills.XpCheck(attacker); - - //Taming Debug Stuff - if(event.getEntity() instanceof Wolf) - { - if(Party.getInstance().inSameParty(attacker, Taming.getOwner(event.getEntity(), pluginx))) - event.setCancelled(true); - if(attacker.getItemInHand().getTypeId() == 352 && mcPermissions.getInstance().taming(attacker)) - { - attacker.sendMessage(ChatColor.GREEN+"**You examine the Wolf using Beast Lore**"); - if(Taming.getOwnerName(event.getEntity()) != null) - attacker.sendMessage(ChatColor.DARK_GREEN+"The Beast's Master : "+Taming.getOwnerName(event.getEntity())); - else - attacker.sendMessage(ChatColor.GRAY+"This Beast has no Master..."); - attacker.sendMessage(ChatColor.GREEN+"This beast has "+((Wolf)event.getEntity()).getHealth()+" Health"); - event.setCancelled(true); - } - } + //Damage modifiers + if(mcPermissions.getInstance().unarmed(attacker) && attacker.getItemInHand().getTypeId() == 0) //Unarmed + Unarmed.unarmedBonus(attacker, eventb); + if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker) && PPa.getSkill("axes") >= 500) + event.setDamage(event.getDamage()+4); + + //If there are any abilities to activate + combatAbilityChecks(attacker, PPa, pluginx); + + //Check for offensive procs + if(!(event instanceof EntityDamageByProjectileEvent)) + { + if(mcPermissions.getInstance().axes(attacker)) + Axes.axeCriticalCheck(attacker, eventb, pluginx); //Axe Criticals + + if(!pluginx.misc.bleedTracker.contains((LivingEntity) event.getEntity())) //Swords Bleed + Swords.bleedCheck(attacker, (LivingEntity)event.getEntity(), pluginx); + + if(event.getEntity() instanceof Player && mcPermissions.getInstance().unarmed(attacker)) + { + Player defender = (Player)event.getEntity(); + Unarmed.disarmProcCheck(attacker, defender); + } + + + + //Modify the event damage if Attacker is Berserk + if(PPa.getBerserkMode()) + event.setDamage(event.getDamage() + (event.getDamage() / 2)); + + //Handle Ability Interactions + if(PPa.getSkullSplitterMode() && m.isAxes(attacker.getItemInHand())) + Axes.applyAoeDamage(attacker, eventb, pluginx); + if(PPa.getSerratedStrikesMode() && m.isSwords(attacker.getItemInHand())) + Swords.applySerratedStrikes(attacker, eventb, pluginx); + + //Experience + if(event.getEntity() instanceof Player) + { + Player defender = (Player)event.getEntity(); + PlayerProfile PPd = Users.getProfile(defender); + if(attacker != null && defender != null && LoadProperties.pvpxp) + { + if(System.currentTimeMillis() >= PPd.getRespawnATS() + 5000 + && ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis() + && defender.getHealth() >= 1) + { + if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)) + PPa.addAxesXP((event.getDamage() * 2) * LoadProperties.pvpxprewardmodifier); + if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) + PPa.addSwordsXP((event.getDamage() * 2) * LoadProperties.pvpxprewardmodifier); + if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) + PPa.addUnarmedXP((event.getDamage() * 2) * LoadProperties.pvpxprewardmodifier); + } + } + } + + if(event.getEntity() instanceof Monster && !pluginx.misc.mobSpawnerList.contains(event.getEntity())) + { + int xp = 0; + if(event.getEntity() instanceof Creeper) + xp = (event.getDamage() * 4) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Spider) + xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Skeleton) + xp = (event.getDamage() * 2) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Zombie) + xp = (event.getDamage() * 2) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof PigZombie) + xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Slime) + xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Ghast) + xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + + if(pluginx.mob.mobDiff.containsKey(event.getEntity().getEntityId())) + { + pluginx.mob.isAggressive.put(event.getEntity().getEntityId(), true); + //ARMOR REDUCTION BASED ON ENEMY RANKING + int modifiedDmg = event.getDamage() / (pluginx.mob.mobDiff.get(event.getEntity().getEntityId())+1); + if(modifiedDmg < 1) + modifiedDmg = 1; + event.setDamage(modifiedDmg); + } + + //ADJUST TO DIFFICULTY + if(pluginx.mob.mobDiff.containsKey(event.getEntity().getEntityId())) + { + xp = xp * (pluginx.mob.mobDiff.get(event.getEntity().getEntityId())+1); + } + + if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) + PPa.addSwordsXP(xp); + if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)) + PPa.addAxesXP(xp); + if(attacker.getItemInHand().getTypeId() == 0 && mcPermissions.getInstance().unarmed(attacker)) + PPa.addUnarmedXP(xp); + } + Skills.XpCheck(attacker); + + if(event.getEntity() instanceof Wolf) + { + Wolf theWolf = (Wolf)event.getEntity(); + + if(attacker.getItemInHand().getTypeId() == 352 && mcPermissions.getInstance().taming(attacker)) + { + event.setCancelled(true); + if(theWolf.isTamed()) + { + attacker.sendMessage(Messages.getString("Combat.BeastLore")+" "+ + Messages.getString("Combat.BeastLoreOwner", new Object[] {Taming.getOwnerName(theWolf)})+" "+ + Messages.getString("Combat.BeastLoreHealthWolfTamed", new Object[] {theWolf.getHealth()})); + } + else + { + attacker.sendMessage(Messages.getString("Combat.BeastLore")+" "+ + Messages.getString("Combat.BeastLoreHealthWolf", new Object[] {theWolf.getHealth()})); + } + } + } + } + } } + /* * OFFENSIVE CHECKS FOR WOLVES VERSUS ENTITIES */ if(event instanceof EntityDamageByEntityEvent && ((EntityDamageByEntityEvent) event).getDamager() instanceof Wolf) { EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent) event; - if(Taming.hasOwner(eventb.getDamager(), pluginx)) + Wolf theWolf = (Wolf) eventb.getDamager(); + if(Taming.ownerOnline(theWolf, pluginx)) { - Player master = Taming.getOwner(eventb.getDamager(), pluginx); + Player master = Taming.getOwner(theWolf, pluginx); PlayerProfile PPo = Users.getProfile(master); - if(mcPermissions.getInstance().taming(master)){ + + if(mcPermissions.getInstance().taming(master)) + { //Sharpened Claws - if(PPo.getTamingInt() >= 750) + if(PPo.getSkill("taming") >= 750) { event.setDamage(event.getDamage() + 2); } //Gore - if(Math.random() * 1000 <= PPo.getTamingInt()) + if(Math.random() * 1000 <= PPo.getSkill("taming")) { event.setDamage(event.getDamage() * 2); if(event.getEntity() instanceof Player) { Player target = (Player)event.getEntity(); - target.sendMessage(ChatColor.RED+"**STRUCK BY GORE**"); + target.sendMessage(Messages.getString("Combat.StruckByGore")); //$NON-NLS-1$ Users.getProfile(target).setBleedTicks(2); } else - Config.getInstance().addToBleedQue(event.getEntity()); + pluginx.misc.addToBleedQue((LivingEntity) event.getEntity()); - master.sendMessage(ChatColor.GREEN+"**GORE**"); + master.sendMessage(Messages.getString("Combat.Gore")); //$NON-NLS-1$ + } + if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity())) + { + int xp = 0; + if(event.getEntity() instanceof Monster) + { + if(event.getEntity() instanceof Creeper) + xp = (event.getDamage() * 6) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Spider) + xp = (event.getDamage() * 5) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Skeleton) + xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Zombie) + xp = (event.getDamage() * 3) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof PigZombie) + xp = (event.getDamage() * 4) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Slime) + xp = (event.getDamage() * 4) * LoadProperties.xpGainMultiplier; + if(event.getEntity() instanceof Ghast) + xp = (event.getDamage() * 4) * LoadProperties.xpGainMultiplier; + Users.getProfile(master).addTamingXP(xp); + } + if(event.getEntity() instanceof Player) + { + xp = (event.getDamage() * 2) * LoadProperties.xpGainMultiplier; + Users.getProfile(master).addTamingXP(xp); + } + Skills.XpCheck(master); } } } } //Another offensive check for Archery if(event instanceof EntityDamageByProjectileEvent) - archeryCheck((EntityDamageByProjectileEvent) event); + archeryCheck((EntityDamageByProjectileEvent) event, pluginx); /* * DEFENSIVE CHECKS @@ -192,29 +276,34 @@ public class Combat { /* * DEFENSIVE CHECKS FOR WOLVES */ - if(event.getEntity() instanceof Wolf){ - if(Taming.hasOwner(event.getEntity(), pluginx)) + + if(event.getEntity() instanceof Wolf) + { + Wolf theWolf = (Wolf) event.getEntity(); + + if(Taming.ownerOnline(theWolf, pluginx)) { - Player master = Taming.getOwner(event.getEntity(), pluginx); + Player master = Taming.getOwner(theWolf, pluginx); PlayerProfile PPo = Users.getProfile(master); if(mcPermissions.getInstance().taming(master)) { /* * TEMPORARY FIX AS WOLVES AREN'T TRIGGERING DAMAGE EVENTS WHEN ATTACKING NON PLAYERS AT THE TIME OF WRITING */ - if(!event.isCancelled() && event.getCause() != DamageCause.LIGHTNING){ + if(!event.isCancelled() && event.getCause() != DamageCause.LIGHTNING) + { PPo.addTamingXP(event.getDamage() * 3); Skills.XpCheck(master); } //Shock-Proof - if((event.getCause() == DamageCause.ENTITY_EXPLOSION || event.getCause() == DamageCause.BLOCK_EXPLOSION) && PPo.getTamingInt() >= 500) + if((event.getCause() == DamageCause.ENTITY_EXPLOSION || event.getCause() == DamageCause.BLOCK_EXPLOSION) && PPo.getSkill("taming") >= 500) { event.setDamage(2); } //Thick Fur - if(PPo.getTamingInt() >= 250) + if(PPo.getSkill("taming") >= 250) event.setDamage(event.getDamage() / 2); } } @@ -231,24 +320,31 @@ public class Combat { if(PPa.getFistsPreparationMode()) Unarmed.berserkActivationCheck(attacker, pluginx); } - public static void archeryCheck(EntityDamageByProjectileEvent event){ + public static void archeryCheck(EntityDamageByProjectileEvent event, mcMMO pluginx) + { Entity y = event.getDamager(); Entity x = event.getEntity(); - if(event.getProjectile().toString().equals("CraftArrow") && x instanceof Player){ + Projectile projectile = event.getProjectile(); + if(projectile.toString().equals("CraftArrow") && x instanceof Player) + { //$NON-NLS-1$ Player defender = (Player)x; PlayerProfile PPd = Users.getProfile(defender); if(PPd == null) Users.addUser(defender); - if(mcPermissions.getInstance().unarmed(defender) && defender.getItemInHand().getTypeId() == 0){ - if(defender != null && PPd.getUnarmedInt() >= 1000){ - if(Math.random() * 1000 <= 500){ + if(mcPermissions.getInstance().unarmed(defender) && defender.getItemInHand().getTypeId() == 0) + { + if(defender != null && PPd.getSkill("unarmed") >= 1000) + { + if(Math.random() * 1000 <= 500) + { event.setCancelled(true); - defender.sendMessage(ChatColor.WHITE+"**ARROW DEFLECT**"); + defender.sendMessage(Messages.getString("Combat.ArrowDeflect")); //$NON-NLS-1$ return; } - } else if(defender != null && Math.random() * 1000 <= (PPd.getUnarmedInt() / 2)){ + } else if(defender != null && Math.random() * 1000 <= (PPd.getSkill("unarmed") / 2)) + { event.setCancelled(true); - defender.sendMessage(ChatColor.WHITE+"**ARROW DEFLECT**"); + defender.sendMessage(Messages.getString("Combat.ArrowDeflect")); //$NON-NLS-1$ return; } } @@ -256,22 +352,30 @@ public class Combat { /* * If attacker is player */ - if(y instanceof Player){ + if(y instanceof Player) + { Player attacker = (Player)y; PlayerProfile PPa = Users.getProfile(attacker); - if(event.getProjectile().toString().equals("CraftArrow") && mcPermissions.getInstance().archery(attacker)){ - if(!Config.getInstance().isTracked(x) && event.getDamage() > 0){ - Config.getInstance().addArrowTrack(x, 0); - if(attacker != null){ - if(Math.random() * 1000 <= PPa.getArcheryInt()){ - Config.getInstance().addArrowCount(x, 1); + if(projectile.toString().equals("CraftArrow") && mcPermissions.getInstance().archery(attacker)) + { //$NON-NLS-1$ + if(!pluginx.misc.arrowTracker.containsKey(x) && event.getDamage() > 0) + { + pluginx.misc.arrowTracker.put(x, 0); + if(attacker != null) + { + if(Math.random() * 1000 <= PPa.getSkill("archery")) + { + pluginx.misc.arrowTracker.put(x, 1); } } - } else { - if(event.getDamage() > 0){ + } else + { + if(event.getDamage() > 0) + { if(attacker != null){ - if(Math.random() * 1000 <= PPa.getArcheryInt()){ - Config.getInstance().addArrowCount(x, 1); + if(Math.random() * 1000 <= PPa.getSkill("archery")) + { + pluginx.misc.arrowTracker.put(x, 1); } } } @@ -279,15 +383,15 @@ public class Combat { /* * DAMAGE MODIFIER */ - if(PPa.getArcheryInt() >= 50 && PPa.getArcheryInt() < 250) + if(PPa.getSkill("archery") >= 50 && PPa.getSkill("archery") < 250) event.setDamage(event.getDamage()+1); - if(PPa.getArcheryInt() >= 250 && PPa.getArcheryInt() < 575) + if(PPa.getSkill("archery") >= 250 && PPa.getSkill("archery") < 575) event.setDamage(event.getDamage()+2); - if(PPa.getArcheryInt() >= 575 && PPa.getArcheryInt() < 725) + if(PPa.getSkill("archery") >= 575 && PPa.getSkill("archery") < 725) event.setDamage(event.getDamage()+3); - if(PPa.getArcheryInt() >= 725 && PPa.getArcheryInt() < 1000) + if(PPa.getSkill("archery") >= 725 && PPa.getSkill("archery") < 1000) event.setDamage(event.getDamage()+4); - if(PPa.getArcheryInt() >= 1000) + if(PPa.getSkill("archery") >= 1000) event.setDamage(event.getDamage()+5); /* @@ -296,27 +400,27 @@ public class Combat { if(Math.random() * 100 >= 75){ int ignition = 20; - if(PPa.getArcheryInt() >= 200) + if(PPa.getSkill("archery") >= 200) ignition+=20; - if(PPa.getArcheryInt() >= 400) + if(PPa.getSkill("archery") >= 400) ignition+=20; - if(PPa.getArcheryInt() >= 600) + if(PPa.getSkill("archery") >= 600) ignition+=20; - if(PPa.getArcheryInt() >= 800) + if(PPa.getSkill("archery") >= 800) ignition+=20; - if(PPa.getArcheryInt() >= 1000) + if(PPa.getSkill("archery") >= 1000) ignition+=20; if(x instanceof Player){ Player Defender = (Player)x; if(!Party.getInstance().inSameParty(attacker, Defender)){ event.getEntity().setFireTicks(ignition); - attacker.sendMessage(ChatColor.RED+"**IGNITION**"); - Defender.sendMessage(ChatColor.DARK_RED+"You were struck by a burning arrow!"); + attacker.sendMessage(Messages.getString("Combat.Ignition")); //$NON-NLS-1$ + Defender.sendMessage(Messages.getString("Combat.BurningArrowHit")); //$NON-NLS-1$ } } else { event.getEntity().setFireTicks(ignition); - attacker.sendMessage(ChatColor.RED+"**IGNITION**"); + attacker.sendMessage(Messages.getString("Combat.Ignition")); //$NON-NLS-1$ } } /* @@ -324,27 +428,25 @@ public class Combat { */ if(x instanceof Monster){ //XP - if(!Config.getInstance().isMobSpawnTracked(x)){ - if(x instanceof Creeper) - PPa.addArcheryXP((event.getDamage() * 4) * LoadProperties.xpGainMultiplier); - if(x instanceof Spider) - PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.xpGainMultiplier); - if(x instanceof Skeleton) - PPa.addArcheryXP((event.getDamage() * 2) * LoadProperties.xpGainMultiplier); - if(x instanceof Zombie) - PPa.addArcheryXP((event.getDamage() * 2) * LoadProperties.xpGainMultiplier); - if(x instanceof PigZombie) - PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.xpGainMultiplier); - } + if(x instanceof Creeper) + PPa.addArcheryXP((event.getDamage() * 4) * LoadProperties.xpGainMultiplier); + if(x instanceof Spider) + PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.xpGainMultiplier); + if(x instanceof Skeleton) + PPa.addArcheryXP((event.getDamage() * 2) * LoadProperties.xpGainMultiplier); + if(x instanceof Zombie) + PPa.addArcheryXP((event.getDamage() * 2) * LoadProperties.xpGainMultiplier); + if(x instanceof PigZombie) + PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.xpGainMultiplier); + if(x instanceof Slime) + PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.xpGainMultiplier); + if(x instanceof Ghast) + PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.xpGainMultiplier); } /* * Attacker is Player */ if(x instanceof Player){ - if(LoadProperties.pvp == false){ - event.setCancelled(true); - return; - } Player defender = (Player)x; PlayerProfile PPd = Users.getProfile(defender); /* @@ -359,7 +461,8 @@ public class Combat { /* * PVP XP */ - if(LoadProperties.pvpxp && !Party.getInstance().inSameParty(attacker, defender)){ + if(LoadProperties.pvpxp && !Party.getInstance().inSameParty(attacker, defender) + && ((PPd.getLastLogin()+5)*1000) < System.currentTimeMillis()){ PPa.addArcheryXP((event.getDamage() * 3) * LoadProperties.pvpxprewardmodifier); } /* @@ -371,16 +474,16 @@ public class Combat { } else { loc.setPitch(-90); } - if(PPa.getArcheryInt() >= 1000){ + if(PPa.getSkill("archery") >= 1000){ if(Math.random() * 1000 <= 500){ defender.teleport(loc); - defender.sendMessage(ChatColor.DARK_RED+"Touched Fuzzy. Felt Dizzy."); - attacker.sendMessage("Target was "+ChatColor.DARK_RED+"Dazed"); + defender.sendMessage(Messages.getString("Combat.TouchedFuzzy")); //$NON-NLS-1$ + attacker.sendMessage(Messages.getString("Combat.TargetDazed")); //$NON-NLS-1$ //$NON-NLS-2$ } - } else if(Math.random() * 2000 <= PPa.getArcheryInt()){ + } else if(Math.random() * 2000 <= PPa.getSkill("archery")){ defender.teleport(loc); - defender.sendMessage(ChatColor.DARK_RED+"Touched Fuzzy. Felt Dizzy."); - attacker.sendMessage("Target was "+ChatColor.DARK_RED+"Dazed"); + defender.sendMessage(Messages.getString("Combat.TouchedFuzzy")); //$NON-NLS-1$ + attacker.sendMessage(Messages.getString("Combat.TargetDazed")); //$NON-NLS-1$ //$NON-NLS-2$ } } } @@ -398,4 +501,11 @@ public class Combat { ((Monster) target).damage(dmg); } } + public static boolean pvpAllowed(EntityDamageByEntityEvent event, World world) + { + if(!event.getEntity().getWorld().getPVP()) + return false; + //If it made it this far, pvp is enabled + return true; + } } diff --git a/mcMMO/com/gmail/nossr50/Database.java b/mcMMO/com/gmail/nossr50/Database.java index 06f5443a8..0d56f1a84 100644 --- a/mcMMO/com/gmail/nossr50/Database.java +++ b/mcMMO/com/gmail/nossr50/Database.java @@ -4,7 +4,6 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; -import java.sql.Statement; import java.util.HashMap; import java.util.ArrayList; import java.sql.PreparedStatement; diff --git a/mcMMO/com/gmail/nossr50/Item.java b/mcMMO/com/gmail/nossr50/Item.java index 52b512b74..4d04376d6 100644 --- a/mcMMO/com/gmail/nossr50/Item.java +++ b/mcMMO/com/gmail/nossr50/Item.java @@ -1,6 +1,5 @@ package com.gmail.nossr50; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -50,7 +49,7 @@ public class Item { y++; if(player != null){ if(player.getLocation().getWorld().getBlockAt(block.getX(), y, block.getZ()).getType() != Material.AIR){ - player.sendMessage("**CHIMAERA WING FAILED!**"); + player.sendMessage(Messages.getString("Item.ChimaeraWingFail")); //$NON-NLS-1$ player.teleport(player.getLocation().getWorld().getBlockAt(block.getX(), (y - 1), block.getZ()).getLocation()); return; } @@ -67,12 +66,11 @@ public class Item { } else { player.teleport(player.getWorld().getSpawnLocation()); } - player.sendMessage("**CHIMAERA WING**"); + player.sendMessage(Messages.getString("Item.ChimaeraWingPass")); //$NON-NLS-1$ } else if (!Skills.cooldownOver(player, PP.getRecentlyHurt(), 60) && is.getAmount() >= 10) { - player.sendMessage("You were injured recently and must wait to use this." - +ChatColor.YELLOW+" ("+Skills.calculateTimeLeft(player, PP.getRecentlyHurt(), 60)+"s)"); + player.sendMessage(Messages.getString("Item.InjuredWait", new Object[] {Skills.calculateTimeLeft(player, PP.getRecentlyHurt(), 60)})); //$NON-NLS-1$ } else if (is.getTypeId() == 288 && is.getAmount() <= 9){ - player.sendMessage("You need more of that to use it"); + player.sendMessage(Messages.getString("Item.NeedFeathers")); //$NON-NLS-1$ } } } diff --git a/mcMMO/com/gmail/nossr50/Leaderboard.java b/mcMMO/com/gmail/nossr50/Leaderboard.java index fb526b164..75b8559e1 100644 --- a/mcMMO/com/gmail/nossr50/Leaderboard.java +++ b/mcMMO/com/gmail/nossr50/Leaderboard.java @@ -13,8 +13,8 @@ import com.gmail.nossr50.datatypes.PlayerStat; import com.gmail.nossr50.datatypes.Tree; public class Leaderboard { - static String location = "plugins/mcMMO/mcmmo.users"; - protected static final Logger log = Logger.getLogger("Minecraft"); + static String location = "plugins/mcMMO/mcmmo.users"; //$NON-NLS-1$ + protected static final Logger log = Logger.getLogger("Minecraft"); //$NON-NLS-1$ /* * Read from the file @@ -39,11 +39,11 @@ public class Leaderboard { //Open the user file FileReader file = new FileReader(location); BufferedReader in = new BufferedReader(file); - String line = ""; + String line = ""; //$NON-NLS-1$ while((line = in.readLine()) != null) { - String[] character = line.split(":"); + String[] character = line.split(":"); //$NON-NLS-1$ String p = character[0]; @@ -99,26 +99,26 @@ public class Leaderboard { } in.close(); } catch (Exception e) { - log.log(Level.SEVERE, "Exception while reading " - + location + " (Are you sure you formatted it correctly?)", e); + log.log(Level.SEVERE, "Exception while reading " //$NON-NLS-1$ + + location + " (Are you sure you formatted it correctly?)", e); //$NON-NLS-1$ } //Write the leader board files - leaderWrite(Mining.inOrder(), "mining"); - leaderWrite(WoodCutting.inOrder(), "woodcutting"); - leaderWrite(Repair.inOrder(), "repair"); - leaderWrite(Unarmed.inOrder(), "unarmed"); - leaderWrite(Herbalism.inOrder(), "herbalism"); - leaderWrite(Excavation.inOrder(), "excavation"); - leaderWrite(Archery.inOrder(), "archery"); - leaderWrite(Swords.inOrder(), "swords"); - leaderWrite(Axes.inOrder(), "axes"); - leaderWrite(Acrobatics.inOrder(), "acrobatics"); - leaderWrite(Taming.inOrder(), "taming"); - leaderWrite(PowerLevel.inOrder(), "powerlevel"); + leaderWrite(Mining.inOrder(), "mining"); //$NON-NLS-1$ + leaderWrite(WoodCutting.inOrder(), "woodcutting"); //$NON-NLS-1$ + leaderWrite(Repair.inOrder(), "repair"); //$NON-NLS-1$ + leaderWrite(Unarmed.inOrder(), "unarmed"); //$NON-NLS-1$ + leaderWrite(Herbalism.inOrder(), "herbalism"); //$NON-NLS-1$ + leaderWrite(Excavation.inOrder(), "excavation"); //$NON-NLS-1$ + leaderWrite(Archery.inOrder(), "archery"); //$NON-NLS-1$ + leaderWrite(Swords.inOrder(), "swords"); //$NON-NLS-1$ + leaderWrite(Axes.inOrder(), "axes"); //$NON-NLS-1$ + leaderWrite(Acrobatics.inOrder(), "acrobatics"); //$NON-NLS-1$ + leaderWrite(Taming.inOrder(), "taming"); //$NON-NLS-1$ + leaderWrite(PowerLevel.inOrder(), "powerlevel"); //$NON-NLS-1$ } public static void leaderWrite(PlayerStat[] ps, String statName) { - String theLocation = "plugins/mcMMO/" + statName + ".mcmmo"; + String theLocation = "plugins/mcMMO/" + statName + ".mcmmo"; //$NON-NLS-1$ //$NON-NLS-2$ //CHECK IF THE FILE EXISTS File theDir = new File(theLocation); if(!theDir.exists()){ @@ -127,14 +127,14 @@ public class Leaderboard { try { writer = new FileWriter(theLocation); } catch (Exception e) { - log.log(Level.SEVERE, "Exception while creating " + theLocation, e); + log.log(Level.SEVERE, "Exception while creating " + theLocation, e); //$NON-NLS-1$ } finally { try { if (writer != null) { writer.close(); } } catch (IOException e) { - log.log(Level.SEVERE, "Exception while closing writer for " + theLocation, e); + log.log(Level.SEVERE, "Exception while closing writer for " + theLocation, e); //$NON-NLS-1$ } } } else { @@ -147,12 +147,12 @@ public class Leaderboard { for(PlayerStat p : ps) { - if(p.name.equals("$mcMMO_DummyInfo")) + if(p.name.equals("$mcMMO_DummyInfo")) //$NON-NLS-1$ continue; if(p.statVal == 0) continue; - writer.append(p.name + ":" + p.statVal); - writer.append("\r\n"); + writer.append(p.name + ":" + p.statVal); //$NON-NLS-1$ + writer.append("\r\n"); //$NON-NLS-1$ } in.close(); @@ -161,7 +161,7 @@ public class Leaderboard { out.write(writer.toString()); out.close(); } catch (Exception e) { - log.log(Level.SEVERE, "Exception while writing to " + theLocation + " (Are you sure you formatted it correctly?)", e); + log.log(Level.SEVERE, "Exception while writing to " + theLocation + " (Are you sure you formatted it correctly?)", e); //$NON-NLS-1$ //$NON-NLS-2$ } } //Create/open the file @@ -170,7 +170,7 @@ public class Leaderboard { } public static String[] retrieveInfo(String statName, int pagenumber){ - String theLocation = "plugins/mcMMO/" + statName + ".mcmmo"; + String theLocation = "plugins/mcMMO/" + statName + ".mcmmo"; //$NON-NLS-1$ //$NON-NLS-2$ try { FileReader file = new FileReader(theLocation); BufferedReader in = new BufferedReader(file); @@ -178,7 +178,7 @@ public class Leaderboard { int destination = (pagenumber - 1) * 10; //How many lines to skip through int x = 0; //how many lines we've gone through int y = 0; //going through the lines - String line = ""; + String line = ""; //$NON-NLS-1$ String[] info = new String[10]; //what to return while((line = in.readLine()) != null && y < 10) { @@ -191,41 +191,41 @@ public class Leaderboard { in.close(); return info; } catch (Exception e) { - log.log(Level.SEVERE, "Exception while reading " - + theLocation + " (Are you sure you formatted it correctly?)", e); + log.log(Level.SEVERE, "Exception while reading " //$NON-NLS-1$ + + theLocation + " (Are you sure you formatted it correctly?)", e); //$NON-NLS-1$ } return null; //Shouldn't get here } public static void updateLeaderboard(PlayerStat ps, String statName){ if(LoadProperties.useMySQL) return; - String theLocation = "plugins/mcMMO/" + statName + ".mcmmo"; + String theLocation = "plugins/mcMMO/" + statName + ".mcmmo"; //$NON-NLS-1$ //$NON-NLS-2$ try { //Open the file FileReader file = new FileReader(theLocation); BufferedReader in = new BufferedReader(file); StringBuilder writer = new StringBuilder(); - String line = ""; + String line = ""; //$NON-NLS-1$ Boolean inserted = false; //While not at the end of the file while((line = in.readLine()) != null) { //Insert the player into the line before it finds a smaller one - if(Integer.valueOf(line.split(":")[1]) < ps.statVal && !inserted) + if(Integer.valueOf(line.split(":")[1]) < ps.statVal && !inserted) //$NON-NLS-1$ { - writer.append(ps.name + ":" + ps.statVal).append("\r\n"); + writer.append(ps.name + ":" + ps.statVal).append("\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ inserted = true; } //Write anything that isn't the player already in the file so we remove the duplicate - if(!line.split(":")[0].equalsIgnoreCase(ps.name)) + if(!line.split(":")[0].equalsIgnoreCase(ps.name)) //$NON-NLS-1$ { - writer.append(line).append("\r\n"); + writer.append(line).append("\r\n"); //$NON-NLS-1$ } } if(!inserted) { - writer.append(ps.name + ":" + ps.statVal).append("\r\n"); + writer.append(ps.name + ":" + ps.statVal).append("\r\n"); //$NON-NLS-1$ //$NON-NLS-2$ } in.close(); @@ -234,7 +234,7 @@ public class Leaderboard { out.write(writer.toString()); out.close(); } catch (Exception e) { - log.log(Level.SEVERE, "Exception while writing to " + theLocation + " (Are you sure you formatted it correctly?)", e); + log.log(Level.SEVERE, "Exception while writing to " + theLocation + " (Are you sure you formatted it correctly?)", e); //$NON-NLS-1$ //$NON-NLS-2$ } } public static boolean isInt(String string){ diff --git a/mcMMO/com/gmail/nossr50/Messages.java b/mcMMO/com/gmail/nossr50/Messages.java new file mode 100644 index 000000000..1c4b71677 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/Messages.java @@ -0,0 +1,73 @@ +package com.gmail.nossr50; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.bukkit.ChatColor; + +import com.gmail.nossr50.config.LoadProperties; + +public class Messages { + private static final String BUNDLE_NAME = "com.gmail.nossr50.messages"; //$NON-NLS-1$ + + private static ResourceBundle RESOURCE_BUNDLE = null; + + private Messages() { + } + + public static String getString(String key) { + return getString(key, null); + } + + public static String getString(String key, Object[] messageArguments) { + try { + if (RESOURCE_BUNDLE == null) { + String myLocale = LoadProperties.locale.toLowerCase(); + try { + //attempt to get the locale denoted + RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, new Locale(myLocale)); + } catch (MissingResourceException e) { + //System.out.println("Failed to load locale specified by mcmmo.properties '"+myLocale+"', defaulting to en_us"); + RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, new Locale("en_us")); + } + } + + String output = RESOURCE_BUNDLE.getString(key); + + if (messageArguments != null) { + MessageFormat formatter = new MessageFormat(""); + formatter.applyPattern(output); + output = formatter.format(messageArguments); + } + + output = addColors(output); + + return output; + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } + + private static String addColors(String input) { + input = input.replaceAll("\\Q[[BLACK]]\\E", ChatColor.BLACK.toString()); + input = input.replaceAll("\\Q[[DARK_BLUE]]\\E", ChatColor.DARK_BLUE.toString()); + input = input.replaceAll("\\Q[[DARK_GREEN]]\\E", ChatColor.DARK_GREEN.toString()); + input = input.replaceAll("\\Q[[DARK_AQUA]]\\E", ChatColor.DARK_AQUA.toString()); + input = input.replaceAll("\\Q[[DARK_RED]]\\E", ChatColor.DARK_RED.toString()); + input = input.replaceAll("\\Q[[DARK_PURPLE]]\\E", ChatColor.DARK_PURPLE.toString()); + input = input.replaceAll("\\Q[[GOLD]]\\E", ChatColor.GOLD.toString()); + input = input.replaceAll("\\Q[[GRAY]]\\E", ChatColor.GRAY.toString()); + input = input.replaceAll("\\Q[[DARK_GRAY]]\\E", ChatColor.DARK_GRAY.toString()); + input = input.replaceAll("\\Q[[BLUE]]\\E", ChatColor.BLUE.toString()); + input = input.replaceAll("\\Q[[GREEN]]\\E", ChatColor.GREEN.toString()); + input = input.replaceAll("\\Q[[AQUA]]\\E", ChatColor.AQUA.toString()); + input = input.replaceAll("\\Q[[RED]]\\E", ChatColor.RED.toString()); + input = input.replaceAll("\\Q[[LIGHT_PURPLE]]\\E", ChatColor.LIGHT_PURPLE.toString()); + input = input.replaceAll("\\Q[[YELLOW]]\\E", ChatColor.YELLOW.toString()); + input = input.replaceAll("\\Q[[WHITE]]\\E", ChatColor.WHITE.toString()); + + return input; + } +} diff --git a/mcMMO/com/gmail/nossr50/Mob.java b/mcMMO/com/gmail/nossr50/Mob.java new file mode 100644 index 000000000..0f28ee6d0 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/Mob.java @@ -0,0 +1,76 @@ +package com.gmail.nossr50; + +import java.util.HashMap; + +import org.bukkit.entity.*; + +public class Mob +{ + HashMap mobDiff = new HashMap(); + HashMap isAggressive = new HashMap(); + + public void assignDifficulty(Entity entity) + { + short x = 0; + + if(entity.getLocation().getY() >= 45) + { + //LEVEL 2 + if(Math.random() * 100 > 50) + { + x = 0; + } + //LEVEL 3 + else + { + x = 1; + } + } + else + { + double y = Math.random() * 100; + //HIGH CHANCE FOR 5's + if(entity.getLocation().getY() < 20) + { + //ASSIGN INTO THE 5 RANKS + if(y >= 0 && y < 50) + x = 0; + if(y >= 50 && y < 80) + x = 1; + if(y >= 80 && y < 95) + x = 2; + if(y >= 95 && y < 98) + x = 3; + if(y >= 98 && y <= 100) + x = 4; + } + //HIGH CHANCE FOR 4's + else + { + //ASSIGN INTO THE 5 RANKS + if(y >= 0 && y < 50) + x = 0; + if(y >= 50 && y < 74) + x = 1; + if(y >= 74 && y < 89) + x = 2; + if(y >= 89 && y < 99) + x = 3; + if(y >= 99 && y <= 100) + x = 4; + } + if(x > 1) + { + isAggressive.put(entity.getEntityId(), false); + } + + } + + if(!mobDiff.containsKey(entity.getEntityId())) + { + mobDiff.put(entity.getEntityId(), x); + //System.out.println("Mob "+entity.getEntityId()+" (DIFFICULTY) "+ + //(x +1)+"(DEPTH) "+entity.getLocation().getY()); + } + } +} diff --git a/mcMMO/com/gmail/nossr50/Users.java b/mcMMO/com/gmail/nossr50/Users.java index a97fc9798..89541105a 100644 --- a/mcMMO/com/gmail/nossr50/Users.java +++ b/mcMMO/com/gmail/nossr50/Users.java @@ -1,16 +1,12 @@ package com.gmail.nossr50; import java.io.*; -import java.util.ArrayList; import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; import java.util.HashMap; -import org.bukkit.Location; import org.bukkit.entity.*; -import org.bukkit.plugin.Plugin; - import com.gmail.nossr50.datatypes.PlayerProfile; @@ -28,15 +24,18 @@ public class Users { properties.load(new FileInputStream(location)); } //To save - public void save() { - try { - properties.store(new FileOutputStream(location), null); - }catch(IOException ex) { - } + public void save() + { + try + { + properties.store(new FileOutputStream(location), null); + }catch(IOException ex) { + } } - public void loadUsers(){ + public void loadUsers() + { File theDir = new File(location); if(!theDir.exists()){ //properties = new PropertiesFile(location); @@ -77,9 +76,12 @@ public class Users { return players; } - public static void removeUser(Player player){ + public static void removeUser(Player player) + { PlayerProfile PP = Users.getProfile(player); - if(PP != null){ + + if(PP != null) + { PP.save(); if(players.containsKey(player)) players.remove(player); @@ -87,7 +89,13 @@ public class Users { } public static PlayerProfile getProfile(Player player){ - return players.get(player); + if(players.get(player) != null) + return players.get(player); + else + { + players.put(player, new PlayerProfile(player)); + return players.get(player); + } } public static Users getInstance() { @@ -96,8 +104,5 @@ public class Users { } return instance; } - public static void getRow(){ - - } } \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/config/Config.java b/mcMMO/com/gmail/nossr50/config/Config.java deleted file mode 100644 index 86d375399..000000000 --- a/mcMMO/com/gmail/nossr50/config/Config.java +++ /dev/null @@ -1,176 +0,0 @@ -package com.gmail.nossr50.config; - -import java.util.*; -import java.util.logging.Logger; -import org.bukkit.block.Block; -import org.bukkit.entity.Entity; -import org.bukkit.entity.Player; - -public class Config { - private static volatile Config instance; - String location = "mcmmo.properties"; - protected static final Logger log = Logger.getLogger("Minecraft"); - public static ArrayList removalQue = new ArrayList(); - static ArrayList adminChatList = new ArrayList(); - static ArrayList blockWatchList = new ArrayList(); - static ArrayList treeFeller = new ArrayList(); - static ArrayList partyChatList = new ArrayList(); - static ArrayList godModeList = new ArrayList(); - HashMap arrowTracker = new HashMap(); - static ArrayList bleedTracker = new ArrayList(); - static ArrayList mobSpawnTracker = new ArrayList(); - - /* - * The Bleed Que Stuff - */ - public Entity[] bleedQue = new Entity[20]; - public int bleedQuePos = 0; - - public void addToBleedQue(Entity entity){ - //Assign entity to empty position - bleedQue[bleedQuePos] = entity; - //Move position up by 1 increment - bleedQuePos++; - - //Check if array is full - if(bleedQuePos >= bleedQue.length){ - //Create new temporary array - Entity[] temp = new Entity[bleedQue.length*2]; - //Copy data from bleedQue to temporary array - System.arraycopy(bleedQue, 0, temp, 0, bleedQue.length); - //Point bleedQue to new array - bleedQue = temp; - } - } - - public Entity[] getBleedQue(){return bleedQue;} - - public void clearBleedQue(){ - bleedQue = new Entity[bleedQue.length]; - setBleedQuePos(0); - } - public void setBleedQuePos(int x){bleedQuePos = x;} - - /* - * The Bleed Removal Que Stuff - */ - - public Entity[] bleedRemovalQue = new Entity[20]; - public int bleedRemovalQuePos = 0; - - public void addToBleedRemovalQue(Entity entity){ - //Assign entity to empty position - bleedRemovalQue[bleedRemovalQuePos] = entity; - //Move position up by 1 increment - bleedRemovalQuePos++; - - //Check if array is full - if(bleedRemovalQuePos >= bleedRemovalQue.length){ - //Create new temporary array - Entity[] temp = new Entity[bleedRemovalQue.length*2]; - //Copy data from bleedRemovalQue to temporary array - System.arraycopy(bleedRemovalQue, 0, temp, 0, bleedRemovalQue.length); - //Point bleedRemovalQue to new array - bleedRemovalQue = temp; - } - } - - public Entity[] getBleedRemovalQue(){return bleedRemovalQue;} - - public void clearBleedRemovalQue(){ - bleedQue = new Entity[bleedRemovalQue.length]; - setBleedQuePos(0); - } - public void setBleedRemovalQuePos(int x){bleedRemovalQuePos = x;} - - - public boolean isBlockWatched(Block block) {return blockWatchList.contains(block);} - public boolean isTreeFellerWatched(Block block) {return treeFeller.contains(block);} - public ArrayList getTreeFeller() {return treeFeller;} - public void removeBlockWatch(Block block) {blockWatchList.remove(blockWatchList.indexOf(block));} - public void addBlockWatch(Block block) {blockWatchList.add(block);} - public void removeTreeFeller(Block block) {treeFeller.remove(treeFeller.indexOf(block));} - public void addTreeFeller(Block block) {treeFeller.add(block);} - public void addBleedTrack(Entity entity) {bleedTracker.add(entity);} - public void addMobSpawnTrack(Entity entity) {mobSpawnTracker.add(entity);} - public void removeMobSpawnTrack(Entity entity) {mobSpawnTracker.remove(entity);} - public ArrayList getBleedTracked() {return bleedTracker;} - public void addArrowTrack(Entity entity, Integer arrowcount) {arrowTracker.put(entity, arrowcount);} - public Integer getArrowCount(Entity entity) {return arrowTracker.get(entity);} - public void removeArrowTracked(Entity entity){ - if(arrowTracker.containsKey(entity)){ - arrowTracker.remove(entity); - } - } - public void removeBleedTrack(Entity entity){ - bleedTracker.remove(entity); - } - public void clearTreeFeller(){ - treeFeller.clear(); - } - public void setBleedCount(Entity entity, Integer newvalue){ - bleedTracker.add(entity); - } - public void addArrowCount(Entity entity, Integer newvalue) { - arrowTracker.put(entity, arrowTracker.get(entity) + newvalue); - } - public boolean isTracked(Entity entity) { - if(arrowTracker.containsKey(entity)){ - return true; - } else { - return false; - } - } - public boolean isMobSpawnTracked(Entity entity) { - if(mobSpawnTracker.contains(entity)){ - return true; - } else { - return false; - } - } - public boolean isBleedTracked(Entity entity) { - if(bleedTracker.contains(entity)){ - return true; - } else { - return false; - } - } - public boolean isAdminToggled(String playerName) {return adminChatList.contains(playerName);} - public boolean isPartyToggled(String playerName) {return partyChatList.contains(playerName);} - public boolean isGodModeToggled(String playerName) {return godModeList.contains(playerName);} - public void removeGodModeToggled(String playerName) {godModeList.remove(godModeList.indexOf(playerName));} - public void removePartyToggled(String playerName) {partyChatList.remove(partyChatList.indexOf(playerName));} - public void removeAdminToggled(String playerName) {adminChatList.remove(adminChatList.indexOf(playerName));} - public void addGodModeToggled(String playerName) {godModeList.add(playerName);} - public void addPartyToggled(String playerName) {partyChatList.add(playerName);} - public void addAdminToggled(String playerName) {adminChatList.add(playerName);} - - public static Config getInstance() { - if (instance == null) { - instance = new Config(); - } - return instance; - } - public void toggleAdminChat(String playerName){ - if(isAdminToggled(playerName)){ - removeAdminToggled(playerName); - } else { - addAdminToggled(playerName); - } - } - public void toggleGodMode(String playerName){ - if(isGodModeToggled(playerName)){ - removeGodModeToggled(playerName); - } else { - addGodModeToggled(playerName); - } - } - public void togglePartyChat(String playerName){ - if(isPartyToggled(playerName)){ - removePartyToggled(playerName); - } else { - addPartyToggled(playerName); - } - } - -} \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/config/LoadProperties.java b/mcMMO/com/gmail/nossr50/config/LoadProperties.java index f9d05def4..ad5d28a42 100644 --- a/mcMMO/com/gmail/nossr50/config/LoadProperties.java +++ b/mcMMO/com/gmail/nossr50/config/LoadProperties.java @@ -1,131 +1,415 @@ package com.gmail.nossr50.config; +import java.io.File; +import java.util.List; +import org.bukkit.util.config.Configuration; + import com.gmail.nossr50.mcMMO; public class LoadProperties { - public static Boolean enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, pvp, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; - public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, mcability, mcmmo, mcc, mcrefresh, mcitem, mcgod, stats, mmoedit, ptp, party, myspawn, setmyspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond;; - public static int MySQLport, xpGainMultiplier, superBreakerCooldown, greenTerraCooldown, gigaDrillBreakerCooldown, treeFellerCooldown, berserkCooldown, serratedStrikeCooldown, skullSplitterCooldown, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier, rWood, rStone, rIron, rGold, rDiamond;; + public static Boolean xpGainsMobSpawners=false, print_reports = false, myspawnEnable = true, mccEnable = true, mcmmoEnable = true, partyEnable = true, inviteEnable = true, acceptEnable = true, whoisEnable = true, statsEnable = true, addxpEnable = true, ptpEnable = true, mmoeditEnable = true, clearmyspawnEnable = true, mcgodEnable = true, mcabilityEnable = true, mctopEnable = true, mcrefreshEnable = true, enableMotd, enableMySpawn, enableRegen, enableCobbleToMossy, useMySQL, cocoabeans, archeryFireRateLimit, mushrooms, toolsLoseDurabilityFromAbilities, pvpxp, miningrequirespickaxe, woodcuttingrequiresaxe, eggs, apples, cake, music, diamond, glowstone, slowsand, sulphur, netherrack, bones, coal, clay, anvilmessages; + public static String MySQLtablePrefix, MySQLuserName, MySQLserverName, MySQLdbName, MySQLdbPass, mctop, addxp, mcability, mcmmo, mcc, mcrefresh, mcgod, stats, mmoedit, ptp, party, myspawn, whois, invite, accept, clearmyspawn, nWood, nStone, nIron, nGold, nDiamond, locale; + public static int mcocoa = 10, water_thunder = 75, cure_self = 5, cure_other = 5, mbones, msulphur, mslowsand, mmushroom2, mglowstone2, mmusic, mdiamond2, mbase, mapple, meggs, mcake, mpine, mbirch, mspruce, mcactus, mmushroom, mflower, msugar, mpumpkin, mwheat, mgold, mdiamond, miron, mredstone, mlapus, mobsidian, mnetherrack, mglowstone, mcoal, mstone, MySQLport, xpGainMultiplier, superBreakerCooldown = 240, greenTerraCooldown = 240, gigaDrillBreakerCooldown = 240, treeFellerCooldown = 240, berserkCooldown = 240, serratedStrikeCooldown = 240, skullSplitterCooldown = 240, abilityDurabilityLoss, feathersConsumedByChimaeraWing, pvpxprewardmodifier, repairdiamondlevel, globalxpmodifier, tamingxpmodifier, miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier, sorceryxpmodifier = 2, unarmedxpmodifier, herbalismxpmodifier, excavationxpmodifier, archeryxpmodifier, swordsxpmodifier, axesxpmodifier, acrobaticsxpmodifier, rWood, rStone, rIron, rGold, rDiamond; + private static mcMMO plugin; - public static void loadMain(){ - String propertiesFile = mcMMO.maindirectory + "mcmmo.properties"; - mcProperties properties = new mcProperties(propertiesFile); - properties.load(); - - /* - * COOLDOWN CONTROL - */ - greenTerraCooldown = properties.getInteger("greenTerraCooldown", 240); - superBreakerCooldown = properties.getInteger("superBreakerCooldown", 240); - gigaDrillBreakerCooldown = properties.getInteger("gigaDrillBreakerCooldown", 240); - treeFellerCooldown = properties.getInteger("treeFellerCooldown", 240); - berserkCooldown = properties.getInteger("berserkCooldown", 240); - serratedStrikeCooldown = properties.getInteger("serratedStrikeCooldown", 240); - skullSplitterCooldown = properties.getInteger("skullSplitterCooldown", 240); - - /* - * MySQL Stuff - */ - - MySQLserverName = properties.getString("MySQLServer", "ipofserver"); - MySQLdbPass = properties.getString("MySQLdbPass", "defaultdbpass"); - MySQLdbName = properties.getString("MySQLdbName", "defaultdbname"); - MySQLuserName = properties.getString("MySQLuserName", "defaultusername"); - MySQLtablePrefix = properties.getString("MySQLTablePrefix", "mcmmo_"); - MySQLport = properties.getInteger("MySQLport", 3306); - useMySQL = properties.getBoolean("UseMySQL", false); - - /* - * OTHER - */ - - enableCobbleToMossy = properties.getBoolean("enableGreenThumbCobbleToMossy", true); - archeryFireRateLimit = properties.getBoolean("archeryFireRateLimit", true); - xpGainMultiplier = properties.getInteger("xpGainMultiplier", 1); - toolsLoseDurabilityFromAbilities = properties.getBoolean("toolsLoseDurabilityFromAbilities", true); - abilityDurabilityLoss = properties.getInteger("abilityDurabilityLoss", 2); - feathersConsumedByChimaeraWing = properties.getInteger("feathersConsumedByChimaeraWing", 10); - pvpxp = properties.getBoolean("pvpGivesXP", true); - pvpxprewardmodifier = properties.getInteger("pvpXpRewardModifier", 1); - miningrequirespickaxe = properties.getBoolean("miningRequiresPickaxe", true); - woodcuttingrequiresaxe = properties.getBoolean("woodcuttingRequiresAxe", true); - repairdiamondlevel = properties.getInteger("repairDiamondLevel", 50); - /* - * EXPERIENCE RATE MODIFIER - */ - globalxpmodifier = properties.getInteger("globalXpModifier", 1); - tamingxpmodifier = properties.getInteger("tamingXpModifier", 2); - miningxpmodifier = properties.getInteger("miningXpModifier", 2); - repairxpmodifier = properties.getInteger("repairXpModifier", 2); - woodcuttingxpmodifier = properties.getInteger("woodcuttingXpModifier", 2); - unarmedxpmodifier = properties.getInteger("unarmedXpModifier", 2); - herbalismxpmodifier = properties.getInteger("herbalismXpModifier", 2); - excavationxpmodifier = properties.getInteger("excavationXpModifier", 2); - archeryxpmodifier = properties.getInteger("archeryXpModifier", 2); - swordsxpmodifier = properties.getInteger("swordsXpModifier", 2); - axesxpmodifier = properties.getInteger("axesXpModifier", 2); - acrobaticsxpmodifier = properties.getInteger("acrobaticsXpModifier", 2); - /* - * TOGGLE CLAY - */ - clay = properties.getBoolean("gravelToClay", true); - /* - * ANVIL MESSAGES - */ - anvilmessages = properties.getBoolean("anvilMessages", true); - - /* - * ANVIL REPAIR (REQUIRED ITEM) AND (NAME OF ITEM) - */ - rGold = properties.getInteger("GoldRepairItemNumber", 266); - nGold = properties.getString("GoldItemRepairName", "Gold Bars"); - rStone = properties.getInteger("CobblestoneRepairItemNumber", 4); - nStone = properties.getString("CobblestoneItemRepairName", "Cobblestone"); - rWood = properties.getInteger("WoodRepairItemNumber", 5); - nWood = properties.getString("WoodItemRepairName", "Wood Planks"); - rDiamond = properties.getInteger("DiamondRepairItemNumber", 264); - nDiamond = properties.getString("DiamondItemRepairName", "Diamond Ore"); - rIron = properties.getInteger("IronRepairItemNumber", 265); - nIron = properties.getString("IronItemRepairName", "Iron Bars"); - /* - * EXCAVATION LOOT TOGGLES - */ - cocoabeans = properties.getBoolean("canExcavateCocoaBeans", true); - mushrooms = properties.getBoolean("canExcavateMushrooms", true); - glowstone = properties.getBoolean("canExcavateGlowstone", true); - pvp = properties.getBoolean("pvp", true); - eggs = properties.getBoolean("canExcavateEggs", true); - apples = properties.getBoolean("canExcavateApples", true); - cake = properties.getBoolean("canExcavateCake", true); - music = properties.getBoolean("canExcavateMusic", true); - diamond = properties.getBoolean("canExcavateDiamond", true); - slowsand = properties.getBoolean("canExcavateSlowSand", true); - sulphur = properties.getBoolean("canExcavateSulphur", true); - netherrack = properties.getBoolean("canExcavateNetherrack", true); - bones = properties.getBoolean("canExcavateBones", true); - - /* - * CUSTOM COMMANDS - */ - mctop = properties.getString("/mctop", "mctop"); - addxp = properties.getString("/addxp", "addxp"); - mcability = properties.getString("/mcability", "mcability"); - mcrefresh = properties.getString("/mcrefresh", "mcrefresh"); - mcitem = properties.getString("/mcitem", "mcitem"); - mcmmo = properties.getString("/mcmmo", "mcmmo"); - mcc = properties.getString("/mcc", "mcc"); - mcgod = properties.getString("/mcgod", "mcgod"); - stats = properties.getString("/stats", "stats"); - mmoedit = properties.getString("/mmoedit", "mmoedit"); - ptp = properties.getString("/ptp", "ptp"); - party = properties.getString("/party", "party"); - myspawn = properties.getString("/myspawn", "myspawn"); - setmyspawn = properties.getString("/setmyspawn", "setmyspawn"); - whois = properties.getString("/whois", "whois"); - invite = properties.getString("/invite", "invite"); - accept = properties.getString("/accept", "accept"); - clearmyspawn = properties.getString("/clearmyspawn", "clearmyspawn"); - properties.save("==McMMO Configuration==\r\nYou can turn off excavation loot tables by turning the option to false\r\nYou can customize mcMMOs command names by modifying them here as well\r\nThis is an early version of the configuration file, eventually you'll be able to customize messages from mcMMO and XP gains"); - //herp derp - } -} \ No newline at end of file + public String directory = "plugins/mcMMO/"; + File file = new File(directory + File.separator + "config.yml"); + + public void configCheck() + { + new File(directory).mkdir(); + if(!file.exists()) + { + try + { + file.createNewFile(); + addDefaults(); + } + catch (Exception ex) + { + ex.printStackTrace(); + } + } + else + { + loadkeys(); + } + } + private void write(String root, Object x) + { + Configuration config = load(); + config.setProperty(root, x); + config.save(); + } + private Boolean readBoolean(String root) + { + Configuration config = load(); + return config.getBoolean(root, false); + } + private Integer readInteger(String root) + { + Configuration config = load(); + return config.getInt(root, 0); + } + + private Double readDouble(String root) + { + Configuration config = load(); + return config.getDouble(root, 0); + } + private List readStringList(String root) + { + Configuration config = load(); + return config.getKeys(root); + } + private String readString(String root) + { + Configuration config = load(); + return config.getString(root); + } + private Configuration load() + { + + try { + Configuration config = new Configuration(file); + config.load(); + return config; + + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + private void addDefaults(){ + plugin.log.info("Generating Config File..."); + + //Put in defaults + write("MySQL.Enabled", false); + write("MySQL.Server.Address", "localhost"); + write("MySQL.Server.Port", 3306); + write("MySQL.Database.Name", "DataBaseName"); + write("MySQL.Database.User.Name", "UserName"); + write("MySQL.Database.TablePrefix", "mcmmo_"); + write("MySQL.Database.User.Password", "UserPassword"); + + write("General.Locale", "en_us"); + write("General.MOTD.Enabled", true); + write("General.MySpawn.Enabled", true); + write("General.HP_Regeneration.Enabled", true); + write("General.Performance.Print_Reports", false); + + write("Items.Chimaera_Wing.Feather_Cost", 10); + + write("XP.PVP.Rewards", true); + write("XP.Gains.Multiplier.PVP", 1); + write("XP.Gains.Mobspawners.Enabled", false); + write("XP.Gains.Multiplier.Global", 1); + write("XP.Formula.Multiplier.Global", 1); + write("XP.Formula.Multiplier.Taming", 2); + write("XP.Formula.Multiplier.Mining", 2); + write("XP.Formula.Multiplier.Repair", 2); + write("XP.Formula.Multiplier.Woodcutting", 2); + write("XP.Formula.Multiplier.Unarmed", 2); + write("XP.Formula.Multiplier.Herbalism", 2); + write("XP.Formula.Multiplier.Excavation", 2); + write("XP.Formula.Multiplier.Swords", 2); + write("XP.Formula.Multiplier.Archery", 2); + write("XP.Formula.Multiplier.Axes", 2); + write("XP.Formula.Multiplier.Sorcery", 2); + write("XP.Formula.Multiplier.Acrobatics", 2); + write("XP.Mining.Gold", 35); + write("XP.Mining.Diamond", 75); + write("XP.Mining.Iron", 25); + write("XP.Mining.Redstone", 15); + write("XP.Mining.Lapus", 40); + write("XP.Mining.Obsidian", 15); + write("XP.Mining.Netherrack", 3); + write("XP.Mining.Glowstone", 3); + write("XP.Mining.Coal", 10); + write("XP.Mining.Stone", 3); + write("XP.Herbalism.Sugar_Cane", 3); + write("XP.Herbalism.Cactus", 3); + write("XP.Herbalism.Pumpkin", 55); + write("XP.Herbalism.Flowers", 10); + write("XP.Herbalism.Wheat", 5); + write("XP.Herbalism.Mushrooms", 15); + write("XP.Woodcutting.Pine", 9); + write("XP.Woodcutting.Birch", 7); + write("XP.Woodcutting.Spruce", 8); + write("XP.Excavation.Base", 4); + write("XP.Excavation.Mushroom", 8); + write("XP.Excavation.Sulphur", 3); + write("XP.Excavation.Slowsand", 8); + write("XP.Excavation.Glowstone", 8); + write("XP.Excavation.Music", 300); + write("XP.Excavation.Bones", 3); + write("XP.Excavation.Diamond", 100); + write("XP.Excavation.Apple", 10); + write("XP.Excavation.Eggs", 10); + write("XP.Excavation.Cake", 300); + write("XP.Excavation.Cocoa_Beans", 10); + + write("Sorcery.Spells.Water.Thunder", 75); + write("Sorcery.Spells.Curative.Cure_Self.Mana_Cost", 5); + write("Sorcery.Spells.Curative.Cure_Other.Mana_Cost", 5); + + write("Excavation.Drops.Cocoa_Beans", true); + write("Excavation.Drops.Mushrooms", true); + write("Excavation.Drops.Glowstone", true); + write("Excavation.Drops.Eggs", true); + write("Excavation.Drops.Apples", true); + write("Excavation.Drops.Cake", true); + write("Excavation.Drops.Music", true); + write("Excavation.Drops.Diamond", true); + write("Excavation.Drops.Slowsand", true); + write("Excavation.Drops.Sulphur", true); + write("Excavation.Drops.Netherrack", true); + write("Excavation.Drops.Bones", true); + + write("Commands.mctop.Name", "mctop"); + write("Commands.mctop.Enabled", true); + write("Commands.addxp.Name", "addxp"); + write("Commands.addxp.Enabled", true); + write("Commands.mcability.Name", "mcability"); + write("Commands.mcability.Enabled", true); + write("Commands.mcrefresh.Name", "mcrefresh"); + write("Commands.mcrefresh.Enabled", true); + write("Commands.mcmmo.Name", "mcmmo"); + write("Commands.mcmmo.Enabled", true); + write("Commands.mcc.Name", "mcc"); + write("Commands.mcc.Enabled", true); + write("Commands.mcgod.Name", "mcgod"); + write("Commands.mcgod.Enabled", true); + write("Commands.stats.Name", "stats"); + write("Commands.stats.Enabled", true); + write("Commands.mmoedit.Name", "mmoedit"); + write("Commands.mmoedit.Enabled", true); + write("Commands.ptp.Name", "ptp"); + write("Commands.ptp.Enabled", true); + write("Commands.party.Name", "party"); + write("Commands.party.Enabled", true); + write("Commands.myspawn.Name", "myspawn"); + write("Commands.myspawn.Enabled", true); + write("Commands.whois.Name", "whois"); + write("Commands.whois.Enabled", true); + write("Commands.invite.Name", "invite"); + write("Commands.invite.Enabled", true); + write("Commands.accept.Name", "accept"); + write("Commands.accept.Enabled", true); + write("Commands.clearmyspawn.Name", "clearmyspawn"); + write("Commands.clearmyspawn.Enabled", true); + + write("Abilities.Tools.Durability_Loss_Enabled", true); + write("Abilities.Tools.Durability_Loss", 2); + write("Abilities.Cooldowns.Green_Terra", 240); + write("Abilities.Cooldowns.Super_Breaker", 240); + write("Abilities.Cooldowns.Giga_Drill_Breaker", 240); + write("Abilities.Cooldowns.Tree_Feller", 240); + write("Abilities.Cooldowns.Berserk", 240); + write("Abilities.Cooldowns.Serrated_Strikes", 240); + write("Abilities.Cooldowns.Skull_Splitter", 240); + + write("Skills.Repair.Anvil_Messages", true); + write("Skills.Repair.Gold.ID", 266); + write("Skills.Repair.Gold.Name", "Gold Bars"); + write("Skills.Repair.Stone.ID", 4); + write("Skills.Repair.Stone.Name", "Cobblestone"); + write("Skills.Repair.Wood.ID", 5); + write("Skills.Repair.Wood.Name", "Wood Planks"); + write("Skills.Repair.Diamond.ID", 264); + write("Skills.Repair.Diamond.Name", "Diamond Ore"); + write("Skills.Repair.Diamond.Level_Required", 50); + write("Skills.Repair.Iron.ID", 265); + write("Skills.Repair.Iron.Name", "Iron Bars"); + write("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy", true); + write("Skills.Archery.Fire_Rate_Limiter", true); + write("Skills.Mining.Requires_Pickaxe", true); + write("Skills.Woodcutting.Requires_Axe", true); + + loadkeys(); + } + private void loadkeys(){ + plugin.log.info("Loading Config File..."); + + System.out.println("print_reports = "+readBoolean("General.Performance.Print_Reports")); + + xpGainsMobSpawners = readBoolean("XP.Gains.Mobspawners.Enabled"); + + if(readBoolean("General.Performance.Print_Reports") != null) + print_reports = readBoolean("General.Performance.Print_Reports"); + else + print_reports = false; + + cure_self = readInteger("Sorcery.Spells.Curative.Cure_Self.Mana_Cost"); + cure_other = readInteger("Sorcery.Spells.Curative.Cure_Other.Mana_Cost"); + water_thunder = readInteger("Sorcery.Spells.Water.Thunder"); + + msulphur = readInteger("XP.Excavation.Sulphur"); + mbones = readInteger("XP.Excavation.Bones"); + mbase = readInteger("XP.Excavation.Base"); + mmushroom2 = readInteger("XP.Excavation.Mushroom"); + mslowsand = readInteger("XP.Excavation.Slowsand"); + mglowstone2 = readInteger("XP.Excavation.Glowstone"); + mmusic = readInteger("XP.Excavation.Music"); + mdiamond2 = readInteger("XP.Excavation.Diamond"); + mapple = readInteger("XP.Excavation.Apple"); + meggs = readInteger("XP.Excavation.Eggs"); + mcake = readInteger("XP.Excavation.Cake"); + mcocoa = readInteger("XP.Excavation.Cocoa_Beans"); + + msugar = readInteger("XP.Herbalism.Sugar_Cane"); + mwheat = readInteger("XP.Herbalism.Wheat"); + mcactus = readInteger("XP.Herbalism.Cactus"); + mpumpkin = readInteger("XP.Herbalism.Pumpkin"); + mflower = readInteger("XP.Herbalism.Flowers"); + mmushroom = readInteger("XP.Herbalism.Mushrooms"); + + mpine = readInteger("XP.Woodcutting.Pine"); + mbirch = readInteger("XP.Woodcutting.Birch"); + mspruce = readInteger("XP.Woodcutting.Spruce"); + + mgold = readInteger("XP.Mining.Gold"); + mdiamond = readInteger("XP.Mining.Diamond"); + miron = readInteger("XP.Mining.Iron"); + mredstone = readInteger("XP.Mining.Redstone"); + mlapus = readInteger("XP.Mining.Lapus"); + mobsidian = readInteger("XP.Mining.Obsidian"); + mnetherrack = readInteger("XP.Mining.Netherrack"); + mglowstone = readInteger("XP.Mining.Glowstone"); + mcoal = readInteger("XP.Mining.Coal"); + mstone = readInteger("XP.Mining.Stone"); + + enableMotd = readBoolean("enableMOTD"); + + greenTerraCooldown = readInteger("Abilities.Cooldowns.Green_Terra"); + superBreakerCooldown = readInteger("Abilities.Cooldowns.Super_Breaker"); + gigaDrillBreakerCooldown = readInteger("Abilities.Cooldowns.Giga_Drill_Breaker"); + treeFellerCooldown = readInteger("Abilities.Cooldowns.Tree_Feller"); + berserkCooldown = readInteger("Abilities.Cooldowns.Berserk"); + serratedStrikeCooldown = readInteger("Abilities.Cooldowns.Serrated_Strikes"); + skullSplitterCooldown = readInteger("Abilities.Cooldowns.Skull_Splitter"); + + MySQLserverName = readString("MySQL.Server.Address"); + + if(readString("MySQL.Database.User.Password") != null) + MySQLdbPass = readString("MySQL.Database.User.Password"); + else + MySQLdbPass = ""; + + MySQLdbName = readString("MySQL.Database.Name"); + MySQLuserName = readString("MySQL.Database.User.Name"); + MySQLtablePrefix = readString("MySQL.Database.TablePrefix"); + MySQLport = readInteger("MySQL.Server.Port"); + useMySQL = readBoolean("MySQL.Enabled"); + + locale = readString("General.Locale"); + enableMotd = readBoolean("General.MOTD.Enabled"); + enableMySpawn = readBoolean("General.MySpawn.Enabled"); + enableRegen = readBoolean("General.HP_Regeneration.Enabled"); + + enableCobbleToMossy = readBoolean("Skills.Herbalism.Green_Thumb.Cobble_To_Mossy"); + archeryFireRateLimit = readBoolean("Skills.Archery.Fire_Rate_Limiter"); + + xpGainMultiplier = readInteger("XP.Gains.Multiplier.Global"); + toolsLoseDurabilityFromAbilities = readBoolean("Abilities.Tools.Durability_Loss_Enabled"); + abilityDurabilityLoss = readInteger("Abilities.Tools.Durability_Loss"); + + feathersConsumedByChimaeraWing = readInteger("Items.Chimaera_Wing.Feather_Cost"); + pvpxp = readBoolean("XP.PVP.Rewards"); + pvpxprewardmodifier = readInteger("XP.Gains.Multiplier.PVP"); + miningrequirespickaxe = readBoolean("Skills.Mining.Requires_Pickaxe"); + woodcuttingrequiresaxe = readBoolean("Skills.Woodcutting.Requires_Axe"); + repairdiamondlevel = readInteger("Skills.Repair.Diamond.Level_Required"); + + globalxpmodifier = readInteger("XP.Formula.Multiplier.Global"); + if(readInteger("XP.Formula.Multiplier.Sorcery") != null) + sorceryxpmodifier = readInteger("XP.Formula.Multiplier.Sorcery"); + else + sorceryxpmodifier = 2; + tamingxpmodifier = readInteger("XP.Formula.Multiplier.Taming"); + miningxpmodifier = readInteger("XP.Formula.Multiplier.Mining"); + repairxpmodifier = readInteger("XP.Formula.Multiplier.Repair"); + woodcuttingxpmodifier = readInteger("XP.Formula.Multiplier.Woodcutting"); + unarmedxpmodifier = readInteger("XP.Formula.Multiplier.Unarmed"); + herbalismxpmodifier = readInteger("XP.Formula.Multiplier.Herbalism"); + excavationxpmodifier = readInteger("XP.Formula.Multiplier.Excavation"); + archeryxpmodifier = readInteger("XP.Formula.Multiplier.Archery"); + swordsxpmodifier = readInteger("XP.Formula.Multiplier.Swords"); + axesxpmodifier = readInteger("XP.Formula.Multiplier.Axes"); + acrobaticsxpmodifier = readInteger("XP.Formula.Multiplier.Acrobatics"); + + anvilmessages = readBoolean("Skills.Repair.Anvil_Messages"); + + rGold = readInteger("Skills.Repair.Gold.ID"); + nGold = readString("Skills.Repair.Gold.Name"); + rStone = readInteger("Skills.Repair.Stone.ID"); + nStone = readString("Skills.Repair.Stone.Name"); + rWood = readInteger("Skills.Repair.Wood.ID"); + nWood = readString("Skills.Repair.Wood.Name"); + rDiamond = readInteger("Skills.Repair.Diamond.ID"); + nDiamond = readString("Skills.Repair.Diamond.Name"); + rIron = readInteger("Skills.Repair.Iron.ID"); + nIron = readString("Skills.Repair.Iron.Name"); + + cocoabeans = readBoolean("Excavation.Drops.Cocoa_Beans"); + mushrooms = readBoolean("Excavation.Drops.Mushrooms"); + glowstone = readBoolean("Excavation.Drops.Glowstone"); + eggs = readBoolean("Excavation.Drops.Eggs"); + apples = readBoolean("Excavation.Drops.Apples"); + cake = readBoolean("Excavation.Drops.Cake"); + music = readBoolean("Excavation.Drops.Music"); + diamond = readBoolean("Excavation.Drops.Diamond"); + slowsand = readBoolean("Excavation.Drops.Slowsand"); + sulphur = readBoolean("Excavation.Drops.Sulphur"); + netherrack = readBoolean("Excavation.Drops.Netherrack"); + bones = readBoolean("Excavation.Drops.Bones"); + + mctop = readString("Commands.mctop.Name"); + mctopEnable = readBoolean("Commands.mctop.Enabled"); + + addxp = readString("Commands.addxp.Name"); + addxpEnable = readBoolean("Commands.addxp.Enabled"); + + mcability = readString("Commands.mcability.Name"); + mcabilityEnable = readBoolean("Commands.mcability.Enabled"); + + mcrefresh = readString("Commands.mcrefresh.Name"); + mcrefreshEnable = readBoolean("Commands.mcrefresh.Enabled"); + + mcmmo = readString("Commands.mcmmo.Name"); + mcmmoEnable = readBoolean("Commands.mcmmo.Enabled"); + + mcc = readString("Commands.mcc.Name"); + mccEnable = readBoolean("Commands.mcc.Enabled"); + + mcgod = readString("Commands.mcgod.Name"); + mcgodEnable = readBoolean("Commands.mcgodEnable.Enabled"); + + stats = readString("Commands.stats.Name"); + statsEnable = readBoolean("Commands.stats.Enabled"); + + mmoedit = readString("Commands.mmoedit.Name"); + mmoeditEnable = readBoolean("Commands.mmoedit.Enabled"); + + ptp = readString("Commands.ptp.Name"); + ptpEnable = readBoolean("Commands.ptp.Enabled"); + + party = readString("Commands.party.Name"); + partyEnable = readBoolean("Commands.party.Enabled"); + + myspawn = readString("Commands.myspawn.Name"); + myspawnEnable = readBoolean("Commands.myspawn.Enabled"); + + whois = readString("Commands.whois.Name"); + whoisEnable = readBoolean("Commands.whois.Enabled"); + + invite = readString("Commands.invite.Name"); + inviteEnable = readBoolean("Commands.invite.Enabled"); + + accept = readString("Commands.accept.Name"); + acceptEnable = readBoolean("Commands.accept.Enabled"); + + clearmyspawn = readString("Commands.clearmyspawn.Name"); + clearmyspawnEnable = readBoolean("Commands.clearmyspawn.Enabled"); + } + } \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/config/Misc.java b/mcMMO/com/gmail/nossr50/config/Misc.java new file mode 100644 index 000000000..cca2578cd --- /dev/null +++ b/mcMMO/com/gmail/nossr50/config/Misc.java @@ -0,0 +1,74 @@ +package com.gmail.nossr50.config; + +import java.util.*; +import java.util.logging.Logger; +import org.bukkit.block.Block; +import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; + +import com.gmail.nossr50.mcMMO; + +public class Misc +{ + String location = "mcmmo.properties"; + + protected static final Logger log = Logger.getLogger("Minecraft"); + + public ArrayList mobSpawnerList = new ArrayList(); + public ArrayList blockWatchList = new ArrayList(); + public ArrayList treeFeller = new ArrayList(); + public HashMap arrowTracker = new HashMap(); + public ArrayList bleedTracker = new ArrayList(); + mcMMO plugin = null; + + //BLEED QUE STUFF + public LivingEntity[] bleedQue = new LivingEntity[20]; + public int bleedQuePos = 0; + public LivingEntity[] bleedRemovalQue = new LivingEntity[20]; + public int bleedRemovalQuePos = 0; + + public Misc(mcMMO mcMMO) + { + plugin = mcMMO; + } + + public void addToBleedQue(LivingEntity entity) + { + //Assign entity to empty position + bleedQue[bleedQuePos] = entity; + + //Move position up by 1 increment + bleedQuePos++; + + //Check if array is full + if(bleedQuePos >= bleedQue.length) + { + //Create new temporary array + LivingEntity[] temp = new LivingEntity[bleedQue.length*2]; + //Copy data from bleedQue to temporary array + System.arraycopy(bleedQue, 0, temp, 0, bleedQue.length); + //Point bleedQue to new array + bleedQue = temp; + } + } + + public void addToBleedRemovalQue(LivingEntity entity) + { + //Assign entity to empty position + bleedRemovalQue[bleedRemovalQuePos] = entity; + + //Move position up by 1 increment + bleedRemovalQuePos++; + + //Check if array is full + if(bleedRemovalQuePos >= bleedRemovalQue.length) + { + //Create new temporary array + LivingEntity[] temp = new LivingEntity[bleedRemovalQue.length*2]; + //Copy data from bleedRemovalQue to temporary array + System.arraycopy(bleedRemovalQue, 0, temp, 0, bleedRemovalQue.length); + //Point bleedRemovalQue to new array + bleedRemovalQue = temp; + } + } +} \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/config/mcProperties.java b/mcMMO/com/gmail/nossr50/config/mcProperties.java deleted file mode 100644 index 4eae8e82d..000000000 --- a/mcMMO/com/gmail/nossr50/config/mcProperties.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.gmail.nossr50.config; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Properties; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class mcProperties extends Properties{ - //private static volatile mcProperties instance; - private String fileName; - public mcProperties(String file) { - this.fileName = file; - } - public void load() { - File file = new File(this.fileName); - if(file.exists()) { - try { - load(new FileInputStream(this.fileName)); - } catch (IOException ex) { - - } - } - } - public static void makeProperties(File Properties, Logger log){ - if(!Properties.exists()){ - try { - Properties.createNewFile(); - FileWriter writer = null; - try { - writer = new FileWriter(Properties); - } catch (Exception e) { - log.log(Level.SEVERE, "Exception while creating " + Properties, e); - } finally { - try { - if (writer != null) { - writer.close(); - } - } catch (IOException e) { - log.log(Level.SEVERE, "Exception while closing writer for " + Properties, e); - } - } - - } catch (IOException e) { - e.printStackTrace(); - } - } - } - public void save(String start){ - try{ - store(new FileOutputStream(this.fileName), start); - } catch (IOException ex) { - - } - } - public int getInteger(String key, int value){ - if(containsKey(key)){ - return Integer.parseInt(getProperty(key)); - } - put(key, String.valueOf(value)); - return value; - } - public String getString(String key, String value){ - if(containsKey(key)){ - return getProperty(key); - } - put(key, value); - return value; - } - public Boolean getBoolean(String key, boolean value) { - if (containsKey(key)) { - String boolString = getProperty(key); - return (boolString.length() > 0) - && (boolString.toLowerCase().charAt(0) == 't'); - } - put(key, value ? "true" : "false"); - return value; - } - public double getDouble(String key, double value) { - if (containsKey(key)) { - return Double.parseDouble(getProperty(key)); - } - - put(key, String.valueOf(value)); - return value; - } - -} diff --git a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java index 3e2b73611..28bee3f03 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java +++ b/mcMMO/com/gmail/nossr50/datatypes/PlayerProfile.java @@ -6,7 +6,6 @@ import java.io.FileReader; import java.io.FileWriter; import java.util.HashMap; import java.util.ArrayList; -import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; @@ -15,38 +14,87 @@ import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; -import com.gmail.nossr50.Database; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.skills.*; public class PlayerProfile { protected final Logger log = Logger.getLogger("Minecraft"); - private String taming="0", tamingXP="0", miningXP="0", woodCuttingXP="0", woodcutting="0", repair="0", mining="0", party, myspawn, myspawnworld, unarmed="0", herbalism="0", excavation="0", - archery="0", swords="0", axes="0", invite, acrobatics="0", repairXP="0", unarmedXP="0", herbalismXP="0", excavationXP="0", archeryXP="0", swordsXP="0", axesXP="0", acrobaticsXP="0"; - private boolean online = true, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true, + + //MISC + private String party, myspawn, myspawnworld, invite; + + //TOGGLES + private boolean partyChatMode = false, adminChatMode = false, godMode = false, greenTerraMode, partyChatOnly = false, greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true, superBreakerInformed = true, serratedStrikesInformed = true, treeFellerInformed = true, dead, abilityuse = true, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, - serratedStrikesMode, hoePreparationMode, shovelPreparationMode, swordsPreparationMode, fistsPreparationMode, pickaxePreparationMode, axePreparationMode, skullSplitterMode, berserkMode; - private long gigaDrillBreakerCooldown = 0, berserkCooldown = 0, superBreakerCooldown = 0, skullSplitterCooldown = 0, serratedStrikesCooldown = 0, - greenTerraCooldown = 0, treeFellerCooldown = 0, recentlyHurt = 0, archeryShotATS = 0, berserkATS = 0, berserkDATS = 0, gigaDrillBreakerATS = 0, gigaDrillBreakerDATS = 0, - respawnATS = 0, mySpawnATS = 0, greenTerraATS = 0, greenTerraDATS = 0, superBreakerATS = 0, superBreakerDATS = 0, serratedStrikesATS = 0, serratedStrikesDATS = 0, treeFellerATS = 0, treeFellerDATS = 0, - skullSplitterATS = 0, skullSplitterDATS = 0, hoePreparationATS = 0, axePreparationATS = 0, pickaxePreparationATS = 0, fistsPreparationATS = 0, shovelPreparationATS = 0, swordsPreparationATS = 0; - private int lastlogin=0, userid = 0, berserkTicks = 0, bleedticks = 0, greenTerraTicks = 0, gigaDrillBreakerTicks = 0, superBreakerTicks = 0, serratedStrikesTicks = 0, skullSplitterTicks = 0, treeFellerTicks = 0; + serratedStrikesMode, hoePreparationMode = false, shovelPreparationMode = false, swordsPreparationMode = false, fistsPreparationMode = false, pickaxePreparationMode = false, axePreparationMode = false, skullSplitterMode, berserkMode; + + //TIMESTAMPS //ATS = (Time of) Activation Time Stamp //DATS = (Time of) Deactivation Time Stamp - Player thisplayer; - char defaultColor; + private long recentlyHurt = 0, archeryShotATS = 0, berserkATS = 0, berserkDATS = 0, gigaDrillBreakerATS = 0, gigaDrillBreakerDATS = 0, + respawnATS = 0, mySpawnATS = 0, greenTerraATS = 0, greenTerraDATS = 0, superBreakerATS = 0, superBreakerDATS = 0, serratedStrikesATS = 0, serratedStrikesDATS = 0, treeFellerATS = 0, treeFellerDATS = 0, + skullSplitterATS = 0, skullSplitterDATS = 0, hoePreparationATS = 0, axePreparationATS = 0, pickaxePreparationATS = 0, fistsPreparationATS = 0, shovelPreparationATS = 0, swordsPreparationATS = 0; - + //MySQL STUFF + private int lastlogin=0, userid = 0, bleedticks = 0; + + //MAGIC STUFF + private int mana = 0; + private int greenDyeCycleSel = 0, greenDyeCycle = 0, blueDyeCycle = 0, blueDyeCycleSel = 0; + public boolean dyeChanged = false; + + private String playername; + + //Time to HashMap this shiz + HashMap stats = new HashMap(); //Skills and XP String location = "plugins/mcMMO/mcmmo.users"; - public PlayerProfile(Player player) { - thisplayer = player; + + //Setup the HashMap for the skills + stats.put("sorcery", 0); + stats.put("sorceryXP", 0); + + stats.put("unarmed", 0); + stats.put("unarmedXP", 0); + + stats.put("taming", 0); + stats.put("tamingXP", 0); + + stats.put("mining", 0); + stats.put("miningXP", 0); + + stats.put("woodcutting", 0); + stats.put("woodcuttingXP", 0); + + stats.put("repair", 0); + stats.put("repairXP", 0); + + stats.put("herbalism", 0); + stats.put("herbalismXP", 0); + + stats.put("excavation", 0); + stats.put("excavationXP", 0); + + stats.put("archery", 0); + stats.put("archeryXP", 0); + + stats.put("swords", 0); + stats.put("swordsXP", 0); + + stats.put("axes", 0); + stats.put("axesXP", 0); + + stats.put("acrobatics", 0); + stats.put("acrobaticsXP", 0); + + mana = getMaxMana(); + + playername = player.getName(); if (LoadProperties.useMySQL) { if(!loadMySQL(player)) { @@ -56,20 +104,19 @@ public class PlayerProfile } else { if(!load()) { addPlayer(); } } + lastlogin = ((Long) (System.currentTimeMillis()/1000)).intValue(); } - - public boolean getOnline(){ - return online; + public int getLastLogin() + { + return lastlogin; } - public void setOnline(Boolean bool){ - online = bool; - } - public int getMySQLuserId(){ + public int getMySQLuserId() + { return userid; } - - public boolean loadMySQL(Player p) { + public boolean loadMySQL(Player p) + { Integer id = 0; id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + p.getName() + "'"); if(id == 0) @@ -77,13 +124,12 @@ public class PlayerProfile this.userid = id; if (id > 0) { HashMap> users = mcMMO.database.Read("SELECT lastlogin, party FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = " + id); - lastlogin = Integer.parseInt(users.get(1).get(0)); + //lastlogin = Integer.parseInt(users.get(1).get(0)); party = users.get(1).get(1); HashMap> spawn = mcMMO.database.Read("SELECT world, x, y, z FROM "+LoadProperties.MySQLtablePrefix+"spawn WHERE user_id = " + id); myspawnworld = spawn.get(1).get(0); myspawn = spawn.get(1).get(1) + "," + spawn.get(1).get(2) + "," + spawn.get(1).get(3); HashMap> cooldowns = mcMMO.database.Read("SELECT mining, woodcutting, unarmed, herbalism, excavation, swords, axes FROM "+LoadProperties.MySQLtablePrefix+"cooldowns WHERE user_id = " + id); - /* * I'm still learning MySQL, this is a fix for adding a new table * its not pretty but it works @@ -103,29 +149,29 @@ public class PlayerProfile skullSplitterDATS = Long.valueOf(cooldowns.get(1).get(6)) * 1000; } HashMap> skills = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics FROM "+LoadProperties.MySQLtablePrefix+"skills WHERE user_id = " + id); - taming = skills.get(1).get(0); - mining = skills.get(1).get(1); - repair = skills.get(1).get(2); - woodcutting = skills.get(1).get(3); - unarmed = skills.get(1).get(4); - herbalism = skills.get(1).get(5); - excavation = skills.get(1).get(6); - archery = skills.get(1).get(7); - swords = skills.get(1).get(8); - axes = skills.get(1).get(9); - acrobatics = skills.get(1).get(10); + stats.put("taming", Integer.valueOf(skills.get(1).get(0))); + stats.put("mining", Integer.valueOf(skills.get(1).get(1))); + stats.put("repair", Integer.valueOf(skills.get(1).get(2))); + stats.put("woodcutting", Integer.valueOf(skills.get(1).get(3))); + stats.put("unarmed", Integer.valueOf(skills.get(1).get(4))); + stats.put("herbalism", Integer.valueOf(skills.get(1).get(5))); + stats.put("excavation", Integer.valueOf(skills.get(1).get(6))); + stats.put("archery", Integer.valueOf(skills.get(1).get(7))); + stats.put("swords", Integer.valueOf(skills.get(1).get(8))); + stats.put("axes", Integer.valueOf(skills.get(1).get(9))); + stats.put("acrobatics", Integer.valueOf(skills.get(1).get(10))); HashMap> experience = mcMMO.database.Read("SELECT taming, mining, repair, woodcutting, unarmed, herbalism, excavation, archery, swords, axes, acrobatics FROM "+LoadProperties.MySQLtablePrefix+"experience WHERE user_id = " + id); - tamingXP = experience.get(1).get(0); - miningXP = experience.get(1).get(1); - repairXP = experience.get(1).get(2); - woodCuttingXP = experience.get(1).get(3); - unarmedXP = experience.get(1).get(4); - herbalismXP = experience.get(1).get(5); - excavationXP = experience.get(1).get(6); - archeryXP = experience.get(1).get(7); - swordsXP = experience.get(1).get(8); - axesXP = experience.get(1).get(9); - acrobaticsXP = experience.get(1).get(10); + stats.put("tamingXP", Integer.valueOf(experience.get(1).get(0))); + stats.put("miningXP", Integer.valueOf(experience.get(1).get(1))); + stats.put("repairXP", Integer.valueOf(experience.get(1).get(2))); + stats.put("woodcuttingXP", Integer.valueOf(experience.get(1).get(3))); + stats.put("unarmedXP", Integer.valueOf(experience.get(1).get(4))); + stats.put("herbalismXP", Integer.valueOf(experience.get(1).get(5))); + stats.put("excavationXP", Integer.valueOf(experience.get(1).get(6))); + stats.put("archeryXP", Integer.valueOf(experience.get(1).get(7))); + stats.put("swordsXP", Integer.valueOf(experience.get(1).get(8))); + stats.put("axesXP", Integer.valueOf(experience.get(1).get(9))); + stats.put("acrobaticsXP", Integer.valueOf(experience.get(1).get(10))); return true; } else { @@ -155,11 +201,11 @@ public class PlayerProfile //Find if the line contains the player we want. String[] character = line.split(":"); - if(!character[0].equals(thisplayer.getName())){continue;} + if(!character[0].equals(playername)){continue;} //Get Mining - if(character.length > 1) - mining = character[1]; + if(character.length > 1 && isInt(character[1])) + stats.put("mining", Integer.valueOf(character[1])); //Myspawn if(character.length > 2) myspawn = character[2]; @@ -167,52 +213,50 @@ public class PlayerProfile if(character.length > 3) party = character[3]; //Mining XP - if(character.length > 4) - miningXP = character[4]; - if(character.length > 5) - woodcutting = character[5]; - if(character.length > 6) - woodCuttingXP = character[6]; - if(character.length > 7) - repair = character[7]; - if(character.length > 8) - unarmed = character[8]; - if(character.length > 9) - herbalism = character[9]; - if(character.length > 10) - excavation = character[10]; - if(character.length > 11) - archery = character[11]; - if(character.length > 12) - swords = character[12]; - if(character.length > 13) - axes = character[13]; - if(character.length > 14) - acrobatics = character[14]; - if(character.length > 15) - repairXP = character[15]; - if(character.length > 16) - unarmedXP = character[16]; - if(character.length > 17) - herbalismXP = character[17]; - if(character.length > 18) - excavationXP = character[18]; - if(character.length > 19) - archeryXP = character[19]; - if(character.length > 20) - swordsXP = character[20]; - if(character.length > 21) - axesXP = character[21]; - if(character.length > 22) - acrobaticsXP = character[22]; - if(character.length > 23) + if(character.length > 4 && isInt(character[4])) + stats.put("miningXP", Integer.valueOf(character[4])); + if(character.length > 5 && isInt(character[5])) + stats.put("woodcutting", Integer.valueOf(character[5])); + if(character.length > 6 && isInt(character[6])) + stats.put("woodcuttingXP", Integer.valueOf(character[6])); + if(character.length > 7 && isInt(character[7])) + stats.put("repair", Integer.valueOf(character[7])); + if(character.length > 8 && isInt(character[8])) + stats.put("unarmed", Integer.valueOf(character[8])); + if(character.length > 9 && isInt(character[9])) + stats.put("herbalism", Integer.valueOf(character[9])); + if(character.length > 10 && isInt(character[10])) + stats.put("excavation", Integer.valueOf(character[10])); + if(character.length > 11 && isInt(character[11])) + stats.put("archery", Integer.valueOf(character[11])); + if(character.length > 12 && isInt(character[12])) + stats.put("swords", Integer.valueOf(character[12])); + if(character.length > 13 && isInt(character[13])) + stats.put("axes", Integer.valueOf(character[13])); + if(character.length > 14 && isInt(character[14])) + stats.put("acrobatics", Integer.valueOf(character[14])); + if(character.length > 15 && isInt(character[15])) + stats.put("repairXP", Integer.valueOf(character[15])); + if(character.length > 16 && isInt(character[16])) + stats.put("unarmedXP", Integer.valueOf(character[16])); + if(character.length > 17 && isInt(character[17])) + stats.put("herbalismXP", Integer.valueOf(character[17])); + if(character.length > 18 && isInt(character[18])) + stats.put("excavationXP", Integer.valueOf(character[18])); + if(character.length > 19 && isInt(character[19])) + stats.put("archeryXP", Integer.valueOf(character[19])); + if(character.length > 20 && isInt(character[20])) + stats.put("swordsXP", Integer.valueOf(character[20])); + if(character.length > 21 && isInt(character[21])) + stats.put("axesXP", Integer.valueOf(character[21])); + if(character.length > 22 && isInt(character[22])) + stats.put("acrobaticsXP", Integer.valueOf(character[22])); + if(character.length > 23 && isInt(character[23])) myspawnworld = character[23]; - if(character.length > 24) - taming = character[24]; - if(character.length > 25) - tamingXP = character[25]; - //Need to store the DATS of abilities nao - //Berserk, Gigadrillbreaker, Tree Feller, Green Terra, Serrated Strikes, Skull Splitter, Super Breaker + if(character.length > 24 && isInt(character[24])) + stats.put("taming", Integer.valueOf(character[24])); + if(character.length > 25 && isInt(character[25])) + stats.put("tamingXP", Integer.valueOf(character[25])); if(character.length > 26) berserkDATS = Long.valueOf(character[26]) * 1000; if(character.length > 27) @@ -256,30 +300,30 @@ public class PlayerProfile +", axes = "+(skullSplitterDATS/1000) +" WHERE user_id = "+this.userid); mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET " - +" taming = "+taming - +", mining = "+mining - +", repair = "+repair - +", woodcutting = "+woodcutting - +", unarmed = "+unarmed - +", herbalism = "+herbalism - +", excavation = "+excavation - +", archery = " +archery - +", swords = " +swords - +", axes = "+axes - +", acrobatics = "+acrobatics + +" taming = "+stats.get("taming") + +", mining = "+stats.get("mining") + +", repair = "+stats.get("repair") + +", woodcutting = "+stats.get("woodcutting") + +", unarmed = "+stats.get("unarmed") + +", herbalism = "+stats.get("herbalism") + +", excavation = "+stats.get("excavation") + +", archery = " +stats.get("archery") + +", swords = " +stats.get("swords") + +", axes = "+stats.get("axes") + +", acrobatics = "+stats.get("acrobatics") +" WHERE user_id = "+this.userid); mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"experience SET " - +" taming = "+tamingXP - +", mining = "+miningXP - +", repair = "+repairXP - +", woodcutting = "+woodCuttingXP - +", unarmed = "+unarmedXP - +", herbalism = "+herbalismXP - +", excavation = "+excavationXP - +", archery = " +archeryXP - +", swords = " +swordsXP - +", axes = "+axesXP - +", acrobatics = "+acrobaticsXP + +" taming = "+stats.get("tamingXP") + +", mining = "+stats.get("miningXP") + +", repair = "+stats.get("repairXP") + +", woodcutting = "+stats.get("woodcuttingXP") + +", unarmed = "+stats.get("unarmedXP") + +", herbalism = "+stats.get("herbalismXP") + +", excavation = "+stats.get("excavationXP") + +", archery = " +stats.get("archeryXP") + +", swords = " +stats.get("swordsXP") + +", axes = "+stats.get("axesXP") + +", acrobatics = "+stats.get("acrobaticsXP") +" WHERE user_id = "+this.userid); } else { @@ -296,38 +340,38 @@ public class PlayerProfile { //Read the line in and copy it to the output it's not the player //we want to edit - if(!line.split(":")[0].equalsIgnoreCase(thisplayer.getName())) + if(!line.split(":")[0].equalsIgnoreCase(playername)) { writer.append(line).append("\r\n"); //Otherwise write the new player information } else { - writer.append(thisplayer.getName() + ":"); - writer.append(mining + ":"); + writer.append(playername + ":"); + writer.append(stats.get("mining") + ":"); writer.append(myspawn + ":"); writer.append(party+":"); - writer.append(miningXP+":"); - writer.append(woodcutting+":"); - writer.append(woodCuttingXP+":"); - writer.append(repair+":"); - writer.append(unarmed+":"); - writer.append(herbalism+":"); - writer.append(excavation+":"); - writer.append(archery+":"); - writer.append(swords+":"); - writer.append(axes+":"); - writer.append(acrobatics+":"); - writer.append(repairXP+":"); - writer.append(unarmedXP+":"); - writer.append(herbalismXP+":"); - writer.append(excavationXP+":"); - writer.append(archeryXP+":"); - writer.append(swordsXP+":"); - writer.append(axesXP+":"); - writer.append(acrobaticsXP+":"); + writer.append(stats.get("miningXP") + ":"); + writer.append(stats.get("woodcutting") + ":"); + writer.append(stats.get("woodcuttingXP") + ":"); + writer.append(stats.get("repair") + ":"); + writer.append(stats.get("unarmed") + ":"); + writer.append(stats.get("herbalism") + ":"); + writer.append(stats.get("excavation") + ":"); + writer.append(stats.get("archery") + ":"); + writer.append(stats.get("swords") + ":"); + writer.append(stats.get("axes") + ":"); + writer.append(stats.get("acrobatics") + ":"); + writer.append(stats.get("repairXP") + ":"); + writer.append(stats.get("unarmedXP") + ":"); + writer.append(stats.get("herbalismXP") + ":"); + writer.append(stats.get("excavationXP") + ":"); + writer.append(stats.get("archeryXP") + ":"); + writer.append(stats.get("swordsXP") + ":"); + writer.append(stats.get("axesXP") + ":"); + writer.append(stats.get("acrobaticsXP") + ":"); writer.append(myspawnworld+":"); - writer.append(taming+":"); - writer.append(tamingXP+":"); + writer.append(stats.get("taming") + ":"); + writer.append(stats.get("tamingXP") + ":"); //Need to store the DATS of abilities nao //Berserk, Gigadrillbreaker, Tree Feller, Green Terra, Serrated Strikes, Skull Splitter, Super Breaker writer.append(String.valueOf(berserkDATS/1000)+":"); @@ -358,7 +402,7 @@ public class PlayerProfile BufferedWriter out = new BufferedWriter(file); //Add the player to the end - out.append(thisplayer.getName() + ":"); + out.append(playername + ":"); out.append(0 + ":"); //mining out.append(myspawn+":"); out.append(party+":"); @@ -381,7 +425,7 @@ public class PlayerProfile out.append(0+":"); //swordsXP out.append(0+":"); //axesXP out.append(0+":"); //acrobaticsXP - out.append(""); + out.append(myspawnworld+":"); out.append(0+":"); //taming out.append(0+":"); //tamingXP out.append(0+":"); //DATS @@ -400,11 +444,85 @@ public class PlayerProfile log.log(Level.SEVERE, "Exception while writing to " + location + " (Are you sure you formatted it correctly?)", e); } } - + public boolean getAdminChatMode() {return adminChatMode;} + public boolean getPartyChatMode() {return partyChatMode;} + public boolean getGodMode() {return godMode;} + + public void toggleAdminChat() + { + adminChatMode = !adminChatMode; + } + + public void toggleGodMode() + { + godMode = !godMode; + } + + public void togglePartyChat() + { + partyChatMode = !partyChatMode; + } + + public void setMana(int newvalue) + { + mana = newvalue; + } + + public int getCurrentMana() + { + return mana; + } + public int getMaxMana() + { + if(stats.get("sorcery") < 50) + return 5; + return stats.get("sorcery") / 10; + } + public void setDyeChanged(Boolean bool) + { + dyeChanged = bool; + } + public boolean getDyeChanged() + { + return dyeChanged; + } + public void setBlueDyeCycle(int newvalue) + { + blueDyeCycle = newvalue; + } + public int getBlueDyeCycle() + { + return blueDyeCycle; + } + public void setBlueDyeCycleSel(int newvalue) + { + blueDyeCycleSel = newvalue; + } + public int getBlueDyeCycleSel() + { + return blueDyeCycleSel; + } + public void setGreenDyeCycle(int newvalue) + { + greenDyeCycle = newvalue; + } + public int getGreenDyeCycle() + { + return greenDyeCycle; + } + public void setGreenDyeCycleSel(int newvalue) + { + greenDyeCycleSel = newvalue; + } + public int getGreenDyeCycleSel() + { + return greenDyeCycleSel; + } + public boolean isPlayer(String player) { - return player.equals(thisplayer.getName()); + return player.equals(playername); } public boolean getPartyChatOnlyToggle(){return partyChatOnly;} public void togglePartyChatOnly(){partyChatOnly = !partyChatOnly;} @@ -438,13 +556,6 @@ public class PlayerProfile public void addBleedTicks(Integer newvalue){ bleedticks+=newvalue; } - public Boolean hasCooldowns(){ - if((treeFellerCooldown + superBreakerCooldown) >= 1){ - return true; - } else { - return false; - } - } /* * EXPLOIT PREVENTION */ @@ -570,14 +681,6 @@ public class PlayerProfile greenTerraDATS = newvalue; save(); } - public void setGreenTerraCooldown(Long newvalue){ - greenTerraCooldown = newvalue; - } - public long getGreenTerraCooldown(){ - return greenTerraCooldown; - } - public void setGreenTerraTicks(Integer newvalue){greenTerraTicks = newvalue;} - public int getGreenTerraTicks(){return greenTerraTicks;} /* * BERSERK MODE */ @@ -600,14 +703,6 @@ public class PlayerProfile berserkDATS = newvalue; save(); } - public void setBerserkCooldown(Long newvalue){ - berserkCooldown = newvalue; - } - public long getBerserkCooldown(){ - return berserkCooldown; - } - public void setBerserkTicks(Integer newvalue){berserkTicks = newvalue;} - public int getBerserkTicks(){return berserkTicks;} /* * SKULL SPLITTER */ @@ -630,14 +725,6 @@ public class PlayerProfile skullSplitterDATS = newvalue; save(); } - public void setSkullSplitterCooldown(Long newvalue){ - skullSplitterCooldown = newvalue; - } - public long getSkullSplitterCooldown(){ - return skullSplitterCooldown; - } - public void setSkullSplitterTicks(Integer newvalue){skullSplitterTicks = newvalue;} - public int getSkullSplitterTicks(){return skullSplitterTicks;} /* * SERRATED STRIKES */ @@ -660,14 +747,6 @@ public class PlayerProfile serratedStrikesDATS = newvalue; save(); } - public void setSerratedStrikesCooldown(Long newvalue){ - serratedStrikesCooldown = newvalue; - } - public long getSerratedStrikesCooldown(){ - return serratedStrikesCooldown; - } - public void setSerratedStrikesTicks(Integer newvalue){serratedStrikesTicks = newvalue;} - public int getSerratedStrikesTicks(){return serratedStrikesTicks;} /* * GIGA DRILL BREAKER */ @@ -690,14 +769,6 @@ public class PlayerProfile gigaDrillBreakerDATS = newvalue; save(); } - public void setGigaDrillBreakerCooldown(Long newvalue){ - gigaDrillBreakerCooldown = newvalue; - } - public long getGigaDrillBreakerCooldown(){ - return gigaDrillBreakerCooldown; - } - public void setGigaDrillBreakerTicks(Integer newvalue){gigaDrillBreakerTicks = newvalue;} - public int getGigaDrillBreakerTicks(){return gigaDrillBreakerTicks;} /* * TREE FELLER STUFF */ @@ -720,14 +791,6 @@ public class PlayerProfile treeFellerDATS = newvalue; save(); } - public void setTreeFellerCooldown(Long newvalue){ - treeFellerCooldown = newvalue; - } - public long getTreeFellerCooldown(){ - return treeFellerCooldown; - } - public void setTreeFellerTicks(Integer newvalue){treeFellerTicks = newvalue;} - public int getTreeFellerTicks(){return treeFellerTicks;} /* * MINING */ @@ -750,579 +813,185 @@ public class PlayerProfile superBreakerDATS = newvalue; save(); } - public void setSuperBreakerCooldown(Long newvalue){ - superBreakerCooldown = newvalue; - } - public long getSuperBreakerCooldown(){ - return superBreakerCooldown; - } - public void setSuperBreakerTicks(Integer newvalue){superBreakerTicks = newvalue;} - public int getSuperBreakerTicks(){return superBreakerTicks;} - public long getRecentlyHurt(){ return recentlyHurt; } public void setRecentlyHurt(long newvalue){ recentlyHurt = newvalue; } - public void skillUpTaming(int newskill){ - int x = 0; - if(taming != null){ - if(isInt(taming)){ - x = Integer.parseInt(taming); - }else { - taming = "0"; - x = Integer.parseInt(taming); - } - } - x += newskill; - taming = Integer.toString(x); + public void skillUp(String skillname, int newvalue) + { + stats.put(skillname, stats.get(skillname)+newvalue); save(); } + public void skillUpSorcery (int newskill){ + skillUp("sorcery", newskill); + } + public void skillUpTaming(int newskill){ + skillUp("taming", newskill); + } public void skillUpAxes(int newskill){ - int x = 0; - if(axes != null){ - if(isInt(axes)){ - x = Integer.parseInt(axes); - }else { - axes = "0"; - x = Integer.parseInt(axes); - } - } - x += newskill; - axes = Integer.toString(x); - save(); + skillUp("axes", newskill); } public void skillUpAcrobatics(int newskill){ - int x = 0; - if(acrobatics != null){ - if(isInt(acrobatics)){ - x = Integer.parseInt(acrobatics); - }else { - acrobatics = "0"; - x = Integer.parseInt(acrobatics); - } - } - x += newskill; - acrobatics = Integer.toString(x); - save(); + skillUp("acrobatics", newskill); } public void skillUpSwords(int newskill){ - int x = 0; - if(swords != null){ - if(isInt(swords)){ - x = Integer.parseInt(swords); - }else { - swords = "0"; - x = Integer.parseInt(swords); - } - } - x += newskill; - swords = Integer.toString(x); - save(); + skillUp("swords", newskill); } public void skillUpArchery(int newskill){ - int x = 0; - if(archery != null){ - if(isInt(archery)){ - x = Integer.parseInt(archery); - }else { - archery = "0"; - x = Integer.parseInt(archery); - } - } - x += newskill; - archery = Integer.toString(x); - save(); + skillUp("archery", newskill); } public void skillUpRepair(int newskill){ - int x = 0; - if(repair != null){ - if(isInt(repair)){ - x = Integer.parseInt(repair); - }else { - repair = "0"; - x = Integer.parseInt(repair); - } - } - x += newskill; - repair = Integer.toString(x); - save(); + skillUp("repair", newskill); } - public void skillUpMining(int newmining){ - int x = 0; - if(mining != null){ - if(isInt(mining)){ - x = Integer.parseInt(mining); - }else { - mining = "0"; - x = Integer.parseInt(mining); - } - } - x += newmining; - mining = Integer.toString(x); - save(); + public void skillUpMining(int newskill){ + skillUp("mining", newskill); } public void skillUpUnarmed(int newskill){ - int x = 0; - if(unarmed != null){ - if(isInt(unarmed)){ - x = Integer.parseInt(unarmed); - }else { - unarmed = "0"; - x = Integer.parseInt(unarmed); - } - } - x += newskill; - unarmed = Integer.toString(x); - save(); + skillUp("unarmed", newskill); } public void skillUpHerbalism(int newskill){ - int x = 0; - if(herbalism != null){ - if(isInt(herbalism)){ - x = Integer.parseInt(herbalism); - }else { - herbalism = "0"; - x = Integer.parseInt(herbalism); - } - } - x += newskill; - herbalism = Integer.toString(x); - save(); + skillUp("herbalism", newskill); } public void skillUpExcavation(int newskill){ - int x = 0; - if(excavation != null){ - if(isInt(excavation)){ - x = Integer.parseInt(excavation); - }else { - excavation = "0"; - x = Integer.parseInt(excavation); - } - } - x += newskill; - excavation = Integer.toString(x); - save(); + skillUp("excavation", newskill); } public void skillUpWoodCutting(int newskill){ - int x = 0; - if(woodcutting != null){ - if(isInt(woodcutting)){ - x = Integer.parseInt(woodcutting); - }else { - woodcutting = "0"; - x = Integer.parseInt(woodcutting); - } - } - x += newskill; - woodcutting = Integer.toString(x); - save(); + skillUp("woodcutting", newskill); } - public String getTaming(){ - if(taming != null && !taming.equals("") && !taming.equals("null")){ - return taming; + public String getSkillToString(String skillname){ + return String.valueOf(stats.get(skillname)); + } + public Integer getSkill(String skillname){ + return stats.get(skillname); + } + public void resetSkillXp(String skillname){ + stats.put(skillname+"XP", 0); + } + public void addXP(String skillname, int newvalue) + { + if(skillname.toLowerCase().equals("all")){ + stats.put("tamingXP", stats.get("tamingXP")+newvalue); + stats.put("miningXP", stats.get("miningXP")+newvalue); + stats.put("woodcuttingXP", stats.get("woodcuttingXP")+newvalue); + stats.put("repairXP", stats.get("repairXP")+newvalue); + stats.put("herbalismXP", stats.get("herbalismXP")+newvalue); + stats.put("acrobaticsXP", stats.get("acrobaticsXP")+newvalue); + stats.put("swordsXP", stats.get("swordsXP")+newvalue); + stats.put("archeryXP", stats.get("archeryXP")+newvalue); + stats.put("unarmedXP", stats.get("unarmedXP")+newvalue); + stats.put("excavationXP", stats.get("excavationXP")+newvalue); + stats.put("axesXP", stats.get("axesXP")+newvalue); + stats.put("sorcery", stats.get("sorceryXP")+newvalue); } else { - return "0"; + stats.put(skillname+"XP", stats.get(skillname+"XP")+newvalue); } + //save(); } - public String getRepair(){ - if(repair != null && !repair.equals("") && !repair.equals("null")){ - return repair; - } else { - return "0"; - } - } - public String getMining(){ - if(mining != null && !mining.equals("") && !mining.equals("null")){ - return mining; - } else { - return "0"; - } - } - public String getUnarmed(){ - if(unarmed != null && !unarmed.equals("") && !unarmed.equals("null")){ - return unarmed; - } else { - return "0"; - } - } - public String getHerbalism(){ - if(herbalism != null && !herbalism.equals("") && !herbalism.equals("null")){ - return herbalism; - } else { - return "0"; - } - } - public String getExcavation(){ - if(excavation != null && !excavation.equals("") && !excavation.equals("null")){ - return excavation; - } else { - return "0"; - } - } - public String getArchery(){ - if(archery != null && !archery.equals("") && !archery.equals("null")){ - return archery; - } else { - return "0"; - } - } - public String getSwords(){ - if(swords != null && !swords.equals("") && !swords.equals("null")){ - return swords; - } else { - return "0"; - } - } - public String getAxes(){ - if(axes != null && !axes.equals("") && !axes.equals("null")){ - return axes; - } else { - return "0"; - } - } - public String getAcrobatics(){ - if(acrobatics != null && !acrobatics.equals("") && !acrobatics.equals("null")){ - return acrobatics; - } else { - return "0"; - } - } - public int getTamingInt(){ - if(isInt(taming)){ - return Integer.parseInt(taming); - } else{ - return 0; - } - } - public int getMiningInt(){ - if(isInt(mining)){ - int x = Integer.parseInt(mining); - return x; - } else{ - return 0; - } - } - public int getUnarmedInt(){ - if(isInt(unarmed)){ - int x = Integer.parseInt(unarmed); - return x; - } else{ - return 0; - } - } - public int getArcheryInt(){ - if(isInt(archery)){ - int x = Integer.parseInt(archery); - return x; - } else{ - return 0; - } - } - public int getSwordsInt(){ - if(isInt(swords)){ - int x = Integer.parseInt(swords); - return x; - } else{ - return 0; - } - } - public int getAxesInt(){ - if(isInt(axes)){ - int x = Integer.parseInt(axes); - return x; - } else{ - return 0; - } - } - public int getAcrobaticsInt(){ - if(isInt(acrobatics)){ - int x = Integer.parseInt(acrobatics); - return x; - } else{ - return 0; - } - } - public int getHerbalismInt(){ - if(isInt(herbalism)){ - int x = Integer.parseInt(herbalism); - return x; - } else{ - return 0; - } - } - public int getExcavationInt(){ - if(isInt(excavation)){ - int x = Integer.parseInt(excavation); - return x; - } else{ - return 0; - } - } - public int getRepairInt(){ - if(isInt(repair)){ - int x = Integer.parseInt(repair); - return x; - } else{ - return 0; - } - } - public int getWoodCuttingInt(){ - if(isInt(woodcutting)){ - int x = Integer.parseInt(woodcutting); - return x; - } else{ - return 0; - } - } - public String getWoodCutting(){ - if(woodcutting != null && !woodcutting.equals("") && !woodcutting.equals("null")){ - return woodcutting; - } else { - return "0"; - } - } - /* - * EXPERIENCE STUFF - */ - public void clearTamingXP(){ - tamingXP = "0"; - } - public void clearRepairXP(){ - repairXP = "0"; - } - public void clearUnarmedXP(){ - unarmedXP = "0"; - } - public void clearHerbalismXP(){ - herbalismXP = "0"; - } - public void clearExcavationXP(){ - excavationXP = "0"; - } - public void clearArcheryXP(){ - archeryXP = "0"; - } - public void clearSwordsXP(){ - swordsXP = "0"; - } - public void clearAxesXP(){ - axesXP = "0"; - } - public void clearAcrobaticsXP(){ - acrobaticsXP = "0"; + public void addSorceryXP(int newXP) + { + addXP("sorcery", newXP); } public void addTamingXP(int newXP) { - int x = 0; - if(isInt(tamingXP)){ - x = Integer.parseInt(tamingXP); - } - x += newXP; - tamingXP = String.valueOf(x); - save(); + addXP("taming", newXP); } public void addAcrobaticsXP(int newXP) { - int x = 0; - if(isInt(acrobaticsXP)){ - x = Integer.parseInt(acrobaticsXP); - } - x += newXP; - acrobaticsXP = String.valueOf(x); - save(); + addXP("acrobatics", newXP); } public void addAxesXP(int newXP) { - int x = 0; - if(isInt(axesXP)){ - x = Integer.parseInt(axesXP); - } - x += newXP; - axesXP = String.valueOf(x); - save(); + addXP("axes", newXP); } public void addSwordsXP(int newXP) { - int x = 0; - if(isInt(swordsXP)){ - x = Integer.parseInt(swordsXP); - } - x += newXP; - swordsXP = String.valueOf(x); - save(); + addXP("swords", newXP); } public void addArcheryXP(int newXP) { - int x = 0; - if(isInt(archeryXP)){ - x = Integer.parseInt(archeryXP); - } - x += newXP; - archeryXP = String.valueOf(x); - save(); + addXP("archery", newXP); } public void addExcavationXP(int newXP) { - int x = 0; - if(isInt(excavationXP)){ - x = Integer.parseInt(excavationXP); - } - x += newXP; - excavationXP = String.valueOf(x); - save(); + addXP("excavation", newXP); } public void addHerbalismXP(int newXP) { - int x = 0; - if(isInt(herbalismXP)){ - x = Integer.parseInt(herbalismXP); - } - x += newXP; - herbalismXP = String.valueOf(x); - save(); + addXP("herbalism", newXP); } public void addRepairXP(int newXP) { - int x = 0; - if(isInt(repairXP)){ - x = Integer.parseInt(repairXP); - } - x += newXP; - repairXP = String.valueOf(x); - save(); + addXP("repair", newXP); } public void addUnarmedXP(int newXP) { - int x = 0; - if(isInt(unarmedXP)){ - x = Integer.parseInt(unarmedXP); - } - x += newXP; - unarmedXP = String.valueOf(x); - save(); + addXP("unarmed", newXP); } public void addWoodcuttingXP(int newXP) { - int x = 0; - if(isInt(woodCuttingXP)){ - x = Integer.parseInt(woodCuttingXP); - } - x += newXP; - woodCuttingXP = String.valueOf(x); - save(); - } - public void removeTamingXP(int newXP){ - int x = 0; - if(isInt(tamingXP)){ - x = Integer.parseInt(tamingXP); - } - x -= newXP; - tamingXP = String.valueOf(x); - save(); - } - public void removeWoodCuttingXP(int newXP){ - int x = 0; - if(isInt(woodCuttingXP)){ - x = Integer.parseInt(woodCuttingXP); - } - x -= newXP; - woodCuttingXP = String.valueOf(x); - save(); + addXP("woodcutting", newXP); } public void addMiningXP(int newXP) { - int x = 0; - if(isInt(miningXP)){ - x = Integer.parseInt(miningXP); + addXP("mining", newXP); + } + public void removeXP(String skillname, int newvalue) + { + if(skillname.toLowerCase().equals("all")){ + stats.put("tamingXP", stats.get("tamingXP")-newvalue); + stats.put("miningXP", stats.get("miningXP")-newvalue); + stats.put("woodcuttingXP", stats.get("woodcuttingXP")-newvalue); + stats.put("repairXP", stats.get("repairXP")-newvalue); + stats.put("herbalismXP", stats.get("herbalismXP")-newvalue); + stats.put("acrobaticsXP", stats.get("acrobaticsXP")-newvalue); + stats.put("swordsXP", stats.get("swordsXP")-newvalue); + stats.put("archeryXP", stats.get("archeryXP")-newvalue); + stats.put("unarmedXP", stats.get("unarmedXP")-newvalue); + stats.put("excavationXP", stats.get("excavationXP")-newvalue); + stats.put("axesXP", stats.get("axesXP")-newvalue); + stats.put("sorceryXP", stats.get("sorceryXP")-newvalue); } else { - x = 0; + stats.put(skillname+"XP", stats.get(skillname+"XP")-newvalue); } - x += newXP; - miningXP = String.valueOf(x); save(); } + public void removeSorceryXP(int newXP){ + removeXP("sorcery", newXP); + } + public void removeTamingXP(int newXP){ + removeXP("taming", newXP); + } + public void removeWoodCuttingXP(int newXP){ + removeXP("woodcutting", newXP); + } public void removeMiningXP(int newXP){ - int x = 0; - if(isInt(miningXP)){ - x = Integer.parseInt(miningXP); - } - x -= newXP; - miningXP = String.valueOf(x); - save(); + removeXP("mining", newXP); } public void removeRepairXP(int newXP){ - int x = 0; - if(isInt(repairXP)){ - x = Integer.parseInt(repairXP); - } - x -= newXP; - repairXP = String.valueOf(x); - save(); + removeXP("repair", newXP); } public void removeUnarmedXP(int newXP){ - int x = 0; - if(isInt(unarmedXP)){ - x = Integer.parseInt(unarmedXP); - } - x -= newXP; - unarmedXP = String.valueOf(x); - save(); + removeXP("unarmed", newXP); } public void removeHerbalismXP(int newXP){ - int x = 0; - if(isInt(herbalismXP)){ - x = Integer.parseInt(herbalismXP); - } - x -= newXP; - herbalismXP = String.valueOf(x); - save(); + removeXP("herbalism", newXP); } public void removeExcavationXP(int newXP){ - int x = 0; - if(isInt(excavationXP)){ - x = Integer.parseInt(excavationXP); - } - x -= newXP; - excavationXP = String.valueOf(x); - save(); + removeXP("excavation", newXP); } public void removeArcheryXP(int newXP){ - int x = 0; - if(isInt(archeryXP)){ - x = Integer.parseInt(archeryXP); - } - x -= newXP; - archeryXP = String.valueOf(x); - save(); + removeXP("archery", newXP); } public void removeSwordsXP(int newXP){ - int x = 0; - if(isInt(swordsXP)){ - x = Integer.parseInt(swordsXP); - } - x -= newXP; - swordsXP = String.valueOf(x); - save(); + removeXP("swords", newXP); } public void removeAxesXP(int newXP){ - int x = 0; - if(isInt(axesXP)){ - x = Integer.parseInt(axesXP); - } - x -= newXP; - axesXP = String.valueOf(x); - save(); + removeXP("axes", newXP); } public void removeAcrobaticsXP(int newXP){ - int x = 0; - if(isInt(acrobaticsXP)){ - x = Integer.parseInt(acrobaticsXP); - } - x -= newXP; - acrobaticsXP = String.valueOf(x); - save(); + removeXP("acrobatics", newXP); } public boolean isInt(String string){ @@ -1346,348 +1015,87 @@ public class PlayerProfile public void acceptInvite(){ party = invite; invite = ""; - save(); } public void modifyInvite(String invitename){ invite = invitename; } - //Returns player XP - public String getTamingXP(){ - if(tamingXP != null && !tamingXP.equals("") && !tamingXP.equals("null")){ - return tamingXP; - } else { - return "0"; - } - } - public String getMiningXP(){ - if(miningXP != null && !miningXP.equals("") && !miningXP.equals("null")){ - return miningXP; - } else { - return "0"; - } - } public String getInvite() { return invite; } - public String getWoodCuttingXP(){ - if(woodCuttingXP != null && !woodCuttingXP.equals("") && !woodCuttingXP.equals("null")){ - return woodCuttingXP; - } else { - return "0"; - } - } - public String getRepairXP(){ - if(repairXP != null && !repairXP.equals("") && !repairXP.equals("null")){ - return repairXP; - } else { - return "0"; - } - } - public String getHerbalismXP(){ - if(herbalismXP != null && !herbalismXP.equals("") && !herbalismXP.equals("null")){ - return herbalismXP; - } else { - return "0"; - } - } - public String getExcavationXP(){ - if(excavationXP != null && !excavationXP.equals("") && !excavationXP.equals("null")){ - return excavationXP; - } else { - return "0"; - } - } - public String getArcheryXP(){ - if(archeryXP != null && !archeryXP.equals("") && !archeryXP.equals("null")){ - return archeryXP; - } else { - return "0"; - } - } - public String getSwordsXP(){ - if(swordsXP != null && !swordsXP.equals("") && !swordsXP.equals("null")){ - return swordsXP; - } else { - return "0"; - } - } - public String getAxesXP(){ - if(axesXP != null && !axesXP.equals("") && !axesXP.equals("null")){ - return axesXP; - } else { - return "0"; - } - } - public String getAcrobaticsXP(){ - if(acrobaticsXP != null && !acrobaticsXP.equals("") && !acrobaticsXP.equals("null")){ - return acrobaticsXP; - } else { - return "0"; - } - } - public String getUnarmedXP(){ - if(unarmedXP != null && !unarmedXP.equals("") && !unarmedXP.equals("null")){ - return unarmedXP; - } else { - return "0"; - } - } - public int getTamingXPInt() { - if(isInt(tamingXP)){ - return Integer.parseInt(tamingXP); - } else { - tamingXP = "0"; - save(); - return 0; - } - } - public int getWoodCuttingXPInt() { - if(isInt(woodCuttingXP)){ - return Integer.parseInt(woodCuttingXP); - } else { - woodCuttingXP = "0"; - save(); - return 0; - } - } - public int getRepairXPInt() { - if(isInt(repairXP)){ - return Integer.parseInt(repairXP); - } else { - repairXP = "0"; - save(); - return 0; - } - } - public int getUnarmedXPInt() { - if(isInt(unarmedXP)){ - return Integer.parseInt(unarmedXP); - } else { - unarmedXP = "0"; - save(); - return 0; - } - } - public int getHerbalismXPInt() { - if(isInt(herbalismXP)){ - return Integer.parseInt(herbalismXP); - } else { - herbalismXP = "0"; - save(); - return 0; - } - } - public int getExcavationXPInt() { - if(isInt(excavationXP)){ - return Integer.parseInt(excavationXP); - } else { - excavationXP = "0"; - save(); - return 0; - } - } - public int getArcheryXPInt() { - if(isInt(archeryXP)){ - return Integer.parseInt(archeryXP); - } else { - archeryXP = "0"; - save(); - return 0; - } - } - public int getSwordsXPInt() { - if(isInt(swordsXP)){ - return Integer.parseInt(swordsXP); - } else { - swordsXP = "0"; - save(); - return 0; - } - } - public int getAxesXPInt() { - if(isInt(axesXP)){ - return Integer.parseInt(axesXP); - } else { - axesXP = "0"; - save(); - return 0; - } - } - public int getAcrobaticsXPInt() { - if(isInt(acrobaticsXP)){ - return Integer.parseInt(acrobaticsXP); - } else { - acrobaticsXP = "0"; - save(); - return 0; - } - } - public void addXpToSkill(int newvalue, String skillname, Player targetPlayer){ - if(!isInt(tamingXP)) - tamingXP = String.valueOf(0); - if(!isInt(miningXP)) - miningXP = String.valueOf(0); - if(!isInt(woodCuttingXP)) - woodCuttingXP = String.valueOf(0); - if(!isInt(repairXP)) - repairXP = String.valueOf(0); - if(!isInt(herbalismXP)) - herbalismXP = String.valueOf(0); - if(!isInt(acrobaticsXP)) - acrobaticsXP = String.valueOf(0); - if(!isInt(swordsXP)) - swordsXP = String.valueOf(0); - if(!isInt(archeryXP)) - archeryXP = String.valueOf(0); - if(!isInt(unarmedXP)) - unarmedXP = String.valueOf(0); - if(!isInt(excavationXP)) - excavationXP = String.valueOf(0); - if(!isInt(axesXP)) - axesXP = String.valueOf(0); - - if(skillname.toLowerCase().equals("taming")){ - tamingXP = String.valueOf(Integer.valueOf(tamingXP)+newvalue); - } - if(skillname.toLowerCase().equals("mining")){ - miningXP = String.valueOf(Integer.valueOf(miningXP)+newvalue); - } - if(skillname.toLowerCase().equals("woodcutting")){ - woodCuttingXP = String.valueOf(Integer.valueOf(woodCuttingXP)+newvalue); - } - if(skillname.toLowerCase().equals("repair")){ - repairXP = String.valueOf(Integer.valueOf(repairXP)+newvalue); - } - if(skillname.toLowerCase().equals("herbalism")){ - herbalismXP = String.valueOf(Integer.valueOf(herbalismXP)+newvalue); - } - if(skillname.toLowerCase().equals("acrobatics")){ - acrobaticsXP = String.valueOf(Integer.valueOf(acrobaticsXP)+newvalue); - } - if(skillname.toLowerCase().equals("swords")){ - swordsXP = String.valueOf(Integer.valueOf(swordsXP)+newvalue); - } - if(skillname.toLowerCase().equals("archery")){ - archeryXP = String.valueOf(Integer.valueOf(archeryXP)+newvalue); - } - if(skillname.toLowerCase().equals("unarmed")){ - unarmedXP = String.valueOf(Integer.valueOf(unarmedXP)+newvalue); - } - if(skillname.toLowerCase().equals("excavation")){ - excavationXP = String.valueOf(Integer.valueOf(excavationXP)+newvalue); - } - if(skillname.toLowerCase().equals("axes")){ - axesXP = String.valueOf(Integer.valueOf(axesXP)+newvalue); - } - if(skillname.toLowerCase().equals("all")){ - tamingXP = String.valueOf(getTamingXPInt()+newvalue); - miningXP = String.valueOf(getMiningXPInt()+newvalue); - woodCuttingXP = String.valueOf(getWoodCuttingXPInt()+newvalue); - repairXP = String.valueOf(getRepairXPInt()+newvalue); - herbalismXP = String.valueOf(getHerbalismXPInt()+newvalue); - acrobaticsXP = String.valueOf(getAcrobaticsXPInt()+newvalue); - swordsXP = String.valueOf(getSwordsXPInt()+newvalue); - archeryXP = String.valueOf(getArcheryXPInt()+newvalue); - unarmedXP = String.valueOf(getUnarmedXPInt()+newvalue); - excavationXP = String.valueOf(getExcavationXPInt()+newvalue); - axesXP = String.valueOf(getAxesXPInt()+newvalue); - } - save(); - Skills.XpCheck(targetPlayer); - } + public void modifyskill(int newvalue, String skillname){ - if(skillname.toLowerCase().equals("taming")){ - taming = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("mining")){ - mining = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("woodcutting")){ - woodcutting = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("repair")){ - repair = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("herbalism")){ - herbalism = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("acrobatics")){ - acrobatics = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("swords")){ - swords = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("archery")){ - archery = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("unarmed")){ - unarmed = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("excavation")){ - excavation = String.valueOf(newvalue); - } - if(skillname.toLowerCase().equals("axes")){ - axes = String.valueOf(newvalue); - } if(skillname.toLowerCase().equals("all")){ - taming = String.valueOf(newvalue); - mining = String.valueOf(newvalue); - woodcutting = String.valueOf(newvalue); - repair = String.valueOf(newvalue); - herbalism = String.valueOf(newvalue); - acrobatics = String.valueOf(newvalue); - swords = String.valueOf(newvalue); - archery = String.valueOf(newvalue); - unarmed = String.valueOf(newvalue); - excavation = String.valueOf(newvalue); - axes = String.valueOf(newvalue); + stats.put("sorcery", newvalue); + stats.put("taming", newvalue); + stats.put("mining", newvalue); + stats.put("woodcutting", newvalue); + stats.put("repair", newvalue); + stats.put("herbalism", newvalue); + stats.put("acrobatics", newvalue); + stats.put("swords", newvalue); + stats.put("archery", newvalue); + stats.put("unarmed", newvalue); + stats.put("excavation", newvalue); + stats.put("axes", newvalue); + + stats.put("tamingXP", 0); + stats.put("sorceryXP", 0); + stats.put("miningXP", 0); + stats.put("woodcuttingXP", 0); + stats.put("repairXP", 0); + stats.put("herbalismXP", 0); + stats.put("acrobaticsXP", 0); + stats.put("swordsXP", 0); + stats.put("archeryXP", 0); + stats.put("unarmedXP", 0); + stats.put("excavationXP", 0); + stats.put("axesXP", 0); + } else { + stats.put(skillname, newvalue); + stats.put(skillname+"XP", newvalue); } save(); } public Integer getXpToLevel(String skillname){ + if(skillname.equals("sorcery")){ + return ((stats.get("sorcery") + 50) * LoadProperties.sorceryxpmodifier) * LoadProperties.globalxpmodifier; + } if(skillname.equals("taming")){ - return ((getTamingInt() + 50) * LoadProperties.tamingxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("taming") + 50) * LoadProperties.tamingxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("mining")){ - return ((getMiningInt() + 50) * LoadProperties.miningxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("mining") + 50) * LoadProperties.miningxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("woodcutting")){ - return ((getWoodCuttingInt() + 50) * LoadProperties.woodcuttingxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("woodcutting") + 50) * LoadProperties.woodcuttingxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("repair")){ - return ((getRepairInt() + 50) * LoadProperties.repairxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("repair") + 50) * LoadProperties.repairxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("herbalism")){ - return ((getHerbalismInt() + 50) * LoadProperties.herbalismxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("herbalism") + 50) * LoadProperties.herbalismxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("acrobatics")){ - return ((getAcrobaticsInt() + 50) * LoadProperties.acrobaticsxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("acrobatics") + 50) * LoadProperties.acrobaticsxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("swords")){ - return ((getSwordsInt() + 50) * LoadProperties.swordsxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("swords") + 50) * LoadProperties.swordsxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("archery")){ - return ((getArcheryInt() + 50) * LoadProperties.archeryxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("archery") + 50) * LoadProperties.archeryxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("unarmed")){ - return ((getUnarmedInt() + 50) * LoadProperties.unarmedxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("unarmed") + 50) * LoadProperties.unarmedxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("excavation")){ - return ((getExcavationInt() + 50) * LoadProperties.excavationxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("excavation") + 50) * LoadProperties.excavationxpmodifier) * LoadProperties.globalxpmodifier; } if(skillname.equals("axes")){ - return ((getAxesInt() + 50) * LoadProperties.axesxpmodifier) * LoadProperties.globalxpmodifier; + return ((stats.get("axes") + 50) * LoadProperties.axesxpmodifier) * LoadProperties.globalxpmodifier; } else { + System.out.println("ELSE CONDITIONS MET"); return 0; } } - public int getMiningXPInt() { - if(isInt(miningXP)){ - return Integer.parseInt(miningXP); - } else { - miningXP = "0"; - save(); - return 0; - } - } + //Store the player's party public void setParty(String newParty) @@ -1758,20 +1166,18 @@ public class PlayerProfile else return null; } - public void setDead(boolean x){ - dead = x; - save(); - } public boolean isDead(){ return dead; } - public Location getMySpawn(Player player){ + public Location getMySpawn(Player player) + { Location loc = null; - if(myspawn != null){ + if(myspawn != null) + { if(isDouble(getX()) && isDouble(getY()) && isDouble(getZ())) loc = new Location(player.getWorld(),(Double.parseDouble(getX())), Double.parseDouble(getY()), Double.parseDouble(getZ())); - else - return null; + else + return null; } else return null; diff --git a/mcMMO/com/gmail/nossr50/datatypes/PlayerStat.java b/mcMMO/com/gmail/nossr50/datatypes/PlayerStat.java index a560555c5..e88a58ac9 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/PlayerStat.java +++ b/mcMMO/com/gmail/nossr50/datatypes/PlayerStat.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.datatypes; -public class PlayerStat { +public class PlayerStat +{ public String name; public int statVal = 0; } \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/datatypes/Tree.java b/mcMMO/com/gmail/nossr50/datatypes/Tree.java index f465db53c..fd77da0ec 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/Tree.java +++ b/mcMMO/com/gmail/nossr50/datatypes/Tree.java @@ -2,8 +2,6 @@ package com.gmail.nossr50.datatypes; import java.util.ArrayList; -import org.bukkit.entity.Player; - import com.gmail.nossr50.datatypes.PlayerStat; public class Tree { diff --git a/mcMMO/com/gmail/nossr50/datatypes/TreeNode.java b/mcMMO/com/gmail/nossr50/datatypes/TreeNode.java index 283a25ec0..92223adc0 100644 --- a/mcMMO/com/gmail/nossr50/datatypes/TreeNode.java +++ b/mcMMO/com/gmail/nossr50/datatypes/TreeNode.java @@ -2,18 +2,18 @@ package com.gmail.nossr50.datatypes; import java.util.ArrayList; -import org.bukkit.entity.Player; - import com.gmail.nossr50.datatypes.PlayerStat; -public class TreeNode { +public class TreeNode +{ TreeNode left = null , right = null; PlayerStat ps = new PlayerStat(); public TreeNode(String p, int in) {ps.statVal = in; ps.name = p;} - public void add (String p, int in) { + public void add (String p, int in) + { if (in >= ps.statVal) { if (left == null) @@ -32,13 +32,17 @@ public class TreeNode { public ArrayList inOrder(ArrayList a) { + //if left node is not null than assign arrayList(a) to left.inOrder() + + //GOES THROUGH THE ENTIRE LEFT BRANCH AND GRABS THE GREATEST NUMBER + if(left != null) - a = left.inOrder(a); + a = left.inOrder(a); a.add(ps); if(right != null) - a = right.inOrder(a); + a = right.inOrder(a); return a; } diff --git a/mcMMO/com/gmail/nossr50/m.java b/mcMMO/com/gmail/nossr50/m.java index 90d86d3fe..1c7f58e7b 100644 --- a/mcMMO/com/gmail/nossr50/m.java +++ b/mcMMO/com/gmail/nossr50/m.java @@ -1,9 +1,7 @@ package com.gmail.nossr50; import java.io.BufferedReader; -import java.io.FileNotFoundException; import java.io.FileReader; -import java.io.IOException; import java.util.logging.Level; import java.util.logging.Logger; @@ -12,26 +10,19 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.entity.*; -import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; import com.gmail.nossr50.config.*; -import com.gmail.nossr50.datatypes.*; -import com.gmail.nossr50.skills.*; -import com.gmail.nossr50.party.*; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.FakeBlockBreakEvent; public class m { - public static final Logger log = Logger.getLogger("Minecraft"); + public static final Logger log = Logger.getLogger("Minecraft"); //$NON-NLS-1$ /* * I'm storing my misc functions/methods in here in an unorganized manner. Spheal with it. */ - private static mcMMO plugin; - public m(mcMMO instance) { - plugin = instance; - } + //The lazy way to default to 0 public static int getInt(String string) { @@ -73,29 +64,30 @@ public class m { return false; } } - public static int getPowerLevel(Player player){ + public static int getPowerLevel(Player player) + { PlayerProfile PP = Users.getProfile(player); int x = 0; if(mcPermissions.getInstance().mining(player)) - x+=PP.getMiningInt(); + x+=PP.getSkill("mining"); if(mcPermissions.getInstance().woodcutting(player)) - x+=PP.getWoodCuttingInt(); + x+=PP.getSkill("woodcutting"); if(mcPermissions.getInstance().unarmed(player)) - x+=PP.getUnarmedInt(); + x+=PP.getSkill("unarmed"); if(mcPermissions.getInstance().herbalism(player)) - x+=PP.getHerbalismInt(); + x+=PP.getSkill("herbalism"); if(mcPermissions.getInstance().excavation(player)) - x+=PP.getExcavationInt(); + x+=PP.getSkill("excavation"); if(mcPermissions.getInstance().archery(player)) - x+=PP.getArcheryInt(); + x+=PP.getSkill("archery"); if(mcPermissions.getInstance().swords(player)) - x+=PP.getSwordsInt(); + x+=PP.getSkill("swords"); if(mcPermissions.getInstance().axes(player)) - x+=PP.getAxesInt(); + x+=PP.getSkill("axes"); if(mcPermissions.getInstance().acrobatics(player)) - x+=PP.getAcrobaticsInt(); + x+=PP.getSkill("acrobatics"); if(mcPermissions.getInstance().repair(player)) - x+=PP.getRepairInt(); + x+=PP.getSkill("repair"); return x; } public static boolean blockBreakSimulate(Block block, Player player, Plugin plugin){ @@ -183,20 +175,25 @@ public class m { return 0; } } + public static double getDistance(Location loca, Location locb) { - return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2) - + Math.pow(loca.getZ() - locb.getZ(), 2)); + return Math.sqrt(Math.pow(loca.getX() - locb.getX(), 2) + Math.pow(loca.getY() - locb.getY(), 2) + + Math.pow(loca.getZ() - locb.getZ(), 2)); } - public static boolean abilityBlockCheck(Block block){ + + public static boolean abilityBlockCheck(Block block) + { int i = block.getTypeId(); - if(i == 68 || i == 355 || i == 26 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){ + if(i == 96 || i == 68 || i == 355 || i == 26 || i == 323 || i == 25 || i == 54 || i == 69 || i == 92 || i == 77 || i == 58 || i == 61 || i == 62 || i == 42 || i == 71 || i == 64 || i == 84 || i == 324 || i == 330){ return false; } else { return true; } } - public static boolean isBlockAround(Location loc, Integer radius, Integer typeid){ + + public static boolean isBlockAround(Location loc, Integer radius, Integer typeid) + { Block blockx = loc.getBlock(); int ox = blockx.getX(); int oy = blockx.getY(); @@ -214,37 +211,6 @@ public class m { return false; } - public static boolean isPvpEnabled(){ - String propertyName = "pvp"; - FileReader fr = null; - try { - fr = new FileReader("server.properties"); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - BufferedReader br = new BufferedReader(fr); - String property; - String s = null; - try { - while((s=br.readLine()) .indexOf(propertyName)==-1); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - property = s.split("=")[1]; - try { - fr.close(); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if(property.toLowerCase().equals("true")){ - return true; - } else { - return false; - } - } public static Integer calculateHealth(Integer health, Integer newvalue){ if((health + newvalue) > 20){ return 20; @@ -259,20 +225,6 @@ public class m { return health-newvalue; } } - public static Integer getHealth(Entity entity){ - if(entity instanceof Monster){ - Monster monster = (Monster)entity; - return monster.getHealth(); - } else if (entity instanceof Animals){ - Animals animals = (Animals)entity; - return animals.getHealth(); - } else if (entity instanceof Player){ - Player player = (Player)entity; - return player.getHealth(); - } else { - return 0; - } - } public static boolean isInt(String string){ try { int x = Integer.parseInt(string); @@ -339,31 +291,28 @@ public class m { { if(!LoadProperties.useMySQL) return; - String location = "plugins/mcMMO/mcmmo.users"; + String location = "plugins/mcMMO/mcmmo.users"; //$NON-NLS-1$ try { //Open the user file FileReader file = new FileReader(location); BufferedReader in = new BufferedReader(file); - String line = ""; - String x = null, y = null, z = null, playerName = null, mining = null, myspawn = null, party = null, miningXP = null, woodcutting = null, woodCuttingXP = null, repair = null, unarmed = null, herbalism = null, + String line = ""; //$NON-NLS-1$ + String playerName = null, mining = null, party = null, miningXP = null, woodcutting = null, woodCuttingXP = null, repair = null, unarmed = null, herbalism = null, excavation = null, archery = null, swords = null, axes = null, acrobatics = null, repairXP = null, unarmedXP = null, herbalismXP = null, excavationXP = null, archeryXP = null, swordsXP = null, axesXP = null, - acrobaticsXP = null, myspawnworld = null, taming = null, tamingXP = null; + acrobaticsXP = null, taming = null, tamingXP = null; int id = 0, theCount = 0; while((line = in.readLine()) != null) { //Find if the line contains the player we want. - String[] character = line.split(":"); + String[] character = line.split(":"); //$NON-NLS-1$ playerName = character[0]; //Check for things we don't want put in the DB - if(playerName == null || playerName.equals("null") || playerName.equals("#Storage place for user information")) + if(playerName == null || playerName.equals("null") || playerName.equals("#Storage place for user information")) //$NON-NLS-1$ //$NON-NLS-2$ continue; //Get Mining if(character.length > 1) mining = character[1]; - //Myspawn - if(character.length > 2) - myspawn = character[2]; //Party if(character.length > 3) party = character[3]; @@ -406,14 +355,12 @@ public class m { axesXP = character[21]; if(character.length > 22) acrobaticsXP = character[22]; - if(character.length > 23) - myspawnworld = character[23]; if(character.length > 24) taming = character[24]; if(character.length > 25) tamingXP = character[25]; //Check to see if the user is in the DB - id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'"); + id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //Prepare some variables /* if(myspawn != null && myspawn.length() > 0) @@ -432,505 +379,542 @@ public class m { { theCount++; //Update the skill values - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET lastlogin = " + 0 + " WHERE id = " + id); + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET lastlogin = " + 0 + " WHERE id = " + id); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //if(getDouble(x) > 0 && getDouble(y) > 0 && getDouble(z) > 0) //mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"spawn SET world = '" + myspawnworld + "', x = " +getDouble(x)+", y = "+getDouble(y)+", z = "+getDouble(z)+" WHERE user_id = "+id); - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET " - +" taming = taming+"+getInt(taming) - +", mining = mining+"+getInt(mining) - +", repair = repair+"+getInt(repair) - +", woodcutting = woodcutting+"+getInt(woodcutting) - +", unarmed = unarmed+"+getInt(unarmed) - +", herbalism = herbalism+"+getInt(herbalism) - +", excavation = excavation+"+getInt(excavation) - +", archery = archery+" +getInt(archery) - +", swords = swords+" +getInt(swords) - +", axes = axes+"+getInt(axes) - +", acrobatics = acrobatics+"+getInt(acrobatics) - +" WHERE user_id = "+id); - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"experience SET " - +" taming = "+getInt(tamingXP) - +", mining = "+getInt(miningXP) - +", repair = "+getInt(repairXP) - +", woodcutting = "+getInt(woodCuttingXP) - +", unarmed = "+getInt(unarmedXP) - +", herbalism = "+getInt(herbalismXP) - +", excavation = "+getInt(excavationXP) - +", archery = " +getInt(archeryXP) - +", swords = " +getInt(swordsXP) - +", axes = "+getInt(axesXP) - +", acrobatics = "+getInt(acrobaticsXP) - +" WHERE user_id = "+id); + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET " //$NON-NLS-1$ //$NON-NLS-2$ + +" taming = taming+"+getInt(taming) //$NON-NLS-1$ + +", mining = mining+"+getInt(mining) //$NON-NLS-1$ + +", repair = repair+"+getInt(repair) //$NON-NLS-1$ + +", woodcutting = woodcutting+"+getInt(woodcutting) //$NON-NLS-1$ + +", unarmed = unarmed+"+getInt(unarmed) //$NON-NLS-1$ + +", herbalism = herbalism+"+getInt(herbalism) //$NON-NLS-1$ + +", excavation = excavation+"+getInt(excavation) //$NON-NLS-1$ + +", archery = archery+" +getInt(archery) //$NON-NLS-1$ + +", swords = swords+" +getInt(swords) //$NON-NLS-1$ + +", axes = axes+"+getInt(axes) //$NON-NLS-1$ + +", acrobatics = acrobatics+"+getInt(acrobatics) //$NON-NLS-1$ + +" WHERE user_id = "+id); //$NON-NLS-1$ + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"experience SET " //$NON-NLS-1$ //$NON-NLS-2$ + +" taming = "+getInt(tamingXP) //$NON-NLS-1$ + +", mining = "+getInt(miningXP) //$NON-NLS-1$ + +", repair = "+getInt(repairXP) //$NON-NLS-1$ + +", woodcutting = "+getInt(woodCuttingXP) //$NON-NLS-1$ + +", unarmed = "+getInt(unarmedXP) //$NON-NLS-1$ + +", herbalism = "+getInt(herbalismXP) //$NON-NLS-1$ + +", excavation = "+getInt(excavationXP) //$NON-NLS-1$ + +", archery = " +getInt(archeryXP) //$NON-NLS-1$ + +", swords = " +getInt(swordsXP) //$NON-NLS-1$ + +", axes = "+getInt(axesXP) //$NON-NLS-1$ + +", acrobatics = "+getInt(acrobaticsXP) //$NON-NLS-1$ + +" WHERE user_id = "+id); //$NON-NLS-1$ } else { theCount++; //Create the user in the DB - mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")"); - id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'"); - mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"spawn (user_id) VALUES ("+id+")"); - mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"skills (user_id) VALUES ("+id+")"); - mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"experience (user_id) VALUES ("+id+")"); + mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"users (user, lastlogin) VALUES ('" + playerName + "'," + System.currentTimeMillis() / 1000 +")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + id = mcMMO.database.GetInt("SELECT id FROM "+LoadProperties.MySQLtablePrefix+"users WHERE user = '" + playerName + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"spawn (user_id) VALUES ("+id+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"skills (user_id) VALUES ("+id+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + mcMMO.database.Write("INSERT INTO "+LoadProperties.MySQLtablePrefix+"experience (user_id) VALUES ("+id+")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //Update the skill values - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET lastlogin = " + 0 + " WHERE id = " + id); - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET party = '"+party+"' WHERE id = " +id); + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET lastlogin = " + 0 + " WHERE id = " + id); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"users SET party = '"+party+"' WHERE id = " +id); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ /* if(getDouble(x) > 0 && getDouble(y) > 0 && getDouble(z) > 0) mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"spawn SET world = '" + myspawnworld + "', x = " +getDouble(x)+", y = "+getDouble(y)+", z = "+getDouble(z)+" WHERE user_id = "+id); */ - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET " - +" taming = "+getInt(taming) - +", mining = "+getInt(mining) - +", repair = "+getInt(repair) - +", woodcutting = "+getInt(woodcutting) - +", unarmed = "+getInt(unarmed) - +", herbalism = "+getInt(herbalism) - +", excavation = "+getInt(excavation) - +", archery = " +getInt(archery) - +", swords = " +getInt(swords) - +", axes = "+getInt(axes) - +", acrobatics = "+getInt(acrobatics) - +" WHERE user_id = "+id); - mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"experience SET " - +" taming = "+getInt(tamingXP) - +", mining = "+getInt(miningXP) - +", repair = "+getInt(repairXP) - +", woodcutting = "+getInt(woodCuttingXP) - +", unarmed = "+getInt(unarmedXP) - +", herbalism = "+getInt(herbalismXP) - +", excavation = "+getInt(excavationXP) - +", archery = " +getInt(archeryXP) - +", swords = " +getInt(swordsXP) - +", axes = "+getInt(axesXP) - +", acrobatics = "+getInt(acrobaticsXP) - +" WHERE user_id = "+id); + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"skills SET " //$NON-NLS-1$ //$NON-NLS-2$ + +" taming = "+getInt(taming) //$NON-NLS-1$ + +", mining = "+getInt(mining) //$NON-NLS-1$ + +", repair = "+getInt(repair) //$NON-NLS-1$ + +", woodcutting = "+getInt(woodcutting) //$NON-NLS-1$ + +", unarmed = "+getInt(unarmed) //$NON-NLS-1$ + +", herbalism = "+getInt(herbalism) //$NON-NLS-1$ + +", excavation = "+getInt(excavation) //$NON-NLS-1$ + +", archery = " +getInt(archery) //$NON-NLS-1$ + +", swords = " +getInt(swords) //$NON-NLS-1$ + +", axes = "+getInt(axes) //$NON-NLS-1$ + +", acrobatics = "+getInt(acrobatics) //$NON-NLS-1$ + +" WHERE user_id = "+id); //$NON-NLS-1$ + mcMMO.database.Write("UPDATE "+LoadProperties.MySQLtablePrefix+"experience SET " //$NON-NLS-1$ //$NON-NLS-2$ + +" taming = "+getInt(tamingXP) //$NON-NLS-1$ + +", mining = "+getInt(miningXP) //$NON-NLS-1$ + +", repair = "+getInt(repairXP) //$NON-NLS-1$ + +", woodcutting = "+getInt(woodCuttingXP) //$NON-NLS-1$ + +", unarmed = "+getInt(unarmedXP) //$NON-NLS-1$ + +", herbalism = "+getInt(herbalismXP) //$NON-NLS-1$ + +", excavation = "+getInt(excavationXP) //$NON-NLS-1$ + +", archery = " +getInt(archeryXP) //$NON-NLS-1$ + +", swords = " +getInt(swordsXP) //$NON-NLS-1$ + +", axes = "+getInt(axesXP) //$NON-NLS-1$ + +", acrobatics = "+getInt(acrobaticsXP) //$NON-NLS-1$ + +" WHERE user_id = "+id); //$NON-NLS-1$ } } - System.out.println("[mcMMO] MySQL Updated from users file, "+theCount+" items added/updated to MySQL DB"); + System.out.println("[mcMMO] MySQL Updated from users file, "+theCount+" items added/updated to MySQL DB"); //$NON-NLS-1$ //$NON-NLS-2$ in.close(); } catch (Exception e) { - log.log(Level.SEVERE, "Exception while reading " - + location + " (Are you sure you formatted it correctly?)", e); + log.log(Level.SEVERE, "Exception while reading " //$NON-NLS-1$ + + location + " (Are you sure you formatted it correctly?)", e); //$NON-NLS-1$ } } public static void mmoHelpCheck(String[] split, Player player, PlayerChatEvent event){ PlayerProfile PP = Users.getProfile(player); - if(split[0].equalsIgnoreCase("/taming")){ + if(split[0].equalsIgnoreCase("/taming") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillTaming").toLowerCase())){ //$NON-NLS-1$ event.setCancelled(true); - float skillvalue = (float)PP.getTamingInt(); + float skillvalue = (float)PP.getSkill("taming"); String percentage = String.valueOf((skillvalue / 1000) * 100); - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"TAMING"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Wolves getting harmed"); - player.sendMessage(ChatColor.GRAY+"**NOTE** Offensive skills are bugged due to a bukkit bug"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Beast Lore: "+ChatColor.YELLOW+ChatColor.GREEN+"Bone-whacking inspects wolves"); - player.sendMessage(ChatColor.DARK_AQUA+"Gore: "+ChatColor.YELLOW+ChatColor.GREEN+"Critical Strike that applies Bleed"); - player.sendMessage(ChatColor.DARK_AQUA+"Sharpened Claws: "+ChatColor.YELLOW+ChatColor.GREEN+"Damage Bonus"); - player.sendMessage(ChatColor.DARK_AQUA+"Environmentally Aware: "+ChatColor.YELLOW+ChatColor.GREEN+"Cactus/Lava Phobia, Fall DMG Immune"); - player.sendMessage(ChatColor.DARK_AQUA+"Thick Fur: "+ChatColor.YELLOW+ChatColor.GREEN+"DMG Reduction, Fire Resistance"); - player.sendMessage(ChatColor.DARK_AQUA+"Shock Proof: "+ChatColor.YELLOW+ChatColor.GREEN+"Explosive Damage Reduction"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - if(PP.getTamingInt() < 100) - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 100+ SKILL (ENVIRONMENTALLY AWARE)"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillTaming")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainTaming")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().taming(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("taming"), PP.getSkillToString("tamingXP"), PP.getXpToLevel("taming")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsTaming1_0"), Messages.getString("m.EffectsTaming1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsTaming2_0"), Messages.getString("m.EffectsTaming2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsTaming3_0"), Messages.getString("m.EffectsTaming3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsTaming4_0"), Messages.getString("m.EffectsTaming4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsTaming5_0"), Messages.getString("m.EffectsTaming5_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsTaming6_0"), Messages.getString("m.EffectsTaming6_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + if(PP.getSkill("taming") < 100) + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockTaming1")})); //$NON-NLS-1$ else - player.sendMessage(ChatColor.RED+"Environmentally Aware: "+ChatColor.YELLOW+"Wolves avoid danger"); - if(PP.getTamingInt() < 250) - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 250+ SKILL (THICK FUR)"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusTaming1_0"), Messages.getString("m.AbilBonusTaming1_1")})); //$NON-NLS-1$ + if(PP.getSkill("taming") < 250) + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockTaming2")})); //$NON-NLS-1$ else - player.sendMessage(ChatColor.RED+"Thick Fur: "+ChatColor.YELLOW+"Halved Damage, Fire Resistance"); - if(PP.getTamingInt() < 500) - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 500+ SKILL (SHOCK PROOF)"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusTaming2_0"), Messages.getString("m.AbilBonusTaming2_1")})); //$NON-NLS-1$ + if(PP.getSkill("taming") < 500) + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockTaming3")})); //$NON-NLS-1$ else - player.sendMessage(ChatColor.RED+"Shock Proof: "+ChatColor.YELLOW+"Explosives do 1/6 normal damage"); - if(PP.getTamingInt() < 750) - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 750+ SKILL (SHARPENED CLAWS)"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusTaming3_0"), Messages.getString("m.AbilBonusTaming3_1")})); //$NON-NLS-1$ + if(PP.getSkill("taming") < 750) + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockTaming4")})); //$NON-NLS-1$ else - player.sendMessage(ChatColor.RED+"Sharpened Claws: "+ChatColor.YELLOW+"+2 Damage"); - player.sendMessage(ChatColor.RED+"Gore Chance: "+ChatColor.YELLOW+percentage+"%"); - //player.sendMessage(ChatColor.RED+"Tree Feller Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusTaming4_0"), Messages.getString("m.AbilBonusTaming4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.TamingGoreChance", new Object[] {percentage})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/woodcutting")){ + if(split[0].equalsIgnoreCase("/woodcutting") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillWoodCutting").toLowerCase())){ //$NON-NLS-1$ event.setCancelled(true); - float skillvalue = (float)PP.getWoodCuttingInt(); + float skillvalue = (float)PP.getSkill("woodcutting"); int ticks = 2; - int x = PP.getWoodCuttingInt(); + int x = PP.getSkill("woodcutting"); while(x >= 50){ x-=50; ticks++; } String percentage = String.valueOf((skillvalue / 1000) * 100); - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"WOODCUTTING"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Chopping down trees"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Tree Feller (ABILITY): "+ChatColor.GREEN+"Make trees explode"); - player.sendMessage(ChatColor.DARK_AQUA+"Leaf Blower: "+ChatColor.GREEN+"Blow Away Leaves"); - player.sendMessage(ChatColor.DARK_AQUA+"Double Drops: "+ChatColor.YELLOW+ChatColor.GREEN+"Double the normal loot"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - if(PP.getWoodCuttingInt() < 100) - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 100+ SKILL (LEAF BLOWER)"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillWoodCutting")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainWoodCutting")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().woodcutting(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("woodcutting"), PP.getSkillToString("woodcuttingXP"), PP.getXpToLevel("woodcutting")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsWoodCutting1_0"), Messages.getString("m.EffectsWoodCutting1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsWoodCutting2_0"), Messages.getString("m.EffectsWoodCutting2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsWoodCutting3_0"), Messages.getString("m.EffectsWoodCutting3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + if(PP.getSkill("woodcutting") < 100) + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockWoodCutting1")})); //$NON-NLS-1$ else - player.sendMessage(ChatColor.RED+"Leaf Blower: "+ChatColor.YELLOW+"Blow away leaves"); - player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%"); - player.sendMessage(ChatColor.RED+"Tree Feller Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusWoodCutting1_0"), Messages.getString("m.AbilBonusWoodCutting1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.WoodCuttingDoubleDropChance", new Object[] {percentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.WoodCuttingTreeFellerLength", new Object[] {ticks})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/archery")){ + if(split[0].equalsIgnoreCase("/archery") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillArchery").toLowerCase())){ //$NON-NLS-1$ event.setCancelled(true); Integer rank = 0; - if(PP.getArcheryInt() >= 50) + if(PP.getSkill("archery") >= 50) rank++; - if(PP.getArcheryInt() >= 250) + if(PP.getSkill("archery") >= 250) rank++; - if(PP.getArcheryInt() >= 575) + if(PP.getSkill("archery") >= 575) rank++; - if(PP.getArcheryInt() >= 725) + if(PP.getSkill("archery") >= 725) rank++; - if(PP.getArcheryInt() >= 1000) + if(PP.getSkill("archery") >= 1000) rank++; - float skillvalue = (float)PP.getArcheryInt(); + float skillvalue = (float)PP.getSkill("archery"); String percentage = String.valueOf((skillvalue / 1000) * 100); int ignition = 20; - if(PP.getArcheryInt() >= 200) + if(PP.getSkill("archery") >= 200) ignition+=20; - if(PP.getArcheryInt() >= 400) + if(PP.getSkill("archery") >= 400) ignition+=20; - if(PP.getArcheryInt() >= 600) + if(PP.getSkill("archery") >= 600) ignition+=20; - if(PP.getArcheryInt() >= 800) + if(PP.getSkill("archery") >= 800) ignition+=20; - if(PP.getArcheryInt() >= 1000) + if(PP.getSkill("archery") >= 1000) ignition+=20; String percentagedaze; - if(PP.getArcheryInt() < 1000){ + if(PP.getSkill("archery") < 1000){ percentagedaze = String.valueOf((skillvalue / 2000) * 100); } else { - percentagedaze = "50"; + percentagedaze = "50"; //$NON-NLS-1$ } - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"ARCHERY"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Ignition: "+ChatColor.GREEN+"25% Chance Enemies will ignite"); - player.sendMessage(ChatColor.DARK_AQUA+"Daze (Players): "+ChatColor.GREEN+"Disorients foes"); - player.sendMessage(ChatColor.DARK_AQUA+"Damage+: "+ChatColor.GREEN+"Modifies Damage"); - player.sendMessage(ChatColor.DARK_AQUA+"Arrow Retrieval: "+ChatColor.GREEN+"Chance to retrieve arrows from corpses"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Chance to Daze: "+ChatColor.YELLOW+percentagedaze+"%"); - player.sendMessage(ChatColor.RED+"Chance to Retrieve Arrows: "+ChatColor.YELLOW+percentage+"%"); - player.sendMessage(ChatColor.RED+"Length of Ignition: "+ChatColor.YELLOW+(ignition / 20)+" seconds"); - player.sendMessage(ChatColor.RED+"Damage+ (Rank"+rank+"):"+ChatColor.YELLOW+" Bonus "+rank+" damage"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillArchery")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainArchery")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().archery(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("archery"), PP.getSkillToString("archeryXP"), PP.getXpToLevel("archery")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsArchery1_0"), Messages.getString("m.EffectsArchery1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsArchery2_0"), Messages.getString("m.EffectsArchery2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsArchery3_0"), Messages.getString("m.EffectsArchery3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsArchery4_0"), Messages.getString("m.EffectsArchery4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.ArcheryDazeChance", new Object[] {percentagedaze})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.ArcheryRetrieveChance", new Object[] {percentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.ArcheryIgnitionLength", new Object[] {(ignition / 20)})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.ArcheryDamagePlus", new Object[] {rank})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/axes")){ + if(split[0].equalsIgnoreCase("/axes") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillAxes"))){ //$NON-NLS-1$ event.setCancelled(true); String percentage; - float skillvalue = (float)PP.getAxesInt(); - if(PP.getAxesInt() < 750){ + float skillvalue = (float)PP.getSkill("axes"); + if(PP.getSkill("axes") < 750){ percentage = String.valueOf((skillvalue / 1000) * 100); } else { - percentage = "75"; + percentage = "75"; //$NON-NLS-1$ } int ticks = 2; - int x = PP.getAxesInt(); + int x = PP.getSkill("axes"); while(x >= 50){ x-=50; ticks++; } - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"AXES"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Skull Splitter (ABILITY): "+ChatColor.GREEN+"Deal AoE Damage"); - player.sendMessage(ChatColor.DARK_AQUA+"Critical Strikes: "+ChatColor.GREEN+"Double Damage"); - player.sendMessage(ChatColor.DARK_AQUA+"Axe Mastery (500 SKILL): "+ChatColor.GREEN+"Modifies Damage"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Chance to crtically strike: "+ChatColor.YELLOW+percentage+"%"); - if(PP.getAxesInt() < 500){ - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 500+ SKILL (AXEMASTERY)"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillAxes")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainAxes")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().axes(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("axes"), PP.getSkillToString("axesXP"), PP.getXpToLevel("axes")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsAxes1_0"), Messages.getString("m.EffectsAxes1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsAxes2_0"), Messages.getString("m.EffectsAxes2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsAxes3_0"), Messages.getString("m.EffectsAxes3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.AxesCritChance", new Object[] {percentage})); //$NON-NLS-1$ + if(PP.getSkill("axes") < 500){ + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockAxes1")})); //$NON-NLS-1$ } else { - player.sendMessage(ChatColor.RED+"Axe Mastery:"+ChatColor.YELLOW+" Bonus 4 damage"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusAxes1_0"), Messages.getString("m.AbilBonusAxes1_1")})); //$NON-NLS-1$ } - player.sendMessage(ChatColor.RED+"Skull Splitter Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.AxesSkullLength", new Object[] {ticks})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/swords")){ + if(split[0].equalsIgnoreCase("/swords") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillSwords").toLowerCase())){ //$NON-NLS-1$ event.setCancelled(true); int bleedrank = 2; String percentage, parrypercentage = null, counterattackpercentage; - float skillvalue = (float)PP.getSwordsInt(); - if(PP.getSwordsInt() < 750){ + float skillvalue = (float)PP.getSkill("swords"); + if(PP.getSkill("swords") < 750){ percentage = String.valueOf((skillvalue / 1000) * 100); } else { - percentage = "75"; + percentage = "75"; //$NON-NLS-1$ } if(skillvalue >= 750) bleedrank+=1; - if(PP.getSwordsInt() <= 900){ + if(PP.getSkill("swords") <= 900){ parrypercentage = String.valueOf((skillvalue / 3000) * 100); } else { - parrypercentage = "30"; + parrypercentage = "30"; //$NON-NLS-1$ } - if(PP.getSwordsInt() <= 600){ + if(PP.getSkill("swords") <= 600){ counterattackpercentage = String.valueOf((skillvalue / 2000) * 100); } else { - counterattackpercentage = "30"; + counterattackpercentage = "30"; //$NON-NLS-1$ } int ticks = 2; - int x = PP.getSwordsInt(); + int x = PP.getSkill("swords"); while(x >= 50){ x-=50; ticks++; } - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"SWORDS"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Counter Attack: "+ChatColor.GREEN+"Reflect 50% of damage taken"); - player.sendMessage(ChatColor.DARK_AQUA+"Serrated Strikes (ABILITY): "+ChatColor.GREEN+"25% DMG AoE, Bleed+ AoE"); - player.sendMessage(ChatColor.DARK_GRAY+"Serrated Strikes Bleed+: "+ChatColor.GREEN+"5 Tick Bleed"); - player.sendMessage(ChatColor.DARK_AQUA+"Parrying: "+ChatColor.GREEN+"Negates Damage"); - player.sendMessage(ChatColor.DARK_AQUA+"Bleed: "+ChatColor.GREEN+"Apply a bleed DoT"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Counter Attack Chance: "+ChatColor.YELLOW+counterattackpercentage+"%"); - player.sendMessage(ChatColor.RED+"Bleed Length: "+ChatColor.YELLOW+bleedrank+" ticks"); - player.sendMessage(ChatColor.GRAY+"NOTE: "+ChatColor.YELLOW+"1 Tick happens every 2 seconds"); - player.sendMessage(ChatColor.RED+"Bleed Chance: "+ChatColor.YELLOW+percentage+"%"); - player.sendMessage(ChatColor.RED+"Parry Chance: "+ChatColor.YELLOW+parrypercentage+"%"); - player.sendMessage(ChatColor.RED+"Serrated Strikes Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillSwords")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainSwords")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().swords(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("swords"), PP.getSkillToString("swordsXP"), PP.getXpToLevel("swords")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsSwords1_0"), Messages.getString("m.EffectsSwords1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsSwords2_0"), Messages.getString("m.EffectsSwords2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsSwords3_0"), Messages.getString("m.EffectsSwords3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsSwords4_0"), Messages.getString("m.EffectsSwords4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsSwords5_0"), Messages.getString("m.EffectsSwords5_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SwordsCounterAttChance", new Object[] {counterattackpercentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SwordsBleedLength", new Object[] {bleedrank})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SwordsTickNote")); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SwordsBleedLength", new Object[] {percentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SwordsParryChance", new Object[] {parrypercentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SwordsSSLength", new Object[] {ticks})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/acrobatics")){ + if(split[0].equalsIgnoreCase("/acrobatics") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillAcrobatics").toLowerCase())){ //$NON-NLS-1$ event.setCancelled(true); String dodgepercentage; - float skillvalue = (float)PP.getAcrobaticsInt(); + float skillvalue = (float)PP.getSkill("acrobatics"); String percentage = String.valueOf((skillvalue / 1000) * 100); String gracepercentage = String.valueOf(((skillvalue / 1000) * 100) * 2); - if(PP.getAcrobaticsInt() <= 800){ + if(PP.getSkill("acrobatics") <= 800){ dodgepercentage = String.valueOf((skillvalue / 4000 * 100)); } else { - dodgepercentage = "20"; + dodgepercentage = "20"; } - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"ACROBATICS"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Falling"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Roll: "+ChatColor.GREEN+"Reduces or Negates damage"); - player.sendMessage(ChatColor.DARK_AQUA+"Graceful Roll: "+ChatColor.GREEN+"Twice as effective as Roll"); - player.sendMessage(ChatColor.DARK_AQUA+"Dodge: "+ChatColor.GREEN+"Reduce damage by half"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Roll Chance: "+ChatColor.YELLOW+percentage+"%"); - player.sendMessage(ChatColor.RED+"Graceful Roll Chance: "+ChatColor.YELLOW+gracepercentage+"%"); - player.sendMessage(ChatColor.RED+"Dodge Chance: "+ChatColor.YELLOW+dodgepercentage+"%"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillAcrobatics")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainAcrobatics")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().acrobatics(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("acrobatics"), PP.getSkillToString("acrobaticsXP"), PP.getXpToLevel("acrobatics")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsAcrobatics1_0"), Messages.getString("m.EffectsAcrobatics1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsAcrobatics2_0"), Messages.getString("m.EffectsAcrobatics2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsAcrobatics3_0"), Messages.getString("m.EffectsAcrobatics3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.AcrobaticsRollChance", new Object[] {percentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.AcrobaticsGracefulRollChance", new Object[] {gracepercentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.AcrobaticsDodgeChance", new Object[] {dodgepercentage})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/mining")){ - float skillvalue = (float)PP.getMiningInt(); + if(split[0].equalsIgnoreCase("/mining") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillMining"))){ //$NON-NLS-1$ + float skillvalue = (float)PP.getSkill("mining"); String percentage = String.valueOf((skillvalue / 1000) * 100); int ticks = 2; - int x = PP.getMiningInt(); + int x = PP.getSkill("mining"); while(x >= 50){ x-=50; ticks++; } event.setCancelled(true); - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"MINING"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Mining Stone & Ore"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Super Breaker (ABILITY): "+ChatColor.GREEN+"Speed+, Triple Drop Chance"); - player.sendMessage(ChatColor.DARK_AQUA+"Double Drops: "+ChatColor.GREEN+"Double the normal loot"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%"); - player.sendMessage(ChatColor.RED+"Super Breaker Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillMining")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainMining")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().mining(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("taming"), PP.getSkillToString("tamingXP"), PP.getXpToLevel("taming")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsMining1_0"), Messages.getString("m.EffectsMining1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsMining2_0"), Messages.getString("m.EffectsMining2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.MiningDoubleDropChance", new Object[] {percentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.MiningSuperBreakerLength", new Object[] {ticks})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/repair")){ - float skillvalue = (float)PP.getRepairInt(); + if(split[0].equalsIgnoreCase("/repair") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillRepair").toLowerCase())){ //$NON-NLS-1$ + float skillvalue = (float)PP.getSkill("repair"); String percentage = String.valueOf((skillvalue / 1000) * 100); String repairmastery = String.valueOf((skillvalue / 500) * 100); event.setCancelled(true); - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"REPAIR"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Repairing"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Repair: "+ChatColor.GREEN+"Repair Iron Tools & Armor"); - player.sendMessage(ChatColor.DARK_AQUA+"Repair Mastery: "+ChatColor.GREEN+"Increased repair amount"); - player.sendMessage(ChatColor.DARK_AQUA+"Super Repair: "+ChatColor.GREEN+"Double effectiveness"); - player.sendMessage(ChatColor.DARK_AQUA+"Diamond Repair ("+LoadProperties.repairdiamondlevel+"+ SKILL): "+ChatColor.GREEN+"Repair Diamond Tools & Armor"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Repair Mastery: "+ChatColor.YELLOW+"Extra "+repairmastery+"% durability restored"); - player.sendMessage(ChatColor.RED+"Super Repair Chance: "+ChatColor.YELLOW+percentage+"%"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillRepair")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainRepair")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().repair(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("repair"), PP.getSkillToString("repairXP"), PP.getXpToLevel("repair")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsRepair1_0"), Messages.getString("m.EffectsRepair1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsRepair2_0"), Messages.getString("m.EffectsRepair2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsRepair3_0"), Messages.getString("m.EffectsRepair3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsRepair4_0", new Object[]{LoadProperties.repairdiamondlevel}), Messages.getString("m.EffectsRepair4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.RepairRepairMastery", new Object[] {repairmastery})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.RepairSuperRepairChance", new Object[] {percentage})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/unarmed")){ + if(split[0].equalsIgnoreCase("/unarmed")){ //$NON-NLS-1$ event.setCancelled(true); String percentage, arrowpercentage; - float skillvalue = (float)PP.getUnarmedInt(); + float skillvalue = (float)PP.getSkill("unarmed"); - if(PP.getUnarmedInt() < 1000){ + if(PP.getSkill("unarmed") < 1000){ percentage = String.valueOf((skillvalue / 4000) * 100); } else { - percentage = "25"; + percentage = "25"; //$NON-NLS-1$ } - if(PP.getUnarmedInt() < 1000){ + if(PP.getSkill("unarmed") < 1000){ arrowpercentage = String.valueOf(((skillvalue / 1000) * 100) / 2); } else { - arrowpercentage = "50"; + arrowpercentage = "50"; //$NON-NLS-1$ } int ticks = 2; - int x = PP.getUnarmedInt(); + int x = PP.getSkill("unarmed"); while(x >= 50){ x-=50; ticks++; } - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"UNARMED"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Attacking Monsters"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Berserk (ABILITY): "+ChatColor.GREEN+"+50% DMG, Breaks weak materials"); - player.sendMessage(ChatColor.DARK_AQUA+"Disarm (Players): "+ChatColor.GREEN+"Drops the foes item held in hand"); - player.sendMessage(ChatColor.DARK_AQUA+"Unarmed Mastery: "+ChatColor.GREEN+"Large Damage Upgrade"); - player.sendMessage(ChatColor.DARK_AQUA+"Unarmed Apprentice: "+ChatColor.GREEN+"Damage Upgrade"); - player.sendMessage(ChatColor.DARK_AQUA+"Arrow Deflect: "+ChatColor.GREEN+"Deflect arrows"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Arrow Deflect Chance: "+ChatColor.YELLOW+arrowpercentage+"%"); - player.sendMessage(ChatColor.RED+"Disarm Chance: "+ChatColor.YELLOW+percentage+"%"); - if(PP.getUnarmedInt() < 250){ - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 250+ SKILL (UNARMED APPRENTICE)"); - } else if(PP.getUnarmedInt() >= 250 && PP.getUnarmedInt() < 500){ - player.sendMessage(ChatColor.RED+"Unarmed Apprentice: "+ChatColor.YELLOW+"+2 DMG Upgrade"); - player.sendMessage(ChatColor.GRAY+"LOCKED UNTIL 500+ SKILL (UNARMED MASTERY)"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillUnarmed")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainUnarmed")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().unarmed(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("unarmed"), PP.getSkillToString("unarmedXP"), PP.getXpToLevel("unarmed")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsUnarmed1_0"), Messages.getString("m.EffectsUnarmed1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsUnarmed2_0"), Messages.getString("m.EffectsUnarmed2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsUnarmed3_0"), Messages.getString("m.EffectsUnarmed3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsUnarmed4_0"), Messages.getString("m.EffectsUnarmed4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsUnarmed5_0"), Messages.getString("m.EffectsUnarmed5_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.UnarmedArrowDeflectChance", new Object[] {arrowpercentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.UnarmedDisarmChance", new Object[] {percentage})); //$NON-NLS-1$ + if(PP.getSkill("unarmed") < 250){ + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockUnarmed1")})); //$NON-NLS-1$ + } else if(PP.getSkill("unarmed") >= 250 && PP.getSkill("unarmed") < 500){ + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusUnarmed1_0"), Messages.getString("m.AbilBonusUnarmed1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.AbilityLockTemplate", new Object[] {Messages.getString("m.AbilLockUnarmed2")})); //$NON-NLS-1$ } else { - player.sendMessage(ChatColor.RED+"Unarmed Mastery: "+ChatColor.YELLOW+"+4 DMG Upgrade"); + player.sendMessage(Messages.getString("m.AbilityBonusTemplate", new Object[] {Messages.getString("m.AbilBonusUnarmed2_0"), Messages.getString("m.AbilBonusUnarmed2_1")})); //$NON-NLS-1$ } - player.sendMessage(ChatColor.RED+"Berserk Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.UnarmedBerserkLength", new Object[] {ticks})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/herbalism")){ + if(split[0].equalsIgnoreCase("/herbalism") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillHerbalism").toLowerCase())){ //$NON-NLS-1$ event.setCancelled(true); int rank = 0; - if(PP.getHerbalismInt() >= 50) + if(PP.getSkill("herbalism") >= 50) rank++; - if (PP.getHerbalismInt() >= 150) + if (PP.getSkill("herbalism") >= 150) rank++; - if (PP.getHerbalismInt() >= 250) + if (PP.getSkill("herbalism") >= 250) rank++; - if (PP.getHerbalismInt() >= 350) + if (PP.getSkill("herbalism") >= 350) rank++; - if (PP.getHerbalismInt() >= 450) + if (PP.getSkill("herbalism") >= 450) rank++; - if (PP.getHerbalismInt() >= 550) + if (PP.getSkill("herbalism") >= 550) rank++; - if (PP.getHerbalismInt() >= 650) + if (PP.getSkill("herbalism") >= 650) rank++; - if (PP.getHerbalismInt() >= 750) + if (PP.getSkill("herbalism") >= 750) rank++; int bonus = 0; - if(PP.getHerbalismInt() >= 200) + if(PP.getSkill("herbalism") >= 200) bonus++; - if(PP.getHerbalismInt() >= 400) + if(PP.getSkill("herbalism") >= 400) bonus++; - if(PP.getHerbalismInt() >= 600) + if(PP.getSkill("herbalism") >= 600) bonus++; int ticks = 2; - int x = PP.getHerbalismInt(); + int x = PP.getSkill("herbalism"); while(x >= 50){ x-=50; ticks++; } - float skillvalue = (float)PP.getHerbalismInt(); + float skillvalue = (float)PP.getSkill("herbalism"); String percentage = String.valueOf((skillvalue / 1000) * 100); String gpercentage = String.valueOf((skillvalue / 1500) * 100); - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"HERBALISM"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Harvesting Herbs"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Green Terra (ABILITY): "+ChatColor.GREEN+"Spread the Terra, 3x Drops"); - player.sendMessage(ChatColor.DARK_AQUA+"Green Thumb (Wheat): "+ChatColor.GREEN+"Auto-Plants wheat when harvesting"); - player.sendMessage(ChatColor.DARK_AQUA+"Green Thumb (Cobble): "+ChatColor.GREEN+"Cobblestone -> Mossy w/ Seeds"); - player.sendMessage(ChatColor.DARK_AQUA+"Food+: "+ChatColor.GREEN+"Modifies health received from bread/stew"); - player.sendMessage(ChatColor.DARK_AQUA+"Double Drops (All Herbs): "+ChatColor.GREEN+"Double the normal loot"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Green Terra Length: "+ChatColor.YELLOW+ticks+"s"); - player.sendMessage(ChatColor.RED+"Green Thumb Chance: "+ChatColor.YELLOW+gpercentage+"%"); - player.sendMessage(ChatColor.RED+"Green Thumb Stage: "+ChatColor.YELLOW+"Wheat grows in stage "+bonus); - player.sendMessage(ChatColor.RED+"Double Drop Chance: "+ChatColor.YELLOW+percentage+"%"); - player.sendMessage(ChatColor.RED+"Food+ (Rank"+rank+"): "+ChatColor.YELLOW+"Bonus "+rank+" healing"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillHerbalism")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainHerbalism")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().herbalism(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("herbalism"), PP.getSkillToString("herbalismXP"), PP.getXpToLevel("herbalism")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsHerbalism1_0"), Messages.getString("m.EffectsHerbalism1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsHerbalism2_0"), Messages.getString("m.EffectsHerbalism2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsHerbalism3_0"), Messages.getString("m.EffectsHerbalism3_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsHerbalism4_0"), Messages.getString("m.EffectsHerbalism4_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsHerbalism5_0"), Messages.getString("m.EffectsHerbalism5_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.HerbalismGreenTerraLength", new Object[] {ticks})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.HerbalismGreenThumbChance", new Object[] {gpercentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.HerbalismGreenThumbStage", new Object[] {bonus})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.HerbalismDoubleDropChance", new Object[] {percentage})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.HerbalismFoodPlus", new Object[] {rank})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/excavation")) + + if(split[0].equalsIgnoreCase("/excavation") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillExcavation").toLowerCase())) //$NON-NLS-1$ { event.setCancelled(true); int ticks = 2; - int x = PP.getExcavationInt(); + int x = PP.getSkill("excavation"); while(x >= 50){ x-=50; ticks++; } - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"EXCAVATION"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.DARK_GRAY+"XP GAIN: "+ChatColor.WHITE+"Digging and finding treasures"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"EFFECTS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.DARK_AQUA+"Giga Drill Breaker (ABILITY): "+ChatColor.GREEN+"3x Drop Rate, 3x EXP, +Speed"); - player.sendMessage(ChatColor.DARK_AQUA+"Treasure Hunter: "+ChatColor.GREEN+"Ability to dig for treasure"); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.GREEN+"YOUR STATS"+ChatColor.RED+"[]---"); - player.sendMessage(ChatColor.RED+"Giga Drill Breaker Length: "+ChatColor.YELLOW+ticks+"s"); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillExcavation")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainExcavation")})); //$NON-NLS-1$ + if(mcPermissions.getInstance().excavation(player)) + player.sendMessage(Messages.getString("m.LVL", new Object[] {PP.getSkillToString("excavation"), PP.getSkillToString("excavationXP"), PP.getXpToLevel("excavation")})); + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsExcavation1_0"), Messages.getString("m.EffectsExcavation1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsExcavation2_0"), Messages.getString("m.EffectsExcavation2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.ExcavationGreenTerraLength", new Object[] {ticks})); //$NON-NLS-1$ } - if(split[0].equalsIgnoreCase("/"+LoadProperties.mcmmo)){ + + if(split[0].equalsIgnoreCase("/sorcery") || split[0].toLowerCase().equalsIgnoreCase("/"+Messages.getString("m.SkillSorcery").toLowerCase())) //$NON-NLS-1$ + { event.setCancelled(true); - player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"mMO"+ChatColor.RED+"[]-----"); - player.sendMessage(ChatColor.YELLOW+"mcMMO is an RPG server mod for minecraft."); - player.sendMessage(ChatColor.YELLOW+"There are many skills added by mcMMO to minecraft."); - player.sendMessage(ChatColor.YELLOW+"They can do anything from giving a chance"); - player.sendMessage(ChatColor.YELLOW+"for double drops to letting you break materials instantly."); - player.sendMessage(ChatColor.YELLOW+"For example, by harvesting logs from trees you will gain"); - player.sendMessage(ChatColor.YELLOW+"Woodcutting xp and once you have enough xp you will gain"); - player.sendMessage(ChatColor.YELLOW+"a skill level in Woodcutting. By raising this skill you will"); - player.sendMessage(ChatColor.YELLOW+"be able to receive benefits like "+ChatColor.RED+"double drops"); - player.sendMessage(ChatColor.YELLOW+"and increase the effects of the "+ChatColor.RED+"\"Tree Felling\""+ChatColor.YELLOW+" ability."); - player.sendMessage(ChatColor.YELLOW+"mMO has abilities related to the skill, skills normally"); - player.sendMessage(ChatColor.YELLOW+"provide passive bonuses but they also have activated"); - player.sendMessage(ChatColor.YELLOW+"abilities too. Each ability is activated by holding"); - player.sendMessage(ChatColor.YELLOW+"the appropriate tool and "+ChatColor.RED+"right clicking."); - player.sendMessage(ChatColor.YELLOW+"For example, if you hold a Mining Pick and right click"); - player.sendMessage(ChatColor.YELLOW+"you will ready your Pickaxe, attack mining materials"); - player.sendMessage(ChatColor.YELLOW+"and then "+ChatColor.RED+"Super Breaker "+ChatColor.YELLOW+"will activate."); - player.sendMessage(ChatColor.GREEN+"Find out mcMMO commands with "+ChatColor.DARK_AQUA+"/"+LoadProperties.mcc); - player.sendMessage(ChatColor.GREEN+"You can donate via paypal to"+ChatColor.DARK_RED+" nossr50@gmail.com"); + + /* + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.SkillExcavation")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.XPGain", new Object[] {Messages.getString("m.XPGainExcavation")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.Effects")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsExcavation1_0"), Messages.getString("m.EffectsExcavation1_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.EffectsTemplate", new Object[] {Messages.getString("m.EffectsExcavation2_0"), Messages.getString("m.EffectsExcavation2_1")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.SkillHeader", new Object[] {Messages.getString("m.YourStats")})); //$NON-NLS-1$ + player.sendMessage(Messages.getString("m.ExcavationGreenTerraLength", new Object[] {ticks})); //$NON-NLS-1$ + */ } - if(split[0].equalsIgnoreCase("/"+LoadProperties.mcc)){ + + if(LoadProperties.mcmmoEnable && split[0].equalsIgnoreCase("/"+LoadProperties.mcmmo)){ + event.setCancelled(true); + player.sendMessage(ChatColor.RED+"-----[]"+ChatColor.GREEN+"mMO"+ChatColor.RED+"[]-----"); + player.sendMessage(ChatColor.YELLOW+"mcMMO is an RPG server mod for minecraft."); + player.sendMessage(ChatColor.YELLOW+"There are many skills added by mcMMO to minecraft."); + player.sendMessage(ChatColor.YELLOW+"They can do anything from giving a chance"); + player.sendMessage(ChatColor.YELLOW+"for double drops to letting you break materials instantly."); + player.sendMessage(ChatColor.YELLOW+"For example, by harvesting logs from trees you will gain"); + player.sendMessage(ChatColor.YELLOW+"Woodcutting xp and once you have enough xp you will gain"); + player.sendMessage(ChatColor.YELLOW+"a skill level in Woodcutting. By raising this skill you will"); + player.sendMessage(ChatColor.YELLOW+"be able to receive benefits like "+ChatColor.RED+"double drops"); + player.sendMessage(ChatColor.YELLOW+"and increase the effects of the "+ChatColor.RED+"\"Tree Felling\""+ChatColor.YELLOW+" ability."); + player.sendMessage(ChatColor.YELLOW+"mMO has abilities related to the skill, skills normally"); + player.sendMessage(ChatColor.YELLOW+"provide passive bonuses but they also have activated"); + player.sendMessage(ChatColor.YELLOW+"abilities too. Each ability is activated by holding"); + player.sendMessage(ChatColor.YELLOW+"the appropriate tool and "+ChatColor.RED+"right clicking."); + player.sendMessage(ChatColor.YELLOW+"For example, if you hold a Mining Pick and right click"); + player.sendMessage(ChatColor.YELLOW+"you will ready your Pickaxe, attack mining materials"); + player.sendMessage(ChatColor.YELLOW+"and then "+ChatColor.RED+"Super Breaker "+ChatColor.YELLOW+"will activate."); + player.sendMessage(ChatColor.GREEN+"Find out mcMMO commands with "+ChatColor.DARK_AQUA+"/"+LoadProperties.mcc); + player.sendMessage(ChatColor.GREEN+"You can donate via paypal to"+ChatColor.DARK_RED+" nossr50@gmail.com"); + } + if(LoadProperties.mccEnable && split[0].equalsIgnoreCase("/"+LoadProperties.mcc)){ event.setCancelled(true); - player.sendMessage(ChatColor.RED+"---[]"+ChatColor.YELLOW+"mcMMO Commands"+ChatColor.RED+"[]---"); + player.sendMessage(ChatColor.RED+"---[]"+ChatColor.YELLOW+"mcMMO Commands"+ChatColor.RED+"[]---"); if(mcPermissions.getInstance().party(player)){ - player.sendMessage(ChatColor.GREEN+"--PARTY COMMANDS--"); - player.sendMessage("/"+LoadProperties.party+" [party name] "+ChatColor.RED+"- Create/Join designated party"); - player.sendMessage("/"+LoadProperties.party+" q "+ChatColor.RED+"- Leave your current party"); + player.sendMessage(Messages.getString("m.mccPartyCommands")); + player.sendMessage("/"+LoadProperties.party+" "+Messages.getString("m.mccParty")); + player.sendMessage("/"+LoadProperties.party+" q "+Messages.getString("m.mccPartyQ")); if(mcPermissions.getInstance().partyChat(player)) - player.sendMessage("/p "+ChatColor.RED+" - Toggle Party Chat"); - player.sendMessage("/"+LoadProperties.invite+" [player name] "+ChatColor.RED+"- Send party invite"); - player.sendMessage("/"+LoadProperties.accept+" "+ChatColor.RED+"- Accept party invite"); + player.sendMessage("/p "+Messages.getString("m.mccPartyToggle")); + player.sendMessage("/"+LoadProperties.invite+" "+Messages.getString("m.mccPartyInvite")); + player.sendMessage("/"+LoadProperties.accept+" "+Messages.getString("m.mccPartyAccept")); if(mcPermissions.getInstance().partyTeleport(player)) - player.sendMessage("/"+LoadProperties.ptp+" [party member name] "+ChatColor.RED+"- Teleport to party member"); + player.sendMessage("/"+LoadProperties.ptp+" "+Messages.getString("m.mccPartyTeleport")); } - player.sendMessage(ChatColor.GREEN+"--OTHER COMMANDS--"); - player.sendMessage("/"+LoadProperties.stats+ChatColor.RED+" - View your mcMMO stats"); - player.sendMessage("/mctop "+ChatColor.RED+"- Leaderboards"); + player.sendMessage(Messages.getString("m.mccOtherCommands")); + player.sendMessage("/"+LoadProperties.stats+ChatColor.RED+" "+Messages.getString("m.mccStats")); + player.sendMessage("/mctop "+ChatColor.RED+Messages.getString("m.mccLeaderboards")); if(mcPermissions.getInstance().mySpawn(player)){ - player.sendMessage("/"+LoadProperties.myspawn+" "+ChatColor.RED+"- Clears inventory & teleports to myspawn"); - player.sendMessage("/"+LoadProperties.clearmyspawn+" "+ChatColor.RED+"- Clears your MySpawn"); + player.sendMessage("/"+LoadProperties.myspawn+" "+ChatColor.RED+Messages.getString("m.mccMySpawn")); + player.sendMessage("/"+LoadProperties.clearmyspawn+" "+ChatColor.RED+Messages.getString("m.mccClearMySpawn")); } if(mcPermissions.getInstance().mcAbility(player)) - player.sendMessage("/"+LoadProperties.mcability+ChatColor.RED+" - Toggle ability activation with right click"); + player.sendMessage("/"+LoadProperties.mcability+ChatColor.RED+" "+Messages.getString("m.mccToggleAbility")); if(mcPermissions.getInstance().adminChat(player)){ - player.sendMessage("/a "+ChatColor.RED+"- Toggle admin chat"); + player.sendMessage("/a "+ChatColor.RED+Messages.getString("m.mccAdminToggle")); } if(mcPermissions.getInstance().whois(player)) - player.sendMessage("/"+LoadProperties.whois+" [playername] "+ChatColor.RED+"- View detailed player info"); + player.sendMessage("/"+LoadProperties.whois+" "+Messages.getString("m.mccWhois")); if(mcPermissions.getInstance().mmoedit(player)){ //player.sendMessage("/"+LoadProperties.mmoedit+" [skill] [newvalue] "+ChatColor.RED+"Modify the designated skill value"); - player.sendMessage("/"+LoadProperties.mmoedit+" [playername] [skill] [newvalue] "+ChatColor.RED+"- Modify target"); + player.sendMessage("/"+LoadProperties.mmoedit+Messages.getString("m.mccMmoedit")); } if(mcPermissions.getInstance().mcgod(player)) - player.sendMessage("/"+LoadProperties.mcgod+ChatColor.RED+" - God Mode"); - player.sendMessage("/[skillname] "+ChatColor.RED+" View detailed information about a skill"); - player.sendMessage("/"+LoadProperties.mcmmo+" "+ChatColor.RED+"- Read brief mod description"); + player.sendMessage("/"+LoadProperties.mcgod+ChatColor.RED+" "+Messages.getString("m.mccMcGod")); + player.sendMessage("/"+Messages.getString("m.mccSkillInfo")); + player.sendMessage("/"+LoadProperties.mcmmo+" "+Messages.getString("m.mccModDescription")); } } } diff --git a/mcMMO/com/gmail/nossr50/mcBlockListener.java b/mcMMO/com/gmail/nossr50/mcBlockListener.java index 33a2bca14..6615708de 100644 --- a/mcMMO/com/gmail/nossr50/mcBlockListener.java +++ b/mcMMO/com/gmail/nossr50/mcBlockListener.java @@ -1,12 +1,9 @@ package com.gmail.nossr50; -import org.bukkit.ChatColor; - import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import org.bukkit.Material; import org.bukkit.Statistic; -import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockBreakEvent; @@ -16,11 +13,7 @@ import org.bukkit.event.block.BlockListener; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.config.*; -import com.gmail.nossr50.datatypes.*; import com.gmail.nossr50.skills.*; -import com.gmail.nossr50.party.*; - import com.gmail.nossr50.datatypes.FakeBlockBreakEvent; @@ -31,26 +24,40 @@ public class mcBlockListener extends BlockListener { this.plugin = plugin; } - public void onBlockPlace(BlockPlaceEvent event) { + public void onBlockPlace(BlockPlaceEvent event) + { + long before = System.currentTimeMillis(); Block block; Player player = event.getPlayer(); - if (event.getBlock() != null && event.getBlockReplacedState() != null && event.getBlockReplacedState().getTypeId() == 78) { + if (event.getBlock() != null && event.getBlockReplacedState() != null && event.getBlockReplacedState().getTypeId() == 78) + { block = event.getBlockAgainst(); } - else { + else + { block = event.getBlock(); } - if(player != null && m.shouldBeWatched(block)){ - if(block.getTypeId() != 17) + if(player != null && m.shouldBeWatched(block)) + { + if(block.getTypeId() != 17 && block.getTypeId() != 39 && block.getTypeId() != 40 && block.getTypeId() != 91 && block.getTypeId() != 86) block.setData((byte) 5); //Change the byte - if(block.getTypeId() == 17 || block.getTypeId() == 91 || block.getTypeId() == 86) - Config.getInstance().addBlockWatch(block); + if(block.getTypeId() == 17 || block.getTypeId() == 39 || block.getTypeId() == 40 || block.getTypeId() == 91 || block.getTypeId() == 86) + plugin.misc.blockWatchList.add(block); } if(block.getTypeId() == 42 && LoadProperties.anvilmessages) - event.getPlayer().sendMessage(ChatColor.DARK_RED+"You have placed an anvil, anvils can repair tools and armor."); + event.getPlayer().sendMessage(Messages.getString("mcBlockListener.PlacedAnvil")); //$NON-NLS-1$ + + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onBlockPlace+=(after-before); + } } - public void onBlockBreak(BlockBreakEvent event) { + public void onBlockBreak(BlockBreakEvent event) + { + long before = System.currentTimeMillis(); + Player player = event.getPlayer(); PlayerProfile PP = Users.getProfile(player); Block block = event.getBlock(); @@ -59,21 +66,19 @@ public class mcBlockListener extends BlockListener { return; if (event instanceof FakeBlockBreakEvent) return; - /* - * Check if the Timer is doing its job - */ - Skills.monitorSkills(player); /* * HERBALISM */ - if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && block.getTypeId() == 59 && block.getData() == (byte) 0x07){ + if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalismAbility(player) && block.getTypeId() == 59 && block.getData() == (byte) 0x07) + { Herbalism.greenTerraCheck(player, block, plugin); } //Wheat && Triple drops - if(PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block)){ - Herbalism.herbalismProcCheck(block, player, event); - Herbalism.greenTerraWheat(player, block, event); + if(PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(block)) + { + Herbalism.herbalismProcCheck(block, player, event, plugin); + Herbalism.greenTerraWheat(player, block, event, plugin); } @@ -83,43 +88,49 @@ public class mcBlockListener extends BlockListener { if(mcPermissions.getInstance().mining(player)){ if(LoadProperties.miningrequirespickaxe){ if(m.isMiningPick(inhand)) - Mining.miningBlockCheck(player, block); + Mining.miningBlockCheck(player, block, plugin); } else { - Mining.miningBlockCheck(player, block); + Mining.miningBlockCheck(player, block, plugin); } } /* * WOOD CUTTING */ - if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)){ - if(LoadProperties.woodcuttingrequiresaxe){ - if(m.isAxes(inhand)){ - if(!Config.getInstance().isBlockWatched(block)){ + if(player != null && block.getTypeId() == 17 && mcPermissions.getInstance().woodcutting(player)) + { + if(LoadProperties.woodcuttingrequiresaxe) + { + if(m.isAxes(inhand)) + { + if(!plugin.misc.blockWatchList.contains(block)) + { WoodCutting.woodCuttingProcCheck(player, block); //Default if(block.getData() == (byte)0) - PP.addWoodcuttingXP(7 * LoadProperties.xpGainMultiplier); + PP.addWoodcuttingXP(LoadProperties.mpine * LoadProperties.xpGainMultiplier); //Spruce if(block.getData() == (byte)1) - PP.addWoodcuttingXP(8 * LoadProperties.xpGainMultiplier); + PP.addWoodcuttingXP(LoadProperties.mspruce * LoadProperties.xpGainMultiplier); //Birch if(block.getData() == (byte)2) - PP.addWoodcuttingXP(9 * LoadProperties.xpGainMultiplier); + PP.addWoodcuttingXP(LoadProperties.mbirch * LoadProperties.xpGainMultiplier); } } - } else { - if(!Config.getInstance().isBlockWatched(block)){ + } else + { + if(!plugin.misc.blockWatchList.contains(block)) + { WoodCutting.woodCuttingProcCheck(player, block); //Default if(block.getData() == (byte)0) - PP.addWoodcuttingXP(7 * LoadProperties.xpGainMultiplier); + PP.addWoodcuttingXP(LoadProperties.mpine * LoadProperties.xpGainMultiplier); //Spruce if(block.getData() == (byte)1) - PP.addWoodcuttingXP(8 * LoadProperties.xpGainMultiplier); + PP.addWoodcuttingXP(LoadProperties.mspruce * LoadProperties.xpGainMultiplier); //Birch if(block.getData() == (byte)2) - PP.addWoodcuttingXP(9 * LoadProperties.xpGainMultiplier); + PP.addWoodcuttingXP(LoadProperties.mbirch * LoadProperties.xpGainMultiplier); } } Skills.XpCheck(player); @@ -132,8 +143,9 @@ public class mcBlockListener extends BlockListener { && block.getTypeId() == 17 && m.blockBreakSimulate(block, player, plugin)){ - WoodCutting.treeFeller(block, player); - for(Block blockx : Config.getInstance().getTreeFeller()){ + WoodCutting.treeFeller(block, player, plugin); + for(Block blockx : plugin.misc.treeFeller) + { if(blockx != null){ Material mat = Material.getMaterial(block.getTypeId()); byte type = 0; @@ -143,12 +155,14 @@ public class mcBlockListener extends BlockListener { if(blockx.getTypeId() == 17){ blockx.getLocation().getWorld().dropItemNaturally(blockx.getLocation(), item); //XP WOODCUTTING - if(!Config.getInstance().isBlockWatched(block)){ + if(!plugin.misc.blockWatchList.contains(block)) + { WoodCutting.woodCuttingProcCheck(player, blockx); - PP.addWoodcuttingXP(7); + PP.addWoodcuttingXP(LoadProperties.mpine); } } - if(blockx.getTypeId() == 18){ + if(blockx.getTypeId() == 18) + { mat = Material.SAPLING; item = new ItemStack(mat, 1, (short)0, blockx.getData()); @@ -163,7 +177,7 @@ public class mcBlockListener extends BlockListener { } if(LoadProperties.toolsLoseDurabilityFromAbilities) m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss); - Config.getInstance().clearTreeFeller(); + plugin.misc.treeFeller.clear(); } } /* @@ -174,27 +188,42 @@ public class mcBlockListener extends BlockListener { /* * HERBALISM */ - if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(block)){ + if(PP.getHoePreparationMode() && mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(block)) + { Herbalism.greenTerraCheck(player, block, plugin); } if(mcPermissions.getInstance().herbalism(player) && block.getData() != (byte) 5) - Herbalism.herbalismProcCheck(block, player, event); + Herbalism.herbalismProcCheck(block, player, event, plugin); //Change the byte back when broken if(block.getData() == 5 && m.shouldBeWatched(block)) + { block.setData((byte) 0); + if(plugin.misc.blockWatchList.contains(block)) + { + plugin.misc.blockWatchList.remove(block); + } + } + + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onBlockBreak+=(after-before); + } } - public void onBlockDamage(BlockDamageEvent event) { + public void onBlockDamage(BlockDamageEvent event) + { + long before = System.currentTimeMillis(); + if(event.isCancelled()) return; Player player = event.getPlayer(); PlayerProfile PP = Users.getProfile(player); ItemStack inhand = player.getItemInHand(); Block block = event.getBlock(); - /* - * Check if the Timer is doing its job - */ - Skills.monitorSkills(player); + + Skills.monitorSkills(player); + /* * ABILITY PREPARATION CHECKS */ @@ -219,10 +248,7 @@ public class mcBlockListener extends BlockListener { /* * GIGA DRILL BREAKER CHECKS */ - if(PP.getGigaDrillBreakerMode() - && m.blockBreakSimulate(block, player, plugin) - && Excavation.canBeGigaDrillBroken(block) - && m.isShovel(inhand)){ + if(PP.getGigaDrillBreakerMode() && m.blockBreakSimulate(block, player, plugin) && Excavation.canBeGigaDrillBroken(block) && m.isShovel(inhand)){ if(m.getTier(player) >= 2) Excavation.excavationProcCheck(block, player); @@ -265,20 +291,22 @@ public class mcBlockListener extends BlockListener { */ if(PP.getSuperBreakerMode() && Mining.canBeSuperBroken(block) - && m.blockBreakSimulate(block, player, plugin)){ + && m.blockBreakSimulate(block, player, plugin)) + { - if(LoadProperties.miningrequirespickaxe){ + if(LoadProperties.miningrequirespickaxe) + { if(m.isMiningPick(inhand)) - Mining.SuperBreakerBlockCheck(player, block); + Mining.SuperBreakerBlockCheck(player, block, plugin); } else { - Mining.SuperBreakerBlockCheck(player, block); + Mining.SuperBreakerBlockCheck(player, block, plugin); } } /* * LEAF BLOWER */ - if(block.getTypeId() == 18 && mcPermissions.getInstance().woodcutting(player) && PP.getWoodCuttingInt() >= 100 && m.isAxes(player.getItemInHand()) && m.blockBreakSimulate(block, player, plugin)) + if(block.getTypeId() == 18 && mcPermissions.getInstance().woodcutting(player) && PP.getSkill("woodcutting") >= 100 && m.isAxes(player.getItemInHand()) && m.blockBreakSimulate(block, player, plugin)) { m.damageTool(player, (short)1); if(Math.random() * 10 > 9) @@ -289,13 +317,31 @@ public class mcBlockListener extends BlockListener { block.setType(Material.AIR); player.incrementStatistic(Statistic.MINE_BLOCK, event.getBlock().getType()); } + if(block.getType() == Material.AIR && plugin.misc.blockWatchList.contains(block)) + { + plugin.misc.blockWatchList.remove(block); + } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onBlockDamage+=(after-before); + } } - public void onBlockFromTo(BlockFromToEvent event) { + public void onBlockFromTo(BlockFromToEvent event) + { + long before = System.currentTimeMillis(); + Block blockFrom = event.getBlock(); Block blockTo = event.getToBlock(); - if(m.shouldBeWatched(blockFrom) && blockFrom.getData() == (byte)5){ + if(m.shouldBeWatched(blockFrom) && blockFrom.getData() == (byte)5) + { blockTo.setData((byte)5); } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onBlockFromTo+=(after-before); + } } } \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/mcEntityListener.java b/mcMMO/com/gmail/nossr50/mcEntityListener.java index 9000e35ca..5bfdda00b 100644 --- a/mcMMO/com/gmail/nossr50/mcEntityListener.java +++ b/mcMMO/com/gmail/nossr50/mcEntityListener.java @@ -2,23 +2,22 @@ package com.gmail.nossr50; import net.minecraft.server.EntityLiving; -import org.bukkit.ChatColor; -import org.bukkit.Location; import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.entity.Arrow; import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.entity.Wolf; import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.EntityDamageByEntityEvent; -import org.bukkit.event.entity.EntityDamageByProjectileEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.event.entity.EntityListener; +import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.party.Party; @@ -33,13 +32,7 @@ public class mcEntityListener extends EntityListener { public mcEntityListener(final mcMMO plugin) { this.plugin = plugin; } - public boolean isBow(ItemStack is){ - if (is.getTypeId() == 261){ - return true; - } else { - return false; - } - } + /* public void onCreatureSpawn(CreatureSpawnEvent event) { Location loc = event.getLocation(); Entity spawnee = event.getEntity(); @@ -47,16 +40,18 @@ public class mcEntityListener extends EntityListener { Config.getInstance().addMobSpawnTrack(spawnee); } } - public void onEntityDamage(EntityDamageEvent event) { + */ + public void onEntityDamage(EntityDamageEvent event) + { + long before = System.currentTimeMillis(); + if(event.isCancelled()) return; - /* - * CHECK FOR mcMMO PVP FLAG - */ + //Check for world pvp flag if(event instanceof EntityDamageByEntityEvent) { EntityDamageByEntityEvent eventb = (EntityDamageByEntityEvent)event; - if(eventb.getEntity() instanceof Player && eventb.getDamager() instanceof Player && !LoadProperties.pvp) + if(eventb.getEntity() instanceof Player && eventb.getDamager() instanceof Player && !event.getEntity().getWorld().getPVP()) return; } /* @@ -66,7 +61,7 @@ public class mcEntityListener extends EntityListener { { Player defender = (Player)event.getEntity(); PlayerProfile PPd = Users.getProfile(defender); - if(defender != null && Config.getInstance().isGodModeToggled(defender.getName())) + if(defender != null && PPd.getGodMode()) event.setCancelled(true); if(PPd == null) Users.addUser(defender); @@ -82,23 +77,24 @@ public class mcEntityListener extends EntityListener { { Entity x = event.getEntity(); DamageCause type = event.getCause(); - if(event.getEntity() instanceof Wolf) + if(event.getEntity() instanceof Wolf && ((Wolf)event.getEntity()).isTamed() && Taming.getOwner(((Wolf)event.getEntity()), plugin) != null) { - Player master = Taming.getOwner(event.getEntity(), plugin); + Wolf theWolf = (Wolf) event.getEntity(); + Player master = Taming.getOwner(theWolf, plugin); PlayerProfile PPo = Users.getProfile(master); if(master == null || PPo == null) return; //Environmentally Aware - if((event.getCause() == DamageCause.CONTACT || event.getCause() == DamageCause.LAVA || event.getCause() == DamageCause.FIRE) && PPo.getTamingInt() >= 100) + if((event.getCause() == DamageCause.CONTACT || event.getCause() == DamageCause.LAVA || event.getCause() == DamageCause.FIRE) && PPo.getSkill("taming") >= 100) { if(event.getDamage() < ((Wolf) event.getEntity()).getHealth()) { - event.getEntity().teleport(Taming.getOwner(event.getEntity(), plugin).getLocation()); - master.sendMessage(ChatColor.DARK_GRAY+"Your wolf scurries back to you..."); + event.getEntity().teleport(Taming.getOwner(theWolf, plugin).getLocation()); + master.sendMessage(Messages.getString("mcEntityListener.WolfComesBack")); //$NON-NLS-1$ event.getEntity().setFireTicks(0); } } - if(event.getCause() == DamageCause.FALL && PPo.getTamingInt() >= 100) + if(event.getCause() == DamageCause.FALL && PPo.getSkill("taming") >= 100) { event.setCancelled(true); } @@ -151,26 +147,94 @@ public class mcEntityListener extends EntityListener { } } } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onEntityDamage+=(after-before); + } } - public void onEntityDeath(EntityDeathEvent event) { + public void onEntityDeath(EntityDeathEvent event) + { + long before = System.currentTimeMillis(); Entity x = event.getEntity(); x.setFireTicks(0); - //Remove bleed track - if(Config.getInstance().isBleedTracked(x)) - Config.getInstance().addToBleedRemovalQue(x); + //cleanup mob diff + if(plugin.mob.mobDiff.containsKey(event.getEntity().getEntityId())) + plugin.mob.mobDiff.remove(event.getEntity().getEntityId()); - Skills.arrowRetrievalCheck(x); + + //Remove bleed track + if(plugin.misc.bleedTracker.contains((LivingEntity)x)) + plugin.misc.addToBleedRemovalQue((LivingEntity)x); + + Skills.arrowRetrievalCheck(x, plugin); + /* if(Config.getInstance().isMobSpawnTracked(x)){ Config.getInstance().removeMobSpawnTrack(x); } + */ if(x instanceof Player){ Player player = (Player)x; Users.getProfile(player).setBleedTicks(0); } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onEntityDeath+=(after-before); + } } - public boolean isPlayer(Entity entity){ + + public void onCreatureSpawn(CreatureSpawnEvent event) + { + long before = System.currentTimeMillis(); + SpawnReason reason = event.getSpawnReason(); + + if(reason == SpawnReason.SPAWNER && !LoadProperties.xpGainsMobSpawners) + { + plugin.misc.mobSpawnerList.add(event.getEntity()); + } else + { + if(event.getEntity() instanceof Monster && !plugin.mob.mobDiff.containsKey(event.getEntity().getEntityId())) + plugin.mob.assignDifficulty(event.getEntity()); + } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onCreatureSpawn+=(after-before); + } + } + + public void onEntityTarget(EntityTargetEvent event) + { + long before = System.currentTimeMillis(); + int type = event.getEntity().getEntityId(); + //Make 3+ non-aggressive + if(event.getEntity() instanceof Monster + && plugin.mob.mobDiff.containsKey(type) + && plugin.mob.isAggressive.containsKey(type)) + { + if(plugin.mob.mobDiff.get(type) >= 2 && plugin.mob.isAggressive.get(type) == false) + { + event.setCancelled(true); + event.setTarget(null); + } + } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onEntityTarget+=(after-before); + } + } + public boolean isBow(ItemStack is){ + if (is.getTypeId() == 261){ + return true; + } else { + return false; + } + } + public boolean isPlayer(Entity entity){ if (entity instanceof Player) { return true; } else{ diff --git a/mcMMO/com/gmail/nossr50/mcMMO.java b/mcMMO/com/gmail/nossr50/mcMMO.java index 5fe95eae5..75b938319 100644 --- a/mcMMO/com/gmail/nossr50/mcMMO.java +++ b/mcMMO/com/gmail/nossr50/mcMMO.java @@ -2,9 +2,7 @@ package com.gmail.nossr50; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.config.*; -import com.gmail.nossr50.datatypes.*; import com.gmail.nossr50.skills.*; -import com.gmail.nossr50.party.*; import com.nijikokun.bukkit.Permissions.Permissions; import com.nijiko.Messaging; import com.nijiko.permissions.PermissionHandler; @@ -13,19 +11,7 @@ import org.bukkit.plugin.Plugin; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; - -import java.sql.PreparedStatement; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; -import java.sql.Connection; -import java.sql.Statement; -import java.sql.ResultSet; - - import java.util.ArrayList; -import java.util.HashMap; import java.util.Timer; import java.util.logging.Level; import java.util.logging.Logger; @@ -37,25 +23,85 @@ import org.bukkit.plugin.PluginManager; import org.bukkit.entity.Player; -public class mcMMO extends JavaPlugin { - public static String maindirectory = "plugins/mcMMO/"; - static File Properties = new File(maindirectory + "mcmmo.properties"); - public static final Logger log = Logger.getLogger("Minecraft"); +public class mcMMO extends JavaPlugin +{ + public static String maindirectory = "plugins/mcMMO/"; //$NON-NLS-1$ + File file = new File(maindirectory + File.separator + "config.yml"); + public static final Logger log = Logger.getLogger("Minecraft"); //$NON-NLS-1$ private final mcPlayerListener playerListener = new mcPlayerListener(this); private final mcBlockListener blockListener = new mcBlockListener(this); private final mcEntityListener entityListener = new mcEntityListener(this); - private final String name = "mcMMO"; + private final String name = "mcMMO"; //$NON-NLS-1$ public static PermissionHandler PermissionsHandler = null; private Permissions permissions; - private Timer mcMMO_Timer = new Timer(true); + + //PERFORMANCE DEBUG STUFF + public long onPlayerRespawn=0, onPlayerQuit=0, onPlayerLogin=0, onPlayerInteract=0,onPlayerJoin=0, onPlayerCommandPreprocess=0, onPlayerChat=0, onBlockDamage=0, onBlockBreak=0, onBlockFromTo=0, onBlockPlace=0, + onEntityTarget=0, onEntityDeath=0, onEntityDamage=0, onCreatureSpawn=0, bleedSimulation=0, mcTimerx=0; + + public void printDelays() + { + log.log(Level.INFO,"####mcMMO PERFORMANCE REPORT####"); + log.log(Level.INFO,"[These are the cumulative milliseconds mcMMO has lagged in the last 40 seconds]"); + log.log(Level.INFO,"[1000ms = 1 second, lower is better]"); + + log.log(Level.INFO,"onPlayerRespawn: "+onPlayerRespawn+"ms"); + log.log(Level.INFO,"onPlayerQuit: "+onPlayerQuit+"ms"); + log.log(Level.INFO,"onPlayerLogin: "+onPlayerLogin+"ms"); + log.log(Level.INFO,"onPlayerInteract: "+onPlayerInteract+"ms"); + log.log(Level.INFO,"onPlayerJoin: "+onPlayerJoin+"ms"); + log.log(Level.INFO,"onPlayerCommandPreProcess: "+onPlayerCommandPreprocess+"ms"); + log.log(Level.INFO,"onPlayerChat: "+onPlayerChat+"ms"); + + log.log(Level.INFO,"onBlockDamage: "+onBlockDamage+"ms"); + log.log(Level.INFO,"onBlockBreak: "+onBlockBreak+"ms"); + log.log(Level.INFO,"onBlockFromTo: "+onBlockFromTo+"ms"); + log.log(Level.INFO,"onBlockPlace: "+onBlockPlace+"ms"); + + log.log(Level.INFO,"onEntityTarget: "+onEntityTarget+"ms"); + log.log(Level.INFO,"onEntityDeath: "+onEntityDeath+"ms"); + log.log(Level.INFO,"onEntityDamage: "+onEntityDamage+"ms"); + log.log(Level.INFO,"onCreatureSpawn: "+onCreatureSpawn+"ms"); + + log.log(Level.INFO,"mcTimer (HPREGEN/ETC): "+mcTimerx+"ms"); + log.log(Level.INFO,"bleedSimulation: "+bleedSimulation+"ms"); + log.log(Level.INFO,"####mcMMO END OF PERFORMANCE REPORT####"); + + onPlayerRespawn=0; + onPlayerQuit=0; + onPlayerLogin=0; + onPlayerJoin=0; + onPlayerInteract=0; + onPlayerCommandPreprocess=0; + onPlayerChat=0; + onBlockDamage=0; + onBlockBreak=0; + onBlockFromTo=0; + onBlockPlace=0; + onEntityTarget=0; + onEntityDeath=0; + onEntityDamage=0; + onCreatureSpawn=0; + mcTimerx=0; + bleedSimulation=0; + } + + private Timer mcMMO_Timer = new Timer(true); //BLEED AND REGENERATION + //private Timer mcMMO_SpellTimer = new Timer(true); + public static Database database = null; + public Mob mob = new Mob(); + public Misc misc = new Misc(this); + public Sorcery sorcery = new Sorcery(this); + + //Config file stuff + LoadProperties config = new LoadProperties(); public void onEnable() { - - new File(maindirectory).mkdir(); - mcProperties.makeProperties(Properties, log); //Make Props file - LoadProperties.loadMain(); //Load Props file + //new File(maindirectory).mkdir(); + config.configCheck(); + Users.getInstance().loadUsers(); //Load Users file /* @@ -63,59 +109,55 @@ public class mcMMO extends JavaPlugin { */ PluginManager pm = getServer().getPluginManager(); + + //Player Stuff + pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_JOIN, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_LOGIN, playerListener, Priority.Normal, this); - pm.registerEvent(Event.Type.BLOCK_DAMAGE, blockListener, Priority.Highest, this); pm.registerEvent(Event.Type.PLAYER_CHAT, playerListener, Priority.Lowest, this); + pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Priority.Monitor, this); + pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, playerListener, Priority.Normal, this); - pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this); + + //Block Stuff + pm.registerEvent(Event.Type.BLOCK_DAMAGE, blockListener, Priority.Highest, this); pm.registerEvent(Event.Type.BLOCK_BREAK, blockListener, Priority.Highest, this); pm.registerEvent(Event.Type.BLOCK_FROMTO, blockListener, Priority.Normal, this); pm.registerEvent(Event.Type.BLOCK_PLACE, blockListener, Priority.Normal, this); - pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Priority.Monitor, this); - pm.registerEvent(Event.Type.PLAYER_RESPAWN, playerListener, Priority.Normal, this); - pm.registerEvent(Event.Type.PLAYER_ITEM_HELD, playerListener, Priority.Normal, this); - pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this); - pm.registerEvent(Event.Type.PLAYER_QUIT, playerListener, Priority.Normal, this); + //Entity Stuff + pm.registerEvent(Event.Type.ENTITY_TARGET, entityListener, Priority.Normal, this); + pm.registerEvent(Event.Type.ENTITY_DEATH, entityListener, Priority.Normal, this); + pm.registerEvent(Event.Type.ENTITY_DAMAGE, entityListener, Priority.Highest, this); + pm.registerEvent(Event.Type.CREATURE_SPAWN, entityListener, Priority.Normal, this); + PluginDescriptionFile pdfFile = this.getDescription(); mcPermissions.initialize(getServer()); - mcLoadMySQL(); + if(LoadProperties.useMySQL) - database.createStructure(); //Make Structure - if(!LoadProperties.useMySQL) + { + database = new Database(this); + database.createStructure(); + } else Leaderboard.makeLeaderboards(); //Make the leaderboards + for(Player player : getServer().getOnlinePlayers()){Users.addUser(player);} //In case of reload add all users back into PlayerProfile - System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" ); + System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!" ); //$NON-NLS-1$ //$NON-NLS-2$ mcMMO_Timer.schedule(new mcTimer(this), (long)0, (long)(1000)); - } - - public void mcLoadMySQL() - { - if (LoadProperties.useMySQL) { - // create database object - database = new Database(this); - } + //mcMMO_SpellTimer.schedule(new mcTimerSpells(this), (long)0, (long)(100)); } public void setupPermissions() { - Plugin test = this.getServer().getPluginManager().getPlugin("Permissions"); + Plugin test = this.getServer().getPluginManager().getPlugin("Permissions"); //$NON-NLS-1$ if(this.PermissionsHandler == null) { if(test != null) { this.PermissionsHandler = ((Permissions)test).getHandler(); } else { - log.info(Messaging.bracketize(name) + " Permission system not enabled. Disabling plugin."); + log.info(Messaging.bracketize(name) + " Permission system not enabled. Disabling plugin."); //$NON-NLS-1$ this.getServer().getPluginManager().disablePlugin(this); } } } - public boolean isPartyChatToggled(Player player){ - if(Config.getInstance().isPartyToggled(player.getName())){ - return true; - } else { - return false; - } - } public boolean inSameParty(Player playera, Player playerb){ if(Users.getProfile(playera).inParty() && Users.getProfile(playerb).inParty()){ if(Users.getProfile(playera).getParty().equals(Users.getProfile(playerb).getParty())){ @@ -127,9 +169,17 @@ public class mcMMO extends JavaPlugin { return false; } } + public void getXpToLevel(Player player, String skillname){ + Users.getProfile(player).getXpToLevel(skillname.toLowerCase()); + } + public void removeXp(Player player, String skillname, Integer newvalue){ + PlayerProfile PP = Users.getProfile(player); + PP.removeXP(skillname, newvalue); + Skills.XpCheck(player); + } public void addXp(Player player, String skillname, Integer newvalue){ PlayerProfile PP = Users.getProfile(player); - PP.addXpToSkill(newvalue, skillname, player); + PP.addXP(skillname, newvalue); Skills.XpCheck(player); } public void modifySkill(Player player, String skillname, Integer newvalue){ @@ -137,16 +187,16 @@ public class mcMMO extends JavaPlugin { PP.modifyskill(newvalue, skillname); } public ArrayList getParties(){ - String location = "plugins/mcMMO/mcmmo.users"; + String location = "plugins/mcMMO/mcmmo.users"; //$NON-NLS-1$ ArrayList parties = new ArrayList(); try { //Open the users file FileReader file = new FileReader(location); BufferedReader in = new BufferedReader(file); - String line = ""; + String line = ""; //$NON-NLS-1$ while((line = in.readLine()) != null) { - String[] character = line.split(":"); + String[] character = line.split(":"); //$NON-NLS-1$ String theparty = null; //Party if(character.length > 3) @@ -156,8 +206,8 @@ public class mcMMO extends JavaPlugin { } in.close(); } catch (Exception e) { - log.log(Level.SEVERE, "Exception while reading " - + location + " (Are you sure you formatted it correctly?)", e); + log.log(Level.SEVERE, "Exception while reading " //$NON-NLS-1$ + + location + " (Are you sure you formatted it correctly?)", e); //$NON-NLS-1$ } return parties; } @@ -169,17 +219,10 @@ public class mcMMO extends JavaPlugin { PlayerProfile PP = Users.getProfile(player); return PP.inParty(); } - public boolean isAdminChatToggled(Player player){ - if(Config.getInstance().isAdminToggled(player.getName())){ - return true; - } else { - return false; - } - } public Permissions getPermissions() { return permissions; } public void onDisable() { - System.out.println("mcMMO was disabled."); + System.out.println("mcMMO was disabled."); //$NON-NLS-1$ } } \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/mcPermissions.java b/mcMMO/com/gmail/nossr50/mcPermissions.java index 18e9718c8..25f961d0d 100644 --- a/mcMMO/com/gmail/nossr50/mcPermissions.java +++ b/mcMMO/com/gmail/nossr50/mcPermissions.java @@ -190,6 +190,60 @@ public class mcPermissions { } return instance; } + public boolean sorcery(Player player){ + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.sorcery"); + } else { + return true; + } + } + /* + * SORCERY WATER + */ + public boolean sorceryWater(Player player) + { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.sorcery.water"); + } else { + return true; + } + } + public boolean sorceryWaterThunder(Player player) + { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.sorcery.water.thunder"); + } else { + return true; + } + } + /* + * SORCERY CURATIVE + */ + public boolean sorceryCurative(Player player) + { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.curative"); + } else { + return true; + } + } + public boolean sorceryCurativeHealOther(Player player) + { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.curative.heal.other"); + } else { + return true; + } + } + public boolean sorceryCurativeHealSelf(Player player) + { + if (permissionsEnabled) { + return permission(player, "mcmmo.skills.curative.heal.self"); + } else { + return true; + } + } + public boolean taming(Player player) { if (permissionsEnabled) { return permission(player, "mcmmo.skills.taming"); @@ -211,7 +265,7 @@ public class mcPermissions { return true; } } - public static boolean repair(Player player) { + public boolean repair(Player player) { if (permissionsEnabled) { return permission(player, "mcmmo.skills.repair"); } else { diff --git a/mcMMO/com/gmail/nossr50/mcPlayerListener.java b/mcMMO/com/gmail/nossr50/mcPlayerListener.java index a5e5ad0b8..030501a02 100644 --- a/mcMMO/com/gmail/nossr50/mcPlayerListener.java +++ b/mcMMO/com/gmail/nossr50/mcPlayerListener.java @@ -21,7 +21,6 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.inventory.ItemStack; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.party.Party; @@ -31,7 +30,7 @@ import com.gmail.nossr50.skills.Skills; public class mcPlayerListener extends PlayerListener { - protected static final Logger log = Logger.getLogger("Minecraft"); + protected static final Logger log = Logger.getLogger("Minecraft"); //$NON-NLS-1$ public Location spawn = null; private mcMMO plugin; @@ -40,59 +39,90 @@ public class mcPlayerListener extends PlayerListener { } - public void onPlayerRespawn(PlayerRespawnEvent event) { + public void onPlayerRespawn(PlayerRespawnEvent event) + { + long before = System.currentTimeMillis(); Player player = event.getPlayer(); - PlayerProfile PP = Users.getProfile(player); - if(player != null){ - PP.setRespawnATS(System.currentTimeMillis()); - Location mySpawn = PP.getMySpawn(player); - if(mySpawn != null && plugin.getServer().getWorld(PP.getMySpawnWorld(plugin)) != null) - mySpawn.setWorld(plugin.getServer().getWorld(PP.getMySpawnWorld(plugin))); - if(mcPermissions.getInstance().mySpawn(player) && mySpawn != null){ - event.setRespawnLocation(mySpawn); - } + if(LoadProperties.enableMySpawn && mcPermissions.getInstance().mySpawn(player)) + { + PlayerProfile PP = Users.getProfile(player); + + if(player != null && PP != null) + { + PP.setRespawnATS(System.currentTimeMillis()); + Location mySpawn = PP.getMySpawn(player); + if(mySpawn != null && plugin.getServer().getWorld(PP.getMySpawnWorld(plugin)) != null) + mySpawn.setWorld(plugin.getServer().getWorld(PP.getMySpawnWorld(plugin))); + if(mySpawn != null) + { + event.setRespawnLocation(mySpawn); + } + } } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onPlayerRespawn+=(after-before); + } } - public Player[] getPlayersOnline() { - return plugin.getServer().getOnlinePlayers(); + public void onPlayerLogin(PlayerLoginEvent event) + { + long before = System.currentTimeMillis(); + Users.addUser(event.getPlayer()); + long after = System.currentTimeMillis(); + + if(LoadProperties.print_reports) + { + plugin.onPlayerLogin+=(after-before); + } } - public boolean isPlayer(String playerName){ - for(Player herp : getPlayersOnline()){ - if(herp.getName().toLowerCase().equals(playerName.toLowerCase())){ - return true; - } - } - return false; + + public void onPlayerQuit(PlayerQuitEvent event) + { + long before = System.currentTimeMillis(); + /* + * GARBAGE COLLECTION + */ + + //Discard the PlayerProfile object from players array in the Users object stored for this player as it is no longer needed + Users.removeUser(event.getPlayer()); + long after = System.currentTimeMillis(); + + if(LoadProperties.print_reports) + { + plugin.onPlayerQuit+=(after-before); + } } - public Player getPlayer(String playerName){ - for(Player herp : getPlayersOnline()){ - if(herp.getName().toLowerCase().equals(playerName.toLowerCase())){ - return herp; - } - } - return null; - } - public void onPlayerLogin(PlayerLoginEvent event) { - if(Users.getProfile(event.getPlayer()) != null){ - Users.getProfile(event.getPlayer()).setOnline(true); - } - Users.addUser(event.getPlayer()); - } - public void onPlayerQuit(PlayerQuitEvent event) { - Users.getProfile(event.getPlayer()).setOnline(false); - } - public void onPlayerJoin(PlayerJoinEvent event) { + + public void onPlayerJoin(PlayerJoinEvent event) + { + long before = System.currentTimeMillis(); Player player = event.getPlayer(); - if(mcPermissions.getInstance().motd(player)){ - player.sendMessage(ChatColor.BLUE +"This server is running mcMMO "+plugin.getDescription().getVersion()+" type /"+ChatColor.YELLOW+LoadProperties.mcmmo+ChatColor.BLUE+ " for help."); - player.sendMessage(ChatColor.GREEN+"http://mcmmo.wikia.com"+ChatColor.BLUE+" - mcMMO Wiki"); + + if(mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd) + { + //player.sendMessage(ChatColor.BLUE +"This server is running mcMMO "+plugin.getDescription().getVersion()+" type /"+ChatColor.YELLOW+LoadProperties.mcmmo+ChatColor.BLUE+ " for help."); + player.sendMessage(Messages.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), LoadProperties.mcmmo})); + //player.sendMessage(ChatColor.GREEN+"http://mcmmo.wikia.com"+ChatColor.BLUE+" - mcMMO Wiki"); + player.sendMessage(Messages.getString("mcPlayerListener.WIKI")); } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onPlayerJoin+=(after-before); + } } + public void onPlayerInteract(PlayerInteractEvent event) { + long before = System.currentTimeMillis(); + Player player = event.getPlayer(); PlayerProfile PP = Users.getProfile(player); Action action = event.getAction(); Block block = event.getClickedBlock(); + + + //Archery Nerf if(player.getItemInHand().getTypeId() == 261 && LoadProperties.archeryFireRateLimit){ if(System.currentTimeMillis() < PP.getArcheryShotATS() + 1000){ @@ -106,21 +136,26 @@ public class mcPlayerListener extends PlayerListener { PP.setArcheryShotATS(System.currentTimeMillis()); } } + /* * Ability checks */ - if(action == Action.RIGHT_CLICK_BLOCK){ + if(action == Action.RIGHT_CLICK_BLOCK) + { ItemStack is = player.getItemInHand(); - if(block != null && player != null){ + if(LoadProperties.enableMySpawn && block != null && player != null) + { if(block.getTypeId() == 26 && mcPermissions.getInstance().setMySpawn(player)){ Location loc = player.getLocation(); if(mcPermissions.getInstance().setMySpawn(player)){ PP.setMySpawn(loc.getX(), loc.getY(), loc.getZ(), loc.getWorld().getName()); } - player.sendMessage(ChatColor.DARK_AQUA + "Myspawn has been set to your current location."); + player.sendMessage(Messages.getString("mcPlayerListener.MyspawnSet")); } } - if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getClickedBlock().getTypeId() == 42){ + + if(block != null && player != null && mcPermissions.getInstance().repair(player) && event.getClickedBlock().getTypeId() == 42) + { Repair.repairCheck(player, is, event.getClickedBlock()); } @@ -133,108 +168,253 @@ public class mcPlayerListener extends PlayerListener { } //GREEN THUMB - if(block != null && (block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT) && player.getItemInHand().getType() == Material.SEEDS){ + if(block != null && (block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT) && player.getItemInHand().getType() == Material.SEEDS) + { boolean pass = false; if(Herbalism.hasSeeds(player) && mcPermissions.getInstance().herbalism(player)){ Herbalism.removeSeeds(player); - if(LoadProperties.enableCobbleToMossy && block.getType() == Material.COBBLESTONE && Math.random() * 1500 <= PP.getHerbalismInt()){ - player.sendMessage(ChatColor.GREEN+"**GREEN THUMB**"); + if(LoadProperties.enableCobbleToMossy && m.blockBreakSimulate(block, player, plugin) && block.getType() == Material.COBBLESTONE && Math.random() * 1500 <= PP.getSkill("herbalism")){ + player.sendMessage(Messages.getString("mcPlayerListener.GreenThumb")); block.setType(Material.MOSSY_COBBLESTONE); pass = true; } - if(block.getType() == Material.DIRT && Math.random() * 1500 <= PP.getHerbalismInt()){ - player.sendMessage(ChatColor.GREEN+"**GREEN THUMB**"); + if(block.getType() == Material.DIRT && m.blockBreakSimulate(block, player, plugin) && Math.random() * 1500 <= PP.getSkill("herbalism")){ + player.sendMessage(Messages.getString("mcPlayerListener.GreenThumb")); block.setType(Material.GRASS); pass = true; } if(pass == false) - player.sendMessage(ChatColor.RED+"**GREEN THUMB FAIL**"); + player.sendMessage(Messages.getString("mcPlayerListener.GreenThumbFail")); } return; } } - if(action == Action.RIGHT_CLICK_AIR){ + if(action == Action.RIGHT_CLICK_AIR) + { Skills.hoeReadinessCheck(player); Skills.abilityActivationCheck(player); /* * HERBALISM MODIFIERS */ - if(mcPermissions.getInstance().herbalism(player)){ + if(mcPermissions.getInstance().herbalism(player)) + { Herbalism.breadCheck(player, player.getItemInHand()); Herbalism.stewCheck(player, player.getItemInHand()); } } + /* + if(action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK) + { + if(mcPermissions.getInstance().sorcery(player)) + { + //FIND OUT WHAT SPELL THEY ARE USING + if(player.getItemInHand().getTypeId() == 351) + { + //IF USING LIGHT BLUE DYE (WATER MAGIC) + if(player.getItemInHand().getDurability() == (short) 12) + { + if(PP.getBlueDyeCycle() == 0 && PP.getCurrentMana() >= LoadProperties.water_thunder) + { + if(plugin.sorcery.getSpellTargetBlock(player) != null) + { + PP.setMana(PP.getCurrentMana() - LoadProperties.water_thunder); + + Block targetBlock = plugin.sorcery.getSpellTargetBlock(player); + World world = targetBlock.getLocation().getWorld(); + + world.strikeLightning(targetBlock.getLocation()); + world.strikeLightning(targetBlock.getLocation()); + world.strikeLightning(targetBlock.getLocation()); + + world.createExplosion(targetBlock.getLocation(), (float) 4, true); + + plugin.sorcery.informSpell(Messages.getString("Sorcery.Water.Thunder"), player); + plugin.sorcery.shoutSpell(Messages.getString("Sorcery.Water.Thunder"), player); + } + } + else if (PP.getBlueDyeCycle() == 0 && PP.getCurrentMana() < LoadProperties.water_thunder ) + { + player.sendMessage(Messages.getString("Sorcery.OOM", new Object[] {PP.getCurrentMana(), LoadProperties.water_thunder, Messages.getString("Sorcery.Water.Thunder")})); + } + } + //IF USING LIGHT GREEN DYE (RESTORATIVE MAGIC) + if(player.getItemInHand().getDurability() == (short) 10) + { + //CHECK WHICH SPELL + + //HEAL SELF SPELL + if(PP.getGreenDyeCycle() == 0 && mcPermissions.getInstance().sorceryCurativeHealSelf(player)) + { + //SPELL COST + if(PP.getCurrentMana() >= LoadProperties.cure_self) + { + PP.setMana(PP.getCurrentMana() - LoadProperties.cure_self); + player.setHealth(player.getHealth()+2); + if(player.getHealth() > 20) + player.setHealth(20); + + //XP + PP.addSorceryXP((LoadProperties.cure_self/PP.getMaxMana()) * 100); + Skills.XpCheck(player); + + plugin.sorcery.informSpell(Messages.getString("Sorcery.Curative.Self"), player); + plugin.sorcery.shoutSpell(Messages.getString("Sorcery.Curative.Self"), player); + } + else + { + player.sendMessage(Messages.getString("Sorcery.OOM", new Object[] {PP.getCurrentMana(), LoadProperties.cure_self, Messages.getString("Sorcery.Curative.Self")})); + } + } + //HEAL OTHER SPELL + if(PP.getGreenDyeCycle() == 1) + { + //SPELL COST + if(PP.getCurrentMana() >= LoadProperties.cure_other) + { + PP.setMana(PP.getCurrentMana() - LoadProperties.cure_other); + + //XP + PP.addSorceryXP((LoadProperties.cure_other/PP.getMaxMana()) * 100); + Skills.XpCheck(player); + + plugin.sorcery.informSpell(Messages.getString("Sorcery.Curative.Other"), player); + plugin.sorcery.shoutSpell(Messages.getString("Sorcery.Curative.Other"), player); + } + else + { + player.sendMessage(Messages.getString("Sorcery.OOM", new Object[] {PP.getCurrentMana(), LoadProperties.cure_other, Messages.getString("Sorcery.Curative.Other")})); + } + } + } + } + } + } + */ + + /* + if(action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) + { + if(mcPermissions.getInstance().sorcery(player)) + { + //FIND OUT WHAT SPELL THEY ARE USING + if(player.getItemInHand().getTypeId() == 351) + { + //IF USING LIGHT GREEN DYE (RESTORATIVE MAGIC) + if(mcPermissions.getInstance().sorceryCurative(player) && player.getItemInHand().getDurability() == (short) 10) + { + + while(PP.getDyeChanged() == false) + { + plugin.sorcery.handleGreenDyeCycle(player); + } + + //CHANGE BACK + PP.setDyeChanged(false); + } + } + } + } + */ + /* * ITEM CHECKS */ if(action == Action.RIGHT_CLICK_AIR) Item.itehecks(player, plugin); - if(action == Action.RIGHT_CLICK_BLOCK){ + if(action == Action.RIGHT_CLICK_BLOCK) + { if(m.abilityBlockCheck(event.getClickedBlock())) Item.itehecks(player, plugin); } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onPlayerInteract+=(after-before); + } } - public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { + public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) + { + long before = System.currentTimeMillis(); Player player = event.getPlayer(); PlayerProfile PP = Users.getProfile(player); String[] split = event.getMessage().split(" "); String playerName = player.getName(); //Check if the command is an MMO related help command m.mmoHelpCheck(split, player, event); - if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.mcability)){ + if(LoadProperties.mcabilityEnable && mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.mcability)){ //$NON-NLS-1$ event.setCancelled(true); if(PP.getAbilityUse()){ - player.sendMessage("Ability use toggled off"); + player.sendMessage(Messages.getString("mcPlayerListener.AbilitiesOff")); //$NON-NLS-1$ PP.toggleAbilityUse(); } else { - player.sendMessage("Ability use toggled on"); + player.sendMessage(Messages.getString("mcPlayerListener.AbilitiesOn")); //$NON-NLS-1$ PP.toggleAbilityUse(); } } + /* + if(split[0].equalsIgnoreCase("/mmosupplies") && player.isOp()) + { + Location location = event.getPlayer().getLocation(); + World world = location.getWorld(); + world.spawnCreature(location, CreatureType.WOLF); + + ItemStack[] dye = new ItemStack[15]; + int y = 0; + for(ItemStack x : dye) + { + dye[y] = new ItemStack(351, 64, (short) y); + event.getPlayer().getWorld().dropItemNaturally(event.getPlayer().getLocation(), dye[y]); + y++; + } + + } + */ + /* * FFS -> MySQL */ - if(split[0].equalsIgnoreCase("/mmoupdate")) + if(split[0].equalsIgnoreCase("/mmoupdate")) //$NON-NLS-1$ { event.setCancelled(true); if(!mcPermissions.getInstance().admin(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } - player.sendMessage(ChatColor.GRAY+"Starting conversion..."); + player.sendMessage(ChatColor.GRAY+"Starting conversion..."); //$NON-NLS-1$ Users.clearUsers(); m.convertToMySQL(plugin); for(Player x : plugin.getServer().getOnlinePlayers()) { Users.addUser(x); } - player.sendMessage(ChatColor.GREEN+"Conversion finished!"); + player.sendMessage(ChatColor.GREEN+"Conversion finished!"); //$NON-NLS-1$ } /* * LEADER BOARD COMMAND */ - if(split[0].equalsIgnoreCase("/"+LoadProperties.mctop)){ + if(LoadProperties.mctopEnable && split[0].equalsIgnoreCase("/"+LoadProperties.mctop)){ //$NON-NLS-1$ event.setCancelled(true); if(LoadProperties.useMySQL == false){ /* * POWER LEVEL INFO RETRIEVAL */ - if(split.length == 1){ + if(split.length == 1) + { int p = 1; - String[] info = Leaderboard.retrieveInfo("powerlevel", p); - player.sendMessage(ChatColor.YELLOW+"--mcMMO"+ChatColor.BLUE+" Power Level "+ChatColor.YELLOW+"Leaderboard--"); + String[] info = Leaderboard.retrieveInfo("powerlevel", p); //$NON-NLS-1$ + player.sendMessage(Messages.getString("mcPlayerListener.PowerLevelLeaderboard")); int n = 1 * p; //Position for(String x : info){ if(x != null){ String digit = String.valueOf(n); if(n < 10) - digit ="0"+String.valueOf(n); - String[] splitx = x.split(":"); + digit ="0"+String.valueOf(n); //$NON-NLS-1$ + String[] splitx = x.split(":"); //$NON-NLS-1$ //Format: 1. Playername - skill value - player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]); + player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]); //$NON-NLS-1$ //$NON-NLS-2$ n++; } } @@ -253,17 +433,17 @@ public class mcPlayerListener extends PlayerListener { pt += (pt * 10); pt = 10; } - String[] info = Leaderboard.retrieveInfo("powerlevel", p); - player.sendMessage("--mcMMO Power Level Leaderboard--"); + String[] info = Leaderboard.retrieveInfo("powerlevel", p); //$NON-NLS-1$ + player.sendMessage(Messages.getString("mcPlayerListener.PowerLevelLeaderboard")); //$NON-NLS-1$ int n = 1 * pt; //Position for(String x : info){ if(x != null){ String digit = String.valueOf(n); if(n < 10) - digit ="0"+String.valueOf(n); - String[] splitx = x.split(":"); + digit ="0"+String.valueOf(n); //$NON-NLS-1$ + String[] splitx = x.split(":"); //$NON-NLS-1$ //Format: 1. Playername - skill value - player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]); + player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]); //$NON-NLS-1$ //$NON-NLS-2$ n++; } } @@ -290,16 +470,16 @@ public class mcPlayerListener extends PlayerListener { String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase(); String[] info = Leaderboard.retrieveInfo(split[1].toLowerCase(), p); - player.sendMessage(ChatColor.YELLOW+"--mcMMO "+ChatColor.BLUE+capitalized+ChatColor.YELLOW+" Leaderboard--"); + player.sendMessage(Messages.getString("mcPlayerListener.SkillLeaderboard", new Object[] {capitalized})); //$NON-NLS-1$ //$NON-NLS-2$ int n = 1 * pt; //Position for(String x : info){ if(x != null){ String digit = String.valueOf(n); if(n < 10) - digit ="0"+String.valueOf(n); - String[] splitx = x.split(":"); + digit ="0"+String.valueOf(n); //$NON-NLS-1$ + String[] splitx = x.split(":"); //$NON-NLS-1$ //Format: 1. Playername - skill value - player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]); + player.sendMessage(digit+". "+ChatColor.GREEN+splitx[1]+" - "+ChatColor.WHITE+splitx[0]); //$NON-NLS-1$ //$NON-NLS-2$ n++; } } @@ -309,7 +489,7 @@ public class mcPlayerListener extends PlayerListener { * MYSQL LEADERBOARDS */ { - String powerlevel = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics"; + String powerlevel = "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics"; //$NON-NLS-1$ if(split.length >= 2 && Skills.isSkill(split[1])) { /* @@ -320,7 +500,7 @@ public class mcPlayerListener extends PlayerListener { String remainder = split[1].substring(1); //Get remainder of word. String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase(); - player.sendMessage(ChatColor.YELLOW+"--mcMMO "+ChatColor.BLUE+capitalized+ChatColor.YELLOW+" Leaderboard--"); + player.sendMessage(Messages.getString("mcPlayerListener.SkillLeaderboard", new Object[] {capitalized})); //$NON-NLS-1$ //$NON-NLS-2$ if(split.length >= 3 && m.isInt(split[2])) { int n = 1; //For the page number @@ -332,33 +512,33 @@ public class mcPlayerListener extends PlayerListener { n = n * (n2-1); } //If a page number is specified - HashMap> userslist = mcMMO.database.Read("SELECT "+lowercase+", user_id FROM " - +LoadProperties.MySQLtablePrefix+"skills WHERE "+lowercase+" > 0 ORDER BY `"+LoadProperties.MySQLtablePrefix+"skills`.`"+lowercase+"` DESC "); + HashMap> userslist = mcMMO.database.Read("SELECT "+lowercase+", user_id FROM " //$NON-NLS-1$ //$NON-NLS-2$ + +LoadProperties.MySQLtablePrefix+"skills WHERE "+lowercase+" > 0 ORDER BY `"+LoadProperties.MySQLtablePrefix+"skills`.`"+lowercase+"` DESC "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ for(int i=n;i<=n+10;i++) { - if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) + if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ break; - HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); - player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); + HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); //$NON-NLS-1$ //$NON-NLS-2$ } return; } //If no page number is specified - HashMap> userslist = mcMMO.database.Read("SELECT "+lowercase+", user_id FROM " - +LoadProperties.MySQLtablePrefix+"skills WHERE "+lowercase+" > 0 ORDER BY `"+LoadProperties.MySQLtablePrefix+"skills`.`"+lowercase+"` DESC "); + HashMap> userslist = mcMMO.database.Read("SELECT "+lowercase+", user_id FROM " //$NON-NLS-1$ //$NON-NLS-2$ + +LoadProperties.MySQLtablePrefix+"skills WHERE "+lowercase+" > 0 ORDER BY `"+LoadProperties.MySQLtablePrefix+"skills`.`"+lowercase+"` DESC "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ for(int i=1;i<=10;i++) //i<=userslist.size() { - if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) + if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ break; - HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); - player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); + HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); //$NON-NLS-1$ //$NON-NLS-2$ } return; } if(split.length >= 1) { - player.sendMessage(ChatColor.YELLOW+"--mcMMO "+ChatColor.BLUE+"Power Level"+ChatColor.YELLOW+" Leaderboard--"); + player.sendMessage(Messages.getString("mcPlayerListener.PowerLevelLeaderboard")); //$NON-NLS-1$ if(split.length >= 2 && m.isInt(split[1])) { int n = 1; //For the page number @@ -370,25 +550,25 @@ public class mcPlayerListener extends PlayerListener { n = n * (n2-1); } //If a page number is specified - HashMap> userslist = mcMMO.database.Read("SELECT "+powerlevel+", user_id FROM " - +LoadProperties.MySQLtablePrefix+"skills WHERE "+powerlevel+" > 0 ORDER BY taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics DESC "); + HashMap> userslist = mcMMO.database.Read("SELECT "+powerlevel+", user_id FROM " //$NON-NLS-1$ //$NON-NLS-2$ + +LoadProperties.MySQLtablePrefix+"skills WHERE "+powerlevel+" > 0 ORDER BY taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics DESC "); //$NON-NLS-1$ //$NON-NLS-2$ for(int i=n;i<=n+10;i++) { - if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) + if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ break; - HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); - player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); + HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); //$NON-NLS-1$ //$NON-NLS-2$ } return; } - HashMap> userslist = mcMMO.database.Read("SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics, user_id FROM " - +LoadProperties.MySQLtablePrefix+"skills WHERE "+powerlevel+" > 0 ORDER BY taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics DESC "); + HashMap> userslist = mcMMO.database.Read("SELECT taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics, user_id FROM " //$NON-NLS-1$ + +LoadProperties.MySQLtablePrefix+"skills WHERE "+powerlevel+" > 0 ORDER BY taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics DESC "); //$NON-NLS-1$ //$NON-NLS-2$ for(int i=1;i<=10;i++) { - if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) + if (i > userslist.size() || mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'") == null) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ break; - HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); - player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); + HashMap> username = mcMMO.database.Read("SELECT user FROM "+LoadProperties.MySQLtablePrefix+"users WHERE id = '" + Integer.valueOf(userslist.get(i).get(1)) + "'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + player.sendMessage(String.valueOf(i)+". "+ChatColor.GREEN+userslist.get(i).get(0)+" - "+ChatColor.WHITE+username.get(1).get(0)); //$NON-NLS-1$ //$NON-NLS-2$ //System.out.println(username.get(1).get(0)); //System.out.println("Mining : " + userslist.get(i).get(0) + ", User id : " + userslist.get(i).get(1)); } @@ -396,14 +576,14 @@ public class mcPlayerListener extends PlayerListener { } } - if(split[0].equalsIgnoreCase("/"+LoadProperties.mcrefresh)){ + if(LoadProperties.mcrefreshEnable && split[0].equalsIgnoreCase("/"+LoadProperties.mcrefresh)){ //$NON-NLS-1$ event.setCancelled(true); if(!mcPermissions.getInstance().mcrefresh(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length >= 2 && isPlayer(split[1])){ - player.sendMessage("You have refreshed "+split[1]+"'s cooldowns!"); + player.sendMessage("You have refreshed "+split[1]+"'s cooldowns!"); //$NON-NLS-1$ //$NON-NLS-2$ player = getPlayer(split[1]); } /* @@ -448,269 +628,257 @@ public class mcPlayerListener extends PlayerListener { PP.setBerserkMode(false); PP.setBerserkDeactivatedTimeStamp((long)0); - player.sendMessage(ChatColor.GREEN+"**ABILITIES REFRESHED!**"); - } - if(split[0].equalsIgnoreCase("/"+LoadProperties.mcitem)){ - + player.sendMessage(Messages.getString("mcPlayerListener.AbilitiesRefreshed")); //$NON-NLS-1$ } /* * GODMODE COMMAND */ - if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.mcgod)){ + if(LoadProperties.mcgodEnable && mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.mcgod)) + { //$NON-NLS-1$ event.setCancelled(true); - if(!mcPermissions.getInstance().mcgod(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + if(!mcPermissions.getInstance().mcgod(player)) + { + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } - if(Config.getInstance().isGodModeToggled(playerName)){ - player.sendMessage(ChatColor.YELLOW+"MMO Godmode Disabled"); - Config.getInstance().toggleGodMode(playerName); + if(PP.getGodMode()) + { + player.sendMessage(Messages.getString("mcPlayerListener.GodModeDisabled")); //$NON-NLS-1$ + PP.toggleGodMode(); } else { - player.sendMessage(ChatColor.YELLOW+"MMO Godmode Enabled"); - Config.getInstance().toggleGodMode(playerName); + player.sendMessage(Messages.getString("mcPlayerListener.GodModeEnabled")); //$NON-NLS-1$ + PP.toggleGodMode(); } } - if(mcPermissions.getInstance().mySpawn(player) && split[0].equalsIgnoreCase("/"+LoadProperties.clearmyspawn)){ + if(LoadProperties.clearmyspawnEnable && LoadProperties.enableMySpawn && mcPermissions.getInstance().mySpawn(player) && split[0].equalsIgnoreCase("/"+LoadProperties.clearmyspawn)){ //$NON-NLS-1$ event.setCancelled(true); double x = plugin.getServer().getWorlds().get(0).getSpawnLocation().getX(); double y = plugin.getServer().getWorlds().get(0).getSpawnLocation().getY(); double z = plugin.getServer().getWorlds().get(0).getSpawnLocation().getZ(); String worldname = plugin.getServer().getWorlds().get(0).getName(); PP.setMySpawn(x, y, z, worldname); - player.sendMessage(ChatColor.DARK_AQUA+"Myspawn is now cleared."); + player.sendMessage(Messages.getString("mcPlayerListener.MyspawnCleared")); //$NON-NLS-1$ } - if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.mmoedit)){ + if(LoadProperties.mmoeditEnable && mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.mmoedit)){ //$NON-NLS-1$ event.setCancelled(true); if(!mcPermissions.getInstance().mmoedit(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length < 3){ - player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.mmoedit+" playername skillname newvalue"); + player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.mmoedit+" playername skillname newvalue"); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length == 4){ if(isPlayer(split[1]) && m.isInt(split[3]) && Skills.isSkill(split[2])){ int newvalue = Integer.valueOf(split[3]); Users.getProfile(getPlayer(split[1])).modifyskill(newvalue, split[2]); - player.sendMessage(ChatColor.RED+split[2]+" has been modified."); + player.sendMessage(ChatColor.RED+split[2]+" has been modified."); //$NON-NLS-1$ } } else if(split.length == 3){ if(m.isInt(split[2]) && Skills.isSkill(split[1])){ int newvalue = Integer.valueOf(split[2]); PP.modifyskill(newvalue, split[1]); - player.sendMessage(ChatColor.RED+split[1]+" has been modified."); + player.sendMessage(ChatColor.RED+split[1]+" has been modified."); //$NON-NLS-1$ } } else { - player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.mmoedit+" playername skillname newvalue"); + player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.mmoedit+" playername skillname newvalue"); //$NON-NLS-1$ //$NON-NLS-2$ } } /* * ADD EXPERIENCE COMMAND */ - if(mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.addxp)){ + if(LoadProperties.addxpEnable && mcPermissions.permissionsEnabled && split[0].equalsIgnoreCase("/"+LoadProperties.addxp)){ //$NON-NLS-1$ event.setCancelled(true); if(!mcPermissions.getInstance().mmoedit(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length < 3){ - player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.addxp+" playername skillname xp"); + player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.addxp+" playername skillname xp"); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length == 4){ if(isPlayer(split[1]) && m.isInt(split[3]) && Skills.isSkill(split[2])){ int newvalue = Integer.valueOf(split[3]); - Users.getProfile(getPlayer(split[1])).addXpToSkill(newvalue, split[2], getPlayer(split[1])); - getPlayer(split[1]).sendMessage(ChatColor.GREEN+"Experience granted!"); - player.sendMessage(ChatColor.RED+split[2]+" has been modified."); + Users.getProfile(getPlayer(split[1])).addXP(split[2], newvalue); + getPlayer(split[1]).sendMessage(ChatColor.GREEN+"Experience granted!"); //$NON-NLS-1$ + player.sendMessage(ChatColor.RED+split[2]+" has been modified."); //$NON-NLS-1$ + Skills.XpCheck(getPlayer(split[1])); } } else if(split.length == 3 && m.isInt(split[2]) && Skills.isSkill(split[1])){ int newvalue = Integer.valueOf(split[2]); - PP.addXpToSkill(newvalue, split[1], player); - player.sendMessage(ChatColor.RED+split[1]+" has been modified."); + Users.getProfile(player).addXP(split[1], newvalue); + player.sendMessage(ChatColor.RED+split[1]+" has been modified."); //$NON-NLS-1$ } else { - player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.addxp+" playername skillname xp"); + player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.addxp+" playername skillname xp"); //$NON-NLS-1$ //$NON-NLS-2$ } } - if(PP.inParty() && split[0].equalsIgnoreCase("/"+LoadProperties.ptp)){ + if(LoadProperties.ptpEnable && PP != null && PP.inParty() && split[0].equalsIgnoreCase("/"+LoadProperties.ptp)){ //$NON-NLS-1$ event.setCancelled(true); if(!mcPermissions.getInstance().partyTeleport(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length < 2){ - player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.ptp+" "); + player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.ptp+" "); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(!isPlayer(split[1])){ - player.sendMessage("That is not a valid player"); + player.sendMessage("That is not a valid player"); //$NON-NLS-1$ } if(isPlayer(split[1])){ Player target = getPlayer(split[1]); PlayerProfile PPt = Users.getProfile(target); if(PP.getParty().equals(PPt.getParty())){ player.teleport(target); - player.sendMessage(ChatColor.GREEN+"You have teleported to "+target.getName()); - target.sendMessage(ChatColor.GREEN+player.getName() + " has teleported to you."); + player.sendMessage(ChatColor.GREEN+"You have teleported to "+target.getName()); //$NON-NLS-1$ + target.sendMessage(ChatColor.GREEN+player.getName() + " has teleported to you."); //$NON-NLS-1$ } } } /* * WHOIS COMMAND */ - if((player.isOp() || mcPermissions.getInstance().whois(player)) && split[0].equalsIgnoreCase("/"+LoadProperties.whois)){ + if(LoadProperties.whoisEnable && (player.isOp() || mcPermissions.getInstance().whois(player)) && split[0].equalsIgnoreCase("/"+LoadProperties.whois)){ //$NON-NLS-1$ event.setCancelled(true); if(split.length < 2){ - player.sendMessage(ChatColor.RED + "Proper usage is /"+LoadProperties.whois+" "); + player.sendMessage(ChatColor.RED + "Proper usage is /"+LoadProperties.whois+" "); //$NON-NLS-1$ //$NON-NLS-2$ return; } //if split[1] is a player - if(isPlayer(split[1])){ - Player target = getPlayer(split[1]); - PlayerProfile PPt = Users.getProfile(target); - double x,y,z; - x = target.getLocation().getX(); - y = target.getLocation().getY(); - z = target.getLocation().getZ(); - player.sendMessage(ChatColor.GREEN + "~~WHOIS RESULTS~~"); - player.sendMessage(target.getName()); - if(PPt.inParty()) - player.sendMessage("Party: "+PPt.getParty()); - player.sendMessage("Health: "+target.getHealth()+ChatColor.GRAY+" (20 is full health)"); - player.sendMessage("OP: " + target.isOp()); - player.sendMessage(ChatColor.GREEN+"MMO Stats for "+ChatColor.YELLOW+target.getName()); - if(mcPermissions.getInstance().taming(target)) - player.sendMessage(ChatColor.YELLOW + "Taming Skill: " + ChatColor.GREEN + PPt.getTaming()+ChatColor.DARK_AQUA - + " XP("+PPt.getTamingXP() - +"/"+PPt.getXpToLevel("taming")+")"); - if(mcPermissions.getInstance().mining(target)) - player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PPt.getMining()+ChatColor.DARK_AQUA - + " XP("+PPt.getMiningXP() - +"/"+PPt.getXpToLevel("mining")+")"); - if(mcPermissions.getInstance().repair(target)) - player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PPt.getRepair()+ChatColor.DARK_AQUA - + " XP("+PPt.getRepairXP() - +"/"+PPt.getXpToLevel("repair")+")"); - if(mcPermissions.getInstance().woodcutting(target)) - player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PPt.getWoodCutting()+ChatColor.DARK_AQUA - + " XP("+PPt.getWoodCuttingXP() - +"/"+PPt.getXpToLevel("woodcutting")+")"); - if(mcPermissions.getInstance().unarmed(target)) - player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PPt.getUnarmed()+ChatColor.DARK_AQUA - + " XP("+PPt.getUnarmedXP() - +"/"+PPt.getXpToLevel("unarmed")+")"); - if(mcPermissions.getInstance().herbalism(target)) - player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PPt.getHerbalism()+ChatColor.DARK_AQUA - + " XP("+PPt.getHerbalismXP() - +"/"+PPt.getXpToLevel("herbalism")+")"); - if(mcPermissions.getInstance().excavation(target)) - player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PPt.getExcavation()+ChatColor.DARK_AQUA - + " XP("+PPt.getExcavationXP() - +"/"+PPt.getXpToLevel("excavation")+")"); - if(mcPermissions.getInstance().archery(target)) - player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PPt.getArchery()+ChatColor.DARK_AQUA - + " XP("+PPt.getArcheryXP() - +"/"+PPt.getXpToLevel("archery")+")"); - if(mcPermissions.getInstance().swords(target)) - player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PPt.getSwords()+ChatColor.DARK_AQUA - + " XP("+PPt.getSwordsXP() - +"/"+PPt.getXpToLevel("swords")+")"); - if(mcPermissions.getInstance().axes(target)) - player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PPt.getAxes()+ChatColor.DARK_AQUA - + " XP("+PPt.getAxesXP() - +"/"+PPt.getXpToLevel("axes")+")"); - if(mcPermissions.getInstance().acrobatics(target)) - player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PPt.getAcrobatics()+ChatColor.DARK_AQUA - + " XP("+PPt.getAcrobaticsXP() - +"/"+PPt.getXpToLevel("acrobatics")+")"); - player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(m.getPowerLevel(target))); - player.sendMessage(ChatColor.GREEN+"~~COORDINATES~~"); - player.sendMessage("X: "+x); - player.sendMessage("Y: "+y); - player.sendMessage("Z: "+z); + if(isPlayer(split[1])) + { + Player target = getPlayer(split[1]); + PlayerProfile PPt = Users.getProfile(target); + double x,y,z; + x = target.getLocation().getX(); + y = target.getLocation().getY(); + z = target.getLocation().getZ(); + player.sendMessage(ChatColor.GREEN + "~~WHOIS RESULTS~~"); //$NON-NLS-1$ + player.sendMessage(target.getName()); + if(PPt.inParty()) + player.sendMessage("Party: "+PPt.getParty()); //$NON-NLS-1$ + player.sendMessage("Health: "+target.getHealth()+ChatColor.GRAY+" (20 is full health)"); //$NON-NLS-1$ //$NON-NLS-2$ + player.sendMessage("OP: " + target.isOp()); //$NON-NLS-1$ + player.sendMessage(ChatColor.GREEN+"mcMMO Stats for "+ChatColor.YELLOW+target.getName()); //$NON-NLS-1$ + + player.sendMessage(ChatColor.GOLD+"-=GATHERING SKILLS=-"); + if(mcPermissions.getInstance().excavation(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillToString("excavation"), PPt.getSkillToString("excavationXP"), PPt.getXpToLevel("excavation"))); + if(mcPermissions.getInstance().herbalism(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillToString("herbalism"), PPt.getSkillToString("herbalismXP"), PPt.getXpToLevel("herbalism"))); + if(mcPermissions.getInstance().mining(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.MiningSkill"), PPt.getSkillToString("mining"), PPt.getSkillToString("miningXP"), PPt.getXpToLevel("mining"))); + if(mcPermissions.getInstance().woodCuttingAbility(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.WoodcuttingSkill"), PPt.getSkillToString("woodcutting"), PPt.getSkillToString("woodcuttingXP"), PPt.getXpToLevel("woodcutting"))); + + player.sendMessage(ChatColor.GOLD+"-=COMBAT SKILLS=-"); + if(mcPermissions.getInstance().axes(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.AxesSkill"), PPt.getSkillToString("axes"), PPt.getSkillToString("axesXP"), PPt.getXpToLevel("axes"))); + if(mcPermissions.getInstance().archery(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.ArcherySkill"), PPt.getSkillToString("archery"), PPt.getSkillToString("archeryXP"), PPt.getXpToLevel("archery"))); + //if(mcPermissions.getInstance().sorcery(target)) + //player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.SorcerySkill"), PPt.getSkillToString("sorcery"), PPt.getSkillToString("sorceryXP"), PPt.getXpToLevel("excavation"))); + if(mcPermissions.getInstance().swords(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.SwordsSkill"), PPt.getSkillToString("swords"), PPt.getSkillToString("swordsXP"), PPt.getXpToLevel("swords"))); + if(mcPermissions.getInstance().taming(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.TamingSkill"), PPt.getSkillToString("taming"), PPt.getSkillToString("tamingXP"), PPt.getXpToLevel("taming"))); + if(mcPermissions.getInstance().unarmed(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.UnarmedSkill"), PPt.getSkillToString("unarmed"), PPt.getSkillToString("unarmedXP"), PPt.getXpToLevel("unarmed"))); + + player.sendMessage(ChatColor.GOLD+"-=MISC SKILLS=-"); + if(mcPermissions.getInstance().acrobatics(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillToString("acrobatics"), PPt.getSkillToString("acrobaticsXP"), PPt.getXpToLevel("acrobatics"))); + if(mcPermissions.getInstance().repair(target)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.RepairSkill"), PPt.getSkillToString("repair"), PPt.getSkillToString("repairXP"), PPt.getXpToLevel("repair"))); + + player.sendMessage(Messages.getString("mcPlayerListener.PowerLevel") +ChatColor.GREEN+(m.getPowerLevel(target))); //$NON-NLS-1$ + + player.sendMessage(ChatColor.GREEN+"~~COORDINATES~~"); //$NON-NLS-1$ + player.sendMessage("X: "+x); //$NON-NLS-1$ + player.sendMessage("Y: "+y); //$NON-NLS-1$ + player.sendMessage("Z: "+z); //$NON-NLS-1$ } } /* * STATS COMMAND */ - if(split[0].equalsIgnoreCase("/"+LoadProperties.stats)){ + if(LoadProperties.statsEnable && split[0].equalsIgnoreCase("/"+LoadProperties.stats)){ //$NON-NLS-1$ event.setCancelled(true); - player.sendMessage(ChatColor.GREEN + "Your MMO Stats"); - if(mcPermissions.getInstance().permissionsEnabled) - player.sendMessage(ChatColor.DARK_GRAY+"If you don't have access to a skill it will not be shown here."); - if(mcPermissions.getInstance().taming(player)) - player.sendMessage(ChatColor.YELLOW + "Taming Skill: " + ChatColor.GREEN + PP.getTaming()+ChatColor.DARK_AQUA - + " XP("+PP.getTamingXP() - +"/"+PP.getXpToLevel("taming")+")"); - if(mcPermissions.getInstance().mining(player)) - player.sendMessage(ChatColor.YELLOW + "Mining Skill: " + ChatColor.GREEN + PP.getMining()+ChatColor.DARK_AQUA - + " XP("+PP.getMiningXP() - +"/"+PP.getXpToLevel("mining")+")"); - if(mcPermissions.getInstance().repair(player)) - player.sendMessage(ChatColor.YELLOW + "Repair Skill: "+ ChatColor.GREEN + PP.getRepair()+ChatColor.DARK_AQUA - + " XP("+PP.getRepairXP() - +"/"+PP.getXpToLevel("repair")+")"); - if(mcPermissions.getInstance().woodcutting(player)) - player.sendMessage(ChatColor.YELLOW + "Woodcutting Skill: "+ ChatColor.GREEN + PP.getWoodCutting()+ChatColor.DARK_AQUA - + " XP("+PP.getWoodCuttingXP() - +"/"+PP.getXpToLevel("woodcutting")+")"); - if(mcPermissions.getInstance().unarmed(player)) - player.sendMessage(ChatColor.YELLOW + "Unarmed Skill: " + ChatColor.GREEN + PP.getUnarmed()+ChatColor.DARK_AQUA - + " XP("+PP.getUnarmedXP() - +"/"+PP.getXpToLevel("unarmed")+")"); - if(mcPermissions.getInstance().herbalism(player)) - player.sendMessage(ChatColor.YELLOW + "Herbalism Skill: "+ ChatColor.GREEN + PP.getHerbalism()+ChatColor.DARK_AQUA - + " XP("+PP.getHerbalismXP() - +"/"+PP.getXpToLevel("herbalism")+")"); - if(mcPermissions.getInstance().excavation(player)) - player.sendMessage(ChatColor.YELLOW + "Excavation Skill: "+ ChatColor.GREEN + PP.getExcavation()+ChatColor.DARK_AQUA - + " XP("+PP.getExcavationXP() - +"/"+PP.getXpToLevel("excavation")+")"); - if(mcPermissions.getInstance().archery(player)) - player.sendMessage(ChatColor.YELLOW + "Archery Skill: " + ChatColor.GREEN + PP.getArchery()+ChatColor.DARK_AQUA - + " XP("+PP.getArcheryXP() - +"/"+PP.getXpToLevel("archery")+")"); - if(mcPermissions.getInstance().swords(player)) - player.sendMessage(ChatColor.YELLOW + "Swords Skill: " + ChatColor.GREEN + PP.getSwords()+ChatColor.DARK_AQUA - + " XP("+PP.getSwordsXP() - +"/"+PP.getXpToLevel("swords")+")"); - if(mcPermissions.getInstance().axes(player)) - player.sendMessage(ChatColor.YELLOW + "Axes Skill: " + ChatColor.GREEN + PP.getAxes()+ChatColor.DARK_AQUA - + " XP("+PP.getAxesXP() - +"/"+PP.getXpToLevel("axes")+")"); - if(mcPermissions.getInstance().acrobatics(player)) - player.sendMessage(ChatColor.YELLOW + "Acrobatics Skill: " + ChatColor.GREEN + PP.getAcrobatics()+ChatColor.DARK_AQUA - + " XP("+PP.getAcrobaticsXP() - +"/"+PP.getXpToLevel("acrobatics")+")"); - player.sendMessage(ChatColor.DARK_RED+"POWER LEVEL: "+ChatColor.GREEN+(m.getPowerLevel(player))); + player.sendMessage(Messages.getString("mcPlayerListener.YourStats")); //$NON-NLS-1$ + if(mcPermissions.getInstance().permissionsEnabled) + player.sendMessage(Messages.getString("mcPlayerListener.NoSkillNote")); //$NON-NLS-1$ + + ChatColor header = ChatColor.GOLD; + + if(Skills.hasGatheringSkills(player)) + { + player.sendMessage(header+"-=GATHERING SKILLS=-"); + if(mcPermissions.getInstance().excavation(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.ExcavationSkill"), PP.getSkillToString("excavation"), PP.getSkillToString("excavationXP"), PP.getXpToLevel("excavation"))); + if(mcPermissions.getInstance().herbalism(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.HerbalismSkill"), PP.getSkillToString("herbalism"), PP.getSkillToString("herbalismXP"), PP.getXpToLevel("herbalism"))); + if(mcPermissions.getInstance().mining(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.MiningSkill"), PP.getSkillToString("mining"), PP.getSkillToString("miningXP"), PP.getXpToLevel("mining"))); + if(mcPermissions.getInstance().woodCuttingAbility(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.WoodcuttingSkill"), PP.getSkillToString("woodcutting"), PP.getSkillToString("woodcuttingXP"), PP.getXpToLevel("woodcutting"))); + } + if(Skills.hasCombatSkills(player)) + { + player.sendMessage(header+"-=COMBAT SKILLS=-"); + if(mcPermissions.getInstance().axes(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.AxesSkill"), PP.getSkillToString("axes"), PP.getSkillToString("axesXP"), PP.getXpToLevel("axes"))); + if(mcPermissions.getInstance().archery(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.ArcherySkill"), PP.getSkillToString("archery"), PP.getSkillToString("archeryXP"), PP.getXpToLevel("archery"))); + //if(mcPermissions.getInstance().sorcery(player)) + //player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.SorcerySkill"), PP.getSkillToString("sorcery"), PP.getSkillToString("sorceryXP"), PP.getXpToLevel("excavation"))); + if(mcPermissions.getInstance().swords(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.SwordsSkill"), PP.getSkillToString("swords"), PP.getSkillToString("swordsXP"), PP.getXpToLevel("swords"))); + if(mcPermissions.getInstance().taming(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.TamingSkill"), PP.getSkillToString("taming"), PP.getSkillToString("tamingXP"), PP.getXpToLevel("taming"))); + if(mcPermissions.getInstance().unarmed(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.UnarmedSkill"), PP.getSkillToString("unarmed"), PP.getSkillToString("unarmedXP"), PP.getXpToLevel("unarmed"))); + } + + if(Skills.hasMiscSkills(player)) + { + player.sendMessage(header+"-=MISC SKILLS=-"); + if(mcPermissions.getInstance().acrobatics(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.AcrobaticsSkill"), PP.getSkillToString("acrobatics"), PP.getSkillToString("acrobaticsXP"), PP.getXpToLevel("acrobatics"))); + if(mcPermissions.getInstance().repair(player)) + player.sendMessage(Skills.getSkillStats(Messages.getString("mcPlayerListener.RepairSkill"), PP.getSkillToString("repair"), PP.getSkillToString("repairXP"), PP.getXpToLevel("repair"))); + } + player.sendMessage(Messages.getString("mcPlayerListener.PowerLevel")+ChatColor.GREEN+(m.getPowerLevel(player))); //$NON-NLS-1$ } //Invite Command - if(mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+LoadProperties.invite)){ + if(LoadProperties.inviteEnable && mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+LoadProperties.invite)){ //$NON-NLS-1$ event.setCancelled(true); if(!PP.inParty()){ - player.sendMessage(ChatColor.RED+"You are not in a party."); + player.sendMessage(Messages.getString("mcPlayerListener.NotInParty")); //$NON-NLS-1$ return; } if(split.length < 2){ - player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.invite+" "); + player.sendMessage(ChatColor.RED+"Usage is /"+LoadProperties.invite+" "); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(PP.inParty() && split.length >= 2 && isPlayer(split[1])){ Player target = getPlayer(split[1]); PlayerProfile PPt = Users.getProfile(target); PPt.modifyInvite(PP.getParty()); - player.sendMessage(ChatColor.GREEN+"Invite sent successfully"); - target.sendMessage(ChatColor.RED+"ALERT: "+ChatColor.GREEN+"You have received a party invite for "+PPt.getInvite()+" from "+player.getName()); - target.sendMessage(ChatColor.YELLOW+"Type "+ChatColor.GREEN+"/"+LoadProperties.accept+ChatColor.YELLOW+" to accept the invite"); + player.sendMessage(Messages.getString("mcPlayerListener.InviteSuccess")); //$NON-NLS-1$ + //target.sendMessage(ChatColor.RED+"ALERT: "+ChatColor.GREEN+"You have received a party invite for "+PPt.getInvite()+" from "+player.getName()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + target.sendMessage(Messages.getString("mcPlayerListener.ReceivedInvite1", new Object[] {PPt.getInvite(), player.getName()})); + //target.sendMessage(ChatColor.YELLOW+"Type "+ChatColor.GREEN+"/"+LoadProperties.accept+ChatColor.YELLOW+" to accept the invite"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + target.sendMessage(Messages.getString("mcPlayerListener.ReceivedInvite2", new Object[] {LoadProperties.accept})); } } //Accept invite - if(mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+LoadProperties.accept)){ + if(LoadProperties.acceptEnable && mcPermissions.getInstance().party(player) && split[0].equalsIgnoreCase("/"+LoadProperties.accept)){ //$NON-NLS-1$ event.setCancelled(true); if(PP.hasPartyInvite()){ if(PP.inParty()){ @@ -718,24 +886,24 @@ public class mcPlayerListener extends PlayerListener { } PP.acceptInvite(); Party.getInstance().informPartyMembers(player, getPlayersOnline()); - player.sendMessage(ChatColor.GREEN+"Invite accepted. You have joined party ("+PP.getParty()+")"); + player.sendMessage(Messages.getString("mcPlayerListener.InviteAccepted", new Object[]{PP.getParty()})); //$NON-NLS-1$ //$NON-NLS-2$ } else { - player.sendMessage(ChatColor.RED+"You have no invites at this time"); + player.sendMessage(Messages.getString("mcPlayerListener.NoInvites")); //$NON-NLS-1$ } } //Party command - if(split[0].equalsIgnoreCase("/"+LoadProperties.party)){ + if(LoadProperties.partyEnable && split[0].equalsIgnoreCase("/"+LoadProperties.party)){ //$NON-NLS-1$ event.setCancelled(true); if(!mcPermissions.getInstance().party(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(split.length == 1 && !PP.inParty()){ - player.sendMessage("Proper usage is "+"/"+LoadProperties.party+" or 'q' to quit"); + player.sendMessage("Proper usage is "+"/"+LoadProperties.party+" or 'q' to quit"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return; } if(split.length == 1 && PP.inParty()){ - String tempList = ""; + String tempList = ""; //$NON-NLS-1$ int x = 0; for(Player p : plugin.getServer().getOnlinePlayers()) { @@ -745,122 +913,146 @@ public class mcPlayerListener extends PlayerListener { x++; } if(p != null && x < Party.getInstance().partyCount(player, getPlayersOnline())){ - tempList+= p.getName() +", "; + tempList+= p.getName() +", "; //$NON-NLS-1$ x++; } } } - player.sendMessage(ChatColor.GREEN+"You are in party \""+PP.getParty()+"\""); - player.sendMessage(ChatColor.GREEN + "Party Members ("+ChatColor.WHITE+tempList+ChatColor.GREEN+")"); + player.sendMessage(Messages.getString("mcPlayerListener.YouAreInParty", new Object[] {PP.getParty()})); + player.sendMessage(Messages.getString("mcPlayerListener.PartyMembers")+" ("+ChatColor.WHITE+tempList+ChatColor.GREEN+")"); //$NON-NLS-1$ //$NON-NLS-2$ } - if(split.length > 1 && split[1].equals("q") && PP.inParty()){ + if(split.length > 1 && split[1].equals("q") && PP.inParty()){ //$NON-NLS-1$ Party.getInstance().informPartyMembersQuit(player, getPlayersOnline()); PP.removeParty(); - player.sendMessage(ChatColor.RED + "You have left that party"); + player.sendMessage(Messages.getString("mcPlayerListener.LeftParty")); //$NON-NLS-1$ return; } - if(split.length >= 2){ + if(split.length >= 2) + { if(PP.inParty()) Party.getInstance().informPartyMembersQuit(player, getPlayersOnline()); PP.setParty(split[1]); - player.sendMessage("Joined Party: " + split[1]); + player.sendMessage(Messages.getString("mcPlayerListener.JoinedParty", new Object[] {split[1]})); Party.getInstance().informPartyMembers(player, getPlayersOnline()); - } + } } - if(split[0].equalsIgnoreCase("/p")){ + if(LoadProperties.partyEnable && split[0].equalsIgnoreCase("/p")) + { event.setCancelled(true); - if(!mcPermissions.getInstance().party(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + if(!mcPermissions.getInstance().party(player)) + { + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } - if(Config.getInstance().isAdminToggled(player.getName())) - Config.getInstance().toggleAdminChat(playerName); - Config.getInstance().togglePartyChat(playerName); - if(Config.getInstance().isPartyToggled(playerName)){ - player.sendMessage(ChatColor.GREEN + "Party Chat Toggled On"); + if(PP.getAdminChatMode()) + PP.toggleAdminChat(); + + PP.togglePartyChat(); + + if(PP.getPartyChatMode()) + { + //player.sendMessage(ChatColor.GREEN + "Party Chat Toggled On"); //$NON-NLS-1$ + player.sendMessage(Messages.getString("mcPlayerListener.PartyChatOn")); } else { - player.sendMessage(ChatColor.GREEN + "Party Chat Toggled " + ChatColor.RED + "Off"); + //player.sendMessage(ChatColor.GREEN + "Party Chat Toggled " + ChatColor.RED + "Off"); //$NON-NLS-1$ //$NON-NLS-2$ + player.sendMessage(Messages.getString("mcPlayerListener.PartyChatOff")); } } - if(split[0].equalsIgnoreCase("/a") && (player.isOp() || mcPermissions.getInstance().adminChat(player))){ - if(!mcPermissions.getInstance().adminChat(player) && !player.isOp()){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + + if(split[0].equalsIgnoreCase("/a") && (player.isOp() || mcPermissions.getInstance().adminChat(player))) + { + if(!mcPermissions.getInstance().adminChat(player) && !player.isOp()) + { + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } + event.setCancelled(true); - if(Config.getInstance().isPartyToggled(player.getName())) - Config.getInstance().togglePartyChat(playerName); - Config.getInstance().toggleAdminChat(playerName); - if(Config.getInstance().isAdminToggled(playerName)){ - player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.GREEN + "On"); + + if(PP.getPartyChatMode()) + PP.togglePartyChat(); + + PP.toggleAdminChat(); + + if(PP.getAdminChatMode()) + { + player.sendMessage(Messages.getString("mcPlayerListener.AdminChatOn")); + //player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.GREEN + "On"); //$NON-NLS-1$ //$NON-NLS-2$ } else { - player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.RED + "Off"); + player.sendMessage(Messages.getString("mcPlayerListener.AdminChatOff")); + //player.sendMessage(ChatColor.AQUA + "Admin chat toggled " + ChatColor.RED + "Off"); //$NON-NLS-1$ //$NON-NLS-2$ } } + /* * MYSPAWN */ - if(split[0].equalsIgnoreCase("/"+LoadProperties.myspawn)){ + if(LoadProperties.myspawnEnable && LoadProperties.enableMySpawn && split[0].equalsIgnoreCase("/"+LoadProperties.myspawn)){ //$NON-NLS-1$ event.setCancelled(true); if(!mcPermissions.getInstance().mySpawn(player)){ - player.sendMessage(ChatColor.YELLOW+"[MMO]"+ChatColor.DARK_RED +" Insufficient mcPermissions."); + player.sendMessage(ChatColor.YELLOW+"[mcMMO]"+ChatColor.DARK_RED +Messages.getString("mcPlayerListener.NoPermission")); //$NON-NLS-1$ //$NON-NLS-2$ return; } if(System.currentTimeMillis() < PP.getMySpawnATS() + 3600000){ - long x = System.currentTimeMillis(); - int seconds = 0; - int minutes = 0; - while(x < PP.getMySpawnATS() + 3600000){ - x+=1000; - seconds++; - } - while(seconds >= 60){ - seconds-=60; - minutes++; - } - player.sendMessage("You must wait "+minutes+"m"+seconds+"s"+" to use myspawn"); + long x = ((PP.getMySpawnATS() + 3600000) - System.currentTimeMillis()); + int y = (int) (x/60000); + int z = (int) ((x/1000) - (y*60)); + player.sendMessage(Messages.getString("mcPlayerListener.MyspawnTimeNotice", new Object[] {y, z})); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ return; } PP.setMySpawnATS(System.currentTimeMillis()); - if(PP.getMySpawn(player) != null){ - player.setHealth(20); - Location mySpawn = PP.getMySpawn(player); - //player.sendMessage("MMO DEBUG CODE 1"); - if(PP.getMySpawnWorld(plugin) != null && !PP.getMySpawnWorld(plugin).equals("")){ - mySpawn.setWorld(plugin.getServer().getWorld(PP.getMySpawnWorld(plugin))); - //player.sendMessage("MMO DEBUG CODE 2"); - } else { - //player.sendMessage("MMO DEBUG CODE 5"); - mySpawn.setWorld(plugin.getServer().getWorlds().get(0)); - } - player.teleport(mySpawn); //It's done twice because teleporting from one world to another is weird - player.teleport(mySpawn); + if(PP.getMySpawn(player) != null) + { + Location mySpawn = PP.getMySpawn(player); + if(mySpawn != null && plugin.getServer().getWorld(PP.getMySpawnWorld(plugin)) != null) + mySpawn.setWorld(plugin.getServer().getWorld(PP.getMySpawnWorld(plugin))); + if(mySpawn != null) + { + //It's done twice because it acts oddly when you are in another world + player.teleport(mySpawn); + player.teleport(mySpawn); + } } else { - player.sendMessage(ChatColor.RED+"Configure your myspawn first with a bed."); + player.sendMessage(Messages.getString("mcPlayerListener.MyspawnNotExist")); //$NON-NLS-1$ } } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onPlayerCommandPreprocess+=(after-before); + } } - public void onPlayerChat(PlayerChatEvent event) { + public void onPlayerChat(PlayerChatEvent event) + { + long before = System.currentTimeMillis(); Player player = event.getPlayer(); PlayerProfile PP = Users.getProfile(player); - String x = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") "; - String y = ChatColor.AQUA + "{" + ChatColor.WHITE + player.getName() + ChatColor.AQUA + "} "; - if(Config.getInstance().isPartyToggled(player.getName())){ + + String x = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") "; //$NON-NLS-1$ //$NON-NLS-2$ + String y = ChatColor.AQUA + "{" + ChatColor.WHITE + player.getName() + ChatColor.AQUA + "} "; //$NON-NLS-1$ //$NON-NLS-2$ + + if(PP.getPartyChatMode()) + { event.setCancelled(true); - log.log(Level.INFO, "[P]("+PP.getParty()+")"+"<"+player.getName()+"> "+event.getMessage()); - for(Player herp : plugin.getServer().getOnlinePlayers()){ - if(Users.getProfile(herp).inParty()){ - if(Party.getInstance().inSameParty(herp, player)){ - herp.sendMessage(x+event.getMessage()); - } + log.log(Level.INFO, "[P]("+PP.getParty()+")"+"<"+player.getName()+"> "+event.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ + for(Player herp : plugin.getServer().getOnlinePlayers()) + { + if(Users.getProfile(herp).inParty()) + { + if(Party.getInstance().inSameParty(herp, player)) + { + herp.sendMessage(x+event.getMessage()); + } } } return; } - if((player.isOp() || mcPermissions.getInstance().adminChat(player)) && Config.getInstance().isAdminToggled(player.getName())){ - log.log(Level.INFO, "[A]"+"<"+player.getName()+"> "+event.getMessage()); + + if((player.isOp() || mcPermissions.getInstance().adminChat(player)) && PP.getAdminChatMode()) + { + log.log(Level.INFO, "[A]"+"<"+player.getName()+"> "+event.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ event.setCancelled(true); for(Player herp : plugin.getServer().getOnlinePlayers()){ if((herp.isOp() || mcPermissions.getInstance().adminChat(herp))){ @@ -868,13 +1060,43 @@ public class mcPlayerListener extends PlayerListener { } } return; - } - /* - * Remove from normal chat if toggled - for(Player z : event.getRecipients()){ - if(Users.getProfile(z.getName()).getPartyChatOnlyToggle() == true) - event.getRecipients().remove(z); - } - */ } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.onPlayerChat+=(after-before); + } + } + + + public Player[] getPlayersOnline() + { + return plugin.getServer().getOnlinePlayers(); + } + + + public boolean isPlayer(String playerName) + { + for(Player herp : getPlayersOnline()) + { + if(herp.getName().toLowerCase().equals(playerName.toLowerCase())) + { + return true; + } + } + return false; + } + + + public Player getPlayer(String playerName) + { + for(Player herp : getPlayersOnline()) + { + if(herp.getName().toLowerCase().equals(playerName.toLowerCase())) + { + return herp; + } + } + return null; + } } \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/mcTimer.java b/mcMMO/com/gmail/nossr50/mcTimer.java index cd1287635..df53e0849 100644 --- a/mcMMO/com/gmail/nossr50/mcTimer.java +++ b/mcMMO/com/gmail/nossr50/mcTimer.java @@ -1,50 +1,73 @@ package com.gmail.nossr50; -import java.awt.Color; import java.util.TimerTask; -import org.bukkit.ChatColor; import org.bukkit.entity.*; +import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.skills.Swords; -public class mcTimer extends TimerTask{ +public class mcTimer extends TimerTask +{ private final mcMMO plugin; int thecount = 1; - public mcTimer(final mcMMO plugin) { + public mcTimer(final mcMMO plugin) + { this.plugin = plugin; } - public void run() { - Player[] playerlist = plugin.getServer().getOnlinePlayers(); - for(Player player : playerlist) + public void run() + { + long before = System.currentTimeMillis(); + for(Player player : plugin.getServer().getOnlinePlayers()) { - PlayerProfile PP = Users.getProfile(player); if(player == null) continue; + PlayerProfile PP = Users.getProfile(player); + if(PP == null) - Users.addUser(player); + continue; + /* * MONITOR SKILLS */ Skills.monitorSkills(player); + /* * COOLDOWN MONITORING */ Skills.watchCooldowns(player); + /* + * MANA MONITORING + */ + /* + if(mcPermissions.getInstance().sorcery(player) && thecount == 20 && PP.getCurrentMana() < PP.getMaxMana()) + { + PP.setMana(PP.getCurrentMana()+PP.getMaxMana()/5); + + //MAKE SURE THE MANA IS NOT ABOVE MAXIMUM + if(PP.getMaxMana() < PP.getCurrentMana()) + PP.setMana(PP.getMaxMana()); + + if(PP.getMaxMana() != PP.getCurrentMana()) + player.sendMessage(Messages.getString("Sorcery.Current_Mana")+" "+ChatColor.GREEN+PP.getCurrentMana()+"/"+PP.getMaxMana()); + } + */ + /* * PLAYER BLEED MONITORING */ - if(thecount % 2 == 0 && PP != null && PP.getBleedTicks() >= 1){ + if(thecount % 2 == 0 && PP.getBleedTicks() >= 1) + { player.damage(2); PP.decreaseBleedTicks(); } - if(mcPermissions.getInstance().regeneration(player) && PP != null && System.currentTimeMillis() >= PP.getRecentlyHurt() + 60000) + if(LoadProperties.enableRegen && mcPermissions.getInstance().regeneration(player) && System.currentTimeMillis() >= PP.getRecentlyHurt() + 60000) { if(thecount == 10 || thecount == 20 || thecount == 30 || thecount == 40){ if(player != null && @@ -61,7 +84,8 @@ public class mcTimer extends TimerTask{ player.setHealth(m.calculateHealth(player.getHealth(), 1)); } } - if(thecount == 40){ + if(thecount == 40) + { if(player != null && player.getHealth() > 0 && player.getHealth() < 20 && m.getPowerLevel(player) < 500){ @@ -71,18 +95,27 @@ public class mcTimer extends TimerTask{ } } + /* * NON-PLAYER BLEED MONITORING */ - if(thecount % 2 == 0) - Swords.bleedSimulate(); - if(thecount < 40) - { - thecount++; - } else - { + if(thecount % 2 == 0) + Swords.bleedSimulate(plugin); + + //SETUP FOR HP REGEN/BLEED + thecount++; + if(thecount >= 41) thecount = 1; + + + if(LoadProperties.print_reports) + { + long after = System.currentTimeMillis(); + plugin.mcTimerx+=(after-before); + + if(thecount == 40) + plugin.printDelays(); } } } diff --git a/mcMMO/com/gmail/nossr50/mcTimerSpells.java b/mcMMO/com/gmail/nossr50/mcTimerSpells.java new file mode 100644 index 000000000..5ce670c40 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/mcTimerSpells.java @@ -0,0 +1,20 @@ +package com.gmail.nossr50; + +import java.util.TimerTask; + +public class mcTimerSpells extends TimerTask +{ + mcMMO plugin = null; + + public mcTimerSpells(mcMMO pluginx) + { + plugin = pluginx; + } + + @Override + public void run() + { + + } + +} diff --git a/mcMMO/com/gmail/nossr50/messages_de.properties b/mcMMO/com/gmail/nossr50/messages_de.properties new file mode 100644 index 000000000..d878d6694 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/messages_de.properties @@ -0,0 +1,321 @@ +Combat.WolfExamine=[[GREEN]]**du musterst den Wolf mit Bestienkunde** +Combat.WolfShowMaster=[[DARK_GREEN]]Der Bestienmeister \: {0} +Combat.Ignition=[[RED]]**ENTZUENDEN** +Combat.BurningArrowHit=[[DARK_RED]]Du wurdest von einem brennenden Pfeil gestriffen\! +Combat.TouchedFuzzy=[[DARK_RED]]Benommen. fuehlt sich schwindelig. +Combat.TargetDazed=Target was [[DARK_RED]]benommen +Combat.WolfNoMaster=[[GRAY]]Diese Bestie hat keinen Meister... +Combat.WolfHealth=[[GREEN]]Die Bestie hat {0} Lebensenergie +Combat.StruckByGore=[[RED]]**Getroffen von Biss** +Combat.Gore=[[GREEN]]**BISS** +Combat.ArrowDeflect=[[WHITE]]**PFEIL ABGELENKT** +Item.ChimaeraWingFail=**CHIMAERA FLUEGEL fehlgeschlagen\!** +Item.ChimaeraWingPass=**CHIMAERA FLUEGEL** +Item.InjuredWait=du wurdest kurz zuvor verletzt und musst mit der Benutzung warten. [[YELLOW]]({0}s) +Item.NeedFeathers=[[GRAY]]Du brauchst mehr Federn.. +m.mccPartyCommands=[[GREEN]]--GRUPPEN BEFEHLE-- +m.mccParty=[party name] [[RED]]- Erstellen/beitreten einer Gruppe +m.mccPartyQ=[[RED]]- Verlasse aktuelle Gruppe +m.mccPartyToggle=[[RED]] - aktiviert Gruppenchat +m.mccPartyInvite=[player name] [[RED]]- sende Gruppeneinladung +m.mccPartyAccept=[[RED]]- Gruppeneinladung akzeptieren +m.mccPartyTeleport=[party member name] [[RED]]- Teleport zu Gruppenmitglied +m.mccOtherCommands=[[GREEN]]--ANDERE BEFEHLE-- +m.mccStats=- zeigt deinen Status +m.mccLeaderboards=- Ranglisten +m.mccMySpawn=- Teleport zum Spawnpunkt +m.mccClearMySpawn=- Spawnpunkt loeschen +m.mccToggleAbility=- Faehigkeitsaktivierung mit rechtsklick an/aus schalten +m.mccAdminToggle=- Adminchat aktivieren +m.mccWhois=[playername] [[RED]]- Detailierte Spielerinfos zeigen +m.mccMmoedit=[playername] [skill] [newvalue] [[RED]]- Ziel modifizieren +m.mccMcGod=- God Mode +m.mccSkillInfo=[skillname] [[RED]]- Detailierte Skillinfos zeigen +m.mccModDescription=[[RED]]- kurze MOD-Beschreibung lesen +m.SkillHeader=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- +m.XPGain=[[DARK_GRAY]]XP Erhalten: [[WHITE]]{0} +m.EffectsTemplate=[[DARK_AQUA]]{0}: [[GREEN]]{1} +m.AbilityLockTemplate=[[GRAY]]{0} +m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} +m.Effects=EFFEKTE +m.YourStats=DEINE WERTE +m.SkillTaming=Bestienkunde (Taming) +m.XPGainTaming=wenn Woelfe Schaden bekommen +m.EffectsTaming1_0=Bestienkunde +m.EffectsTaming1_1=mit Knochen schlagen inspiziert Woelfe +m.EffectsTaming2_0=Biss +m.EffectsTaming2_1=Kritischer Schlag mit Blutungseffekt +m.EffectsTaming3_0=Geschaerfte Krallen +m.EffectsTaming3_1=Schadens-Bonus +m.EffectsTaming4_0=Umweltbewusst +m.EffectsTaming4_1=Kaktus/Lava Phobie, Fall Schaden Immun +m.EffectsTaming5_0=Dichtes Fell +m.EffectsTaming5_1=Schadens-Reduzierung, Feuer-Resistenz +m.EffectsTaming6_0=schockfest +m.EffectsTaming6_1=Explosions-Schaden-Reduzierung +m.AbilLockTaming1=gesperrt bis 100+ Skilllevel (Umweltbewusst) +m.AbilLockTaming2=gesperrt bis 250+ Skillevel (Dichtes Fell) +m.AbilLockTaming3=gesperrt bis 500+ Skillevel (Schockfest) +m.AbilLockTaming4=gesperrt bis 750+ Skillevel (Geschaerfte Krallen) +m.AbilBonusTaming1_0=Umweltbewusst +m.AbilBonusTaming1_1=Woelfe meiden Gefahr +m.AbilBonusTaming2_0=Dichtes Fell +m.AbilBonusTaming2_1=Halber Schaden, Feuer-Resistenz +m.AbilBonusTaming3_0=Schockfest +m.AbilBonusTaming3_1=Explosionen machen 1/6 normalen Schaden +m.AbilBonusTaming4_0=Geschärfte Krallen +m.AbilBonusTaming4_1=+2 Schaden +m.TamingGoreChance=[[RED]]Biss Chance: [[YELLOW]]{0}% +m.SkillWoodCutting=Holzfaellen (WoodCutting) +m.XPGainWoodCutting=Baeume faellen +m.EffectsWoodCutting1_0=Baumfaeller (Faehigkeit) +m.EffectsWoodCutting1_1=Bringt Baeume zum explodieren +m.EffectsWoodCutting2_0=Blaetter-Sturm +m.EffectsWoodCutting2_1=blaest Blaetter weg +m.EffectsWoodCutting3_0=Doppelte Drops +m.EffectsWoodCutting3_1=doppelte Anzahl Items +m.AbilLockWoodCutting1=gesperrt bis 100+ Skilllevel (Blaetter-Sturm) +m.AbilBonusWoodCutting1_0=Blaetter-Sturm +m.AbilBonusWoodCutting1_1=blaest Blaetter weg +m.WoodCuttingDoubleDropChance=[[RED]]Doppelte Drop Chance: [[YELLOW]]{0}% +m.WoodCuttingTreeFellerLength=[[RED]]Baumfaeller Dauer: [[YELLOW]]{0}s +m.SkillArchery=Bogenschiessen (Archery) +m.XPGainArchery=Monster/Spieler angreifen +m.EffectsArchery1_0=Entzuenden +m.EffectsArchery1_1=25% Chance das Feind Feuer faengt +m.EffectsArchery2_0=Blenden (Spieler) +m.EffectsArchery2_1=Disorientiert Feinde +m.EffectsArchery3_0=Schaden+ +m.EffectsArchery3_1=Modifiziert Schaden +m.EffectsArchery4_0=Pfeil Rueckgewinnung +m.EffectsArchery4_1=Chance Pfeile von Leichen zurueckzugewinnen +m.ArcheryDazeChance=[[RED]]Chance zu blenden: [[YELLOW]]{0}% +m.ArcheryRetrieveChance=[[RED]]Chance Pfeile zurueckzugewinnen: [[YELLOW]]{0}% +m.ArcheryIgnitionLength=[[RED]]Dauer von Entzuenden: [[YELLOW]]{0} seconds +m.ArcheryDamagePlus=[[RED]]Schaden+ (Rank{0}): [[YELLOW]]Bonus {0} damage +m.SkillAxes=Axt (Axes) +m.XPGainAxes=Monster/Spieler angreifen +m.EffectsAxes1_0=Schaedelspalter (Faehigkeit) +m.EffectsAxes1_1=Verursacht Flaechenschaden +m.EffectsAxes2_0=Kritischer Schlag +m.EffectsAxes2_1=doppelter Schaden +m.EffectsAxes3_0=Axtmeister (500 Skilllevel) +m.EffectsAxes3_1=Modifiziert Schaden +m.AbilLockAxes1=gesperrt bis 500+ Skilllevel(Axtmeister) +m.AbilBonusAxes1_0=Axtmeister +m.AbilBonusAxes1_1=4 Bonus-Schaden +m.AxesCritChance=[[RED]]Chance fuer kritische Treffer: [[YELLOW]]{0}% +m.AxesSkullLength=[[RED]]Schaedelspalter Dauer: [[YELLOW]]{0}s +m.SkillSwords=Schwert (Swords) +m.XPGainSwords=Monster/Spieler angreifen +m.EffectsSwords1_0=Konter +m.EffectsSwords1_1=Reflektiert 50% des erhaltenen Schadens +m.EffectsSwords2_0=Saegezahn-Schlag (Faehigkeit) +m.EffectsSwords2_1=25% Flaechenschaden, Blutung+ Flaecheneffekt +m.EffectsSwords3_0=Saegezahn-Schlag Blutung+ +m.EffectsSwords3_1=5 Tick Blutung +m.EffectsSwords4_0=parrieren +m.EffectsSwords4_1=negiert Schaden +m.EffectsSwords5_0=Blutung +m.EffectsSwords5_1=hinterlaesst Blutungs-DOT +m.SwordsCounterAttChance=[[RED]]Konter Chance: [[YELLOW]]{0}% +m.SwordsBleedLength=[[RED]]Blutung Dauer: [[YELLOW]]{0} ticks +m.SwordsBleedChance=[[RED]]Blutung Chance: [[YELLOW]]{0} % +m.SwordsParryChance=[[RED]]Parieren Chance: [[YELLOW]]{0} % +m.SwordsSSLength=[[RED]]Saegezahn-Schlag Dauer: [[YELLOW]]{0}s +m.SwordsTickNote=[[GRAY]]NOTIZ: [[YELLOW]]1 Tick erfolgt aller 2 Sekunden +m.SkillAcrobatics=Akrobatik (Acrobatics) +m.XPGainAcrobatics=runterfallen +m.EffectsAcrobatics1_0=Rolle +m.EffectsAcrobatics1_1=Reduziert oder negiert Schaden +m.EffectsAcrobatics2_0=elegante Rolle +m.EffectsAcrobatics2_1=Doppelt so effektiv wie Rolle +m.EffectsAcrobatics3_0=Ausweichen +m.EffectsAcrobatics3_1=halbiert Schaden +m.AcrobaticsRollChance=[[RED]]Rolle Chance: [[YELLOW]]{0}% +m.AcrobaticsGracefulRollChance=[[RED]]elegante Rolle Chance: [[YELLOW]]{0}% +m.AcrobaticsDodgeChance=[[RED]]Ausweichen Chance: [[YELLOW]]{0}% +m.SkillMining=Bergbau (Mining) +m.XPGainMining=Abbauen von Stein und Erz +m.EffectsMining1_0=Super Brecher (Faehigkeit) +m.EffectsMining1_1=Tempo+, dreifache Drop Chance +m.EffectsMining2_0=doppelte Drops +m.EffectsMining2_1=doppelte Anzahl Items +m.MiningDoubleDropChance=[[RED]]doppelte Drops Chance: [[YELLOW]]{0}% +m.MiningSuperBreakerLength=[[RED]]Super Brecher Dauer: [[YELLOW]]{0}s +m.SkillRepair=Reparieren (Repair) +m.XPGainRepair=reparieren +m.EffectsRepair1_0=reparieren +m.EffectsRepair1_1=reparieren von Eisenwerkzeugen und Ruestung +m.EffectsRepair2_0=reparieren - Meister +m.EffectsRepair2_1=erhoeht Reparierwert +m.EffectsRepair3_0=Super Reparatur +m.EffectsRepair3_1=doppelte Effektivitaet +m.EffectsRepair4_0=Diamanten Reparatur ({0}+ SKILL) +m.EffectsRepair4_1=Reparieren von Diamantwerkzeugen und Ruestung +m.RepairRepairMastery=[[RED]]reparieren - Meister: [[YELLOW]]Extra {0}% Haltbarkeit +m.RepairSuperRepairChance=[[RED]]Super Reparatur Chance: [[YELLOW]]{0}% +m.SkillUnarmed=Faustkampf (Unarmed) +m.XPGainUnarmed=Monster/Spieler angreifen +m.EffectsUnarmed1_0=Berserker (Faehigkeit) +m.EffectsUnarmed1_1=+50% Schaden, bricht weiches Material (Bsp. Erde) +m.EffectsUnarmed2_0=Entwaffnen (Spieler) +m.EffectsUnarmed2_1=Droppt Item welches Feind in Hand haelt +m.EffectsUnarmed3_0=Faustkampfmeister +m.EffectsUnarmed3_1=grosse Schadenssteigerung +m.EffectsUnarmed4_0=Faustkampflehrling +m.EffectsUnarmed4_1=Schadens-Bonus +m.EffectsUnarmed5_0=Pfeil ablenken +m.EffectsUnarmed5_1=wehrt Pfeile ab +m.AbilLockUnarmed1=gesperrt bis 250+ Skilllevel (Faustkampflehrling) +m.AbilLockUnarmed2=gesperrt bis 500+ Skilllevel (Faustkampfmeister) +m.AbilBonusUnarmed1_0=Faustkampflehrling +m.AbilBonusUnarmed1_1=+2 Schadens-Bonus +m.AbilBonusUnarmed2_0=Faustkampfmeister +m.AbilBonusUnarmed2_1=+4 Schadens-Bonus +m.UnarmedArrowDeflectChance=[[RED]]Pfeil ablenken Chance: [[YELLOW]]{0}% +m.UnarmedDisarmChance=[[RED]]Entwaffnen Chance: [[YELLOW]]{0}% +m.UnarmedBerserkLength=[[RED]]Berserker Dauer: [[YELLOW]]{0}s +m.SkillHerbalism=Kraeutersammler (Herbalism) +m.XPGainHerbalism=Kraeuter sammeln +m.EffectsHerbalism1_0=Gruene Welt (Faehigkeit) +m.EffectsHerbalism1_1=Pflegt die Welt, dreifache Drops +m.EffectsHerbalism2_0=Gruener Daumen (Weizen) +m.EffectsHerbalism2_1=automatisches neupflanzen nach ernten +m.EffectsHerbalism3_0=Gruener Daumen (Cobble) +m.EffectsHerbalism3_1=verwandelt Cobblestone zu Mossy Cobblestone mithilfe von Samen +m.EffectsHerbalism4_0=Nahrung+ +m.EffectsHerbalism4_1=Modifiziert Heilung von Brot/Suppe +m.EffectsHerbalism5_0=Doppelte Drops (Alle Kraeuter) +m.EffectsHerbalism5_1=doppelte Anzahl Items +m.HerbalismGreenTerraLength=[[RED]]Gruene Welt Dauer: [[YELLOW]]{0}s +m.HerbalismGreenThumbChance=[[RED]]Gruener Daumen Chance: [[YELLOW]]{0}% +m.HerbalismGreenThumbStage=[[RED]]Gruener Daumen Stufe: [[YELLOW]] Getreide waechst auf Stufe {0} +m.HerbalismDoubleDropChance=[[RED]]Doppelte Drop Chance: [[YELLOW]]{0}% +m.HerbalismFoodPlus=[[RED]]Nahrung+ (Rank{0}): [[YELLOW]]Bonus-Heilung {0} +m.SkillExcavation=Graben (Excavation) +m.XPGainExcavation=Graben und finden von Schaetzen +m.EffectsExcavation1_0=Giga Bohrer (Faehigkeit) +m.EffectsExcavation1_1=3x Drop Rate, 3x EXP, +Tempo +m.EffectsExcavation2_0=Schatzjaeger +m.EffectsExcavation2_1=Faehigkeit nach Schaetzen zu graben +m.ExcavationGreenTerraLength=[[RED]]Giga Bohrer Dauer: [[YELLOW]]{0}s +mcBlockListener.PlacedAnvil=[[DARK_RED]]Du hast einen Ambos platziert, du kannst hier Werkzeuge und Ruestungen reparieren. +mcEntityListener.WolfComesBack=[[DARK_GRAY]]Dein Wolf hastet zurueck zu dir... +mcPlayerListener.AbilitiesOff=Faehigkeiten nutzen (rechtsklick) aus +mcPlayerListener.AbilitiesOn=Faehigkeiten nutzen (rechtsklick) an +mcPlayerListener.AbilitiesRefreshed=[[GREEN]]**Faehigkeiten aufgefrischt\!** +mcPlayerListener.AcrobaticsSkill=[[YELLOW]]Akrobatik Skill (Acrobatics): +mcPlayerListener.ArcherySkill=[[YELLOW]]Bogenschiessen Skill (Archery): +mcPlayerListener.AxesSkill=[[YELLOW]]Axt Skill (Axes): +mcPlayerListener.ExcavationSkill=[[YELLOW]]Graben Skill (Excavations): +mcPlayerListener.GodModeDisabled=[[YELLOW]]mcMMO Godmode deaktiviert +mcPlayerListener.GodModeEnabled=[[YELLOW]]mcMMO Godmode aktiviert +mcPlayerListener.GreenThumb=[[GREEN]]**GRUENER DAUMEN** +mcPlayerListener.GreenThumbFail=[[RED]]**GREEN THUMB FEHLGESCHLAGEN** +mcPlayerListener.HerbalismSkill=[[YELLOW]]Kraeuterkunde Skill (Herbalism): +mcPlayerListener.MiningSkill=[[YELLOW]]Bergbau Skill (Mining): +mcPlayerListener.MyspawnCleared=[[DARK_AQUA]]Myspawn ist freigegeben +mcPlayerListener.MyspawnNotExist=[[RED]]Lege deinen myspawn erst mit einem Bett fest +mcPlayerListener.MyspawnSet=[[DARK_AQUA]]Myspawn wurde an deine aktuelle Position gesetzt +mcPlayerListener.MyspawnTimeNotice=Du musst {0}m {1}s warten um myspawn zu nutzen +mcPlayerListener.NoPermission=unzureichende mcPermissions. +mcPlayerListener.NoSkillNote=[[DARK_GRAY]]wenn du keinen Zugriff auf einen Skill hast wird er nicht hier gezeigt +mcPlayerListener.NotInParty=[[RED]]Du bist in keiner Gruppe. +mcPlayerListener.InviteSuccess=[[GREEN]]Einladung erfolgreich versendet. +mcPlayerListener.ReceivedInvite1=[[RED]]ALERT: [[GREEN]]Du hast eine Gruppeneinladung für {0} von {1} +mcPlayerListener.ReceivedInvite2=[[YELLOW]]Schreibe[[GREEN]]/{0}[[YELLOW]] um die Einladung zu akzeptieren +mcPlayerListener.InviteAccepted=[[GREEN]]Einladung akzeptiert. du bist {0} beigetreten +mcPlayerListener.NoInvites=[[RED]]Du hast derzeit keine Einladungen +mcPlayerListener.YouAreInParty=[[GREEN]]Du bist in Gruppe {0} +mcPlayerListener.PartyMembers=[[GREEN]]Gruppen Mitglieder +mcPlayerListener.LeftParty=[[RED]]Du hast die Gruppe verlassen +mcPlayerListener.JoinedParty=beigetrettene Gruppe: {0} +mcPlayerListener.PartyChatOn=nur Gruppenchat [[RED]]an +mcPlayerListener.PartyChatOff=nur Gruppenchat [[RED]]aus +mcPlayerListener.AdminChatOn=nur Adminchat [[GREEN]]an +mcPlayerListener.AdminChatOff=nur Adminchat [[RED]]aus +mcPlayerListener.MOTD=[[BLUE]]Auf diesem Server laeuft {0} schreibe[[YELLOW]]/{1}[[BLUE]] fuer Hilfe. +mcPlayerListener.WIKI=[[GREEN]]http://mcmmo.wikia.com[[BLUE]] - mcMMO Wiki +mcPlayerListener.PowerLevel=[[DARK_RED]]POWER LEVEL: +mcPlayerListener.PowerLevelLeaderboard=[[YELLOW]]--mcMMO[[BLUE]] Power Level [[YELLOW]]Rangliste-- +mcPlayerListener.SkillLeaderboard=[[YELLOW]]--mcMMO [[BLUE]]{0}[[YELLOW]] Rangliste-- +mcPlayerListener.RepairSkill=[[YELLOW]]Reparieren Skill (Repair): +mcPlayerListener.SwordsSkill=[[YELLOW]]Schwert Skill (Swords): +mcPlayerListener.TamingSkill=[[YELLOW]]Bestienkunde Skill (Taming): +mcPlayerListener.UnarmedSkill=[[YELLOW]]Faustkampf Skill (Unarmed): +mcPlayerListener.WoodcuttingSkill=[[YELLOW]]Holzfaeller Skill (Woodcutting): +mcPlayerListener.YourStats=[[GREEN]]Deine MMO Werte +Party.InformedOnJoin={0} [[GREEN]] ist deiner Gruppe beigetreten +Party.InformedOnQuit={0} [[GREEN]] hat deine Gruppe verlassen +Skills.YourGreenTerra=[[GREEN]]Deine [[YELLOW]]Gruene Welt [[GREEN]]Faehigkeit ist bereit! +Skills.YourTreeFeller=[[GREEN]]Deine [[YELLOW]]Baumfaeller [[GREEN]]Faehigkeit ist bereit! +Skills.YourSuperBreaker=[[GREEN]]Deine [[YELLOW]]Super Brecher [[GREEN]]Faehigkeit ist bereit! +Skills.YourSerratedStrikes=[[GREEN]]Deine [[YELLOW]]Saegezahn-Schlag [[GREEN]]Faehigkeit ist bereit! +Skills.YourBerserk=[[GREEN]]Deine [[YELLOW]]Berserker [[GREEN]]Faehigkeit ist bereit! +Skills.YourSkullSplitter=[[GREEN]]Deine [[YELLOW]]Schaedelspalter[[GREEN]]Faehigkeit ist bereit! +Skills.YourGigaDrillBreaker=[[GREEN]]Deine [[YELLOW]]Giga Bohrer[[GREEN]]Faehigkeit ist bereit! +Skills.TooTired=[[RED]]Du bist zu muede um diese Faehigkeit erneut zu nutzen. +Skills.ReadyHoe=[[GREEN]]**DU BEREITEST DEINE HARKE VOR** +Skills.LowerHoe=[[GRAY]]**DU SENKST DEINE HARKE** +Skills.ReadyAxe=[[GREEN]]**DU BEREITEST DEINE AXT VOR** +Skills.LowerAxe=[[GRAY]]**DU SENKST DEINE AXT** +Skills.ReadyFists=[[GREEN]]**DU BEREITEST DEINE FAEUSTE VOR** +Skills.LowerFists=[[GRAY]]**DU SENKST DEINE FAUSTE** +Skills.ReadyPickAxe=[[GREEN]]**DU BEREITEST DEINE SPITZHACKE VOR** +Skills.LowerPickAxe=[[GRAY]]**DU SENKST DEINE SPITZHACKE** +Skills.ReadyShovel=[[GREEN]]**DU BEREITEST DEINE SCHAUFEL VOR** +Skills.LowerShovel=[[GRAY]]**DU SENKST DEINE SCHAUFEL** +Skills.ReadySword=[[GREEN]]**DU ERHEBST DEIN SCHWERT** +Skills.LowerSword=[[GRAY]]**DU SENKST DEIN SCHWERT** +Skills.GreenTerraOn=[[GREEN]]**GRUENE WELT AKTIV** +Skills.GreenTerraPlayer=[[GREEN]]{0}[[DARK_GREEN]] hat [[RED]]Green Terra[[DARK_GREEN]] benutzt! +Skills.TreeFellerOn=[[GREEN]]**BAUMFAELLER AKTIV** +Skills.TreeFellerPlayer=[[GREEN]]{0}[[DARK_GREEN]] hat [[RED]]Baumfaeller[[DARK_GREEN]] benutzt! +Skills.SuperBreakerOn=[[GREEN]]**SUPER BRECHER AKTIV** +Skills.SuperBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] hat [[RED]]Super Brecher[[DARK_GREEN]] benutzt! +Skills.SerratedStrikesOn=[[GREEN]]**SAEGEZAHN-SCHLAG AKTIV** +Skills.SerratedStrikesPlayer=[[GREEN]]{0}[[DARK_GREEN]] hat [[RED]]Saegezahn-Schlag[[DARK_GREEN]] benutzt! +Skills.SkullSplitterOn=[[GREEN]]**SCHAEDELSPALTER AKTIV** +Skills.SkullSplitterPlayer=[[GREEN]]{0}[[DARK_GREEN]] hat [[RED]]Schaedelspalter[[DARK_GREEN]] benutzt! +Skills.GigaDrillBreakerOn=[[GREEN]]**GIGA BOHRER AKTIV** +Skills.GigaDrillBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] hat [[RED]]GigaBohrer[[DARK_GREEN]] benutzt! +Skills.GreenTerraOff=[[RED]]**Gruene Welt ausgelaufen** +Skills.TreeFellerOff=[[RED]]**Baumfaeller ausgelaufen** +Skills.SuperBreakerOff=[[RED]]**Super Brecher ausgelaufen** +Skills.SerratedStrikesOff=[[RED]]**Saegezahn-Schlag ausgelaufen** +Skills.BerserkOff=[[RED]]**Berserker ausgelaufen** +Skills.SkullSplitterOff=[[RED]]**Schaedelspalter ausgelaufen** +Skills.GigaDrillBreakerOff=[[RED]]**Gruene Welt ausgelaufen** +Skills.TamingUp=[[YELLOW]]Bestienkunde um {0} erhoeht. Gesamt ({1}) +Skills.AcrobaticsUp=[[YELLOW]]Akrobatik um {0} erhoeht. Gesamt ({1}) +Skills.ArcheryUp=[[YELLOW]]Bogenschiessen um {0} erhoeht. Gesamt ({1}) +Skills.SwordsUp=[[YELLOW]]Schwert um {0} erhoeht. Gesamt ({1}) +Skills.AxesUp=[[YELLOW]]Axt um {0} erhoeht. Gesamt ({1}) +Skills.UnarmedUp=[[YELLOW]]Faustkampf um {0} erhoeht. Gesamt ({1}) +Skills.HerbalismUp=[[YELLOW]]Krauterkunde um {0} erhoeht. Gesamt ({1}) +Skills.MiningUp=[[YELLOW]]Bergbau um {0} erhoeht. Gesamt ({1}) +Skills.WoodcuttingUp=[[YELLOW]]Holzfaeller um {0} erhoeht. Gesamt ({1}) +Skills.RepairUp=[[YELLOW]]Reparieren um {0} erhoeht. Gesamt ({1}) +Skills.ExcavationUp=[[YELLOW]]Graben um {0} erhoeht. Gesamt ({1}) +Skills.FeltEasy=[[GRAY]]Das fuehlt sich einfach an. +Skills.StackedItems=[[DARK_RED]]Du kannst keine gestapelten Items reparieren +Skills.NeedMore=[[DARK_RED]]Du brauchst mehr +Skills.AdeptDiamond=[[DARK_RED]]Du bist nicht talentiert genug um Diamantwerkzeuge zu reparieren +Skills.FullDurability=[[GRAY]]Dieses Item hat volle Haltbarkeit +Skills.Disarmed=[[DARK_RED]]Du wurdest entwaffnet! +mcPlayerListener.SorcerySkill=Zauberkunst Skill (Sorcery): +m.SkillSorcery=Zauberkunst (Sorcery) +Sorcery.HasCast=[[GREEN]]**ZAUBERN**[[GOLD]] +Sorcery.Current_Mana=[[DARK_AQUA]]MP +Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]]) +Sorcery.Cost=[[RED]][COST] {0} MP +Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Kein Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]]) +Sorcery.Water.Thunder=GEWITTER +Sorcery.Curative.Self=HEILEN (SELBST) +Sorcery.Curative.Other=HEILEN (ANDERE) +m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) +Combat.BeastLore=[[GREEN]]**BESTIENKUNDE** +Combat.BeastLoreOwner=[[DARK_AQUA]]BEsitzer ([[RED]]{0}[[DARK_AQUA]]) +Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Gesundheit ([[GREEN]]{0}[[DARK_AQUA]]/20) +Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Gesundheit ([[GREEN]]{0}[[DARK_AQUA]]/8) \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/messages_en_us.properties b/mcMMO/com/gmail/nossr50/messages_en_us.properties new file mode 100644 index 000000000..e52aa20cc --- /dev/null +++ b/mcMMO/com/gmail/nossr50/messages_en_us.properties @@ -0,0 +1,323 @@ +Combat.WolfExamine=[[GREEN]]**You examine the Wolf using Beast Lore** +Combat.WolfShowMaster=[[DARK_GREEN]]The Beast's Master \: {0} +Combat.Ignition=[[RED]]**IGNITION** +Combat.BurningArrowHit=[[DARK_RED]]You were struck by a burning arrow\! +Combat.TouchedFuzzy=[[DARK_RED]]Touched Fuzzy. Felt Dizzy. +Combat.TargetDazed=Target was [[DARK_RED]]Dazed +Combat.WolfNoMaster=[[GRAY]]This Beast has no Master... +Combat.WolfHealth=[[GREEN]]This beast has {0} Health +Combat.StruckByGore=[[RED]]**STRUCK BY GORE** +Combat.Gore=[[GREEN]]**GORE** +Combat.ArrowDeflect=[[WHITE]]**ARROW DEFLECT** +Item.ChimaeraWingFail=**CHIMAERA WING FAILED\!** +Item.ChimaeraWingPass=**CHIMAERA WING** +Item.InjuredWait=You were injured recently and must wait to use this. [[YELLOW]]({0}s) +Item.NeedFeathers=[[GRAY]]You need more feathers.. +m.mccPartyCommands=[[GREEN]]--PARTY COMMANDS-- +m.mccParty=[party name] [[RED]]- Create/Join designated party +m.mccPartyQ=[[RED]]- Leave your current party +m.mccPartyToggle=[[RED]] - Toggle Party Chat +m.mccPartyInvite=[player name] [[RED]]- Send party invite +m.mccPartyAccept=[[RED]]- Accept party invite +m.mccPartyTeleport=[party member name] [[RED]]- Teleport to party member +m.mccOtherCommands=[[GREEN]]--OTHER COMMANDS-- +m.mccStats=- View your mcMMO stats +m.mccLeaderboards=- Leaderboards +m.mccMySpawn=- Teleports to myspawn +m.mccClearMySpawn=- Clears your MySpawn +m.mccToggleAbility=- Toggle ability activation with right click +m.mccAdminToggle=- Toggle admin chat +m.mccWhois=[playername] [[RED]]- View detailed player info +m.mccMmoedit=[playername] [skill] [newvalue] [[RED]]- Modify target +m.mccMcGod=- God Mode +m.mccSkillInfo=[skillname] [[RED]]- View detailed information about a skill +m.mccModDescription=[[RED]]- Read brief mod description +m.SkillHeader=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- +m.XPGain=[[DARK_GRAY]]XP GAIN: [[WHITE]]{0} +m.EffectsTemplate=[[DARK_AQUA]]{0}: [[GREEN]]{1} +m.AbilityLockTemplate=[[GRAY]]{0} +m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} +m.Effects=EFFECTS +m.YourStats=YOUR STATS +m.SkillTaming=TAMING +m.XPGainTaming=Wolves getting harmed +m.EffectsTaming1_0=Beast Lore +m.EffectsTaming1_1=Bone-whacking inspects wolves +m.EffectsTaming2_0=Gore +m.EffectsTaming2_1=Critical Strike that applies Bleed +m.EffectsTaming3_0=Sharpened Claws +m.EffectsTaming3_1=Damage Bonus +m.EffectsTaming4_0=Environmentally Aware +m.EffectsTaming4_1=Cactus/Lava Phobia, Fall DMG Immune +m.EffectsTaming5_0=Thick Fur +m.EffectsTaming5_1=DMG Reduction, Fire Resistance +m.EffectsTaming6_0=Shock Proof +m.EffectsTaming6_1=Explosive Damage Reduction +m.AbilLockTaming1=LOCKED UNTIL 100+ SKILL (ENVIRONMENTALLY AWARE) +m.AbilLockTaming2=LOCKED UNTIL 250+ SKILL (THICK FUR) +m.AbilLockTaming3=LOCKED UNTIL 500+ SKILL (SHOCK PROOF) +m.AbilLockTaming4=LOCKED UNTIL 750+ SKILL (SHARPENED CLAWS) +m.AbilBonusTaming1_0=Environmentally Aware +m.AbilBonusTaming1_1=Wolves avoid danger +m.AbilBonusTaming2_0=Thick Fur +m.AbilBonusTaming2_1=Halved Damage, Fire Resistance +m.AbilBonusTaming3_0=Shock Proof +m.AbilBonusTaming3_1=Explosives do 1/6 normal damage +m.AbilBonusTaming4_0=Sharpened Claws +m.AbilBonusTaming4_1=+2 Damage +m.TamingGoreChance=[[RED]]Gore Chance: [[YELLOW]]{0}% +m.SkillWoodCutting=WOODCUTTING +m.XPGainWoodCutting=Chopping down trees +m.EffectsWoodCutting1_0=Tree Feller (ABILITY) +m.EffectsWoodCutting1_1=Make trees explode +m.EffectsWoodCutting2_0=Leaf Blower +m.EffectsWoodCutting2_1=Blow Away Leaves +m.EffectsWoodCutting3_0=Double Drops +m.EffectsWoodCutting3_1=Double the normal loot +m.AbilLockWoodCutting1=LOCKED UNTIL 100+ SKILL (LEAF BLOWER) +m.AbilBonusWoodCutting1_0=Leaf Blower +m.AbilBonusWoodCutting1_1=Blow away leaves +m.WoodCuttingDoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}% +m.WoodCuttingTreeFellerLength=[[RED]]Tree Feller Length: [[YELLOW]]{0}s +m.SkillArchery=ARCHERY +m.XPGainArchery=Attacking Monsters +m.EffectsArchery1_0=Ignition +m.EffectsArchery1_1=25% Chance Enemies will ignite +m.EffectsArchery2_0=Daze (Players) +m.EffectsArchery2_1=Disorients foes +m.EffectsArchery3_0=Damage+ +m.EffectsArchery3_1=Modifies Damage +m.EffectsArchery4_0=Arrow Retrieval +m.EffectsArchery4_1=Chance to retrieve arrows from corpses +m.ArcheryDazeChance=[[RED]]Chance to Daze: [[YELLOW]]{0}% +m.ArcheryRetrieveChance=[[RED]]Chance to Retrieve Arrows: [[YELLOW]]{0}% +m.ArcheryIgnitionLength=[[RED]]Length of Ignition: [[YELLOW]]{0} seconds +m.ArcheryDamagePlus=[[RED]]Damage+ (Rank{0}): [[YELLOW]]Bonus {0} damage +m.SkillAxes=AXES +m.XPGainAxes=Attacking Monsters +m.EffectsAxes1_0=Skull Splitter (ABILITY) +m.EffectsAxes1_1=Deal AoE Damage +m.EffectsAxes2_0=Critical Strikes +m.EffectsAxes2_1=Double Damage +m.EffectsAxes3_0=Axe Mastery (500 SKILL) +m.EffectsAxes3_1=Modifies Damage +m.AbilLockAxes1=LOCKED UNTIL 500+ SKILL (AXEMASTERY) +m.AbilBonusAxes1_0=Axe Mastery +m.AbilBonusAxes1_1=Bonus 4 damage +m.AxesCritChance=[[RED]]Chance to critically strike: [[YELLOW]]{0}% +m.AxesSkullLength=[[RED]]Skull Splitter Length: [[YELLOW]]{0}s +m.SkillSwords=SWORDS +m.XPGainSwords=Attacking Monsters +m.EffectsSwords1_0=Counter Attack +m.EffectsSwords1_1=Reflect 50% of damage taken +m.EffectsSwords2_0=Serrated Strikes (ABILITY) +m.EffectsSwords2_1=25% DMG AoE, Bleed+ AoE +m.EffectsSwords3_0=Serrated Strikes Bleed+ +m.EffectsSwords3_1=5 Tick Bleed +m.EffectsSwords4_0=Parrying +m.EffectsSwords4_1=Negates Damage +m.EffectsSwords5_0=Bleed +m.EffectsSwords5_1=Apply a bleed DoT +m.SwordsCounterAttChance=[[RED]]Counter Attack Chance: [[YELLOW]]{0}% +m.SwordsBleedLength=[[RED]]Bleed Length: [[YELLOW]]{0} ticks +m.SwordsBleedChance=[[RED]]Bleed Chance: [[YELLOW]]{0} % +m.SwordsParryChance=[[RED]]Parry Chance: [[YELLOW]]{0} % +m.SwordsSSLength=[[RED]]Serrated Strikes Length: [[YELLOW]]{0}s +m.SwordsTickNote=[[GRAY]]NOTE: [[YELLOW]]1 Tick happens every 2 seconds +m.SkillAcrobatics=ACROBATICS +m.XPGainAcrobatics=Falling +m.EffectsAcrobatics1_0=Roll +m.EffectsAcrobatics1_1=Reduces or Negates damage +m.EffectsAcrobatics2_0=Graceful Roll +m.EffectsAcrobatics2_1=Twice as effective as Roll +m.EffectsAcrobatics3_0=Dodge +m.EffectsAcrobatics3_1=Reduce damage by half +m.AcrobaticsRollChance=[[RED]]Roll Chance: [[YELLOW]]{0}% +m.AcrobaticsGracefulRollChance=[[RED]]Graceful Roll Chance: [[YELLOW]]{0}% +m.AcrobaticsDodgeChance=[[RED]]Dodge Chance: [[YELLOW]]{0}% +m.SkillMining=MINING +m.XPGainMining=Mining Stone & Ore +m.EffectsMining1_0=Super Breaker (ABILITY) +m.EffectsMining1_1=Speed+, Triple Drop Chance +m.EffectsMining2_0=Double Drops +m.EffectsMining2_1=Double the normal loot +m.MiningDoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}% +m.MiningSuperBreakerLength=[[RED]]Super Breaker Length: [[YELLOW]]{0}s +m.SkillRepair=REPAIR +m.XPGainRepair=Repairing +m.EffectsRepair1_0=Repair +m.EffectsRepair1_1=Repair Iron Tools & Armor +m.EffectsRepair2_0=Repair Mastery +m.EffectsRepair2_1=Increased repair amount +m.EffectsRepair3_0=Super Repair +m.EffectsRepair3_1=Double effectiveness +m.EffectsRepair4_0=Diamond Repair ({0}+ SKILL) +m.EffectsRepair4_1=Repair Diamond Tools & Armor +m.RepairRepairMastery=[[RED]]Repair Mastery: [[YELLOW]]Extra {0}% durability restored +m.RepairSuperRepairChance=[[RED]]Super Repair Chance: [[YELLOW]]{0}% +m.SkillUnarmed=UNARMED +m.XPGainUnarmed=Attacking Monsters +m.EffectsUnarmed1_0=Berserk (ABILITY) +m.EffectsUnarmed1_1=+50% DMG, Breaks weak materials +m.EffectsUnarmed2_0=Disarm (Players) +m.EffectsUnarmed2_1=Drops the foes item held in hand +m.EffectsUnarmed3_0=Unarmed Mastery +m.EffectsUnarmed3_1=Large Damage Upgrade +m.EffectsUnarmed4_0=Unarmed Apprentice +m.EffectsUnarmed4_1=Damage Upgrade +m.EffectsUnarmed5_0=Arrow Deflect +m.EffectsUnarmed5_1=Deflect arrows +m.AbilLockUnarmed1=LOCKED UNTIL 250+ SKILL (UNARMED APPRENTICE) +m.AbilLockUnarmed2=LOCKED UNTIL 500+ SKILL (UNARMED MASTERY) +m.AbilBonusUnarmed1_0=Unarmed Apprentice +m.AbilBonusUnarmed1_1=+2 DMG Upgrade +m.AbilBonusUnarmed2_0=Unarmed Mastery +m.AbilBonusUnarmed2_1=+4 DMG Upgrade +m.UnarmedArrowDeflectChance=[[RED]]Arrow Deflect Chance: [[YELLOW]]{0}% +m.UnarmedDisarmChance=[[RED]]Disarm Chance: [[YELLOW]]{0}% +m.UnarmedBerserkLength=[[RED]]Berserk Length: [[YELLOW]]{0}s +m.SkillHerbalism=HERBALISM +m.XPGainHerbalism=Harvesting Herbs +m.EffectsHerbalism1_0=Green Terra (ABILITY) +m.EffectsHerbalism1_1=Spread the Terra, 3x Drops +m.EffectsHerbalism2_0=Green Thumb (Wheat) +m.EffectsHerbalism2_1=Auto-Plants wheat when harvesting +m.EffectsHerbalism3_0=Green Thumb (Cobble) +m.EffectsHerbalism3_1=Cobblestone -> Mossy w/ Seeds +m.EffectsHerbalism4_0=Food+ +m.EffectsHerbalism4_1=Modifies health received from bread/stew +m.EffectsHerbalism5_0=Double Drops (All Herbs) +m.EffectsHerbalism5_1=Double the normal loot +m.HerbalismGreenTerraLength=[[RED]]Green Terra Length: [[YELLOW]]{0}s +m.HerbalismGreenThumbChance=[[RED]]Green Thumb Chance: [[YELLOW]]{0}% +m.HerbalismGreenThumbStage=[[RED]]Green Thumb Stage: [[YELLOW]] Wheat grows in stage {0} +m.HerbalismDoubleDropChance=[[RED]]Double Drop Chance: [[YELLOW]]{0}% +m.HerbalismFoodPlus=[[RED]]Food+ (Rank{0}): [[YELLOW]]Bonus {0} healing +m.SkillExcavation=EXCAVATION +m.XPGainExcavation=Digging and finding treasures +m.EffectsExcavation1_0=Giga Drill Breaker (ABILITY) +m.EffectsExcavation1_1=3x Drop Rate, 3x EXP, +Speed +m.EffectsExcavation2_0=Treasure Hunter +m.EffectsExcavation2_1=Ability to dig for treasure +m.ExcavationGreenTerraLength=[[RED]]Giga Drill Breaker Length: [[YELLOW]]{0}s +mcBlockListener.PlacedAnvil=[[DARK_RED]]You have placed an anvil, anvils can repair tools and armor. +mcEntityListener.WolfComesBack=[[DARK_GRAY]]Your wolf scurries back to you... +mcPlayerListener.AbilitiesOff=Ability use toggled off +mcPlayerListener.AbilitiesOn=Ability use toggled on +mcPlayerListener.AbilitiesRefreshed=[[GREEN]]**ABILITIES REFRESHED\!** +mcPlayerListener.AcrobaticsSkill=Acrobatics: +mcPlayerListener.ArcherySkill=Archery: +mcPlayerListener.AxesSkill=Axes: +mcPlayerListener.ExcavationSkill=Excavation: +mcPlayerListener.GodModeDisabled=[[YELLOW]]mcMMO Godmode Disabled +mcPlayerListener.GodModeEnabled=[[YELLOW]]mcMMO Godmode Enabled +mcPlayerListener.GreenThumb=[[GREEN]]**GREEN THUMB** +mcPlayerListener.GreenThumbFail=[[RED]]**GREEN THUMB FAIL** +mcPlayerListener.HerbalismSkill=Herbalism: +mcPlayerListener.MiningSkill=Mining: +mcPlayerListener.MyspawnCleared=[[DARK_AQUA]]Myspawn is now cleared. +mcPlayerListener.MyspawnNotExist=[[RED]]Configure your myspawn first with a bed. +mcPlayerListener.MyspawnSet=[[DARK_AQUA]]Myspawn has been set to your current location. +mcPlayerListener.MyspawnTimeNotice=You must wait {0}m {1}s to use myspawn +mcPlayerListener.NoPermission=Insufficient mcPermissions. +mcPlayerListener.NoSkillNote=[[DARK_GRAY]]If you don't have access to a skill it will not be shown here. +mcPlayerListener.NotInParty=[[RED]]You are not in a party. +mcPlayerListener.InviteSuccess=[[GREEN]]Invite sent successfully. +mcPlayerListener.ReceivedInvite1=[[RED]]ALERT: [[GREEN]]You have received a party invite for {0} from {1} +mcPlayerListener.ReceivedInvite2=[[YELLOW]]Type [[GREEN]]/{0}[[YELLOW]] to accept the invite +mcPlayerListener.InviteAccepted=[[GREEN]]Invite Accepted. You have joined party {0} +mcPlayerListener.NoInvites=[[RED]]You have no invites at this time +mcPlayerListener.YouAreInParty=[[GREEN]]You are in party {0} +mcPlayerListener.PartyMembers=[[GREEN]]Party Members +mcPlayerListener.LeftParty=[[RED]]You have left that party +mcPlayerListener.JoinedParty=Joined Party: {0} +mcPlayerListener.PartyChatOn=Party Chat only [[GREEN]]On +mcPlayerListener.PartyChatOff=Party Chat only [[RED]]Off +mcPlayerListener.AdminChatOn=Admin Chat only [[GREEN]]On +mcPlayerListener.AdminChatOff=Admin Chat only [[RED]]Off +mcPlayerListener.MOTD=[[BLUE]]This server is running mcMMO {0} type [[YELLOW]]/{1}[[BLUE]] for help. +mcPlayerListener.WIKI=[[GREEN]]http://mcmmo.wikia.com[[BLUE]] - mcMMO Wiki +mcPlayerListener.PowerLevel=[[DARK_RED]]POWER LEVEL: +mcPlayerListener.PowerLevelLeaderboard=[[YELLOW]]--mcMMO[[BLUE]] Power Level [[YELLOW]]Leaderboard-- +mcPlayerListener.SkillLeaderboard=[[YELLOW]]--mcMMO [[BLUE]]{0}[[YELLOW]] Leaderboard-- +mcPlayerListener.RepairSkill=Repair: +mcPlayerListener.SwordsSkill=Swords: +mcPlayerListener.TamingSkill=Taming: +mcPlayerListener.UnarmedSkill=Unarmed: +mcPlayerListener.WoodcuttingSkill=Woodcutting: +mcPlayerListener.YourStats=[[GREEN]][mcMMO] Stats +Party.InformedOnJoin={0} [[GREEN]] has joined your party +Party.InformedOnQuit={0} [[GREEN]] has left your party +Skills.YourGreenTerra=[[GREEN]]Your [[YELLOW]]Green Terra [[GREEN]]ability is refreshed! +Skills.YourTreeFeller=[[GREEN]]Your [[YELLOW]]Tree Feller [[GREEN]]ability is refreshed! +Skills.YourSuperBreaker=[[GREEN]]Your [[YELLOW]]Super Breaker [[GREEN]]ability is refreshed! +Skills.YourSerratedStrikes=[[GREEN]]Your [[YELLOW]]Serrated Strikes [[GREEN]]ability is refreshed! +Skills.YourBerserk=[[GREEN]]Your [[YELLOW]]Berserk [[GREEN]]ability is refreshed! +Skills.YourSkullSplitter=[[GREEN]]Your [[YELLOW]]Skull Splitter [[GREEN]]ability is refreshed! +Skills.YourGigaDrillBreaker=[[GREEN]]Your [[YELLOW]]Giga Drill Breaker [[GREEN]]ability is refreshed! +Skills.TooTired=[[RED]]You are too tired to use that ability again. +Skills.ReadyHoe=[[GREEN]]**YOU READY YOUR HOE** +Skills.LowerHoe=[[GRAY]]**YOU LOWER YOUR HOE** +Skills.ReadyAxe=[[GREEN]]**YOU READY YOUR AXE** +Skills.LowerAxe=[[GRAY]]**YOU LOWER YOUR AXE** +Skills.ReadyFists=[[GREEN]]**YOU READY YOUR FISTS** +Skills.LowerFists=[[GRAY]]**YOU LOWER YOUR FISTS** +Skills.ReadyPickAxe=[[GREEN]]**YOU READY YOUR PICKAXE** +Skills.LowerPickAxe=[[GRAY]]**YOU LOWER YOUR PICKAXE** +Skills.ReadyShovel=[[GREEN]]**YOU READY YOUR SHOVEL** +Skills.LowerShovel=[[GRAY]]**YOU LOWER YOUR SHOVEL** +Skills.ReadySword=[[GREEN]]**YOU READY YOUR SWORD** +Skills.LowerSword=[[GRAY]]**YOU LOWER YOUR SWORD** +Skills.BerserkOn=[[GREEN]]**BERSERK ACTIVATED** +Skills.BerserkPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Berserk! +Skills.GreenTerraOn=[[GREEN]]**GREEN TERRA ACTIVATED** +Skills.GreenTerraPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Green Terra! +Skills.TreeFellerOn=[[GREEN]]**TREE FELLER ACTIVATED** +Skills.TreeFellerPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Tree Feller! +Skills.SuperBreakerOn=[[GREEN]]**SUPER BREAKER ACTIVATED** +Skills.SuperBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Super Breaker! +Skills.SerratedStrikesOn=[[GREEN]]**SERRATED STRIKES ACTIVATED** +Skills.SerratedStrikesPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Serrated Strikes! +Skills.SkullSplitterOn=[[GREEN]]**SKULL SPLITTER ACTIVATED** +Skills.SkullSplitterPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Skull Splitter! +Skills.GigaDrillBreakerOn=[[GREEN]]**GIGA DRILL BREAKER ACTIVATED** +Skills.GigaDrillBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Giga Drill Breaker! +Skills.GreenTerraOff=[[RED]]**Green Terra has worn off** +Skills.TreeFellerOff=[[RED]]**Tree Feller has worn off** +Skills.SuperBreakerOff=[[RED]]**Super Breaker has worn off** +Skills.SerratedStrikesOff=[[RED]]**Serrated Strikes has worn off** +Skills.BerserkOff=[[RED]]**Berserk has worn off** +Skills.SkullSplitterOff=[[RED]]**Skull Splitter has worn off** +Skills.GigaDrillBreakerOff=[[RED]]**Giga Drill Breaker has worn off** +Skills.TamingUp=[[YELLOW]]Taming skill increased by {0}. Total ({1}) +Skills.AcrobaticsUp=[[YELLOW]]Acrobatics skill increased by {0}. Total ({1}) +Skills.ArcheryUp=[[YELLOW]]Archery skill increased by {0}. Total ({1}) +Skills.SwordsUp=[[YELLOW]]Swords skill increased by {0}. Total ({1}) +Skills.AxesUp=[[YELLOW]]Axes skill increased by {0}. Total ({1}) +Skills.UnarmedUp=[[YELLOW]]Unarmed skill increased by {0}. Total ({1}) +Skills.HerbalismUp=[[YELLOW]]Herbalism skill increased by {0}. Total ({1}) +Skills.MiningUp=[[YELLOW]]Mining skill increased by {0}. Total ({1}) +Skills.WoodcuttingUp=[[YELLOW]]Woodcutting skill increased by {0}. Total ({1}) +Skills.RepairUp=[[YELLOW]]Repair skill increased by {0}. Total ({1}) +Skills.ExcavationUp=[[YELLOW]]Excavation skill increased by {0}. Total ({1}) +Skills.FeltEasy=[[GRAY]]That felt easy. +Skills.StackedItems=[[DARK_RED]]You can't repair stacked items +Skills.NeedMore=[[DARK_RED]]You need more +Skills.AdeptDiamond=[[DARK_RED]]You're not skilled enough to repair Diamond +Skills.FullDurability=[[GRAY]]That is at full durability. +Skills.Disarmed=[[DARK_RED]]You have been disarmed! +mcPlayerListener.SorcerySkill=Sorcery: +m.SkillSorcery=SORCERY +Sorcery.HasCast=[[GREEN]]**CASTING**[[GOLD]] +Sorcery.Current_Mana=[[DARK_AQUA]]MP +Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]]) +Sorcery.Cost=[[RED]][COST] {0} MP +Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Out Of Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]]) +Sorcery.Water.Thunder=THUNDER +Sorcery.Curative.Self=CURE SELF +Sorcery.Curative.Other=CURE OTHER +m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) +Combat.BeastLore=[[GREEN]]**BEAST LORE** +Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]]) +Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/20) +Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/8) \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/messages_fi.properties b/mcMMO/com/gmail/nossr50/messages_fi.properties new file mode 100644 index 000000000..d4284b3f7 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/messages_fi.properties @@ -0,0 +1,323 @@ +Combat.WolfExamine=[[GREEN]]**Tutkit sutta käyttämällä Pedon Tarinaa** +Combat.WolfShowMaster=[[DARK_GREEN]]Pedon isäntä \: {0} +Combat.Ignition=[[RED]]**SYTYTYS** +Combat.BurningArrowHit=[[DARK_RED]]Palava nuoli osui sinuun\! +Combat.TouchedFuzzy=[[DARK_RED]]Touched Fuzzy. Felt Dizzy. +Combat.TargetDazed=Kohde [[DARK_RED]]tyrmätty +Combat.WolfNoMaster=[[GRAY]]Tällä pedolla ei ole isäntää... +Combat.WolfHealth=[[GREEN]]Tämän pedon terveys on {0} +Combat.StruckByGore=[[RED]]**SINUA ON PISTETTY** +Combat.Gore=[[GREEN]]**PISTO** +Combat.ArrowDeflect=[[WHITE]]**NUOLI TORJUTTU** +Item.ChimaeraWingFail=**KHIMAIRAN SIIVEN KÄYTTÖ EPÄONNISTUI\!** +Item.ChimaeraWingPass=**KHIMAIRAN SIIPI** +Item.InjuredWait=Sinua on haavoitettu äskettäin joten joudut odottaa tämän käyttöä. [[YELLOW]]({0}s) +Item.NeedFeathers=[[GRAY]]Tarvitset lisää sulkia.. +m.mccPartyCommands=[[GREEN]]--RYHMÄKOMENNOT-- +m.mccParty=[party name] [[RED]]- Luo/liity nimettyyn ryhmään +m.mccPartyQ=[[RED]]- Lähde ryhmästä +m.mccPartyToggle=[[RED]] - Laita ryhmäjuttelu päälle/pois +m.mccPartyInvite=[player name] [[RED]]- Lähetä ryhmäkutsu +m.mccPartyAccept=[[RED]]- Hyväksy ryhmäkutsu +m.mccPartyTeleport=[party member name] [[RED]]- Siirry ryhmän jäsenen luo +m.mccOtherCommands=[[GREEN]]--MUUT KOMENNOT-- +m.mccStats=- Näytä mcMMO tilastosi +m.mccLeaderboards=- Tulostaulukko +m.mccMySpawn=- Siirtää sinut myspawniin +m.mccClearMySpawn=- Tyhjää myspawnisi +m.mccToggleAbility=- Laita taitojen aktivointi oikealla näppäimellä päälle/pois +m.mccAdminToggle=- Laita admin juttelu päälle/pois +m.mccWhois=[playername] [[RED]]- Näytä yksityiskohtaiset tiedot pelaajasta +m.mccMmoedit=[playername] [skill] [newvalue] [[RED]]- Muokkaa kohdetta +m.mccMcGod=- "God Mode" +m.mccSkillInfo=[skillname] [[RED]]- Näytä ykistyiskohtaiset tiedot taidosta +m.mccModDescription=[[RED]]- Lue lyhyt kuvaus modista +m.SkillHeader=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- +m.XPGain=[[DARK_GRAY]]KOKEMUSPISTEIDEN MÄÄRÄ: [[WHITE]]{0} +m.EffectsTemplate=[[DARK_AQUA]]{0}: [[GREEN]]{1} +m.AbilityLockTemplate=[[GRAY]]{0} +m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} +m.Effects=EFEKTIT +m.YourStats=TILASTOSI +m.SkillTaming=KESYTTÄMINEN +m.XPGainTaming=Susien satuttaminen +m.EffectsTaming1_0=Pedon Tarina +m.EffectsTaming1_1=Luulla lyöminen tutkii susia +m.EffectsTaming2_0=Pisto +m.EffectsTaming2_1=Kriittinen Isku joka lisää Verenvuodon +m.EffectsTaming3_0=Teroitetut Kynnet +m.EffectsTaming3_1=Tuhoamis Bonus +m.EffectsTaming4_0=Ympäristötietoinen +m.EffectsTaming4_1=Kaktus/Laavapelko, immuuni Putousvahingolle +m.EffectsTaming5_0=Paksu Turkki +m.EffectsTaming5_1=Vahingon vähennys, Tulenkestävä +m.EffectsTaming6_0=Räjähdyskestävä +m.EffectsTaming6_1=Räjähdysvahingon vähennys +m.AbilLockTaming1=LUKITTU KUNNES 100+ TAITO (YMPÄRISTÖTIETOINEN) +m.AbilLockTaming2=LUKITTU KUNNES 250+ TAITO (PAKSU TURKKI) +m.AbilLockTaming3=LUKITTU KUNNES 500+ TAITO (RÄJÄHDYSKESTÄVÄ) +m.AbilLockTaming4=LUKITTU KUNNES 750+ TAITO (TEROITETUT KYNNET) +m.AbilBonusTaming1_0=Ympäristötietoinen +m.AbilBonusTaming1_1=Sudet karttavat vaaraa +m.AbilBonusTaming2_0=Paksu Turkki +m.AbilBonusTaming2_1=Puolitettu vahinko, Tulenkestävä +m.AbilBonusTaming3_0=Räjähdyskestävä +m.AbilBonusTaming3_1=Räjähteet vahingoittavat 1/6 vähemmän +m.AbilBonusTaming4_0=Teroitetut Kynnet +m.AbilBonusTaming4_1=+2 Vahinko +m.TamingGoreChance=[[RED]]Piston todennäköisyys: [[YELLOW]]{0}% +m.SkillWoodCutting=PUUN KAATO +m.XPGainWoodCutting=Puiden pilkkominen +m.EffectsWoodCutting1_0=Puunkaataja (TAITO) +m.EffectsWoodCutting1_1=Räjäytä puita +m.EffectsWoodCutting2_0=Lehdenpuhallin +m.EffectsWoodCutting2_1=Puhalla lehtiä pois +m.EffectsWoodCutting3_0=Tuplasaalis +m.EffectsWoodCutting3_1=Tuplaa normaali saalis +m.AbilLockWoodCutting1=LUKITTU KUNNES 100+ TAITO (LEHDENPUHALLIN) +m.AbilBonusWoodCutting1_0=Lehdenpuhallin +m.AbilBonusWoodCutting1_1=Puhalla lehtiä pois +m.WoodCuttingDoubleDropChance=[[RED]]Tuplasaaliin todennäköisyys: [[YELLOW]]{0}% +m.WoodCuttingTreeFellerLength=[[RED]]Puunkaatajan kesto: [[YELLOW]]{0}s +m.SkillArchery=JOUSIAMMUNTA +m.XPGainArchery=Hyökkäämällä hirviöiden kimppuun +m.EffectsArchery1_0=Sytytys +m.EffectsArchery1_1=25% Todennäköisyys että vihollinen syttyy tuleen +m.EffectsArchery2_0=Pökerrys (Pelaajat) +m.EffectsArchery2_1=Saa viholliset pois tolaltaan +m.EffectsArchery3_0=Vahinko+ +m.EffectsArchery3_1=Muokkaa vahinkoa +m.EffectsArchery4_0=Nuolenkeräys +m.EffectsArchery4_1=Todennäköisyys kerätä nuolia raadoista +m.ArcheryDazeChance=[[RED]]Todennäköisyys Pökerryttää: [[YELLOW]]{0}% +m.ArcheryRetrieveChance=[[RED]]Todennäköisyys kerätä nuolia: [[YELLOW]]{0}% +m.ArcheryIgnitionLength=[[RED]]Sytytyksen kesto: [[YELLOW]]{0} sekuntia +m.ArcheryDamagePlus=[[RED]]Vahinko+ (Rank{0}): [[YELLOW]]Bonus {0} vahinko +m.SkillAxes=KIRVEET +m.XPGainAxes=Hyökkäämällä hirviöiden kimppuun +m.EffectsAxes1_0=Kallonhalkoja (TAITO) +m.EffectsAxes1_1=Tee aluevahinkoa +m.EffectsAxes2_0=Kriittiset Iskut +m.EffectsAxes2_1=Tuplavahinko +m.EffectsAxes3_0=Kirveiden Herra (500 TAITO) +m.EffectsAxes3_1=Muokkaa vahinkoa +m.AbilLockAxes1=LUKITTU KUNNES 500+ TAITO (KIRVEIDEN HERRA) +m.AbilBonusAxes1_0=Kirveiden Herra +m.AbilBonusAxes1_1=+4 Vahinko +m.AxesCritChance=[[RED]]Todennäköisyys iskeä kriittisesti: [[YELLOW]]{0}% +m.AxesSkullLength=[[RED]]Kallonhalkojan kesto: [[YELLOW]]{0}s +m.SkillSwords=MIEKAT +m.XPGainSwords=Hyökkäämällä hirviöiden kimppuun +m.EffectsSwords1_0=Vastaisku +m.EffectsSwords1_1=Kimmota 50% saadusta vahingosta +m.EffectsSwords2_0=Sahalaitaiset Iskut (TAITO) +m.EffectsSwords2_1=25% Aluevahinko, Verenvuoto+ Aluevahinko +m.EffectsSwords3_0=Sahalaitaiset Iskut Verenvuoto+ +m.EffectsSwords3_1=5 Aiheuta Verenvuotoa +m.EffectsSwords4_0=Torjuminen +m.EffectsSwords4_1=Estää saadun vahingon +m.EffectsSwords5_0=Verenvuoto +m.EffectsSwords5_1=Lisää Verenvuoto +m.SwordsCounterAttChance=[[RED]]Vastaiskun todennäköisyys: [[YELLOW]]{0}% +m.SwordsBleedLength=[[RED]]Verenvuodon kesto: [[YELLOW]]{0} vuotoa +m.SwordsBleedChance=[[RED]]Verenvuodon todennäköisyys: [[YELLOW]]{0} % +m.SwordsParryChance=[[RED]]Torjumisen todennäköisyys: [[YELLOW]]{0} % +m.SwordsSSLength=[[RED]]Sahalaitaisten Iskujen kesto: [[YELLOW]]{0}s +m.SwordsTickNote=[[GRAY]]HUOMAA: [[YELLOW]]1 vuoto tapahtuu joka kahdes sekunti +m.SkillAcrobatics=AKROBATIA +m.XPGainAcrobatics=Tippumalla +m.EffectsAcrobatics1_0=Kieriminen +m.EffectsAcrobatics1_1=Vähentää tai estää vahinkoa +m.EffectsAcrobatics2_0=Sulava Kieriminen +m.EffectsAcrobatics2_1=Tuplasti tehokkaampi kuin Kieriminen +m.EffectsAcrobatics3_0=Väistö +m.EffectsAcrobatics3_1=Vähentää vahingon määrän puoleen +m.AcrobaticsRollChance=[[RED]]Kierimisen todennäköisyys: [[YELLOW]]{0}% +m.AcrobaticsGracefulRollChance=[[RED]]Sulavan Kierimisen todennäköisyys: [[YELLOW]]{0}% +m.AcrobaticsDodgeChance=[[RED]]Väistön todennäköisyys: [[YELLOW]]{0}% +m.SkillMining=LOUHINTA +m.XPGainMining=Louhimalla kiveä ja malmia +m.EffectsMining1_0=Supermurskain (TAITO) +m.EffectsMining1_1=Nopeus+, Triplaa saaliin tippumistodennäköisyys +m.EffectsMining2_0=Tuplasaalis +m.EffectsMining2_1=Tuplaa normaali saaliin määrä +m.MiningDoubleDropChance=[[RED]]Tuplasaaliin todennäköisyys: [[YELLOW]]{0}% +m.MiningSuperBreakerLength=[[RED]]Supermurskaimen kesto: [[YELLOW]]{0}s +m.SkillRepair=KORJAUS +m.XPGainRepair=Korjaamalla +m.EffectsRepair1_0=Korjaa +m.EffectsRepair1_1=Korjaa rautatyökaluja ja haarniskoja +m.EffectsRepair2_0=Korjausten Herra +m.EffectsRepair2_1=Lisätty korjausten määrä +m.EffectsRepair3_0=Superkorjaus +m.EffectsRepair3_1=Tuplatehokkuus +m.EffectsRepair4_0=Timanttikorjaus ({0}+ TAITO) +m.EffectsRepair4_1=Korjaa timanttityökaluja ja haarniskoja +m.RepairRepairMastery=[[RED]]Korjausten Herra: [[YELLOW]]Extra {0}% kestävyyttä palautettu +m.RepairSuperRepairChance=[[RED]]Superkorjauksen todennäköisyys: [[YELLOW]]{0}% +m.SkillUnarmed=ASEISTAMATON +m.XPGainUnarmed=Hyökkäämällä hirviöiden kimppuun +m.EffectsUnarmed1_0=Raivopää (TAITO) +m.EffectsUnarmed1_1=+50% vahinko, rikkoo heikkoja materiaaleja +m.EffectsUnarmed2_0=Aseista riisuminen (Pelaajat) +m.EffectsUnarmed2_1=Pudottaa vihollisen esineen kädestä +m.EffectsUnarmed3_0=Aseistamattomuuden Herra +m.EffectsUnarmed3_1=Suuri vahingonlisäys +m.EffectsUnarmed4_0=Aseistamattomuuden Aloittelija +m.EffectsUnarmed4_1=Vahingonlisäys +m.EffectsUnarmed5_0=Nuolentorjunta +m.EffectsUnarmed5_1=Torjuu nuolia +m.AbilLockUnarmed1=LUKITTU KUNNES 250+ TAITO (ASEISTAMATTOMUUDEN ALOITTELIJA) +m.AbilLockUnarmed2=LUKITTU KUNNES 500+ TAITO (ASEISTAMATTOMUUDEN HERRA) +m.AbilBonusUnarmed1_0=Aseistamattomuuden Aloittelija +m.AbilBonusUnarmed1_1=+2 Vahinko +m.AbilBonusUnarmed2_0=Aseistamattomuuden Herra +m.AbilBonusUnarmed2_1=+4 Vahinko +m.UnarmedArrowDeflectChance=[[RED]]Nuolentorjunnan todennäköisyys: [[YELLOW]]{0}% +m.UnarmedDisarmChance=[[RED]]Aseista riisumisen todennäköisyys: [[YELLOW]]{0}% +m.UnarmedBerserkLength=[[RED]]Raivopään kesto: [[YELLOW]]{0}s +m.SkillHerbalism=YRTTIHOITO +m.XPGainHerbalism=Keräämällä yrttejä +m.EffectsHerbalism1_0=Vihermaa (TAITO) +m.EffectsHerbalism1_1=Levitä vihreyttä, 3x saalis +m.EffectsHerbalism2_0=Viherpeukalo (Vehnä) +m.EffectsHerbalism2_1=Istuttaa vehnää automaattisesti kun keräät vehnää +m.EffectsHerbalism3_0=Viherpeukalo (Mukulakivi) +m.EffectsHerbalism3_1=Mukulakivi -> Sammaleinen mukulakivi ja siemeniä +m.EffectsHerbalism4_0=Ruoka+ +m.EffectsHerbalism4_1=Muokkaa terveyttä jota saat leivästä/muhennoksesta +m.EffectsHerbalism5_0=Tuplasaalis (Kaikki yrtit) +m.EffectsHerbalism5_1=Tuplaa normaali saaliin määrä +m.HerbalismGreenTerraLength=[[RED]]Vihermaan kesto: [[YELLOW]]{0}s +m.HerbalismGreenThumbChance=[[RED]]Viherpeukalon todennäköisyys: [[YELLOW]]{0}% +m.HerbalismGreenThumbStage=[[RED]]Viherpeukalon vaihe: [[YELLOW]] Vehnä kasvaa {0}:ssa vaiheessa +m.HerbalismDoubleDropChance=[[RED]]Tuplasaaliin todennäköisyys: [[YELLOW]]{0}% +m.HerbalismFoodPlus=[[RED]]Ruoka+ (Rank{0}): [[YELLOW]]Bonus {0} terveyden määrä +m.SkillExcavation=KAIVANTO +m.XPGainExcavation=Kaivamalla ja löytämällä aarteita +m.EffectsExcavation1_0=Giga Drill Breaker (TAITO) +m.EffectsExcavation1_1=3x saaliin määrä, 3x kokemuspisteiden määrä, +Nopeus +m.EffectsExcavation2_0=Aarteenmetsästäjä +m.EffectsExcavation2_1=Taito jonka avulla voit kaivaa aarteita +m.ExcavationGreenTerraLength=[[RED]]Giga Drill Breaker kesto: [[YELLOW]]{0}s +mcBlockListener.PlacedAnvil=[[DARK_RED]]Olet asettanut alasimen maahan, sillä voit korjata työkaluja ja haarniskoja. +mcEntityListener.WolfComesBack=[[DARK_GRAY]]Sutesi kipittää takaisin luoksesi... +mcPlayerListener.AbilitiesOff=Taitojen käyttö pois päältä +mcPlayerListener.AbilitiesOn=Taitojen käyttö päällä +mcPlayerListener.AbilitiesRefreshed=[[GREEN]]**TAIDOT PÄIVITETTY\!** +mcPlayerListener.AcrobaticsSkill=[[YELLOW]]Akrobatia: +mcPlayerListener.ArcherySkill=[[YELLOW]]Jousiammunta: +mcPlayerListener.AxesSkill=[[YELLOW]]Kirveet: +mcPlayerListener.ExcavationSkill=[[YELLOW]]Kaivanto: +mcPlayerListener.GodModeDisabled=[[YELLOW]]mcMMO Godmode pois päältä +mcPlayerListener.GodModeEnabled=[[YELLOW]]mcMMO Godmode päällä +mcPlayerListener.GreenThumb=[[GREEN]]**VIHERPEUKALO** +mcPlayerListener.GreenThumbFail=[[RED]]**VIHERPEUKALO EPÄONNISTUI** +mcPlayerListener.HerbalismSkill=[[YELLOW]]Yrttihoito: +mcPlayerListener.MiningSkill=[[YELLOW]]Kaivanto: +mcPlayerListener.MyspawnCleared=[[DARK_AQUA]]Myspawn on tyhjätty. +mcPlayerListener.MyspawnNotExist=[[RED]]Määrää myspawnisi ensin laittamalla sänky maahan. +mcPlayerListener.MyspawnSet=[[DARK_AQUA]]Myspawn on asetettu tämänhetkiseen sijaintiisi. +mcPlayerListener.MyspawnTimeNotice=Sinun pitää odottaa {0}m {1}s käyttääksesi myspawnia +mcPlayerListener.NoPermission=Puutteelliset oikeudet (mcPermissions) +mcPlayerListener.NoSkillNote=[[DARK_GRAY]]Jos sinulla ei ole käyttöoikeutta johonkin taitoon, sitä ei näytetä täällä. +mcPlayerListener.NotInParty=[[RED]]Et ole ryhmässä. +mcPlayerListener.InviteSuccess=[[GREEN]]Kutsu lähetetty. +mcPlayerListener.ReceivedInvite1=[[RED]]HUOMIO: [[GREEN]]Olet saanut ryhmäkutsun ryhmään {0} pelaajalta {1} +mcPlayerListener.ReceivedInvite2=[[YELLOW]]Kirjoita [[GREEN]]/{0}[[YELLOW]] hyväksyäksesi kutsun +mcPlayerListener.InviteAccepted=[[GREEN]]Kutsu hyväksytty. Olet liittynyt ryhmään {0} +mcPlayerListener.NoInvites=[[RED]]Sinulla ei ole kutsuja +mcPlayerListener.YouAreInParty=[[GREEN]]Olet ryhmässä {0} +mcPlayerListener.PartyMembers=[[GREEN]]Ryhmän jäsenet +mcPlayerListener.LeftParty=[[RED]]Olet lähtenyt ryhmästä +mcPlayerListener.JoinedParty=Liityit ryhmään: {0} +mcPlayerListener.PartyChatOn=Vain ryhmäjuttelu [[GREEN]]Päällä +mcPlayerListener.PartyChatOff=Vain ryhmäjuttelu [[RED]]Pois päältä +mcPlayerListener.AdminChatOn=Vain admin juttelu [[GREEN]]Päällä +mcPlayerListener.AdminChatOff=Vain admin juttelu [[RED]]Pois päältä +mcPlayerListener.MOTD=[[BLUE]]Tällä serverillä on mcMMO {0} kirjoita [[YELLOW]]/{1}[[BLUE]] apua varten. +mcPlayerListener.WIKI=[[GREEN]]http://mcmmo.wikia.com[[BLUE]] - mcMMO Wiki +mcPlayerListener.PowerLevel=[[DARK_RED]]VOIMATASO: +mcPlayerListener.PowerLevelLeaderboard=[[YELLOW]]--mcMMO[[BLUE]] Voimataso [[YELLOW]]Tulostaulukko-- +mcPlayerListener.SkillLeaderboard=[[YELLOW]]--mcMMO [[BLUE]]{0}[[YELLOW]] Tulostaulukko-- +mcPlayerListener.RepairSkill=[[YELLOW]]Korjaus: +mcPlayerListener.SwordsSkill=[[YELLOW]]Miekat: +mcPlayerListener.TamingSkill=[[YELLOW]]Kesytys: +mcPlayerListener.UnarmedSkill=[[YELLOW]]Aseistamattomuus: +mcPlayerListener.WoodcuttingSkill=[[YELLOW]]Puunkaato: +mcPlayerListener.YourStats=[[GREEN]]Sinun MMO tilastosi +Party.InformedOnJoin={0} [[GREEN]] on liittynyt ryhmään +Party.InformedOnQuit={0} [[GREEN]] on lähtenyt ryhmästä +Skills.YourGreenTerra=[[GREEN]]Voit taas käyttää [[YELLOW]]Vihermaa [[GREEN]]taitoasi! +Skills.YourTreeFeller=[[GREEN]]Voit taas käyttää [[YELLOW]]Puunkaataja [[GREEN]]taitoasi! +Skills.YourSuperBreaker=[[GREEN]]Voit taas käyttää [[YELLOW]]Supermurskain [[GREEN]]taitoasi! +Skills.YourSerratedStrikes=[[GREEN]]Voit taas käyttää [[YELLOW]]Sahalaitaiset Iskut [[GREEN]]taitoasi! +Skills.YourBerserk=[[GREEN]]Voit taas käyttää [[YELLOW]]Raivopää [[GREEN]]taitoasi! +Skills.YourSkullSplitter=[[GREEN]]Voit taas käyttää [[YELLOW]]Kallonhalkoja [[GREEN]]taitoasi! +Skills.YourGigaDrillBreaker=[[GREEN]]Voit taas käyttää [[YELLOW]]Giga Drill Breaker [[GREEN]]taitoasi! +Skills.TooTired=[[RED]]Olet liian väsynyt käyttääksesi tuota taitoa uudestaan. +Skills.ReadyHoe=[[GREEN]]**OLET VALMIINA KÄYTTÄMÄÄN KUOKKAA** +Skills.LowerHoe=[[GRAY]]**LASKET KUOKKASI** +Skills.ReadyAxe=[[GREEN]]**OLET VALMIINA KÄYTTÄMÄÄN KIRVESTÄ** +Skills.LowerAxe=[[GRAY]]**LASKET KIRVEESI** +Skills.ReadyFists=[[GREEN]]**OLET VALMIINA KÄYTTÄMÄÄN NYRKKEJÄSI** +Skills.LowerFists=[[GRAY]]**LASKET NYRKKISI** +Skills.ReadyPickAxe=[[GREEN]]**OLET VALMIINA KÄYTTÄMÄÄN HAKKUASI** +Skills.LowerPickAxe=[[GRAY]]**LASKET HAKKUSI** +Skills.ReadyShovel=[[GREEN]]**OLET VALMIINA KÄYTTÄMÄÄN LAPIOTASI** +Skills.LowerShovel=[[GRAY]]**LASKET LAPIOSI** +Skills.ReadySword=[[GREEN]]**OLET VALMIINA KÄYTTÄMÄÄN MIEKKAASI** +Skills.LowerSword=[[GRAY]]**LASKET MIEKKASI** +Skills.BerserkOn=[[GREEN]]**BERSERK ACTIVATED** +Skills.BerserkPlayer=[[GREEN]]{0}[[DARK_GREEN]] has used [[RED]]Berserk! +Skills.GreenTerraOn=[[GREEN]]**VIHERMAA AKTIVOITU** +Skills.GreenTerraPlayer=[[GREEN]]{0}[[DARK_GREEN]] käytti [[RED]]Vihermaata! +Skills.TreeFellerOn=[[GREEN]]**PUUNKAATAJA AKTIVOITU** +Skills.TreeFellerPlayer=[[GREEN]]{0}[[DARK_GREEN]] käytti [[RED]]Puunkaatajaa! +Skills.SuperBreakerOn=[[GREEN]]**SUPERMURSKAIN AKTIVOITU** +Skills.SuperBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] käytti [[RED]]Supermurskainta! +Skills.SerratedStrikesOn=[[GREEN]]**SAHALAITAISET ISKUT AKTIVOITU** +Skills.SerratedStrikesPlayer=[[GREEN]]{0}[[DARK_GREEN]] käytti [[RED]]Sahalaitaisia Iskuja! +Skills.SkullSplitterOn=[[GREEN]]**KALLONHALKOJA AKTIVOITU** +Skills.SkullSplitterPlayer=[[GREEN]]{0}[[DARK_GREEN]] käytti [[RED]]Kallonhalkojaa! +Skills.GigaDrillBreakerOn=[[GREEN]]**GIGA DRILL BREAKER AKTIVOITU** +Skills.GigaDrillBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] käytti [[RED]]Giga Drill Breakeria! +Skills.GreenTerraOff=[[RED]]**Vihermaa kului pois** +Skills.TreeFellerOff=[[RED]]**Puunkaataja kului pois** +Skills.SuperBreakerOff=[[RED]]**Supermurskain kului pois** +Skills.SerratedStrikesOff=[[RED]]**Sahalaitaiset Iskut kului pois** +Skills.BerserkOff=[[RED]]**Raivopää kului pois** +Skills.SkullSplitterOff=[[RED]]**Kallonhalkoja kului pois** +Skills.GigaDrillBreakerOff=[[RED]]**Giga Drill Breaker kului pois** +Skills.TamingUp=[[YELLOW]]Sait {0} kesytyspistettä. Kokonaismäärä ({1}) +Skills.AcrobaticsUp=[[YELLOW]]Sait {0} akrobatiikkapistettä. Kokonaismäärä ({1}) +Skills.ArcheryUp=[[YELLOW]]Sait {0} jousiammuntapistettä. Kokonaismäärä ({1}) +Skills.SwordsUp=[[YELLOW]]Sait {0} miekkapistettä. Kokonaismäärä ({1}) +Skills.AxesUp=[[YELLOW]]Sait {0} kirvespistettä. Kokonaismäärä ({1}) +Skills.UnarmedUp=[[YELLOW]]Sait {0} aseistamattomuuspistettä. Kokonaismäärä ({1}) +Skills.HerbalismUp=[[YELLOW]]Sait {0} yrttihoitopistettä. Kokonaismäärä ({1}) +Skills.MiningUp=[[YELLOW]]Sait {0} louhimispistettä. Kokonaismäärä ({1}) +Skills.WoodcuttingUp=[[YELLOW]]Sait {0} puunkaatopistettä. Kokonaismäärä ({1}) +Skills.RepairUp=[[YELLOW]]Sait {0} korjauspistettä. Kokonaismäärä ({1}) +Skills.ExcavationUp=[[YELLOW]]Sait {0} kaivantopistettä. Kokonaismäärä ({1}) +Skills.FeltEasy=[[GRAY]]That felt easy. +Skills.StackedItems=[[DARK_RED]]You can't repair stacked items +Skills.NeedMore=[[DARK_RED]]You need more +Skills.AdeptDiamond=[[DARK_RED]]You're not skilled enough to repair Diamond +Skills.FullDurability=[[GRAY]]That is at full durability. +Skills.Disarmed=[[DARK_RED]]You have been disarmed! +mcPlayerListener.SorcerySkill=Sorcery: +m.SkillSorcery=SORCERY +Sorcery.HasCast=[[GREEN]]**CASTING**[[GOLD]] +Sorcery.Current_Mana=[[DARK_AQUA]]MP +Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]]) +Sorcery.Cost=[[RED]][COST] {0} MP +Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Out Of Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]]) +Sorcery.Water.Thunder=THUNDER +Sorcery.Curative.Self=CURE SELF +Sorcery.Curative.Other=CURE OTHER +m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) +Combat.BeastLore=[[GREEN]]**BEAST LORE** +Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]]) +Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/20) +Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/8) \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/messages_fr.properties b/mcMMO/com/gmail/nossr50/messages_fr.properties new file mode 100644 index 000000000..1a60d0fe6 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/messages_fr.properties @@ -0,0 +1,321 @@ +Combat.WolfExamine=[[GREEN]]**Vous exminez le loup avec le Beast Lore** +Combat.WolfShowMaster=[[DARK_GREEN]]Le Maitre des betes \: {0} +Combat.Ignition=[[RED]]**ALLUMAGE** +Combat.BurningArrowHit=[[DARK_RED]]Vous avez été frappé par une flèche brûlante\! +Combat.TouchedFuzzy=[[DARK_RED]]Vous voyez floue. Vous vous senter étourdi. +Combat.TargetDazed=La cible a été [[DARK_RED]]Étourdi +Combat.WolfNoMaster=[[GRAY]]Cette bete n'a pas de maitre... +Combat.WolfHealth=[[GREEN]]Cette bete a {0} de Vie +Combat.StruckByGore=[[RED]]**FRAPPE JUSQU'AU SANG** +Combat.Gore=[[GREEN]]**SANG** +Combat.ArrowDeflect=[[WHITE]]**FLECHE DEVIER** +Item.ChimaeraWingFail=**CHIMAERA WING MANQUE\!** +Item.ChimaeraWingPass=**CHIMAERA WING** +Item.InjuredWait=Vous avez été blessé récemment et vous devez attendre pour l'utiliser. [[YELLOW]]({0}s) +Item.NeedFeathers=[[GRAY]]Vous avez besoin de plus de plumes.. +m.mccPartyCommands=[[GREEN]]--COMMANDES PARTIE-- +m.mccParty=[party name] [[RED]]- Créer / Rejoignez partie désignée +m.mccPartyQ=[[RED]]- Vous quitter la partie en cours +m.mccPartyToggle=[[RED]] - Active le Chat en groupe +m.mccPartyInvite=[player name] [[RED]]- Envoye une invite +m.mccPartyAccept=[[RED]]- Accepter l'invitation +m.mccPartyTeleport=[party member name] [[RED]]- Vous teleporte vers la partie +m.mccOtherCommands=[[GREEN]]--AUTRES COMMANDES-- +m.mccStats=- Voir les statistiques de votre mcMMO +m.mccLeaderboards=- Classements +m.mccMySpawn=- Téléporte au myspawn +m.mccClearMySpawn=- Efface le MySpawn +m.mccToggleAbility=- Active les capacités avec un clic droit +m.mccAdminToggle=- Active le chat admin +m.mccWhois=[playername] [[RED]]- Voir les infos détaillées du joueur +m.mccMmoedit=[playername] [skill] [newvalue] [[RED]]- Modifier +m.mccMcGod=- Mod dieu +m.mccSkillInfo=[skillname] [[RED]]- Afficher des informations détaillées sur une compétence +m.mccModDescription=[[RED]]- Affiche la description de Mcmmo +m.SkillHeader=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- +m.XPGain=[[DARK_GRAY]]XP GAGNER: [[WHITE]]{0} +m.EffectsTemplate=[[DARK_AQUA]]{0}: [[GREEN]]{1} +m.AbilityLockTemplate=[[GRAY]]{0} +m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} +m.Effects=EFFETS +m.YourStats=VOS STATISTIQUES +m.SkillTaming=APPRIVOISER +m.XPGainTaming=Attaque avec les loups +m.EffectsTaming1_0=Connaissance des betes +m.EffectsTaming1_1=Bone-whacking inspects wolves +m.EffectsTaming2_0=Morsures +m.EffectsTaming2_1=Des coups critiques qui s'applique a la morsures +m.EffectsTaming3_0=Griffes aiguisées +m.EffectsTaming3_1=Bonus de dégâts +m.EffectsTaming4_0=Conscient de l'environnement +m.EffectsTaming4_1=Resistance Cactus/Lava Phobia +m.EffectsTaming5_0=Epaisse fourrure +m.EffectsTaming5_1=Réduction DMG, Résistance au feu +m.EffectsTaming6_0=Résistance aux chocs +m.EffectsTaming6_1=Réduction des dommages explosifs +m.AbilLockTaming1=Verrouillé jusqu'à+ SKILL (Previent du danger) +m.AbilLockTaming2=Verrouillé jusqu'à 250+ SKILL (épaisse fourrure) +m.AbilLockTaming3=Verrouillé jusqu'à 500+ SKILL (antichoc) +m.AbilLockTaming4=Verrouillé jusqu'à 750+ SKILL (Griffes aiguisées) +m.AbilBonusTaming1_0=Conscient de l'environnement +m.AbilBonusTaming1_1=Les loups previent du danger +m.AbilBonusTaming2_0=Epaisse fourrure +m.AbilBonusTaming2_1=Réduit de moitié les dommages dus à la résistance au feu +m.AbilBonusTaming3_0=Résistance aux chocs +m.AbilBonusTaming3_1=1/6 des explotion par rapport au dommages normaux +m.AbilBonusTaming4_0=Griffes aiguisées +m.AbilBonusTaming4_1=+2 Dommages +m.TamingGoreChance=[[RED]]Chancede Morsures: [[YELLOW]]{0}% +m.SkillWoodCutting=COUPAGES DE BOIS +m.XPGainWoodCutting=Abattre des arbres +m.EffectsWoodCutting1_0=Arbre Félée (CAPACITE) +m.EffectsWoodCutting1_1=Faire exploser des arbres +m.EffectsWoodCutting2_0=Soufler les feuilles +m.EffectsWoodCutting2_1=Soufler les feuilles encore + +m.EffectsWoodCutting3_0=Double Drops +m.EffectsWoodCutting3_1=Double du butin normal +m.AbilLockWoodCutting1=Verrouillé jusqu'à 100+ SKILL (LEAF BLOWER) +m.AbilBonusWoodCutting1_0=Soufler les feuilles +m.AbilBonusWoodCutting1_1=Soufler les feuilles encore + +m.WoodCuttingDoubleDropChance=[[RED]]Chance de drop doubler: [[YELLOW]]{0}% +m.WoodCuttingTreeFellerLength=[[RED]]Temps de votre Arbre Félée: [[YELLOW]]{0}s +m.SkillArchery=TIR A L'ARC +m.XPGainArchery=Attaque de monstre +m.EffectsArchery1_0=Bruler +m.EffectsArchery1_1=25% de chance que l'ennemi s'enflamment +m.EffectsArchery2_0=Etourdir (les joueurs) +m.EffectsArchery2_1=Ennemis désoriente +m.EffectsArchery3_0=Dommages+ +m.EffectsArchery3_1=Modifie les dommages +m.EffectsArchery4_0=Récupération de fleches +m.EffectsArchery4_1=Chance pour récupérer les flèches sur un cadavres +m.ArcheryDazeChance=[[RED]]Chance d'étourdir: [[YELLOW]]{0}% +m.ArcheryRetrieveChance=[[RED]]Chance pour récupérer les flèches: [[YELLOW]]{0}% +m.ArcheryIgnitionLength=[[RED]]Durée du feux: [[YELLOW]]{0} seconds +m.ArcheryDamagePlus=[[RED]]Dégâts+ (Rank{0}): [[YELLOW]]Bonus {0} dommages +m.SkillAxes=HACHES +m.XPGainAxes=Attaque de monstre +m.EffectsAxes1_0=Casseur de tete (capacité) +m.EffectsAxes1_1=Frappes de dommages AoE +m.EffectsAxes2_0=Coup critiques +m.EffectsAxes2_1=Double Dommages +m.EffectsAxes3_0=Maîtrise de la hache (500 SKILL) +m.EffectsAxes3_1=Modifie les dommages +m.AbilLockAxes1=Verrouillé jusqu'à 500+ SKILL (MAITRISE DE LA HACHE) +m.AbilBonusAxes1_0=Maîtrise de la hache +m.AbilBonusAxes1_1=4 Blessures en bonus +m.AxesCritChance=[[RED]]Chance de coup critique: [[YELLOW]]{0}% +m.AxesSkullLength=[[RED]]Temps de votre Casseur de tete: [[YELLOW]]{0}s +m.SkillSwords=EPEE +m.XPGainSwords=Attaque de monstre +m.EffectsSwords1_0=Contre-Attaque +m.EffectsSwords1_1=Renvoie 50% des degats subis +m.EffectsSwords2_0=Epee cranté (capacité) +m.EffectsSwords2_1=25% DMG AoE, saignement+ AoE +m.EffectsSwords3_0=Epee cranté et saignement+ +m.EffectsSwords3_1=5 saignement +m.EffectsSwords4_0=Parer +m.EffectsSwords4_1=Inverse les dommages +m.EffectsSwords5_0=Saignement +m.EffectsSwords5_1=Applique un saignement DoT +m.SwordsCounterAttChance=[[RED]]Chance de Contre-Attaque : [[YELLOW]]{0}% +m.SwordsBleedLength=[[RED]]La longueur du saignement : [[YELLOW]]{0} ticks +m.SwordsBleedChance=[[RED]]Chance de faire saigner: [[YELLOW]]{0} % +m.SwordsParryChance=[[RED]]Chance de parer: [[YELLOW]]{0} % +m.SwordsSSLength=[[RED]]Temps de votre epée cranté: [[YELLOW]]{0}s +m.SwordsTickNote=[[GRAY]]NOTE: [[YELLOW]]1 Le Tick va durer 2 secondes +m.SkillAcrobatics=VOLTIGE +m.XPGainAcrobatics=Chute +m.EffectsAcrobatics1_0=Roulade +m.EffectsAcrobatics1_1=Réduit ou Inverse les dommages +m.EffectsAcrobatics2_0=Super roulade +m.EffectsAcrobatics2_1=Roulade deux fois plus efficace +m.EffectsAcrobatics3_0=Esquive +m.EffectsAcrobatics3_1=Domages reduit de moitié +m.AcrobaticsRollChance=[[RED]]Chance de rouler: [[YELLOW]]{0}% +m.AcrobaticsGracefulRollChance=[[RED]]Chance de super roulade: [[YELLOW]]{0}% +m.AcrobaticsDodgeChance=[[RED]]Chance d'esquive: [[YELLOW]]{0}% +m.SkillMining=MINAGE +m.XPGainMining=Extraction de pierre et de minerais +m.EffectsMining1_0=Super Breaker (capacité) +m.EffectsMining1_1=Vitesse+, Triple Chance de loot +m.EffectsMining2_0=Double Drops +m.EffectsMining2_1=Double du butin normal +m.MiningDoubleDropChance=[[RED]]Double Chance de drop: [[YELLOW]]{0}% +m.MiningSuperBreakerLength=[[RED]]Super Breaker Length: [[YELLOW]]{0}s +m.SkillRepair=RÉPARATION +m.XPGainRepair=Réparation +m.EffectsRepair1_0=Réparer +m.EffectsRepair1_1=Réparation Outils en fer & Armure +m.EffectsRepair2_0=Maitre en reparation +m.EffectsRepair2_1=Augmentation des réparations +m.EffectsRepair3_0=Super Réparation +m.EffectsRepair3_1=Double efficacité +m.EffectsRepair4_0=Réparation du Diamant ({0}+ compétence) +m.EffectsRepair4_1=Réparation des outils diamant & Armure +m.RepairRepairMastery=[[RED]]Maitre en reparation: [[YELLOW]]En plus {0}% durabilité restauré +m.RepairSuperRepairChance=[[RED]]Chance de super réparation: [[YELLOW]]{0}% +m.SkillUnarmed=Sans armes +m.XPGainUnarmed=Attaque de monstre +m.EffectsUnarmed1_0=Berserk (CAPACITE) +m.EffectsUnarmed1_1=+50% DMG, Rend matériaux faibles +m.EffectsUnarmed2_0=Désarmer (Players) +m.EffectsUnarmed2_1=Vole l'objet ennemis dans la main +m.EffectsUnarmed3_0=Maitres en désarmement +m.EffectsUnarmed3_1=De gros dégâts ajouter +m.EffectsUnarmed4_0=Apprentissage désarmement +m.EffectsUnarmed4_1=Dommages ajouter +m.EffectsUnarmed5_0=Fleches dévier +m.EffectsUnarmed5_1=Déviation de fleches +m.AbilLockUnarmed1=Verrouillé jusqu'à 250+ SKILL (APPRENTIE DESARMER) +m.AbilLockUnarmed2=Verrouillé jusqu'à 500+ SKILL (MAITRES EN DESARMEMENT) +m.AbilBonusUnarmed1_0=Apprentissage désarmement +m.AbilBonusUnarmed1_1=+2 DMG ajouter +m.AbilBonusUnarmed2_0=Maitres en désarmement +m.AbilBonusUnarmed2_1=+4 DMG ajouter +m.UnarmedArrowDeflectChance=[[RED]]Chance de Fleches dévier: [[YELLOW]]{0}% +m.UnarmedDisarmChance=[[RED]]Chance de Désarmer: [[YELLOW]]{0}% +m.UnarmedBerserkLength=[[RED]]Temps de votre Berserk: [[YELLOW]]{0}s +m.SkillHerbalism=Herboristerie +m.XPGainHerbalism=La récolte des herbes +m.EffectsHerbalism1_0=Main verte (CAPACITE) +m.EffectsHerbalism1_1=Propage la Main verte, 3x Items +m.EffectsHerbalism2_0=Main verte (Wheat) +m.EffectsHerbalism2_1=Auto-plantes lors de la récolte de blé +m.EffectsHerbalism3_0=Main verte (Cobble) +m.EffectsHerbalism3_1=Cobblestone -> Mossy w/ Seeds +m.EffectsHerbalism4_0=Nouriture+ +m.EffectsHerbalism4_1=Modifie la santé a reçu du pain / ragoût +m.EffectsHerbalism5_0=Double items (Toutes les cultures) +m.EffectsHerbalism5_1=Double tout les items +m.HerbalismGreenTerraLength=[[RED]]Temps de la Main verte: [[YELLOW]]{0}s +m.HerbalismGreenThumbChance=[[RED]]Main verte Taux de chance: [[YELLOW]]{0}% +m.HerbalismGreenThumbStage=[[RED]]Main verte par niveaux: [[YELLOW]] Wheat grows in stage {0} +m.HerbalismDoubleDropChance=[[RED]]Double Chance de dropper: [[YELLOW]]{0}% +m.HerbalismFoodPlus=[[RED]]Nourriture+ (Rank{0}): [[YELLOW]]Bonus {0} curatif +m.SkillExcavation=CREUSAGE +m.XPGainExcavation=Creuser et de trouver des trésors +m.EffectsExcavation1_0=Super broyeur (Capacité) +m.EffectsExcavation1_1=3x Drop Rate, 3x EXPERIENCE, +Vitesse +m.EffectsExcavation2_0=Chercheur de trésor +m.EffectsExcavation2_1=Capacité de trouver un trésor +m.ExcavationGreenTerraLength=[[RED]]Temps de votre Super broyeur: [[YELLOW]]{0}s +mcBlockListener.PlacedAnvil=[[DARK_RED]]Vous avez placé une enclume, Les enclumes peuvent réparer les outils et l'armure. +mcEntityListener.WolfComesBack=[[DARK_GRAY]]Votre loup se précipite de nouveau vers vous... +mcPlayerListener.AbilitiesOff=Capacité bascule off +mcPlayerListener.AbilitiesOn=Capacité bascule on +mcPlayerListener.AbilitiesRefreshed=[[GREEN]]**CAPACITE RAFRAICHIE\!** +mcPlayerListener.AcrobaticsSkill=[[YELLOW]]Acrobaties compétences**/Acrobatics**: +mcPlayerListener.ArcherySkill=[[YELLOW]]Tir a l'arc compétences**/Archery**: +mcPlayerListener.AxesSkill=[[YELLOW]]Haches compétences**/Axes**: +mcPlayerListener.ExcavationSkill=[[YELLOW]]Pelle compétences**/Excavation**: +mcPlayerListener.GodModeDisabled=[[YELLOW]]mcMMO Mode Dieux Desactiver +mcPlayerListener.GodModeEnabled=[[YELLOW]]mcMMO Mode Dieux Activer +mcPlayerListener.GreenThumb=[[GREEN]]**GREEN THUMB** +mcPlayerListener.GreenThumbFail=[[RED]]**GREEN THUMB FAIL** +mcPlayerListener.HerbalismSkill=[[YELLOW]]Herboriste compétences**/Herbalism**: +mcPlayerListener.MiningSkill=[[YELLOW]]Minage compétences**/Mining**: +mcPlayerListener.MyspawnCleared=[[DARK_AQUA]]Myspawn est maintenant effacée. +mcPlayerListener.MyspawnNotExist=[[RED]]Configurez votre myspawn en 1er avec un lit. +mcPlayerListener.MyspawnSet=[[DARK_AQUA]]Myspawn a été enregistrer à votre emplacement actuel. +mcPlayerListener.MyspawnTimeNotice=Vous devez attendre {0}m {1}s pour utiliser myspawn +mcPlayerListener.NoPermission=Insufficient mcPermissions. +mcPlayerListener.NoSkillNote=[[DARK_GRAY]]Vous n'avez pas accès a la compétence. +mcPlayerListener.NotInParty=[[RED]]Vous n'êtes pas dans un groupe. +mcPlayerListener.InviteSuccess=[[GREEN]]Invitation a été envoyé avec succès. +mcPlayerListener.ReceivedInvite1=[[RED]]ALERT: [[GREEN]]Vous avez reçu un invitation pour la partie {0} a partir de {1} +mcPlayerListener.ReceivedInvite2=[[YELLOW]]Type [[GREEN]]/{0}[[YELLOW]] à accepter l'invitation +mcPlayerListener.InviteAccepted=[[GREEN]]Invite acceptées. Vous avez rejoint la partie {0} +mcPlayerListener.NoInvites=[[RED]]Vous n'avez pas d'invitation pour le moment +mcPlayerListener.YouAreInParty=[[GREEN]]Vous avez dans la partie {0} +mcPlayerListener.PartyMembers=[[GREEN]]Partie Membres +mcPlayerListener.LeftParty=[[RED]]Vous avez quitté la partie +mcPlayerListener.JoinedParty=Joidre la partie: {0} +mcPlayerListener.PartyChatOn=Party Chat uniquement [[GREEN]]On +mcPlayerListener.PartyChatOff=Party Chat uniquement [[RED]]Off +mcPlayerListener.AdminChatOn=Admin Chat uniquement [[GREEN]]On +mcPlayerListener.AdminChatOff=Admin Chat uniquement [[RED]]Off +mcPlayerListener.MOTD=[[BLUE]]Ce serveur fonctionne avec mcMMO {0} [[YELLOW]]/{1}[[BLUE]] pour voir l'aide. +mcPlayerListener.WIKI=[[GREEN]]http://mcmmo.wikia.com[[BLUE]] - mcMMO Wiki - [[YELLOW]]Traduit par avalondrey +mcPlayerListener.PowerLevel=[[DARK_RED]]POWER LEVEL: +mcPlayerListener.PowerLevelLeaderboard=[[YELLOW]]--mcMMO[[BLUE]] Power Level [[YELLOW]]Leaderboard-- +mcPlayerListener.SkillLeaderboard=[[YELLOW]]--mcMMO [[BLUE]]{0}[[YELLOW]] Leaderboard-- +mcPlayerListener.RepairSkill=[[YELLOW]]Réparation Compétence**/Repair**: +mcPlayerListener.SwordsSkill=[[YELLOW]]Epee compétence**/Swords**: +mcPlayerListener.TamingSkill=[[YELLOW]]Dressage compétence**/Taming**: +mcPlayerListener.UnarmedSkill=[[YELLOW]]Mains nue Compétence**/Unarmed**: +mcPlayerListener.WoodcuttingSkill=[[YELLOW]]Bucheron Compétence**/Woodcutting**: +mcPlayerListener.YourStats=[[GREEN]]Votre MMO Stats +Party.InformedOnJoin={0} [[GREEN]] a join votre partie +Party.InformedOnQuit={0} [[GREEN]] a quitté votre partie +Skills.YourGreenTerra=[[GREEN]]Your [[YELLOW]]Main verte [[GREEN]]la capacité est revenue! +Skills.YourTreeFeller=[[GREEN]]Your [[YELLOW]]Massacre à la tronçonneuse [[GREEN]]la capacité est revenue! +Skills.YourSuperBreaker=[[GREEN]]Your [[YELLOW]]Broyeur [[GREEN]]la capacité est revenue! +Skills.YourSerratedStrikes=[[GREEN]]Your [[YELLOW]]Epee cranté [[GREEN]]la capacité est revenue! +Skills.YourBerserk=[[GREEN]]Your [[YELLOW]]Berserk [[GREEN]]la capacité est revenue! +Skills.YourSkullSplitter=[[GREEN]]Your [[YELLOW]]Casseur de tete [[GREEN]]la capacité est revenue! +Skills.YourGigaDrillBreaker=[[GREEN]]Your [[YELLOW]]Super broyeur [[GREEN]]la capacité est revenue! +Skills.TooTired=[[RED]]Vous êtes trop fatigué pour utiliser cette capacité à nouveau. +Skills.ReadyHoe=[[GREEN]]**TA BINETTE EST PRETE** +Skills.LowerHoe=[[GRAY]]**Ta binette n'est plus prete** +Skills.ReadyAxe=[[GREEN]]**TA HACHE EST PRETE** +Skills.LowerAxe=[[GRAY]]**Ta hache n'est plus prete** +Skills.ReadyFists=[[GREEN]]**TON POINGS EST PRETE** +Skills.LowerFists=[[GRAY]]**Ton poings n'est plus pret** +Skills.ReadyPickAxe=[[GREEN]]**TA PIOCHE EST PRETE** +Skills.LowerPickAxe=[[GRAY]]**Ta pioche n'est plus prete** +Skills.ReadyShovel=[[GREEN]]**TA PELLE EST PRETE** +Skills.LowerShovel=[[GRAY]]**Ta pelle n'est plus prete** +Skills.ReadySword=[[GREEN]]**TON EPEE EST PRETE** +Skills.LowerSword=[[GRAY]]**Ton épee n'est plus prete** +Skills.GreenTerraOn=[[GREEN]]**MAIN VERTE ACTIF** +Skills.GreenTerraPlayer=[[GREEN]]{0}[[DARK_GREEN]] a utilisé [[RED]]Main verte! +Skills.TreeFellerOn=[[GREEN]]**MASSACRE A LA TRONCONNEUSE ACTIF** +Skills.TreeFellerPlayer=[[GREEN]]{0}[[DARK_GREEN]] a utilisé [[RED]]Massacre à la tronçonneuse! +Skills.SuperBreakerOn=[[GREEN]]**BROYEUR ACTIF** +Skills.SuperBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] a utilisé [[RED]]Broyeur! +Skills.SerratedStrikesOn=[[GREEN]]**EPEE CRANTER ACTIF** +Skills.SerratedStrikesPlayer=[[GREEN]]{0}[[DARK_GREEN]] a utilisé [[RED]]Epee cranté! +Skills.SkullSplitterOn=[[GREEN]]**CASSEUR DE TETE ACTIF** +Skills.SkullSplitterPlayer=[[GREEN]]{0}[[DARK_GREEN]] a utilisé [[RED]]Casseur de tete! +Skills.GigaDrillBreakerOn=[[GREEN]]**SUPER BROYEUR ACTIF** +Skills.GigaDrillBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] a utilisé [[RED]]Super broyeur! +Skills.GreenTerraOff=[[RED]]**Main verte est fini** +Skills.TreeFellerOff=[[RED]]**Massacre à la tronçonneuse est fini** +Skills.SuperBreakerOff=[[RED]]**Le broyeur est fini** +Skills.SerratedStrikesOff=[[RED]]**Epee cranté est fini** +Skills.BerserkOff=[[RED]]**Berserk est fini** +Skills.SkullSplitterOff=[[RED]]**Casseur de tete est fini** +Skills.GigaDrillBreakerOff=[[RED]]**Super broyeur est fini** +Skills.TamingUp=[[YELLOW]]La competence du dressage a augmenté de {0}. Total ({1}) +Skills.AcrobaticsUp=[[YELLOW]]La competence acrobaties a augmenté de {0}. Total ({1}) +Skills.ArcheryUp=[[YELLOW]]La competence tir a l'arc a augmenté de {0}. Total ({1}) +Skills.SwordsUp=[[YELLOW]]La competence epee a augmenté de {0}. Total ({1}) +Skills.AxesUp=[[YELLOW]]La competence hache a augmenté de {0}. Total ({1}) +Skills.UnarmedUp=[[YELLOW]]La compétence de combat à mains nues a augmenté de {0}. Total ({1}) +Skills.HerbalismUp=[[YELLOW]]La competence herboriste a augmenté de {0}. Total ({1}) +Skills.MiningUp=[[YELLOW]]La competence minage a augmenté de {0}. Total ({1}) +Skills.WoodcuttingUp=[[YELLOW]]La competence coupe de bois a augmenté de {0}. Total ({1}) +Skills.RepairUp=[[YELLOW]]La competence réparation a augmenté de {0}. Total ({1}) +Skills.ExcavationUp=[[YELLOW]]La competence creusage a augmenté de {0}. Total ({1}) +Skills.FeltEasy=[[GRAY]]That felt easy. +Skills.StackedItems=[[DARK_RED]]You can't repair stacked items +Skills.NeedMore=[[DARK_RED]]You need more +Skills.AdeptDiamond=[[DARK_RED]]You're not skilled enough to repair Diamond +Skills.FullDurability=[[GRAY]]That is at full durability. +Skills.Disarmed=[[DARK_RED]]You have been disarmed! +mcPlayerListener.SorcerySkill=Sorcery: +m.SkillSorcery=SORCERY +Sorcery.HasCast=[[GREEN]]**CASTING**[[GOLD]] +Sorcery.Current_Mana=[[DARK_AQUA]]MP +Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]]) +Sorcery.Cost=[[RED]][COST] {0} MP +Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Out Of Mana [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]]) +Sorcery.Water.Thunder=THUNDER +Sorcery.Curative.Self=CURE SELF +Sorcery.Curative.Other=CURE OTHER +m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]XP[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) +Combat.BeastLore=[[GREEN]]**BEAST LORE** +Combat.BeastLoreOwner=[[DARK_AQUA]]Owner ([[RED]]{0}[[DARK_AQUA]]) +Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/20) +Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Health ([[GREEN]]{0}[[DARK_AQUA]]/8) \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/messages_pl.properties b/mcMMO/com/gmail/nossr50/messages_pl.properties new file mode 100644 index 000000000..8d0c61172 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/messages_pl.properties @@ -0,0 +1,323 @@ +Combat.WolfExamine=[[GREEN]]**Zbadales Wilka uzywajac Wiedzy Besti** +Combat.WolfShowMaster=[[DARK_GREEN]]Wlascicielem besti jest \: {0} +Combat.Ignition=[[RED]]**PODPALENIE** +Combat.BurningArrowHit=[[DARK_RED]]Zostales trafiony plonaca strzala\! +Combat.TouchedFuzzy=[[DARK_RED]]Czujesz sie oszolomiony. +Combat.TargetDazed=Target was [[DARK_RED]]Oszolomiony. +Combat.WolfNoMaster=[[GRAY]]Ta Bestia nie ma wlasciciela... +Combat.WolfHealth=[[GREEN]]Ta bestia ma {0} zycia. +Combat.StruckByGore=[[RED]]**POWALONY** +Combat.Gore=[[GREEN]]**WYLEW KRWI** +Combat.ArrowDeflect=[[WHITE]]**ODBICIE STRZALU** +Item.ChimaeraWingFail=**UZYCIE SKRZYDLA CHIMAERY NIE POWIODLO SIE\!** +Item.ChimaeraWingPass=**UZYLES SKRZYDEL CHIMAERY** +Item.InjuredWait=Musisz poczekac aby znowu to uzyc. [[YELLOW]]({0}sekund) +Item.NeedFeathers=[[GRAY]]Potrzebujesz wiecej pior. +m.mccPartyCommands=[[GREEN]]--KOMENDY DRUZYNOWE-- +m.mccParty=[party name] [[RED]]- Tworzy lub dolacza do danej druzyny. +m.mccPartyQ=[[RED]]- Pozwala opuscic druzyne. +m.mccPartyToggle=[[RED]] - Wlacza chat druzyny. +m.mccPartyInvite=[player name] [[RED]]- Wysyla zaproszenie do druzyny. +m.mccPartyAccept=[[RED]]- Akceptuje zaproszenie do druzyny. +m.mccPartyTeleport=[party member name] [[RED]]- Teleportuje cie do czlonka druzyny. +m.mccOtherCommands=[[GREEN]]--INNE KOMENDY-- +m.mccStats=- Pokazuje twoje statystyki. +m.mccLeaderboards=- Pokazuje najlepszych graczy. +m.mccMySpawn=- Teleportuje do spawna. +m.mccClearMySpawn=- Kasuje twoj spawn i zmienia na domyslny. +m.mccToggleAbility=- Wlacza specjalna umiejetnosc prawym przyciskiem myszy. +m.mccAdminToggle=- Wlacza chat adminow. +m.mccWhois=[nazwa gracza] [[RED]]- Zobacz dokladne informacje na temat gracza. +m.mccMmoedit=[nazwa gracza] [umiejetnosc] [nowa wartosc] [[RED]]- Modyfikuje cel. +m.mccMcGod=- Tryb Boga. +m.mccSkillInfo=[nazwa umiejetnosci (np. Mining)] [[RED]]- Pokazuje dokladne informacje o umiejetnosci. +m.mccModDescription=[[RED]]- Wyswietla opis moda. +m.SkillHeader=[[RED]]-----[][[GREEN]]{0}[[RED]][]----- +m.XPGain=[[DARK_GRAY]]Dostajesz doswiadczenie za: [[WHITE]]{0} +m.EffectsTemplate=[[DARK_AQUA]]{0}: [[GREEN]]{1} +m.AbilityLockTemplate=[[GRAY]]{0} +m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1} +m.Effects=EFEKTY +m.YourStats=TWOJE STATYSTYKI +m.SkillTaming=OSWAJANIE +m.XPGainTaming=Wilki zostaja oswojone. +m.EffectsTaming1_0=Wiedza Besti +m.EffectsTaming1_1=Kosci pozwalaja sprawdzic wilki. +m.EffectsTaming2_0=Krwotok +m.EffectsTaming2_1=Atak Krytyczny powodujacy silny krwotok. +m.EffectsTaming3_0=Naostrzone pazury +m.EffectsTaming3_1=Bonus do obrazen +m.EffectsTaming4_0=Swiadome srodowisko +m.EffectsTaming4_1=Strach przed kaktusami i lawa, odpornosc na obrazenia ze spadania. +m.EffectsTaming5_0=Grube Futro +m.EffectsTaming5_1=Redukcja obrazen, obrona przeciw ogniowi. +m.EffectsTaming6_0=Odpornosc na wstrzasy. +m.EffectsTaming6_1=Redukajca obrazen spowodowanych wybuchem. +m.AbilLockTaming1=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 100+ (SWIADOME SRODOWISKO) +m.AbilLockTaming2=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 250+ (GRUBE FUTRO) +m.AbilLockTaming3=Zablokowane puki nie osiganiesz umiejetnosci na poziomie 500+ (ODPORNOSC NA WSTRZASY) +m.AbilLockTaming4=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 750+ (NAOSTRZONE PAZURY) +m.AbilBonusTaming1_0=Swiadome srodowisko. +m.AbilBonusTaming1_1=Wilki unikaja zagrozenia. +m.AbilBonusTaming2_0=Grube futro. +m.AbilBonusTaming2_1=Polowa obrazen, obrona przeciw ogniowi. +m.AbilBonusTaming3_0=Odpornosc na wstrzasy. +m.AbilBonusTaming3_1=Wybuchy powoduja 1/6 normalnych obrazen. +m.AbilBonusTaming4_0=Naostrzone pazury +m.AbilBonusTaming4_1=+2 Obrazen +m.TamingGoreChance=[[RED]]Szansa na spowodowanie krwotoku: [[YELLOW]]{0}% +m.SkillWoodCutting=Scinanie Drzew +m.XPGainWoodCutting=Powalanie drzew +m.EffectsWoodCutting1_0=Powalacz drzew (UMIEJETNOSC) +m.EffectsWoodCutting1_1=Powoduje ze drzewa blyskawicznie zostaja powalone +m.EffectsWoodCutting2_0=Wysadzacz lisci +m.EffectsWoodCutting2_1=Wyrzuca liscie +m.EffectsWoodCutting3_0=Podwojna Zaplata +m.EffectsWoodCutting3_1=Podwaja normalny drop przedmiotow. +m.AbilLockWoodCutting1=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 100+ (WYSADZACZ LISCI) +m.AbilBonusWoodCutting1_0=Wysadzacz lisci +m.AbilBonusWoodCutting1_1=Wyrzuca liscie +m.WoodCuttingDoubleDropChance=[[RED]]Szansa na Podwojna Zaplate: [[YELLOW]]{0}% +m.WoodCuttingTreeFellerLength=[[RED]]Dlugosc Powalacza Drzew: [[YELLOW]]{0}sekund +m.SkillArchery=LUCZNICTWO +m.XPGainArchery=Atakowanie potworow przy uzyciu luku. +m.EffectsArchery1_0=Podpalenie +m.EffectsArchery1_1=25% szansy, ze cel zostanie podpalony. +m.EffectsArchery2_0=Oszolomienie(Tylko na graczy) +m.EffectsArchery2_1=Dezorientuje przeciwnikow. +m.EffectsArchery3_0=Obrazenia+ +m.EffectsArchery3_1=Modyfikuje obrazenia. +m.EffectsArchery4_0=Odzyskanie strzal. +m.EffectsArchery4_1=Szansa na wyciagniecie strzalow ze zwlok. +m.ArcheryDazeChance=[[RED]]Szansa na oszolomienie: [[YELLOW]]{0}% +m.ArcheryRetrieveChance=[[RED]]Szansa na odzyskanie strzal: [[YELLOW]]{0}% +m.ArcheryIgnitionLength=[[RED]]Dlugosc podpalenia: [[YELLOW]]{0} sekund +m.ArcheryDamagePlus=[[RED]]Obrazenia+ (Rank{0}): [[YELLOW]]Dodatkowe {0} obrazenia +m.SkillAxes=TOPORY +m.XPGainAxes=Atakowanie potworow przy uzyciu toporow. +m.EffectsAxes1_0=Lamacz Czaszek (UMIEJETNOSC) +m.EffectsAxes1_1=Powoduje obrazenia dla calego obszaru. +m.EffectsAxes2_0=Krytyczne Ataki +m.EffectsAxes2_1=Podwojna Sila +m.EffectsAxes3_0=Mistrzostwo Toporow +m.EffectsAxes3_1=Modyfikuje obrazenia +m.AbilLockAxes1=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 500+ (MISTRZOSTWO TOPOROW) +m.AbilBonusAxes1_0=Mistrzostwo Toporow +m.AbilBonusAxes1_1=Dodatkowe 4 obrazen +m.AxesCritChance=[[RED]]Szansa na krytyczne ataki: [[YELLOW]]{0}% +m.AxesSkullLength=[[RED]]Dlugosc Lamacza Czaszek: [[YELLOW]]{0}sekund +m.SkillSwords=MIECZE +m.XPGainSwords=Atakowanie potworow przy uzyciu mieczy. +m.EffectsSwords1_0=Konter-Atak +m.EffectsSwords1_1=Odbija 50% poniesionych obrazen. +m.EffectsSwords2_0=Zabkowany Atak (UMIEJETNOSC) +m.EffectsSwords2_1=25% obrazen obszarowych, Krwotok+ obszarowy +m.EffectsSwords3_0=Zabkowany Atak, Krwotok+ +m.EffectsSwords3_1=Powoduje dlugotrwaly krwotok. +m.EffectsSwords4_0=Blok. +m.EffectsSwords4_1=Nie ponosisz obrazen. +m.EffectsSwords5_0=Krwotok +m.EffectsSwords5_1=Powoduje Krwotok +m.SwordsCounterAttChance=[[RED]]Szansa na Konter-Atak: [[YELLOW]]{0}% +m.SwordsBleedLength=[[RED]]Dlugosc Krwotoku: [[YELLOW]]{0} wylewow krwi. +m.SwordsBleedChance=[[RED]]Szansa na spowodowanie Krwotoku: [[YELLOW]]{0} % +m.SwordsParryChance=[[RED]]Parry Chance: [[YELLOW]]{0} % +m.SwordsSSLength=[[RED]]Dlugosc Zabkowanego Ataku: [[YELLOW]]{0}sekund +m.SwordsTickNote=[[GRAY]]UWAGA: [[YELLOW]]1 Wylew Krwi pojawia sie co 2 sekundy. +m.SkillAcrobatics=AKROBATYKI +m.XPGainAcrobatics=Spadanie +m.EffectsAcrobatics1_0=Rolowanie sie. +m.EffectsAcrobatics1_1=Redukuje albo usuwa obrazenia. +m.EffectsAcrobatics2_0=Wielka przewrotka +m.EffectsAcrobatics2_1=Dwa razy efektowowniejsze niz rolowanie sie. +m.EffectsAcrobatics3_0=Unik +m.EffectsAcrobatics3_1=Redukuje polowe obrazen. +m.AcrobaticsRollChance=[[RED]]Szansa na rolowanie sie: [[YELLOW]]{0}% +m.AcrobaticsGracefulRollChance=[[RED]]Szansa na wielka przewrotke: [[YELLOW]]{0}% +m.AcrobaticsDodgeChance=[[RED]]Szansa na unik: [[YELLOW]]{0}% +m.SkillMining=WYKOPALISKA +m.XPGainMining=Wykopywanie kamienia i roznych rud. +m.EffectsMining1_0=Super Kopacz (UMIEJETNOSC) +m.EffectsMining1_1=Szybkosc+, Szansa na potrujna zaplate. +m.EffectsMining2_0=Podwojna zaplata. +m.EffectsMining2_1=Podwaja normalny drop. +m.MiningDoubleDropChance=[[RED]]Szansa na podwojna zaplate: [[YELLOW]]{0}% +m.MiningSuperBreakerLength=[[RED]]Dlugosc super kopania: [[YELLOW]]{0}sekund +m.SkillRepair=NAPRAWA +m.XPGainRepair=Naprawianie przedmiotow. +m.EffectsRepair1_0=Naprawa +m.EffectsRepair1_1=Naprawianie zelaznych przedmiotow. +m.EffectsRepair2_0=Mistrz naprawy +m.EffectsRepair2_1=Powiekszona liczba napraw. +m.EffectsRepair3_0=Super Naprawa +m.EffectsRepair3_1=Podwojna efektownosc. +m.EffectsRepair4_0=Diamentowa Odnowa ({0}+ UMIEJETNOSC) +m.EffectsRepair4_1=Naprawia diamentowe przedmioty. +m.RepairRepairMastery=[[RED]]Mistrz naprawy: [[YELLOW]]Dodatkowe {0}% wytrzymalosci odzyskane. +m.RepairSuperRepairChance=[[RED]]Szansa na Super Odnowe: [[YELLOW]]{0}% +m.SkillUnarmed=BEZBRONNY +m.XPGainUnarmed=Atakowanie potworow piescia. +m.EffectsUnarmed1_0=Furia (UMIEJETNOSC) +m.EffectsUnarmed1_1=+50% obrazen, niszczy slabe materialy. +m.EffectsUnarmed2_0=Rozbrojenie (Gracze) +m.EffectsUnarmed2_1=Wyrzuca przedmioty przyciwnikow trzymane przez nich w rekach. +m.EffectsUnarmed3_0=Mistrzostwo walki gola piescia +m.EffectsUnarmed3_1=Ogromne ulepszenie obrazen +m.EffectsUnarmed4_0=Poczatkujacy bezbronny +m.EffectsUnarmed4_1=Ulepszenie obrazen +m.EffectsUnarmed5_0=Odbicie strzaly +m.EffectsUnarmed5_1=Odbija strzaly +m.AbilLockUnarmed1=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 250+ (POCZATKUJACY BEZBRONNY) +m.AbilLockUnarmed2=Zablokowane puki nie osiagniesz umiejetnosci na poziomie 500+ (MISTRZOSTWO WALKI GOLA PIESCIA) +m.AbilBonusUnarmed1_0=Poczatkujacy bezbronny +m.AbilBonusUnarmed1_1=+2 obrazen +m.AbilBonusUnarmed2_0=Mistrzostwo walki gola piescia +m.AbilBonusUnarmed2_1=+4 obrazen +m.UnarmedArrowDeflectChance=[[RED]]Szansa na odbicie strzaly: [[YELLOW]]{0}% +m.UnarmedDisarmChance=[[RED]]Szansa na rozbrojenie: [[YELLOW]]{0}% +m.UnarmedBerserkLength=[[RED]]Dlugosc Furii: [[YELLOW]]{0}s +m.SkillHerbalism=ZIELARSTWO +m.XPGainHerbalism=Zbieranie ziol. +m.EffectsHerbalism1_0=Zielona Ziemia (UMIEJETNOSC) +m.EffectsHerbalism1_1=Rozprzestrzenia ziemie, Potraja Wynagrodzenie. +m.EffectsHerbalism2_0=Zielony Kciuk (Zboze) +m.EffectsHerbalism2_1=Automatycznie zasadza nasiona przy zbieraniu zboza. +m.EffectsHerbalism3_0=Zielony Kciuk (Cobbletone) +m.EffectsHerbalism3_1=Zamienia Cooblestone w Mossy Stone +m.EffectsHerbalism4_0=Jedzenie+ +m.EffectsHerbalism4_1=Modyfikuje ilosc zycia regenerowana przez zjedzenie chleba/zupy grzybowej. +m.EffectsHerbalism5_0=Podwojne wynagrodzenie +m.EffectsHerbalism5_1=Podwaja normalny drop +m.HerbalismGreenTerraLength=[[RED]]Czas Trwania Zielonego Kciuka: [[YELLOW]]{0}sekund +m.HerbalismGreenThumbChance=[[RED]]Szansa na powodzenie Zielonego Kciuka: [[YELLOW]]{0}% +m.HerbalismGreenThumbStage=[[RED]]Poziom Zielonego Kciuka: [[YELLOW]] Zboze rosnie na poziomie {0} +m.HerbalismDoubleDropChance=[[RED]]Podwojne wynagrodzenie: [[YELLOW]]{0}% +m.HerbalismFoodPlus=[[RED]]Jedzenie+ (Rank{0}): [[YELLOW]]Dodatkowe {0} zycia +m.SkillExcavation=ARCHEOLOGIA +m.XPGainExcavation=Kopanie i odnajdywanie skarbow +m.EffectsExcavation1_0=Wielki Lamacz Wiertla (UMIEJETNOSC) +m.EffectsExcavation1_1=3x wieksze wynagrodzenei, 3x wiecej doswiadczenia, +Szybkosc +m.EffectsExcavation2_0=Lowca Skarbow +m.EffectsExcavation2_1=Umiejetnosc znajdywania skarbow +m.ExcavationGreenTerraLength=[[RED]]Wielki Lamacz Wiertla: [[YELLOW]]{0}s +mcBlockListener.PlacedAnvil=[[DARK_RED]]Polozyles kowadlo, ktore pozwala na naprawe przedmiotow. +mcEntityListener.WolfComesBack=[[DARK_GRAY]]Twoj Wilk do Ciebie wraca. +mcPlayerListener.AbilitiesOff=Uzywanie umiejetnosci wylaczone +mcPlayerListener.AbilitiesOn=Uzywanie umiejetnosci wlaczone +mcPlayerListener.AbilitiesRefreshed=[[GREEN]]**UMIEJETNOSCI ODSWIEZONE\!** +mcPlayerListener.AcrobaticsSkill=Akrobatyka: +mcPlayerListener.ArcherySkill=Lucznictwo: +mcPlayerListener.AxesSkill=Topory: +mcPlayerListener.ExcavationSkill=Archeologia: +mcPlayerListener.GodModeDisabled=[[YELLOW]]Tryb boga wylaczony +mcPlayerListener.GodModeEnabled=[[YELLOW]]Tryb boga wlaczony +mcPlayerListener.GreenThumb=[[GREEN]]**UZYLES ZIELONY KCIUK** +mcPlayerListener.GreenThumbFail=[[RED]]**UZYWANIE ZIELONEGO KCIUKA NIE POWIODLO SIE** +mcPlayerListener.HerbalismSkill=Zielarstwo: +mcPlayerListener.MiningSkill=Wykopaliska: +mcPlayerListener.MyspawnCleared=[[DARK_AQUA]]Twoj spawn jest teraz oczyszczony. +mcPlayerListener.MyspawnNotExist=[[RED]]Ustaw wpierw swoj spawn za pomoca lozka. +mcPlayerListener.MyspawnSet=[[DARK_AQUA]]Twoj spawn zostal ustawiony na twoje aktualne polozenie. +mcPlayerListener.MyspawnTimeNotice=Musisz zaczekac {0}minut i {1}sekund aby przeteleportowac sie na spawn. +mcPlayerListener.NoPermission=Brak mcPermissions. +mcPlayerListener.NoSkillNote=[[DARK_GRAY]]Jesli nie masz prawa do uzywania umiejetnosci, nie pokaze sie ona tu. +mcPlayerListener.NotInParty=[[RED]]Nie jestes w grupie. +mcPlayerListener.InviteSuccess=[[GREEN]]Zaproszenie wyslane. +mcPlayerListener.ReceivedInvite1=[[RED]]UWAGA: [[GREEN]]Dostales zaproszenie do grupy {0} od {1} +mcPlayerListener.ReceivedInvite2=[[YELLOW]Wpisz [[GREEN]]/{0}[[YELLOW]] aby zaakceptowac zaproszenie +mcPlayerListener.InviteAccepted=[[GREEN]]Zaproszenie akceptowane. Doszles do grupy {0} +mcPlayerListener.NoInvites=[[RED]]Nie masz zadnych zaproszen do grupy +mcPlayerListener.YouAreInParty=[[GREEN]]Jestes w grupie {0} +mcPlayerListener.PartyMembers=[[GREEN]]Czlonkowie grupy +mcPlayerListener.LeftParty=[[RED]]Wyszles z tej grupy +mcPlayerListener.JoinedParty=Doszedles do grupy: {0} +mcPlayerListener.PartyChatOn=Chat tylko dla grupy [[GREEN]]WLACZONY +mcPlayerListener.PartyChatOff=Chat tylko dla grupy [[RED]]WYLACZONY +mcPlayerListener.AdminChatOn=Chat tylko dla adminow [[GREEN]]WLACZONY +mcPlayerListener.AdminChatOff=Chat tylko dla adminow [[RED]]WYLACZONY +mcPlayerListener.MOTD=[[BLUE]]Ten server uzywa plugina mcMMO {0} wpisz [[YELLOW]]/{1}[[BLUE]] aby uzyskac pomoc. +mcPlayerListener.WIKI=[[GREEN]]http://mcmmo.wikia.com[[BLUE]] - mcMMO Wiki +mcPlayerListener.PowerLevel=[[DARK_RED]]POZIOM MOCY: +mcPlayerListener.PowerLevelLeaderboard=[[YELLOW]]--Ranking [[BLUE]]poziomu mocy [[YELLOW]]mcMMO-- +mcPlayerListener.SkillLeaderboard=[[YELLOW]]--Ranking [[BLUE]]{0}[[YELLOW]] mcMMO-- +mcPlayerListener.RepairSkill=Naprawa: +mcPlayerListener.SwordsSkill=Miecze: +mcPlayerListener.TamingSkill=Oswajanie: +mcPlayerListener.UnarmedSkill=Bezbronny: +mcPlayerListener.WoodcuttingSkill=Scinanie drzew: +mcPlayerListener.YourStats=[[GREEN]][mcMMO] Statystyki +Party.InformedOnJoin={0} [[GREEN]] dolaczyl do twojej grupy +Party.InformedOnQuit={0} [[GREEN]] wyszedl z twojej grupy +Skills.YourGreenTerra=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Zielona Ziemia [[GREEN]]zostala naladowana! +Skills.YourTreeFeller=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Powalacz Drzew [[GREEN]]zostala naladowana! +Skills.YourSuperBreaker=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Super Kopacz [[GREEN]]zostala naladowana! +Skills.YourSerratedStrikes=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Zabkowany Atak [[GREEN]]zostala naladowana! +Skills.YourBerserk=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Furia [[GREEN]]zostala naladowana! +Skills.YourSkullSplitter=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Lamacz Czaszek [[GREEN]]zostala naladowana! +Skills.YourGigaDrillBreaker=[[GREEN]]Twoja umiejetnosc [[YELLOW]]Wielki Lamacz Wiertla [[GREEN]]zostala naladowana! +Skills.TooTired=[[RED]]Jestes zbyt zmeczony zeby uzyc znowu tej umiejetnosci. +Skills.ReadyHoe=[[GREEN]]**NALADOWALES SWOJA MOTYKE** +Skills.LowerHoe=[[GRAY]]**ZWOLNILES SWOJA MOTYKE** +Skills.ReadyAxe=[[GREEN]]**NALADOWALES SWOJ TOPOR** +Skills.LowerAxe=[[GRAY]]**ZWOLNILES SWOJ TOPOR** +Skills.ReadyFists=[[GREEN]]**NALADOWALES SWOJE PIESCI** +Skills.LowerFists=[[GRAY]]**ZWOLNILES SWOJE PIESCI** +Skills.ReadyPickAxe=[[GREEN]]**NALADOWALES SWOJ KILOF** +Skills.LowerPickAxe=[[GRAY]]**ZWOLNILES SWOJ KILOF** +Skills.ReadyShovel=[[GREEN]]**NALADOWALES SWOJA LOPATE** +Skills.LowerShovel=[[GRAY]]**ZWOLNILES SWOJA LOPATE** +Skills.ReadySword=[[GREEN]]**NALADOWALES SWOJ MIECZ** +Skills.LowerSword=[[GRAY]]**ZWOLNILES SWOJ MIECZ** +Skills.BerserkOn=[[GREEN]]**FURIA AKTYWOWANA** +Skills.BerserkPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Furie! +Skills.GreenTerraOn=[[GREEN]]**ZIELONA ZIEMIA AKTYWOWANA** +Skills.GreenTerraPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Zielona Ziemie! +Skills.TreeFellerOn=[[GREEN]]**POWALACZ DRZEW AKTYWOWANY** +Skills.TreeFellerPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Powalacza Drzew! +Skills.SuperBreakerOn=[[GREEN]]**SUPER KOPACZ AKTYWOWANY** +Skills.SuperBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Super Kopacza! +Skills.SerratedStrikesOn=[[GREEN]]**ZABKOWANY ATAK AKTYWOWANY** +Skills.SerratedStrikesPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Zabkowany Atak! +Skills.SkullSplitterOn=[[GREEN]]**LAMACZ CZASZEK AKTYWOWANY** +Skills.SkullSplitterPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Lamacza Czaszek! +Skills.GigaDrillBreakerOn=[[GREEN]]**WIELKI LAMACZ WIERTLA AKTYWOWANY** +Skills.GigaDrillBreakerPlayer=[[GREEN]]{0}[[DARK_GREEN]] uzyl [[RED]]Wielki Lamacz Wiertla! +Skills.GreenTerraOff=[[RED]]**Zielona Ziemia zostala zuzyta** +Skills.TreeFellerOff=[[RED]]**Powalacz drzew zostal zuzyty** +Skills.SuperBreakerOff=[[RED]]**Super Kopacz zostal zuzyty** +Skills.SerratedStrikesOff=[[RED]]**Zabkowany Atak zostal zuzyty** +Skills.BerserkOff=[[RED]]**Furia zostala zuzyta** +Skills.SkullSplitterOff=[[RED]]**Lamacz czaszek zostal zuzyty** +Skills.GigaDrillBreakerOff=[[RED]]**Wielki Lamacz Wiertla zostal zuzyty** +Skills.TamingUp=[[YELLOW]]Umiejetnosc oswajania ulepszona o {0}. Razem ({1}) +Skills.AcrobaticsUp=[[YELLOW]]Umiejetnosci akrobatyczne ulepszone o {0}. Razem ({1}) +Skills.ArcheryUp=[[YELLOW]]Umiejetnosc lucznictwa ulepszona o {0}. Razem ({1}) +Skills.SwordsUp=[[YELLOW]]Umiejetnosc uzywania mieczy ulepszona o {0}. Razem ({1}) +Skills.AxesUp=[[YELLOW]]Umiejetnosc uzywania topora ulepszona o {0}. Razem ({1}) +Skills.UnarmedUp=[[YELLOW]]Umiejetnosc bezbronnosci ulepszona o {0}. Razem ({1}) +Skills.HerbalismUp=[[YELLOW]]Umiejetnosc zielarstwa ulepszona o {0}. Razem ({1}) +Skills.MiningUp=[[YELLOW]]Umiejetnosc wykopalisk ulepszona o {0}. Razem ({1}) +Skills.WoodcuttingUp=[[YELLOW]]Umiejetnosc ciecia drzew ulepszona o {0}. Razem ({1}) +Skills.RepairUp=[[YELLOW]]Umiejetnosc naprawy ulepszona o {0}. Razem ({1}) +Skills.ExcavationUp=[[YELLOW]]Umiejetnosc archeologii ulepszona o {0}. Razem ({1}) +Skills.FeltEasy=[[GRAY]]To poszlo latwo. +Skills.StackedItems=[[DARK_RED]]Nie mozesz naprawiac przedmiotow ulozonych na sterte. +Skills.NeedMore=[[DARK_RED]]Potrzebujesz wiecej +Skills.AdeptDiamond=[[DARK_RED]]Nie jestes wystarczajaco utalentowany zeby naprawic Diament +Skills.FullDurability=[[GRAY]]Ten przedmiot jest w pelni wytrzymaly. +Skills.Disarmed=[[DARK_RED]]Zostales rozbrojony! +mcPlayerListener.SorcerySkill=Magia: +m.SkillSorcery=MAGIA +Sorcery.HasCast=[[GREEN]]**RZUCANIE ZAKLECIA**[[GOLD]] +Sorcery.Current_Mana=[[DARK_AQUA]]MP +Sorcery.SpellSelected=[[GREEN]]-=([[GOLD]]{0}[[GREEN]])=- [[RED]]([[GRAY]]{1}[[RED]]) +Sorcery.Cost=[[RED]][COST] {0} MP +Sorcery.OOM=[[DARK_AQUA]][[[GOLD]]{2}[[DARK_AQUA]]][[DARK_GRAY]] Koniec Many [[YELLOW]]([[RED]]{0}[[YELLOW]]/[[GRAY]]{1}[[YELLOW]]) +Sorcery.Water.Thunder=PIORUN +Sorcery.Curative.Self=LECZENIE SIEBIE +Sorcery.Curative.Other=LECZENIE INNYCH LUDZI +m.LVL=[[DARK_GRAY]]LVL: [[GREEN]]{0} [[DARK_AQUA]]Doswiadczenia[[YELLOW]]([[GOLD]]{1}[[YELLOW]]/[[GOLD]]{2}[[YELLOW]]) +Combat.BeastLore=[[GREEN]]**WIEDZA BESTI** +Combat.BeastLoreOwner=[[DARK_AQUA]]Wlasciciel ([[RED]]{0}[[DARK_AQUA]]) +Combat.BeastLoreHealthWolfTamed=[[DARK_AQUA]]Zycie ([[GREEN]]{0}[[DARK_AQUA]]/20) +Combat.BeastLoreHealthWolf=[[DARK_AQUA]]Zycie ([[GREEN]]{0}[[DARK_AQUA]]/8) \ No newline at end of file diff --git a/mcMMO/com/gmail/nossr50/party/Party.java b/mcMMO/com/gmail/nossr50/party/Party.java index c4bc27d71..1e3192075 100644 --- a/mcMMO/com/gmail/nossr50/party/Party.java +++ b/mcMMO/com/gmail/nossr50/party/Party.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.party; -import org.bukkit.ChatColor; import org.bukkit.entity.Player; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.mcMMO; @@ -50,22 +50,24 @@ public class Party { for(Player p : players){ if(player != null && p != null){ if(inSameParty(player, p) && !p.getName().equals(player.getName())){ - p.sendMessage(player.getName() + ChatColor.GREEN + " has joined your party"); + p.sendMessage(Messages.getString("Party.InformedOnJoin", new Object[] {player.getName()})); x++; } } } } - public void informPartyMembersQuit(Player player, Player[] players){ + public void informPartyMembersQuit(Player player, Player[] players) + { int x = 0; for(Player p : players){ - if(player != null && p != null){ - if(inSameParty(player, p) && !p.getName().equals(player.getName())){ - p.sendMessage(player.getName() + ChatColor.GREEN + " has left your party"); - x++; + if(player != null && p != null){ + if(inSameParty(player, p) && !p.getName().equals(player.getName())) + { + p.sendMessage(Messages.getString("Party.InformedOnQuit", new Object[] {player.getName()})); + x++; } - } - } + } + } } } diff --git a/mcMMO/com/gmail/nossr50/skills/Acrobatics.java b/mcMMO/com/gmail/nossr50/skills/Acrobatics.java index 4fe7c7a60..5154d4b20 100644 --- a/mcMMO/com/gmail/nossr50/skills/Acrobatics.java +++ b/mcMMO/com/gmail/nossr50/skills/Acrobatics.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.skills; import org.bukkit.ChatColor; -import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; @@ -16,7 +15,7 @@ public class Acrobatics { public static void acrobaticsCheck(Player player, EntityDamageEvent event){ if(player != null && mcPermissions.getInstance().acrobatics(player)){ PlayerProfile PP = Users.getProfile(player); - int acrovar = PP.getAcrobaticsInt(); + int acrovar = PP.getSkill("acrobatics"); if(player.isSneaking()) acrovar = acrovar * 2; if(Math.random() * 1000 <= acrovar && !event.isCancelled()){ @@ -55,8 +54,8 @@ public class Acrobatics { PlayerProfile PPd = Users.getProfile(defender); if(mcPermissions.getInstance().acrobatics(defender)){ - if(PPd.getAcrobaticsInt() <= 800){ - if(Math.random() * 4000 <= PPd.getAcrobaticsInt()){ + if(PPd.getSkill("acrobatics") <= 800){ + if(Math.random() * 4000 <= PPd.getSkill("acrobatics")){ defender.sendMessage(ChatColor.GREEN+"**DODGE**"); if(System.currentTimeMillis() >= 5000 + PPd.getRespawnATS() && defender.getHealth() >= 1){ PPd.addAcrobaticsXP(event.getDamage() * 12); diff --git a/mcMMO/com/gmail/nossr50/skills/Axes.java b/mcMMO/com/gmail/nossr50/skills/Axes.java index c0ad1ee23..8d9045b0b 100644 --- a/mcMMO/com/gmail/nossr50/skills/Axes.java +++ b/mcMMO/com/gmail/nossr50/skills/Axes.java @@ -3,12 +3,15 @@ package com.gmail.nossr50.skills; import org.bukkit.ChatColor; import org.bukkit.entity.Animals; import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; import org.bukkit.entity.Wolf; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.Combat; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcPermissions; @@ -27,25 +30,24 @@ public class Axes { PP.setAxePreparationMode(false); } int ticks = 2; - int x = PP.getAxesInt(); + int x = PP.getSkill("axes"); while(x >= 50){ x-=50; ticks++; } if(!PP.getSkullSplitterMode() && Skills.cooldownOver(player, PP.getSkullSplitterDeactivatedTimeStamp(), LoadProperties.skullSplitterCooldown)){ - player.sendMessage(ChatColor.GREEN+"**SKULL SPLITTER ACTIVATED**"); + player.sendMessage(Messages.getString("Skills.SkullSplitterOn")); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Skull Splitter!"); + y.sendMessage(Messages.getString("Skills.SkullSplitterPlayer", new Object[] {player.getName()})); } - PP.setSkullSplitterTicks(ticks * 1000); PP.setSkullSplitterActivatedTimeStamp(System.currentTimeMillis()); PP.setSkullSplitterDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setSkullSplitterMode(true); } if(!PP.getSkullSplitterMode() && !Skills.cooldownOver(player, PP.getSkullSplitterDeactivatedTimeStamp(), LoadProperties.skullSplitterCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." + player.sendMessage(Messages.getString("Skills.TooTired") +ChatColor.YELLOW+" ("+Skills.calculateTimeLeft(player, PP.getSkullSplitterDeactivatedTimeStamp(), LoadProperties.skullSplitterCooldown)+"s)"); } } @@ -54,14 +56,17 @@ public class Axes { Entity x = event.getEntity(); if(x instanceof Wolf){ Wolf wolf = (Wolf)x; - if(Taming.getOwner(wolf, pluginx) == attacker) - return; - if(Party.getInstance().inSameParty(attacker, Taming.getOwner(wolf, pluginx))) - return; + if(Taming.getOwner(wolf, pluginx) != null) + { + if(Taming.getOwner(wolf, pluginx) == attacker) + return; + if(Party.getInstance().inSameParty(attacker, Taming.getOwner(wolf, pluginx))) + return; + } } PlayerProfile PPa = Users.getProfile(attacker); if(m.isAxes(attacker.getItemInHand()) && mcPermissions.getInstance().axes(attacker)){ - if(PPa.getAxesInt() >= 750){ + if(PPa.getSkill("axes") >= 750){ if(Math.random() * 1000 <= 750){ if(x instanceof Player){ Player player = (Player)x; @@ -74,7 +79,7 @@ public class Axes { } attacker.sendMessage(ChatColor.RED+"CRITICAL HIT!"); } - } else if(Math.random() * 1000 <= PPa.getAxesInt()){ + } else if(Math.random() * 1000 <= PPa.getSkill("axes")){ if(x instanceof Player){ Player player = (Player)x; player.sendMessage(ChatColor.DARK_RED + "You were CRITICALLY hit!"); @@ -89,38 +94,44 @@ public class Axes { } } - public static void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx){ + public static void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx) + { int targets = 0; Entity x = event.getEntity(); targets = m.getTier(attacker); - for(Entity derp : x.getWorld().getEntities()){ - if(m.getDistance(x.getLocation(), derp.getLocation()) < 5){ - if(derp instanceof Player){ - Player target = (Player)derp; - if(Party.getInstance().inSameParty(attacker, target)) - continue; - if(!target.getName().equals(attacker.getName()) && targets >= 1){ - target.damage(event.getDamage() / 2); - target.sendMessage(ChatColor.DARK_RED+"Struck by CLEAVE!"); - targets--; + for(Entity derp : x.getWorld().getEntities()) + { + if(m.getDistance(x.getLocation(), derp.getLocation()) < 5) + { + if(derp instanceof Player) + { + if(Combat.pvpAllowed(event, derp.getWorld())) + { + Player target = (Player)derp; + if(Party.getInstance().inSameParty(attacker, target)) + continue; + if(!target.getName().equals(attacker.getName()) && targets >= 1) + { + target.damage(event.getDamage() / 2); + target.sendMessage(ChatColor.DARK_RED+"Struck by CLEAVE!"); + targets--; + } } - } - if(derp instanceof Monster && targets >= 1){ - Monster target = (Monster)derp; - target.damage(event.getDamage() / 2); - targets--; - } - if(derp instanceof Wolf){ - Wolf hurrDurr = (Wolf)derp; - if(Taming.getOwner(hurrDurr, pluginx) == attacker) - continue; - if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx))) - continue; - } - if(derp instanceof Animals && targets >= 1){ - Animals target = (Animals)derp; - target.damage(event.getDamage() / 2); - targets--; + } else if(derp instanceof LivingEntity && targets >= 1) + { + if(derp instanceof Wolf) + { + Wolf hurrDurr = (Wolf)derp; + if(Taming.getOwner(hurrDurr, pluginx) == attacker) + continue; + if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx))) + continue; + } + + //Deal the damage + LivingEntity target = (LivingEntity)derp; + target.damage(event.getDamage() / 2); + targets--; } } } diff --git a/mcMMO/com/gmail/nossr50/skills/Excavation.java b/mcMMO/com/gmail/nossr50/skills/Excavation.java index 1b250673a..9d681ae4a 100644 --- a/mcMMO/com/gmail/nossr50/skills/Excavation.java +++ b/mcMMO/com/gmail/nossr50/skills/Excavation.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.skills; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -8,18 +7,14 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; public class Excavation { - private static mcMMO plugin; - public Excavation(mcMMO instance) { - plugin = instance; - } public static void gigaDrillBreakerActivationCheck(Player player, Block block, Plugin pluginx){ PlayerProfile PP = Users.getProfile(player); if(m.isShovel(player.getItemInHand())){ @@ -31,19 +26,18 @@ public class Excavation { PP.setShovelPreparationMode(false); } int ticks = 2; - int x = PP.getExcavationInt(); + int x = PP.getSkill("excavation"); while(x >= 50){ x-=50; ticks++; } - if(!PP.getGigaDrillBreakerMode() && PP.getGigaDrillBreakerCooldown() == 0){ - player.sendMessage(ChatColor.GREEN+"**GIGA DRILL BREAKER ACTIVATED**"); + if(!PP.getGigaDrillBreakerMode() && PP.getGigaDrillBreakerDeactivatedTimeStamp() < System.currentTimeMillis()){ + player.sendMessage(Messages.getString("Skills.GigaDrillBreakerOn")); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Giga Drill Breaker!"); + y.sendMessage(Messages.getString("Skills.GigaDrillBreakerPlayer", new Object[] {player.getName()})); } - PP.setGigaDrillBreakerTicks(ticks * 1000); PP.setGigaDrillBreakerActivatedTimeStamp(System.currentTimeMillis()); PP.setGigaDrillBreakerDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setGigaDrillBreakerMode(true); @@ -69,17 +63,17 @@ public class Excavation { return; } if(type == 2){ - if(PP.getExcavationInt() > 250){ + if(PP.getSkill("excavation") > 250){ //CHANCE TO GET EGGS if(LoadProperties.eggs == true && Math.random() * 100 > 99){ - PP.addExcavationXP(10 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.meggs * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(344); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } //CHANCE TO GET APPLES if(LoadProperties.apples == true && Math.random() * 100 > 99){ - PP.addExcavationXP(10 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.mapple * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(260); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); @@ -88,39 +82,39 @@ public class Excavation { } //DIRT SAND OR GRAVEL if(type == 3 || type == 13 || type == 2 || type == 12){ - PP.addExcavationXP(4 * LoadProperties.xpGainMultiplier); - if(PP.getExcavationInt() > 750){ + PP.addExcavationXP(LoadProperties.mbase * LoadProperties.xpGainMultiplier); + if(PP.getSkill("excavation") > 750){ //CHANCE TO GET CAKE if(LoadProperties.cake == true && Math.random() * 2000 > 1999){ - PP.addExcavationXP(300 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.mcake * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(354); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } } - if(PP.getExcavationInt() > 350){ + if(PP.getSkill("excavation") > 350){ //CHANCE TO GET DIAMOND if(LoadProperties.diamond == true && Math.random() * 750 > 749){ - PP.addExcavationXP(100 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.mdiamond2 * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(264); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } } - if(PP.getExcavationInt() > 250){ + if(PP.getSkill("excavation") > 250){ //CHANCE TO GET YELLOW MUSIC if(LoadProperties.music == true && Math.random() * 2000 > 1999){ - PP.addExcavationXP(300 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.mmusic * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(2256); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } } - if(PP.getExcavationInt() > 350){ + if(PP.getSkill("excavation") > 350){ //CHANCE TO GET GREEN MUSIC if(LoadProperties.music == true && Math.random() * 2000 > 1999){ - PP.addExcavationXP(300 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.mmusic * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(2257); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); @@ -130,15 +124,15 @@ public class Excavation { //SAND if(type == 12){ //CHANCE TO GET GLOWSTONE - if(LoadProperties.glowstone == true && PP.getExcavationInt() > 50 && Math.random() * 100 > 95){ - PP.addExcavationXP(8 * LoadProperties.xpGainMultiplier); + if(LoadProperties.glowstone == true && PP.getSkill("excavation") > 50 && Math.random() * 100 > 95){ + PP.addExcavationXP(LoadProperties.mglowstone2 * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(348); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } //CHANCE TO GET SLOWSAND - if(LoadProperties.slowsand == true && PP.getExcavationInt() > 650 && Math.random() * 200 > 199){ - PP.addExcavationXP(8 * LoadProperties.xpGainMultiplier); + if(LoadProperties.slowsand == true && PP.getSkill("excavation") > 650 && Math.random() * 200 > 199){ + PP.addExcavationXP(LoadProperties.mslowsand * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(88); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); @@ -146,10 +140,10 @@ public class Excavation { } //GRASS OR DIRT if(type == 2 || type == 3){ - if(PP.getExcavationInt() > 50){ + if(PP.getSkill("excavation") > 50){ //CHANCE FOR COCOA BEANS - if(LoadProperties.eggs == true && Math.random() * 75 > 74){ - PP.addExcavationXP(10 * LoadProperties.xpGainMultiplier); + if(LoadProperties.cocoabeans == true && Math.random() * 75 > 74){ + PP.addExcavationXP(LoadProperties.mcocoa * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(351); is = new ItemStack(mat, 1, (byte)0, (byte)0); is.setDurability((byte) 3); //COCOA @@ -157,8 +151,8 @@ public class Excavation { } } //CHANCE FOR SHROOMS - if(LoadProperties.mushrooms == true && PP.getExcavationInt() > 500 && Math.random() * 200 > 199){ - PP.addExcavationXP(8 * LoadProperties.xpGainMultiplier); + if(LoadProperties.mushrooms == true && PP.getSkill("excavation") > 500 && Math.random() * 200 > 199){ + PP.addExcavationXP(LoadProperties.mmushroom2 * LoadProperties.xpGainMultiplier); if(Math.random() * 10 > 5){ mat = Material.getMaterial(39); } else { @@ -168,8 +162,8 @@ public class Excavation { loc.getWorld().dropItemNaturally(loc, is); } //CHANCE TO GET GLOWSTONE - if(LoadProperties.glowstone == true && PP.getExcavationInt() > 25 && Math.random() * 100 > 95){ - PP.addExcavationXP(8 * LoadProperties.xpGainMultiplier); + if(LoadProperties.glowstone == true && PP.getSkill("excavation") > 25 && Math.random() * 100 > 95){ + PP.addExcavationXP(LoadProperties.mglowstone2 * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(348); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); @@ -178,25 +172,25 @@ public class Excavation { //GRAVEL if(type == 13){ //CHANCE TO GET NETHERRACK - if(LoadProperties.netherrack == true && PP.getExcavationInt() > 850 && Math.random() * 200 > 199){ - PP.addExcavationXP(3 * LoadProperties.xpGainMultiplier); + if(LoadProperties.netherrack == true && PP.getSkill("excavation") > 850 && Math.random() * 200 > 199){ + PP.addExcavationXP(LoadProperties.mnetherrack * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(87); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } //CHANCE TO GET SULPHUR - if(LoadProperties.sulphur == true && PP.getExcavationInt() > 75){ + if(LoadProperties.sulphur == true && PP.getSkill("excavation") > 75){ if(Math.random() * 10 > 9){ - PP.addExcavationXP(3 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.msulphur * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(289); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); } } //CHANCE TO GET BONES - if(LoadProperties.bones == true && PP.getExcavationInt() > 175){ + if(LoadProperties.bones == true && PP.getSkill("excavation") > 175){ if(Math.random() * 10 > 9){ - PP.addExcavationXP(3 * LoadProperties.xpGainMultiplier); + PP.addExcavationXP(LoadProperties.mbones * LoadProperties.xpGainMultiplier); mat = Material.getMaterial(352); is = new ItemStack(mat, 1, (byte)0, (byte)0); loc.getWorld().dropItemNaturally(loc, is); diff --git a/mcMMO/com/gmail/nossr50/skills/Herbalism.java b/mcMMO/com/gmail/nossr50/skills/Herbalism.java index 5a156bdcc..c02f135c1 100644 --- a/mcMMO/com/gmail/nossr50/skills/Herbalism.java +++ b/mcMMO/com/gmail/nossr50/skills/Herbalism.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.skills; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; @@ -10,22 +9,20 @@ import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; public class Herbalism { - private static mcMMO plugin; - public Herbalism(mcMMO instance) { - plugin = instance; - } - public static void greenTerraWheat(Player player, Block block, BlockBreakEvent event){ - if(block.getType() == Material.WHEAT && block.getData() == (byte) 0x07){ + public static void greenTerraWheat(Player player, Block block, BlockBreakEvent event, mcMMO plugin) + { + if(block.getType() == Material.WHEAT && block.getData() == (byte) 0x07) + { event.setCancelled(true); PlayerProfile PP = Users.getProfile(player); Material mat = Material.getMaterial(296); @@ -33,8 +30,14 @@ public class Herbalism { ItemStack is = new ItemStack(mat, 1, (byte)0, (byte)0); PP.addHerbalismXP(5 * LoadProperties.xpGainMultiplier); loc.getWorld().dropItemNaturally(loc, is); - herbalismProcCheck(block, player, event); - herbalismProcCheck(block, player, event); + + //DROP SOME SEEDS + mat = Material.SEEDS; + is = new ItemStack(mat, 1, (byte)0, (byte)0); + loc.getWorld().dropItemNaturally(loc, is); + + herbalismProcCheck(block, player, event, plugin); + herbalismProcCheck(block, player, event, plugin); block.setData((byte) 0x03); } } @@ -42,7 +45,8 @@ public class Herbalism { if(block.getType() == Material.COBBLESTONE || block.getType() == Material.DIRT){ if(!hasSeeds(player)) player.sendMessage("You need more seeds to spread Green Terra"); - if(hasSeeds(player) && block.getType() != Material.WHEAT){ + if(hasSeeds(player) && block.getType() != Material.WHEAT) + { removeSeeds(player); if(block.getType() == Material.DIRT) block.setType(Material.GRASS); @@ -95,19 +99,18 @@ public class Herbalism { PP.setHoePreparationMode(false); } int ticks = 2; - int x = PP.getHerbalismInt(); + int x = PP.getSkill("herbalism"); while(x >= 50){ x-=50; ticks++; } if(!PP.getGreenTerraMode() && Skills.cooldownOver(player, PP.getGreenTerraDeactivatedTimeStamp(), LoadProperties.greenTerraCooldown)){ - player.sendMessage(ChatColor.GREEN+"**GREEN TERRA ACTIVATED**"); + player.sendMessage(Messages.getString("Skills.GreenTerraOn")); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Green Terra!"); + y.sendMessage(Messages.getString("Skills.GreenTerraPlayer", new Object[] {player.getName()})); } - PP.setGreenTerraTicks(ticks * 1000); PP.setGreenTerraActivatedTimeStamp(System.currentTimeMillis()); PP.setGreenTerraDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setGreenTerraMode(true); @@ -115,39 +118,45 @@ public class Herbalism { } } - public static void herbalismProcCheck(Block block, Player player, BlockBreakEvent event){ + public static void herbalismProcCheck(Block block, Player player, BlockBreakEvent event, mcMMO plugin) + { PlayerProfile PP = Users.getProfile(player); int type = block.getTypeId(); Location loc = block.getLocation(); ItemStack is = null; Material mat = null; - if(Config.getInstance().isBlockWatched(block)){ + if(plugin.misc.blockWatchList.contains(block)) + { return; } if(type == 59 && block.getData() == (byte) 0x7){ mat = Material.getMaterial(296); is = new ItemStack(mat, 1, (byte)0, (byte)0); - PP.addHerbalismXP(5 * LoadProperties.xpGainMultiplier); + PP.addHerbalismXP(LoadProperties.mwheat * LoadProperties.xpGainMultiplier); if(player != null){ - if(Math.random() * 1000 <= PP.getHerbalismInt()){ + if(Math.random() * 1000 <= PP.getSkill("herbalism")){ loc.getWorld().dropItemNaturally(loc, is); } } //GREEN THUMB - if(Math.random() * 1500 <= PP.getHerbalismInt()){ + if(Math.random() * 1500 <= PP.getSkill("herbalism")){ event.setCancelled(true); loc.getWorld().dropItemNaturally(loc, is); + //DROP SOME SEEDS + mat = Material.SEEDS; + is = new ItemStack(mat, 1, (byte)0, (byte)0); + loc.getWorld().dropItemNaturally(loc, is); block.setData((byte) 0x1); //Change it to first stage //Setup the bonuses int bonus = 0; - if(PP.getHerbalismInt() >= 200) + if(PP.getSkill("herbalism") >= 200) bonus++; - if(PP.getHerbalismInt() >= 400) + if(PP.getSkill("herbalism") >= 400) bonus++; - if(PP.getHerbalismInt() >= 600) + if(PP.getSkill("herbalism") >= 600) bonus++; //Change wheat to be whatever stage based on the bonus @@ -190,11 +199,11 @@ public class Herbalism { is = new ItemStack(Material.CACTUS, 1, (byte)0, (byte)0); if(byteArray[x] != (byte) 5) { - if(Math.random() * 1000 <= PP.getHerbalismInt()) + if(Math.random() * 1000 <= PP.getSkill("herbalism")) { loc.getWorld().dropItemNaturally(target.getLocation(), is); } - PP.addHerbalismXP(3 * LoadProperties.xpGainMultiplier); + PP.addHerbalismXP(LoadProperties.mcactus * LoadProperties.xpGainMultiplier); } } x++; @@ -228,11 +237,11 @@ public class Herbalism { //Check for being placed by the player if(byteArray[x] != (byte) 5) { - if(Math.random() * 1000 <= PP.getHerbalismInt()) + if(Math.random() * 1000 <= PP.getSkill("herbalism")) { loc.getWorld().dropItemNaturally(target.getLocation(), is); } - PP.addHerbalismXP(3 * LoadProperties.xpGainMultiplier); + PP.addHerbalismXP(LoadProperties.msugar * LoadProperties.xpGainMultiplier); } } x++; @@ -240,81 +249,88 @@ public class Herbalism { } //Pumpkins - if((type == 91 || type == 86) && !Config.getInstance().isBlockWatched(block)){ + if((type == 91 || type == 86) && plugin.misc.blockWatchList.contains(block)) + { mat = Material.getMaterial(block.getTypeId()); is = new ItemStack(mat, 1, (byte)0, (byte)0); if(player != null){ - if(Math.random() * 1000 <= PP.getHerbalismInt()){ + if(Math.random() * 1000 <= PP.getSkill("herbalism")){ loc.getWorld().dropItemNaturally(loc, is); } } - PP.addHerbalismXP(55 * LoadProperties.xpGainMultiplier); + PP.addHerbalismXP(LoadProperties.mpumpkin * LoadProperties.xpGainMultiplier); } //Mushroom if(type == 39 || type == 40){ mat = Material.getMaterial(block.getTypeId()); is = new ItemStack(mat, 1, (byte)0, (byte)0); if(player != null){ - if(Math.random() * 1000 <= PP.getHerbalismInt()){ + if(Math.random() * 1000 <= PP.getSkill("herbalism")){ loc.getWorld().dropItemNaturally(loc, is); } } - PP.addHerbalismXP(40 * LoadProperties.xpGainMultiplier); + PP.addHerbalismXP(LoadProperties.mmushroom * LoadProperties.xpGainMultiplier); } //Flower if(type == 37 || type == 38){ mat = Material.getMaterial(block.getTypeId()); is = new ItemStack(mat, 1, (byte)0, (byte)0); if(player != null){ - if(Math.random() * 1000 <= PP.getHerbalismInt()){ + if(Math.random() * 1000 <= PP.getSkill("herbalism")){ loc.getWorld().dropItemNaturally(loc, is); } } - PP.addHerbalismXP(10 * LoadProperties.xpGainMultiplier); + PP.addHerbalismXP(LoadProperties.mflower * LoadProperties.xpGainMultiplier); } } Skills.XpCheck(player); } public static void breadCheck(Player player, ItemStack is){ PlayerProfile PP = Users.getProfile(player); - if(is.getTypeId() == 297){ - if(PP.getHerbalismInt() >= 50 && PP.getHerbalismInt() < 150){ - player.setHealth(player.getHealth() + 1); - } else if (PP.getHerbalismInt() >= 150 && PP.getHerbalismInt() < 250){ - player.setHealth(player.getHealth() + 2); - } else if (PP.getHerbalismInt() >= 250 && PP.getHerbalismInt() < 350){ - player.setHealth(player.getHealth() + 3); - } else if (PP.getHerbalismInt() >= 350 && PP.getHerbalismInt() < 450){ - player.setHealth(player.getHealth() + 4); - } else if (PP.getHerbalismInt() >= 450 && PP.getHerbalismInt() < 550){ - player.setHealth(player.getHealth() + 5); - } else if (PP.getHerbalismInt() >= 550 && PP.getHerbalismInt() < 650){ - player.setHealth(player.getHealth() + 6); - } else if (PP.getHerbalismInt() >= 650 && PP.getHerbalismInt() < 750){ - player.setHealth(player.getHealth() + 7); - } else if (PP.getHerbalismInt() >= 750){ - player.setHealth(player.getHealth() + 8); - } - } + int herbalism = PP.getSkill("herbalism"); + if(is != null && PP != null) + { + if(is.getTypeId() == 297) + { + if(herbalism >= 50 && herbalism < 150){ + player.setHealth(player.getHealth() + 1); + } else if (herbalism >= 150 && herbalism < 250){ + player.setHealth(player.getHealth() + 2); + } else if (herbalism >= 250 && herbalism < 350){ + player.setHealth(player.getHealth() + 3); + } else if (herbalism >= 350 && herbalism < 450){ + player.setHealth(player.getHealth() + 4); + } else if (herbalism >= 450 && herbalism < 550){ + player.setHealth(player.getHealth() + 5); + } else if (herbalism >= 550 && herbalism < 650){ + player.setHealth(player.getHealth() + 6); + } else if (herbalism >= 650 && herbalism < 750){ + player.setHealth(player.getHealth() + 7); + } else if (herbalism >= 750){ + player.setHealth(player.getHealth() + 8); + } + } + } } public static void stewCheck(Player player, ItemStack is){ PlayerProfile PP = Users.getProfile(player); + int herbalism = PP.getSkill("herbalism"); if(is.getTypeId() == 282){ - if(PP.getHerbalismInt() >= 50 && PP.getHerbalismInt() < 150){ + if(herbalism >= 50 && herbalism < 150){ player.setHealth(player.getHealth() + 1); - } else if (PP.getHerbalismInt() >= 150 && PP.getHerbalismInt() < 250){ + } else if (herbalism >= 150 && herbalism < 250){ player.setHealth(player.getHealth() + 2); - } else if (PP.getHerbalismInt() >= 250 && PP.getHerbalismInt() < 350){ + } else if (herbalism >= 250 && herbalism < 350){ player.setHealth(player.getHealth() + 3); - } else if (PP.getHerbalismInt() >= 350 && PP.getHerbalismInt() < 450){ + } else if (herbalism >= 350 && herbalism < 450){ player.setHealth(player.getHealth() + 4); - } else if (PP.getHerbalismInt() >= 450 && PP.getHerbalismInt() < 550){ + } else if (herbalism >= 450 && herbalism < 550){ player.setHealth(player.getHealth() + 5); - } else if (PP.getHerbalismInt() >= 550 && PP.getHerbalismInt() < 650){ + } else if (herbalism >= 550 && herbalism < 650){ player.setHealth(player.getHealth() + 6); - } else if (PP.getHerbalismInt() >= 650 && PP.getHerbalismInt() < 750){ + } else if (herbalism >= 650 && herbalism < 750){ player.setHealth(player.getHealth() + 7); - } else if (PP.getHerbalismInt() >= 750){ + } else if (herbalism >= 750){ player.setHealth(player.getHealth() + 8); } } diff --git a/mcMMO/com/gmail/nossr50/skills/Mining.java b/mcMMO/com/gmail/nossr50/skills/Mining.java index 5c5280320..a8d5db3ae 100644 --- a/mcMMO/com/gmail/nossr50/skills/Mining.java +++ b/mcMMO/com/gmail/nossr50/skills/Mining.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.skills; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Statistic; @@ -9,19 +8,15 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; public class Mining { - private static mcMMO plugin; - public Mining(mcMMO instance) { - plugin = instance; - } public static void superBreakerCheck(Player player, Block block, Plugin pluginx) { @@ -35,19 +30,20 @@ public class Mining { PP.setPickaxePreparationMode(false); } int ticks = 2; - int x = PP.getMiningInt(); - while(x >= 50){ + int x = PP.getSkill("mining"); + while(x >= 50) + { x-=50; ticks++; } if(!PP.getSuperBreakerMode() && Skills.cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)){ - player.sendMessage(ChatColor.GREEN+"**SUPER BREAKER ACTIVATED**"); - for(Player y : pluginx.getServer().getOnlinePlayers()){ + player.sendMessage(Messages.getString("Skills.SuperBreakerOn")); + for(Player y : pluginx.getServer().getOnlinePlayers()) + { if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Super Breaker!"); + y.sendMessage(Messages.getString("Skills.SuperBreakerPlayer", new Object[] {player.getName()})); } - PP.setSuperBreakerTicks(ticks * 1000); PP.setSuperBreakerActivatedTimeStamp(System.currentTimeMillis()); PP.setSuperBreakerDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setSuperBreakerMode(true); @@ -106,65 +102,65 @@ public class Mining { { PlayerProfile PP = Users.getProfile(player); if(player != null){ - if(Math.random() * 1000 <= PP.getMiningInt()){ + if(Math.random() * 1000 <= PP.getSkill("mining")){ blockProcSimulate(block); return; } } } - public static void miningBlockCheck(Player player, Block block) + public static void miningBlockCheck(Player player, Block block, mcMMO plugin) { PlayerProfile PP = Users.getProfile(player); - if(Config.getInstance().isBlockWatched(block) || block.getData() == (byte) 5) + if(plugin.misc.blockWatchList.contains(block) || block.getData() == (byte) 5) return; int xp = 0; if(block.getTypeId() == 1 || block.getTypeId() == 24){ - xp += 3; + xp += LoadProperties.mstone; blockProcCheck(block, player); } //OBSIDIAN if(block.getTypeId() == 49){ - xp += 15; + xp += LoadProperties.mobsidian; blockProcCheck(block, player); } //NETHERRACK if(block.getTypeId() == 87){ - xp += 3; + xp += LoadProperties.mnetherrack; blockProcCheck(block, player); } //GLOWSTONE if(block.getTypeId() == 89){ - xp += 3; + xp += LoadProperties.mglowstone; blockProcCheck(block, player); } //COAL if(block.getTypeId() == 16){ - xp += 10; + xp += LoadProperties.mcoal; blockProcCheck(block, player); } //GOLD if(block.getTypeId() == 14){ - xp += 35; + xp += LoadProperties.mgold; blockProcCheck(block, player); } //DIAMOND if(block.getTypeId() == 56){ - xp += 75; + xp += LoadProperties.mdiamond; blockProcCheck(block, player); } //IRON if(block.getTypeId() == 15){ - xp += 25; + xp += LoadProperties.miron; blockProcCheck(block, player); } //REDSTONE if(block.getTypeId() == 73 || block.getTypeId() == 74){ - xp += 15; + xp += LoadProperties.mredstone; blockProcCheck(block, player); } //LAPUS if(block.getTypeId() == 21){ - xp += 40; + xp += LoadProperties.mlapus; blockProcCheck(block, player); } PP.addMiningXP(xp * LoadProperties.xpGainMultiplier); @@ -181,7 +177,7 @@ public class Mining { return false; } } - public static void SuperBreakerBlockCheck(Player player, Block block){ + public static void SuperBreakerBlockCheck(Player player, Block block, mcMMO plugin){ PlayerProfile PP = Users.getProfile(player); if(LoadProperties.toolsLoseDurabilityFromAbilities) m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss); @@ -192,14 +188,17 @@ public class Mining { ItemStack item = new ItemStack(mat, 1, (byte)0, damage); if(block.getTypeId() == 1 || block.getTypeId() == 24) { - if(!Config.getInstance().isBlockWatched(block) && block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block) && block.getData() != (byte) 5) + { xp += 3; blockProcCheck(block, player); blockProcCheck(block, player); } - if(block.getTypeId() == 1){ + if(block.getTypeId() == 1) + { mat = Material.COBBLESTONE; - } else { + } else + { mat = Material.SANDSTONE; } item = new ItemStack(mat, 1, (byte)0, damage); @@ -210,7 +209,7 @@ public class Mining { //NETHERRACK if(block.getTypeId() == 87) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 3; blockProcCheck(block, player); blockProcCheck(block, player); @@ -224,7 +223,7 @@ public class Mining { //GLOWSTONE if(block.getTypeId() == 89) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 3; blockProcCheck(block, player); blockProcCheck(block, player); @@ -238,7 +237,7 @@ public class Mining { //COAL if(block.getTypeId() == 16) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 10; blockProcCheck(block, player); blockProcCheck(block, player); @@ -252,7 +251,7 @@ public class Mining { //GOLD if(block.getTypeId() == 14 && m.getTier(player) >= 3) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 35; blockProcCheck(block, player); blockProcCheck(block, player); @@ -266,8 +265,8 @@ public class Mining { if(block.getTypeId() == 49 && m.getTier(player) >= 4) { if(LoadProperties.toolsLoseDurabilityFromAbilities) - m.damageTool(player, (short) 104); - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss); + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 15; blockProcCheck(block, player); blockProcCheck(block, player); @@ -281,7 +280,7 @@ public class Mining { //DIAMOND if(block.getTypeId() == 56 && m.getTier(player) >= 3) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 75; blockProcCheck(block, player); blockProcCheck(block, player); @@ -295,7 +294,7 @@ public class Mining { //IRON if(block.getTypeId() == 15 && m.getTier(player) >= 2) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 25; blockProcCheck(block, player); blockProcCheck(block, player); @@ -308,7 +307,7 @@ public class Mining { //REDSTONE if((block.getTypeId() == 73 || block.getTypeId() == 74) && m.getTier(player) >= 4) { - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5) + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5) { xp += 15; blockProcCheck(block, player); @@ -328,7 +327,7 @@ public class Mining { } //LAPUS if(block.getTypeId() == 21 && m.getTier(player) >= 3){ - if(!Config.getInstance().isBlockWatched(block)&& block.getData() != (byte) 5){ + if(!plugin.misc.blockWatchList.contains(block)&& block.getData() != (byte) 5){ xp += 40; blockProcCheck(block, player); blockProcCheck(block, player); diff --git a/mcMMO/com/gmail/nossr50/skills/Repair.java b/mcMMO/com/gmail/nossr50/skills/Repair.java index 879776bcf..032af4f74 100644 --- a/mcMMO/com/gmail/nossr50/skills/Repair.java +++ b/mcMMO/com/gmail/nossr50/skills/Repair.java @@ -5,20 +5,15 @@ import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcPermissions; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; public class Repair { - private static mcMMO plugin; - public Repair(mcMMO instance) { - plugin = instance; - } - private static volatile Repair instance; /* * Repair requirements for each material @@ -40,8 +35,7 @@ public class Repair { short durabilityBefore = player.getItemInHand().getDurability(); short durabilityAfter = 0; short dif = 0; - if(block != null - && mcPermissions.repair(player)){ + if(block != null && mcPermissions.getInstance().repair(player)){ if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){ /* * ARMOR @@ -50,7 +44,7 @@ public class Repair { /* * DIAMOND ARMOR */ - if(isDiamondArmor(is) && hasItem(player, rDiamond) && PP.getRepairInt() >= LoadProperties.repairdiamondlevel){ + if(isDiamondArmor(is) && hasItem(player, rDiamond) && PP.getSkill("repair") >= LoadProperties.repairdiamondlevel){ removeItem(player, rDiamond); player.getItemInHand().setDurability(getRepairAmount(is, player)); durabilityAfter = player.getItemInHand().getDurability(); @@ -136,7 +130,7 @@ public class Repair { if(m.isHoe(is)) dif = (short) (dif / 2); PP.addRepairXP(dif * LoadProperties.xpGainMultiplier); - } else if (isDiamondTools(is) && hasItem(player, rDiamond) && PP.getRepairInt() >= LoadProperties.repairdiamondlevel){ //Check if its diamond and the player has diamonds + } else if (isDiamondTools(is) && hasItem(player, rDiamond) && PP.getSkill("repair") >= LoadProperties.repairdiamondlevel){ //Check if its diamond and the player has diamonds /* * DIAMOND TOOLS */ @@ -170,7 +164,7 @@ public class Repair { } } else { - player.sendMessage("That is at full durability."); + player.sendMessage(Messages.getString("Skills.FullDurability")); } player.updateInventory(); /* @@ -215,8 +209,8 @@ public class Repair { if(is.getTypeId() == 256 || is.getTypeId() == 257 || is.getTypeId() == 258 || is.getTypeId() == 267 || is.getTypeId() == 292 || //IRON is.getTypeId() == 276 || is.getTypeId() == 277 || is.getTypeId() == 278 || is.getTypeId() == 279 || is.getTypeId() == 293 || //DIAMOND is.getTypeId() == 283 || is.getTypeId() == 285 || is.getTypeId() == 286 || is.getTypeId() == 284 || //GOLD - is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || //WOOD - is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275) //STONE + is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290 ||//WOOD + is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275|| is.getTypeId() == 291) //STONE { return true; } else { @@ -224,14 +218,14 @@ public class Repair { } } public static boolean isStoneTools(ItemStack is){ - if(is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275){ + if(is.getTypeId() == 272 || is.getTypeId() == 273 || is.getTypeId() == 274 || is.getTypeId() == 275 || is.getTypeId() == 291){ return true; } else { return false; } } public static boolean isWoodTools(ItemStack is){ - if(is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271){ + if(is.getTypeId() == 268 || is.getTypeId() == 269 || is.getTypeId() == 270 || is.getTypeId() == 271 || is.getTypeId() == 290){ return true; } else { return false; @@ -261,7 +255,8 @@ public class Repair { return false; } } - public static void removeItem(Player player, int typeid){ + public static void removeItem(Player player, int typeid) + { ItemStack[] inventory = player.getInventory().getContents(); for(ItemStack x : inventory){ if(x != null && x.getTypeId() == typeid){ @@ -288,7 +283,7 @@ public class Repair { } public static short repairCalculate(Player player, short durability, short ramt){ PlayerProfile PP = Users.getProfile(player); - float bonus = (PP.getRepairInt() / 500); + float bonus = (PP.getSkill("repair") / 500); bonus = (ramt * bonus); ramt = ramt+=bonus; if(checkPlayerProcRepair(player)){ @@ -326,9 +321,13 @@ public class Repair { case 271: ramt = 20; break; + //WOOD HOE + case 290: + ramt = 30; + break; //STONE SWORD case 272: - ramt = 44; + ramt = 66; break; //STONE SHOVEL case 273: @@ -342,6 +341,10 @@ public class Repair { case 275: ramt = 44; break; + //STONE HOE + case 291: + ramt = 66; + break; //GOLD SHOVEL case 284: ramt = 33; @@ -446,33 +449,33 @@ public class Repair { } public static void needMoreVespeneGas(ItemStack is, Player player){ PlayerProfile PP = Users.getProfile(player); - if ((isDiamondTools(is) || isDiamondArmor(is)) && PP.getRepairInt() < LoadProperties.repairdiamondlevel){ - player.sendMessage(ChatColor.DARK_RED +"You're not adept enough to repair Diamond"); + if ((isDiamondTools(is) || isDiamondArmor(is)) && PP.getSkill("repair") < LoadProperties.repairdiamondlevel){ + player.sendMessage(Messages.getString("AdeptDiamond")); } else if (isDiamondTools(is) && !hasItem(player, rDiamond) || isIronTools(is) && !hasItem(player, rIron) || isGoldTools(is) && !hasItem(player, rGold)){ if(isDiamondTools(is) && !hasItem(player, rDiamond)) - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.BLUE+ nDiamond); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.BLUE+ nDiamond); if(isIronTools(is) && !hasItem(player, rIron)) - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GRAY+ nIron); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.GRAY+ nIron); if(isGoldTools(is) && !hasItem(player, rGold)) - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GOLD+nGold); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.GOLD+nGold); if(isWoodTools(is) && !hasItem(player,rWood)) - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.DARK_GREEN+ nWood); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.DARK_GREEN+ nWood); if(isStoneTools(is) && !hasItem(player, rStone)) - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GRAY+nStone); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.GRAY+nStone); } else if (isDiamondArmor(is) && !hasItem(player, rDiamond)){ - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.BLUE+ nDiamond); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.BLUE+ nDiamond); } else if (isIronArmor(is) && !hasItem(player, rIron)){ - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GRAY+ nIron); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.GRAY+ nIron); } else if (isGoldArmor(is) && !hasItem(player, rGold)){ - player.sendMessage(ChatColor.DARK_RED+"You need more "+ChatColor.GOLD+ nGold); + player.sendMessage(Messages.getString("Skills.NeedMore")+" "+ChatColor.GOLD+ nGold); } else if (is.getAmount() > 1) - player.sendMessage(ChatColor.DARK_RED+"You can't repair stacked items"); + player.sendMessage(Messages.getString("Skills.StackedItems")); } public static boolean checkPlayerProcRepair(Player player){ PlayerProfile PP = Users.getProfile(player); if(player != null){ - if(Math.random() * 1000 <= PP.getRepairInt()){ - player.sendMessage(ChatColor.GRAY + "That felt easy."); + if(Math.random() * 1000 <= PP.getSkill("repair")){ + player.sendMessage(Messages.getString("Skills.FeltEasy")); return true; } } diff --git a/mcMMO/com/gmail/nossr50/skills/Skills.java b/mcMMO/com/gmail/nossr50/skills/Skills.java index 684e861f4..8d1fd8672 100644 --- a/mcMMO/com/gmail/nossr50/skills/Skills.java +++ b/mcMMO/com/gmail/nossr50/skills/Skills.java @@ -6,14 +6,12 @@ import org.bukkit.ChatColor; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; -import org.bukkit.plugin.Plugin; - import com.gmail.nossr50.Leaderboard; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcPermissions; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerStat; @@ -21,7 +19,6 @@ import com.gmail.nossr50.datatypes.PlayerStat; public class Skills { - private static volatile Skills instance; protected static final Logger log = Logger.getLogger("Minecraft"); public void updateSQLfromFile(Player player){ @@ -51,15 +48,12 @@ public class Skills { } } } - public static int calculateTimeLeft(Player player, long deactivatedTimeStamp, int cooldown){ - long currentTime = System.currentTimeMillis(); - int x = 0; - while(currentTime < deactivatedTimeStamp + (cooldown * 1000)){ - currentTime += 1000; - x++; - } - return x; + + public static int calculateTimeLeft(Player player, long deactivatedTimeStamp, int cooldown) + { + return (int) (((deactivatedTimeStamp + (cooldown * 1000)) - System.currentTimeMillis())/1000); } + public static boolean isAllCooldownsOver(PlayerProfile PP) { long t = System.currentTimeMillis(); @@ -80,42 +74,42 @@ public class Skills { PlayerProfile PP = Users.getProfile(player); if(!PP.getGreenTerraInformed() && System.currentTimeMillis() - PP.getGreenTerraDeactivatedTimeStamp() >= (LoadProperties.greenTerraCooldown * 1000)){ PP.setGreenTerraInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Green Terra "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourGreenTerra")); } if(!PP.getTreeFellerInformed() && System.currentTimeMillis() - PP.getTreeFellerDeactivatedTimeStamp() >= (LoadProperties.greenTerraCooldown * 1000)){ PP.setTreeFellerInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Tree Feller "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourTreeFeller")); } if(!PP.getSuperBreakerInformed() && System.currentTimeMillis() - PP.getSuperBreakerDeactivatedTimeStamp() >= (LoadProperties.superBreakerCooldown * 1000)){ PP.setSuperBreakerInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Super Breaker "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourSuperBreaker")); } if(!PP.getSerratedStrikesInformed() && System.currentTimeMillis() - PP.getSerratedStrikesDeactivatedTimeStamp() >= (LoadProperties.serratedStrikeCooldown * 1000)){ PP.setSerratedStrikesInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Serrated Strikes "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourSerratedStrikes")); } if(!PP.getBerserkInformed() && System.currentTimeMillis() - PP.getBerserkDeactivatedTimeStamp() >= (LoadProperties.berserkCooldown * 1000)){ PP.setBerserkInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Berserk "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourBerserk")); } if(!PP.getSkullSplitterInformed() && System.currentTimeMillis() - PP.getSkullSplitterDeactivatedTimeStamp() >= (LoadProperties.skullSplitterCooldown * 1000)){ PP.setSkullSplitterInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Skull Splitter "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourSkullSplitter")); } if(!PP.getGigaDrillBreakerInformed() && System.currentTimeMillis() - PP.getGigaDrillBreakerDeactivatedTimeStamp() >= (LoadProperties.gigaDrillBreakerCooldown * 1000)){ PP.setGigaDrillBreakerInformed(true); - player.sendMessage(ChatColor.GREEN+"Your "+ChatColor.YELLOW+"Giga Drill Breaker "+ChatColor.GREEN+"ability is refreshed!"); + player.sendMessage(Messages.getString("Skills.YourGigaDrillBreaker")); } } public static void hoeReadinessCheck(Player player){ PlayerProfile PP = Users.getProfile(player); if(mcPermissions.getInstance().herbalismAbility(player) && m.isHoe(player.getItemInHand()) && !PP.getHoePreparationMode()){ if(!PP.getGreenTerraMode() && !cooldownOver(player, PP.getGreenTerraDeactivatedTimeStamp(), LoadProperties.greenTerraCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." + player.sendMessage(Messages.getString("Skills.TooTired") +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getGreenTerraDeactivatedTimeStamp(), LoadProperties.greenTerraCooldown)+"s)"); return; } - player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR HOE**"); + player.sendMessage(Messages.getString("Skills.ReadyHoe")); PP.setHoePreparationATS(System.currentTimeMillis()); PP.setHoePreparationMode(true); } @@ -124,151 +118,157 @@ public class Skills { PlayerProfile PP = Users.getProfile(player); if(PP == null) Users.addUser(player); - if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){ - PP.setHoePreparationMode(false); - player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR HOE**"); - } - if(PP.getAxePreparationMode() && System.currentTimeMillis() - PP.getAxePreparationATS() >= 4000){ + if(PP != null) + { + if(PP.getHoePreparationMode() && System.currentTimeMillis() - PP.getHoePreparationATS() >= 4000){ + PP.setHoePreparationMode(false); + player.sendMessage(Messages.getString("Skills.LowerHoe")); + } + if(PP.getAxePreparationMode() && System.currentTimeMillis() - PP.getAxePreparationATS() >= 4000){ PP.setAxePreparationMode(false); - player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR AXE**"); - } - if(PP.getPickaxePreparationMode() && System.currentTimeMillis() - PP.getPickaxePreparationATS() >= 4000){ - PP.setPickaxePreparationMode(false); - player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR PICKAXE**"); - } - if(PP.getSwordsPreparationMode() && System.currentTimeMillis() - PP.getSwordsPreparationATS() >= 4000){ - PP.setSwordsPreparationMode(false); - player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR SWORD**"); - } - if(PP.getFistsPreparationMode() && System.currentTimeMillis() - PP.getFistsPreparationATS() >= 4000){ - PP.setFistsPreparationMode(false); - player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR FISTS**"); - } - if(PP.getShovelPreparationMode() && System.currentTimeMillis() - PP.getShovelPreparationATS() >= 4000){ - PP.setShovelPreparationMode(false); - player.sendMessage(ChatColor.GRAY+"**YOU LOWER YOUR SHOVEL**"); - } - /* - * HERBALISM ABILITY - */ - if(mcPermissions.getInstance().herbalismAbility(player)){ - if(PP.getGreenTerraMode() && PP.getGreenTerraActivatedTimeStamp() + PP.getGreenTerraTicks() <= System.currentTimeMillis()){ + player.sendMessage(Messages.getString("Skills.LowerAxe")); + } + if(PP.getPickaxePreparationMode() && System.currentTimeMillis() - PP.getPickaxePreparationATS() >= 4000){ + PP.setPickaxePreparationMode(false); + player.sendMessage(Messages.getString("Skills.LowerPickAxe")); + } + if(PP.getSwordsPreparationMode() && System.currentTimeMillis() - PP.getSwordsPreparationATS() >= 4000){ + PP.setSwordsPreparationMode(false); + player.sendMessage(Messages.getString("Skills.LowerSword")); + } + if(PP.getFistsPreparationMode() && System.currentTimeMillis() - PP.getFistsPreparationATS() >= 4000){ + PP.setFistsPreparationMode(false); + player.sendMessage(Messages.getString("Skills.LowerFists")); + } + if(PP.getShovelPreparationMode() && System.currentTimeMillis() - PP.getShovelPreparationATS() >= 4000){ + PP.setShovelPreparationMode(false); + player.sendMessage(Messages.getString("Skills.LowerShovel")); + } + + /* + * HERBALISM ABILITY + */ + if(mcPermissions.getInstance().herbalismAbility(player)){ + if(PP.getGreenTerraMode() && PP.getGreenTerraDeactivatedTimeStamp() <= System.currentTimeMillis()){ PP.setGreenTerraMode(false); PP.setGreenTerraInformed(false); - player.sendMessage(ChatColor.RED+"**Green Terra has worn off**"); + player.sendMessage(Messages.getString("Skills.GreenTerraOff")); + } } - } - /* - * AXES ABILITY - */ - if(mcPermissions.getInstance().axesAbility(player)){ - if(PP.getSkullSplitterMode() && PP.getSkullSplitterActivatedTimeStamp() + PP.getSkullSplitterTicks() <= System.currentTimeMillis()){ - PP.setSkullSplitterMode(false); - PP.setSkullSplitterInformed(false); - player.sendMessage(ChatColor.RED+"**Skull Splitter has worn off**"); + /* + * AXES ABILITY + */ + if(mcPermissions.getInstance().axesAbility(player)){ + if(PP.getSkullSplitterMode() && PP.getSkullSplitterDeactivatedTimeStamp() <= System.currentTimeMillis()){ + PP.setSkullSplitterMode(false); + PP.setSkullSplitterInformed(false); + player.sendMessage(Messages.getString("Skills.SkullSplitterOff")); + } } - } - /* - * WOODCUTTING ABILITY - */ - if(mcPermissions.getInstance().woodCuttingAbility(player)){ - if(PP.getTreeFellerMode() && PP.getTreeFellerActivatedTimeStamp() + PP.getTreeFellerTicks() <= System.currentTimeMillis()){ - PP.setTreeFellerMode(false); - PP.setTreeFellerInformed(false); - player.sendMessage(ChatColor.RED+"**Tree Feller has worn off**"); + /* + * WOODCUTTING ABILITY + */ + if(mcPermissions.getInstance().woodCuttingAbility(player)){ + if(PP.getTreeFellerMode() && PP.getTreeFellerDeactivatedTimeStamp() <= System.currentTimeMillis()){ + PP.setTreeFellerMode(false); + PP.setTreeFellerInformed(false); + player.sendMessage(Messages.getString("Skills.TreeFellerOff")); + } } - } - /* - * MINING ABILITY - */ - if(mcPermissions.getInstance().miningAbility(player)){ - if(PP.getSuperBreakerMode() && PP.getSuperBreakerActivatedTimeStamp() + PP.getSuperBreakerTicks() <= System.currentTimeMillis()){ - PP.setSuperBreakerMode(false); - PP.setSuperBreakerInformed(false); - player.sendMessage(ChatColor.RED+"**Super Breaker has worn off**"); + /* + * MINING ABILITY + */ + if(mcPermissions.getInstance().miningAbility(player)){ + if(PP.getSuperBreakerMode() && PP.getSuperBreakerDeactivatedTimeStamp() <= System.currentTimeMillis()){ + PP.setSuperBreakerMode(false); + PP.setSuperBreakerInformed(false); + player.sendMessage(Messages.getString("Skills.SuperBreakerOff")); + } } - } - /* - * EXCAVATION ABILITY - */ - if(mcPermissions.getInstance().excavationAbility(player)){ - if(PP.getGigaDrillBreakerMode() && PP.getGigaDrillBreakerActivatedTimeStamp() + PP.getGigaDrillBreakerTicks() <= System.currentTimeMillis()){ - PP.setGigaDrillBreakerMode(false); - PP.setGigaDrillBreakerInformed(false); - player.sendMessage(ChatColor.RED+"**Giga Drill Breaker has worn off**"); + /* + * EXCAVATION ABILITY + */ + if(mcPermissions.getInstance().excavationAbility(player)){ + if(PP.getGigaDrillBreakerMode() && PP.getGigaDrillBreakerDeactivatedTimeStamp() <= System.currentTimeMillis()){ + PP.setGigaDrillBreakerMode(false); + PP.setGigaDrillBreakerInformed(false); + player.sendMessage(Messages.getString("Skills.GigaDrillBreakerOff")); + } } - } - /* - * SWORDS ABILITY - */ - if(mcPermissions.getInstance().swordsAbility(player)){ - if(PP.getSerratedStrikesMode() && PP.getSerratedStrikesActivatedTimeStamp() + PP.getSerratedStrikesTicks() <= System.currentTimeMillis()){ - PP.setSerratedStrikesMode(false); - PP.setSerratedStrikesInformed(false); - player.sendMessage(ChatColor.RED+"**Serrated Strikes has worn off**"); + /* + * SWORDS ABILITY + */ + if(mcPermissions.getInstance().swordsAbility(player)){ + if(PP.getSerratedStrikesMode() && PP.getSerratedStrikesDeactivatedTimeStamp() <= System.currentTimeMillis()){ + PP.setSerratedStrikesMode(false); + PP.setSerratedStrikesInformed(false); + player.sendMessage(Messages.getString("Skills.SerratedStrikesOff")); + } } - } - /* - * UNARMED ABILITY - */ - if(mcPermissions.getInstance().unarmedAbility(player)){ - if(PP.getBerserkMode() && PP.getBerserkActivatedTimeStamp() + PP.getBerserkTicks() <= System.currentTimeMillis()){ - PP.setBerserkMode(false); - PP.setBerserkInformed(false); - player.sendMessage(ChatColor.RED+"**Berserk has worn off**"); + /* + * UNARMED ABILITY + */ + if(mcPermissions.getInstance().unarmedAbility(player)){ + if(PP.getBerserkMode() && PP.getBerserkDeactivatedTimeStamp() <= System.currentTimeMillis()){ + PP.setBerserkMode(false); + PP.setBerserkInformed(false); + player.sendMessage(Messages.getString("Skills.BerserkOff")); + } } } } public static void abilityActivationCheck(Player player){ PlayerProfile PP = Users.getProfile(player); - if(!PP.getAbilityUse()) - return; - if(mcPermissions.getInstance().miningAbility(player) && m.isMiningPick(player.getItemInHand()) && !PP.getPickaxePreparationMode()){ - if(!PP.getSuperBreakerMode() && !cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." - +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)+"s)"); + if(PP != null){ + if(!PP.getAbilityUse()) return; + if(mcPermissions.getInstance().miningAbility(player) && m.isMiningPick(player.getItemInHand()) && !PP.getPickaxePreparationMode()){ + if(!PP.getSuperBreakerMode() && !cooldownOver(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)){ + player.sendMessage(Messages.getString("Skills.TooTired") + +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSuperBreakerDeactivatedTimeStamp(), LoadProperties.superBreakerCooldown)+"s)"); + return; + } + player.sendMessage(Messages.getString("Skills.ReadyPickAxe")); + PP.setPickaxePreparationATS(System.currentTimeMillis()); + PP.setPickaxePreparationMode(true); } - player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR PICKAXE**"); - PP.setPickaxePreparationATS(System.currentTimeMillis()); - PP.setPickaxePreparationMode(true); - } - if(mcPermissions.getInstance().excavationAbility(player) && m.isShovel(player.getItemInHand()) && !PP.getShovelPreparationMode()){ - if(!PP.getGigaDrillBreakerMode() && !cooldownOver(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." - +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)+"s)"); - return; + if(mcPermissions.getInstance().excavationAbility(player) && m.isShovel(player.getItemInHand()) && !PP.getShovelPreparationMode()){ + if(!PP.getGigaDrillBreakerMode() && !cooldownOver(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)){ + player.sendMessage(Messages.getString("Skills.TooTired") + +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getGigaDrillBreakerDeactivatedTimeStamp(), LoadProperties.gigaDrillBreakerCooldown)+"s)"); + return; + } + player.sendMessage(Messages.getString("Skills.ReadyShovel")); + PP.setShovelPreparationATS(System.currentTimeMillis()); + PP.setShovelPreparationMode(true); } - player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SHOVEL**"); - PP.setShovelPreparationATS(System.currentTimeMillis()); - PP.setShovelPreparationMode(true); - } - if(mcPermissions.getInstance().swordsAbility(player) && m.isSwords(player.getItemInHand()) && !PP.getSwordsPreparationMode()){ - if(!PP.getSerratedStrikesMode() && !cooldownOver(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." - +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)+"s)"); - return; + if(mcPermissions.getInstance().swordsAbility(player) && m.isSwords(player.getItemInHand()) && !PP.getSwordsPreparationMode()){ + if(!PP.getSerratedStrikesMode() && !cooldownOver(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)){ + player.sendMessage(Messages.getString("Skills.TooTired") + +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getSerratedStrikesDeactivatedTimeStamp(), LoadProperties.serratedStrikeCooldown)+"s)"); + return; + } + player.sendMessage(Messages.getString("Skills.ReadySword")); + PP.setSwordsPreparationATS(System.currentTimeMillis()); + PP.setSwordsPreparationMode(true); } - player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR SWORD**"); - PP.setSwordsPreparationATS(System.currentTimeMillis()); - PP.setSwordsPreparationMode(true); - } - if(mcPermissions.getInstance().unarmedAbility(player) && player.getItemInHand().getTypeId() == 0 && !PP.getFistsPreparationMode()){ - if(!PP.getBerserkMode() && !cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)){ - player.sendMessage(ChatColor.RED+"You are too tired to use that ability again." - +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)+"s)"); - return; + if(mcPermissions.getInstance().unarmedAbility(player) && player.getItemInHand().getTypeId() == 0 && !PP.getFistsPreparationMode()){ + if(!PP.getBerserkMode() && !cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)){ + player.sendMessage(Messages.getString("Skills.TooTired") + +ChatColor.YELLOW+" ("+calculateTimeLeft(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)+"s)"); + return; + } + player.sendMessage(Messages.getString("Skills.ReadyFists")); + PP.setFistsPreparationATS(System.currentTimeMillis()); + PP.setFistsPreparationMode(true); + } + if((mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().woodcutting(player)) && !PP.getAxePreparationMode()){ + if(m.isAxes(player.getItemInHand())){ + player.sendMessage(Messages.getString("Skills.ReadyAxe")); + PP.setAxePreparationATS(System.currentTimeMillis()); + PP.setAxePreparationMode(true); + } } - player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR FISTS**"); - PP.setFistsPreparationATS(System.currentTimeMillis()); - PP.setFistsPreparationMode(true); - } - if((mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().woodcutting(player)) && !PP.getAxePreparationMode()){ - if(m.isAxes(player.getItemInHand())){ - player.sendMessage(ChatColor.GREEN+"**YOU READY YOUR AXE**"); - PP.setAxePreparationATS(System.currentTimeMillis()); - PP.setAxePreparationMode(true); - } } } public static void XpCheck(Player player){ @@ -277,9 +277,9 @@ public class Skills { * TAMING */ if(player != null){ - if(PP.getTamingXPInt() >= PP.getXpToLevel("taming")){ + if(PP.getSkill("tamingXP") >= PP.getXpToLevel("taming")){ int skillups = 0; - while(PP.getTamingXPInt() >= PP.getXpToLevel("taming")){ + while(PP.getSkill("tamingXP") >= PP.getXpToLevel("taming")){ skillups++; PP.removeTamingXP(PP.getXpToLevel("taming")); PP.skillUpTaming(1); @@ -289,19 +289,19 @@ public class Skills { */ PlayerStat ps = new PlayerStat(); if(!LoadProperties.useMySQL){ - ps.statVal = PP.getTamingInt(); + ps.statVal = PP.getSkill("taming"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "taming"); } - if(player != null && PP != null && PP.getTaming() != null) - player.sendMessage(ChatColor.YELLOW+"Taming skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getTaming()+")"); + if(player != null && PP != null && PP.getSkillToString("taming") != null) + player.sendMessage(Messages.getString("Skills.TamingUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("taming")})); } /* * ACROBATICS */ - if(PP.getAcrobaticsXPInt() >= PP.getXpToLevel("acrobatics")){ + if(PP.getSkill("acrobaticsXP") >= PP.getXpToLevel("acrobatics")){ int skillups = 0; - while(PP.getAcrobaticsXPInt() >= PP.getXpToLevel("acrobatics")){ + while(PP.getSkill("acrobaticsXP") >= PP.getXpToLevel("acrobatics")){ skillups++; PP.removeAcrobaticsXP(PP.getXpToLevel("acrobatics")); PP.skillUpAcrobatics(1); @@ -311,20 +311,20 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getAcrobaticsInt(); + ps.statVal = PP.getSkill("acrobatics"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "acrobatics"); } - if(player != null && PP != null && PP.getAcrobatics() != null) - player.sendMessage(ChatColor.YELLOW+"Acrobatics skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getAcrobatics()+")"); + if(player != null && PP != null && PP.getSkillToString("acrobatics") != null) + player.sendMessage(Messages.getString("Skills.AcrobaticsUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("acrobatics")})); } /* * ARCHERY */ - if(PP.getArcheryXPInt() >= PP.getXpToLevel("archery")){ + if(PP.getSkill("archeryXP") >= PP.getXpToLevel("archery")){ int skillups = 0; - while(PP.getArcheryXPInt() >= PP.getXpToLevel("archery")){ + while(PP.getSkill("archeryXP") >= PP.getXpToLevel("archery")){ skillups++; PP.removeArcheryXP(PP.getXpToLevel("archery")); PP.skillUpArchery(1); @@ -334,19 +334,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getArcheryInt(); + ps.statVal = PP.getSkill("archery"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "archery"); } - if(player != null && PP != null && PP.getArchery() != null) - player.sendMessage(ChatColor.YELLOW+"Archery skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getArchery()+")"); + if(player != null && PP != null && PP.getSkillToString("archery") != null) + player.sendMessage(Messages.getString("Skills.ArcheryUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("archery")})); } /* * SWORDS */ - if(PP.getSwordsXPInt() >= PP.getXpToLevel("swords")){ + if(PP.getSkill("swordsXP") >= PP.getXpToLevel("swords")){ int skillups = 0; - while(PP.getSwordsXPInt() >= PP.getXpToLevel("swords")){ + while(PP.getSkill("swordsXP") >= PP.getXpToLevel("swords")){ skillups++; PP.removeSwordsXP(PP.getXpToLevel("swords")); PP.skillUpSwords(1); @@ -356,20 +356,20 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getSwordsInt(); + ps.statVal = PP.getSkill("swords"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "swords"); } - if(player != null && PP != null && PP.getSwords() != null) - player.sendMessage(ChatColor.YELLOW+"Swords skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getSwords()+")"); + if(player != null && PP != null && PP.getSkillToString("swords") != null) + player.sendMessage(Messages.getString("Skills.SwordsUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("swords")})); } /* * AXES */ - if(PP.getAxesXPInt() >= PP.getXpToLevel("axes")){ + if(PP.getSkill("axesXP") >= PP.getXpToLevel("axes")){ int skillups = 0; - while(PP.getAxesXPInt() >= PP.getXpToLevel("axes")){ + while(PP.getSkill("axesXP") >= PP.getXpToLevel("axes")){ skillups++; PP.removeAxesXP(PP.getXpToLevel("axes")); PP.skillUpAxes(1); @@ -379,19 +379,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getAxesInt(); + ps.statVal = PP.getSkill("axes"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "axes"); } - if(player != null && PP != null && PP.getAxes() != null) - player.sendMessage(ChatColor.YELLOW+"Axes skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getAxes()+")"); + if(player != null && PP != null && PP.getSkillToString("axes") != null) + player.sendMessage(Messages.getString("Skills.AxesUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("axes")})); } /* * UNARMED */ - if(PP.getUnarmedXPInt() >= PP.getXpToLevel("unarmed")){ + if(PP.getSkill("unarmedXP") >= PP.getXpToLevel("unarmed")){ int skillups = 0; - while(PP.getUnarmedXPInt() >= PP.getXpToLevel("unarmed")){ + while(PP.getSkill("unarmedXP") >= PP.getXpToLevel("unarmed")){ skillups++; PP.removeUnarmedXP(PP.getXpToLevel("unarmed")); PP.skillUpUnarmed(1); @@ -401,19 +401,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getUnarmedInt(); + ps.statVal = PP.getSkill("unarmed"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "unarmed"); } - if(player != null && PP != null && PP.getUnarmed() != null) - player.sendMessage(ChatColor.YELLOW+"Unarmed skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getUnarmed()+")"); + if(player != null && PP != null && PP.getSkillToString("unarmed") != null) + player.sendMessage(Messages.getString("Skills.UnarmedUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("unarmed")})); } /* * HERBALISM */ - if(PP.getHerbalismXPInt() >= PP.getXpToLevel("herbalism")){ + if(PP.getSkill("herbalismXP") >= PP.getXpToLevel("herbalism")){ int skillups = 0; - while(PP.getHerbalismXPInt() >= PP.getXpToLevel("herbalism")){ + while(PP.getSkill("herbalismXP") >= PP.getXpToLevel("herbalism")){ skillups++; PP.removeHerbalismXP(PP.getXpToLevel("herbalism")); PP.skillUpHerbalism(1); @@ -423,19 +423,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getHerbalismInt(); + ps.statVal = PP.getSkill("herbalism"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "herbalism"); } - if(player != null && PP != null && PP.getHerbalism() != null) - player.sendMessage(ChatColor.YELLOW+"Herbalism skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getHerbalism()+")"); + if(player != null && PP != null && PP.getSkillToString("herbalism") != null) + player.sendMessage(Messages.getString("Skills.HerbalismUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("herbalism")})); } /* * MINING */ - if(player != null && PP.getMiningXPInt() >= PP.getXpToLevel("mining")){ + if(player != null && PP.getSkill("miningXP") >= PP.getXpToLevel("mining")){ int skillups = 0; - while(PP.getMiningXPInt() >= PP.getXpToLevel("mining")){ + while(PP.getSkill("miningXP") >= PP.getXpToLevel("mining")){ skillups++; PP.removeMiningXP(PP.getXpToLevel("mining")); PP.skillUpMining(1); @@ -445,19 +445,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getMiningInt(); + ps.statVal = PP.getSkill("mining"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "mining"); } - if(player != null && PP != null && PP.getMining() != null) - player.sendMessage(ChatColor.YELLOW+"Mining skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getMining()+")"); + if(player != null && PP != null && PP.getSkillToString("mining") != null) + player.sendMessage(Messages.getString("Skills.MiningUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("mining")})); } /* * WOODCUTTING */ - if(player != null && PP.getWoodCuttingXPInt() >= PP.getXpToLevel("woodcutting")){ + if(player != null && PP.getSkill("woodcuttingXP") >= PP.getXpToLevel("woodcutting")){ int skillups = 0; - while(PP.getWoodCuttingXPInt() >= PP.getXpToLevel("woodcutting")){ + while(PP.getSkill("woodcuttingXP") >= PP.getXpToLevel("woodcutting")){ skillups++; PP.removeWoodCuttingXP(PP.getXpToLevel("woodcutting")); PP.skillUpWoodCutting(1); @@ -467,19 +467,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getWoodCuttingInt(); + ps.statVal = PP.getSkill("woodcutting"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "woodcutting"); } - if(player != null && PP != null && PP.getWoodCutting() != null) - player.sendMessage(ChatColor.YELLOW+"WoodCutting skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getWoodCutting()+")"); + if(player != null && PP != null && PP.getSkillToString("woodcutting") != null) + player.sendMessage(Messages.getString("Skills.WoodcuttingUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("woodcutting")})); } /* * REPAIR */ - if(PP.getRepairXPInt() >= PP.getXpToLevel("repair")){ + if(PP.getSkill("repairXP") >= PP.getXpToLevel("repair")){ int skillups = 0; - while(PP.getRepairXPInt() >= PP.getXpToLevel("repair")){ + while(PP.getSkill("repairXP") >= PP.getXpToLevel("repair")){ skillups++; PP.removeRepairXP(PP.getXpToLevel("repair")); PP.skillUpRepair(1); @@ -489,19 +489,19 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getRepairInt(); + ps.statVal = PP.getSkill("repair"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "repair"); } - if(player != null && PP != null && PP.getRepair() != null) - player.sendMessage(ChatColor.YELLOW+"Repair skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getRepair()+")"); + if(player != null && PP != null && PP.getSkillToString("repair") != null) + player.sendMessage(Messages.getString("Skills.RepairUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("repair")})); } /* * EXCAVATION */ - if(PP.getExcavationXPInt() >= PP.getXpToLevel("excavation")){ + if(PP.getSkill("excavationXP") >= PP.getXpToLevel("excavation")){ int skillups = 0; - while(PP.getExcavationXPInt() >= PP.getXpToLevel("excavation")){ + while(PP.getSkill("excavationXP") >= PP.getXpToLevel("excavation")){ skillups++; PP.removeExcavationXP(PP.getXpToLevel("excavation")); PP.skillUpExcavation(1); @@ -511,18 +511,21 @@ public class Skills { */ if(!LoadProperties.useMySQL){ PlayerStat ps = new PlayerStat(); - ps.statVal = PP.getExcavationInt(); + ps.statVal = PP.getSkill("excavation"); ps.name = player.getName(); Leaderboard.updateLeaderboard(ps, "excavation"); } - if(player != null && PP != null && PP.getExcavation() != null) - player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getExcavation()+")"); + if(player != null && PP != null && PP.getSkillToString("excavation") != null) + player.sendMessage(Messages.getString("Skills.ExcavationUp", new Object[] {String.valueOf(skillups), PP.getSkillToString("excavation")})); + //player.sendMessage(ChatColor.YELLOW+"Excavation skill increased by "+String.valueOf(skillups)+"."+" Total ("+PP.getSkillToString("excavation")+")"); + } } /* * Leaderboard updating stuff */ - if(!LoadProperties.useMySQL){ + if(!LoadProperties.useMySQL) + { PlayerStat ps = new PlayerStat(); ps.statVal = m.getPowerLevel(player); ps.name = player.getName(); @@ -534,6 +537,9 @@ public class Skills { if(skillname.equals("all")){ return true; } + if(skillname.equals("sorcery")){ + return true; + } if(skillname.equals("taming")){ return true; } @@ -570,15 +576,48 @@ public class Skills { else { return false; } -} - public static void arrowRetrievalCheck(Entity entity){ - if(Config.getInstance().isTracked(entity)){ + } + public static void arrowRetrievalCheck(Entity entity, mcMMO plugin) + { + if(plugin.misc.arrowTracker.containsKey(entity)) + { Integer x = 0; - while(x < Config.getInstance().getArrowCount(entity)){ - m.mcDropItem(entity.getLocation(), 262); - x++; + while(x < plugin.misc.arrowTracker.get(entity)) + { + m.mcDropItem(entity.getLocation(), 262); + x++; } } - Config.getInstance().removeArrowTracked(entity); + plugin.misc.arrowTracker.remove(entity); + } + public static String getSkillStats(String skillname, String level, String XP, Integer XPToLevel) + { + ChatColor parColor = ChatColor.DARK_AQUA; + ChatColor xpColor = ChatColor.GRAY; + ChatColor LvlColor = ChatColor.GREEN; + ChatColor skillColor = ChatColor.YELLOW; + + return skillColor+skillname+LvlColor+level+parColor+" XP"+"("+xpColor+XP+parColor+"/"+xpColor+XPToLevel+parColor+")"; + } + public static boolean hasCombatSkills(Player player) + { + if(mcPermissions.getInstance().axes(player) || mcPermissions.getInstance().archery(player) || mcPermissions.getInstance().sorcery(player) || mcPermissions.getInstance().swords(player) || mcPermissions.getInstance().taming(player) || mcPermissions.getInstance().unarmed(player)) + return true; + else + return false; + } + public static boolean hasGatheringSkills(Player player) + { + if(mcPermissions.getInstance().excavation(player) || mcPermissions.getInstance().herbalism(player) || mcPermissions.getInstance().mining(player) || mcPermissions.getInstance().woodcutting(player)) + return true; + else + return false; + } + public static boolean hasMiscSkills(Player player) + { + if(mcPermissions.getInstance().acrobatics(player) || mcPermissions.getInstance().repair(player)) + return true; + else + return false; } } diff --git a/mcMMO/com/gmail/nossr50/skills/Sorcery.java b/mcMMO/com/gmail/nossr50/skills/Sorcery.java new file mode 100644 index 000000000..c9acc1ba4 --- /dev/null +++ b/mcMMO/com/gmail/nossr50/skills/Sorcery.java @@ -0,0 +1,115 @@ +package com.gmail.nossr50.skills; + +import java.util.List; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; + +import com.gmail.nossr50.Messages; +import com.gmail.nossr50.Users; +import com.gmail.nossr50.m; +import com.gmail.nossr50.mcMMO; +import com.gmail.nossr50.mcPermissions; +import com.gmail.nossr50.config.LoadProperties; +import com.gmail.nossr50.datatypes.PlayerProfile; + +public class Sorcery +{ + mcMMO plugin = null; + + public Sorcery(mcMMO pluginx) + { + plugin = pluginx; + } + + public Block getSpellTargetBlock(Player player) + { + List blocks = player.getLineOfSight(null, 25); + for(Block x : blocks) + { + Material y = Material.AIR; + if(x.getType() != y) + return x; + } + return null; + } + public void informSelected(String spellname, int cost, Player player) + { + player.sendMessage(Messages.getString("Sorcery.SpellSelected", new Object[] {spellname, cost})); + } + + public void informSpell(String spellname, Player player) + { + PlayerProfile PP = Users.getProfile(player); + player.sendMessage(Messages.getString("Sorcery.HasCast") +" "+spellname+" "+ Messages.getString("Sorcery.Current_Mana")+ChatColor.YELLOW+"("+ChatColor.GRAY+PP.getCurrentMana()+ChatColor.YELLOW+"/"+ChatColor.GREEN+PP.getMaxMana()+ChatColor.YELLOW+")"); + } + + public void shoutSpell(String spellname, Player player) + { + for(Player x : plugin.getServer().getOnlinePlayers()) + { + if(x == player) + continue; + if(m.getDistance(x.getLocation(), player.getLocation()) < 35) + { + x.sendMessage(ChatColor.GREEN+"-"+ChatColor.DARK_AQUA+"="+ChatColor.GOLD+spellname+ChatColor.DARK_AQUA+"="+ChatColor.GREEN+"-" + +" "+ChatColor.YELLOW+"["+ChatColor.DARK_RED+player.getName()+ChatColor.YELLOW+"]"); + } + } + } + + public void handleGreenDyeCycle(Player player) + { + PlayerProfile PP = Users.getProfile(player); + + //The selector is used to account for permissions removing spells from this order. + + //Check if player has access to curative spell + if(!hasCurativeSpellPermission(player)) + PP.setDyeChanged(true); + + switch(PP.getGreenDyeCycleSel()) + { + case 0: + if(mcPermissions.getInstance().sorceryCurativeHealSelf(player)) + { + PP.setDyeChanged(true); + PP.setGreenDyeCycleSel(1); + PP.setGreenDyeCycle(0); + + informSelected(Messages.getString("Sorcery.Curative.Self"), LoadProperties.cure_self, player); + break; + } + + else + { + PP.setGreenDyeCycleSel(1); + } + case 1: + if(mcPermissions.getInstance().sorceryCurativeHealOther(player)) + { + PP.setDyeChanged(true); + PP.setGreenDyeCycleSel(0); + PP.setGreenDyeCycle(1); + + informSelected(Messages.getString("Sorcery.Curative.Other"), LoadProperties.cure_other, player); + break; + } + else + { + PP.setGreenDyeCycleSel(0); + } + } + } + public boolean hasCurativeSpellPermission (Player player) + { + if(mcPermissions.getInstance().sorceryCurativeHealOther(player) == false + && mcPermissions.getInstance().sorceryCurativeHealSelf(player) == false) + return false; + else + return true; + } + +} diff --git a/mcMMO/com/gmail/nossr50/skills/Swords.java b/mcMMO/com/gmail/nossr50/skills/Swords.java index 33a9e1b85..d33fe30e8 100644 --- a/mcMMO/com/gmail/nossr50/skills/Swords.java +++ b/mcMMO/com/gmail/nossr50/skills/Swords.java @@ -3,7 +3,7 @@ package com.gmail.nossr50.skills; import org.bukkit.ChatColor; import org.bukkit.entity.Animals; import org.bukkit.entity.Entity; -import org.bukkit.entity.Monster; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Wolf; import org.bukkit.event.entity.EntityDamageByEntityEvent; @@ -12,10 +12,11 @@ import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.plugin.Plugin; import com.gmail.nossr50.Combat; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; +import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcPermissions; -import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.party.Party; @@ -24,24 +25,28 @@ public class Swords { public static void serratedStrikesActivationCheck(Player player, Plugin pluginx){ PlayerProfile PP = Users.getProfile(player); - if(m.isSwords(player.getItemInHand())){ - if(PP.getSwordsPreparationMode()){ + if(m.isSwords(player.getItemInHand())) + { + if(PP.getSwordsPreparationMode()) + { PP.setSwordsPreparationMode(false); } int ticks = 2; - int x = PP.getSwordsInt(); - while(x >= 50){ + int x = PP.getSkill("swords"); + while(x >= 50) + { x-=50; ticks++; } - if(!PP.getSerratedStrikesMode() && PP.getSerratedStrikesCooldown() == 0){ - player.sendMessage(ChatColor.GREEN+"**SERRATED STRIKES ACTIVATED**"); - for(Player y : pluginx.getServer().getOnlinePlayers()){ + if(!PP.getSerratedStrikesMode() && PP.getSerratedStrikesDeactivatedTimeStamp() < System.currentTimeMillis()) + { + player.sendMessage(Messages.getString("Skills.SerratedStrikesOn")); + for(Player y : pluginx.getServer().getOnlinePlayers()) + { if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Serrated Strikes!"); + y.sendMessage(Messages.getString("Skills.SerratedStrikesPlayer", new Object[] {player.getName()})); } - PP.setSerratedStrikesTicks((ticks * 2) * 1000); PP.setSerratedStrikesActivatedTimeStamp(System.currentTimeMillis()); PP.setSerratedStrikesDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setSerratedStrikesMode(true); @@ -50,30 +55,42 @@ public class Swords { } } - public static void bleedCheck(Player attacker, Entity x, Plugin pluginx){ + public static void bleedCheck(Player attacker, LivingEntity x, mcMMO pluginx) + { PlayerProfile PPa = Users.getProfile(attacker); - if(x instanceof Wolf){ + + if(x instanceof Wolf) + { Wolf wolf = (Wolf)x; - if(Taming.getOwner(wolf, pluginx) == attacker) - return; - if(Party.getInstance().inSameParty(attacker, Taming.getOwner(wolf, pluginx))) - return; + if(Taming.getOwner(wolf, pluginx) != null) + { + if(Taming.getOwner(wolf, pluginx) == attacker) + return; + if(Party.getInstance().inSameParty(attacker, Taming.getOwner(wolf, pluginx))) + return; + } } if(mcPermissions.getInstance().swords(attacker) && m.isSwords(attacker.getItemInHand())){ - if(PPa.getSwordsInt() >= 750){ - if(Math.random() * 1000 >= 750){ + if(PPa.getSkill("swords") >= 750) + { + if(Math.random() * 1000 >= 750) + { if(!(x instanceof Player)) - Config.getInstance().addToBleedQue(x); - if(x instanceof Player){ + pluginx.misc.addToBleedQue(x); + if(x instanceof Player) + { Player target = (Player)x; Users.getProfile(target).addBleedTicks(3); } attacker.sendMessage(ChatColor.GREEN+"**ENEMY BLEEDING**"); } - } else if (Math.random() * 1000 <= PPa.getSwordsInt()){ + } + else if (Math.random() * 1000 <= PPa.getSkill("swords")) + { if(!(x instanceof Player)) - Config.getInstance().addToBleedQue(x); - if(x instanceof Player){ + pluginx.misc.addToBleedQue(x); + if(x instanceof Player) + { Player target = (Player)x; Users.getProfile(target).addBleedTicks(2); } @@ -81,69 +98,94 @@ public class Swords { } } } - public static void applySerratedStrikes(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx){ + public static void applySerratedStrikes(Player attacker, EntityDamageByEntityEvent event, mcMMO pluginx) + { int targets = 0; - Entity x = event.getEntity(); - targets = m.getTier(attacker); - for(Entity derp : x.getWorld().getEntities()) + + if(event.getEntity() instanceof LivingEntity) { - if(m.getDistance(x.getLocation(), derp.getLocation()) < 5){ - if(derp instanceof Player){ - Player target = (Player)derp; - if(Party.getInstance().inSameParty(attacker, target)) - continue; - if(!target.getName().equals(attacker.getName()) && targets >= 1){ - target.damage(event.getDamage() / 4); - target.sendMessage(ChatColor.DARK_RED+"Struck by Serrated Strikes!"); - Users.getProfile(target).addBleedTicks(5); - targets--; - } - } - if(derp instanceof Monster && targets >= 1){ - if(!Config.getInstance().isBleedTracked(derp)) - Config.getInstance().addToBleedQue(x); - Monster target = (Monster)derp; - target.damage(event.getDamage() / 4); - targets--; - } - if(derp instanceof Wolf){ - Wolf hurrDurr = (Wolf)derp; - if(Taming.getOwner(hurrDurr, pluginx) == attacker) - continue; - if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx))) - continue; - } - if(derp instanceof Animals && targets >= 1){ - if(!Config.getInstance().isBleedTracked(derp)) - Config.getInstance().addToBleedQue(x); - Animals target = (Animals)derp; - target.damage(event.getDamage() / 4); - targets--; - } - } + LivingEntity x = (LivingEntity) event.getEntity(); + targets = m.getTier(attacker); + + for(Entity derp : x.getWorld().getEntities()) + { + if(m.getDistance(x.getLocation(), derp.getLocation()) < 5) + { + + + //Make sure the Wolf is not friendly + if(derp instanceof Wolf) + { + Wolf hurrDurr = (Wolf)derp; + if(Taming.getOwner(hurrDurr, pluginx) == attacker) + continue; + if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx))) + continue; + } + //Damage nearby LivingEntities + if(derp instanceof LivingEntity && targets >= 1) + { + if(derp instanceof Player && derp.getWorld().getPVP()) + { + Player target = (Player)derp; + + if(target.getName().equals(attacker.getName())) + continue; + + if(Party.getInstance().inSameParty(attacker, target)) + continue; + if(targets >= 1) + { + target.damage(event.getDamage() / 4); + target.sendMessage(ChatColor.DARK_RED+"Struck by Serrated Strikes!"); + Users.getProfile(target).addBleedTicks(5); + targets--; + continue; + } + } + else + { + if(!pluginx.misc.bleedTracker.contains(derp)) + pluginx.misc.addToBleedQue((LivingEntity)derp); + + LivingEntity target = (LivingEntity)derp; + target.damage(event.getDamage() / 4); + targets--; + } + } + } + } } } - public static void parryCheck(EntityDamageByEntityEvent event, Player defender){ + + public static void parryCheck(EntityDamageByEntityEvent event, Player defender) + { Entity y = event.getDamager(); PlayerProfile PPd = Users.getProfile(defender); if(defender != null && m.isSwords(defender.getItemInHand()) && mcPermissions.getInstance().swords(defender)){ - if(PPd.getSwordsInt() >= 900){ - if(Math.random() * 3000 <= 900){ + if(PPd.getSkill("swords") >= 900) + { + if(Math.random() * 3000 <= 900) + { event.setCancelled(true); defender.sendMessage(ChatColor.GREEN+"**PARRIED**"); defender.getItemInHand().setDurability((short) (defender.getItemInHand().getDurability() + 1)); - if(y instanceof Player){ + if(y instanceof Player) + { Player attacker = (Player)y; attacker.sendMessage(ChatColor.GREEN+"**PARRIED**"); } } - } else { - if(Math.random() * 3000 <= PPd.getSwordsInt()){ + } else + { + if(Math.random() * 3000 <= PPd.getSkill("swords")) + { event.setCancelled(true); defender.sendMessage(ChatColor.YELLOW+"*CLANG* SUCCESSFUL PARRY *CLANG*"); defender.getItemInHand().setDurability((short) (defender.getItemInHand().getDurability() + 1)); - if(y instanceof Player){ + if(y instanceof Player) + { Player attacker = (Player)y; attacker.sendMessage(ChatColor.DARK_RED+"**TARGET HAS PARRIED THAT ATTACK**"); } @@ -153,8 +195,10 @@ public class Swords { } public static void counterAttackChecks(EntityDamageEvent event){ //Don't want to counter attack arrows + if(event instanceof EntityDamageByProjectileEvent) return; + if(event instanceof EntityDamageByEntityEvent) { Entity f = ((EntityDamageByEntityEvent) event).getDamager(); @@ -164,7 +208,7 @@ public class Swords { PlayerProfile PPd = Users.getProfile(defender); if(m.isSwords(defender.getItemInHand()) && mcPermissions.getInstance().swords(defender)) { - if(PPd.getSwordsInt() >= 600) + if(PPd.getSkill("swords") >= 600) { if(Math.random() * 2000 <= 600) { @@ -174,7 +218,7 @@ public class Swords { ((Player) f).sendMessage(ChatColor.DARK_RED+"Hit with counterattack!"); } } - else if (Math.random() * 2000 <= PPd.getSwordsInt()) + else if (Math.random() * 2000 <= PPd.getSkill("swords")) { Combat.dealDamage(f, event.getDamage() / 2); defender.sendMessage(ChatColor.GREEN+"**COUNTER-ATTACKED**"); @@ -185,39 +229,51 @@ public class Swords { } } } - public static void bleedSimulate(){ + public static void bleedSimulate(mcMMO plugin) + { + long before = System.currentTimeMillis(); //Add items from Que list to BleedTrack list - for(Entity x : Config.getInstance().getBleedQue()){ - Config.getInstance().addBleedTrack(x); + + for(LivingEntity x : plugin.misc.bleedQue) + { + plugin.misc.bleedTracker.add(x); } + //Clear list - Config.getInstance().clearBleedQue(); + plugin.misc.bleedQue = new LivingEntity[plugin.misc.bleedQue.length]; + plugin.misc.bleedQuePos = 0; //Cleanup any dead entities from the list - for(Entity x : Config.getInstance().getBleedRemovalQue()){ - Config.getInstance().removeBleedTrack(x); + for(LivingEntity x : plugin.misc.bleedRemovalQue) + { + plugin.misc.bleedTracker.remove(x); } //Clear bleed removal list - Config.getInstance().clearBleedRemovalQue(); + plugin.misc.bleedRemovalQue = new LivingEntity[plugin.misc.bleedRemovalQue.length]; + plugin.misc.bleedRemovalQuePos = 0; //Bleed monsters/animals - for(Entity x : Config.getInstance().getBleedTracked()){ - if(x == null){ + for(LivingEntity x : plugin.misc.bleedTracker) + { + if(x == null){continue;} + + if(x.getHealth() <= 0) + { + plugin.misc.addToBleedRemovalQue(x); continue; } - - if(m.getHealth(x) <= 0){ - continue; + else + { + x.damage(2); } - - if(x instanceof Animals){ - ((Animals) x).damage(2); - } - - if(x instanceof Monster){((Monster) x).damage(2);} } + long after = System.currentTimeMillis(); + if(LoadProperties.print_reports) + { + plugin.bleedSimulation+=(after-before); + } } } diff --git a/mcMMO/com/gmail/nossr50/skills/Taming.java b/mcMMO/com/gmail/nossr50/skills/Taming.java index fa0208909..3604524de 100644 --- a/mcMMO/com/gmail/nossr50/skills/Taming.java +++ b/mcMMO/com/gmail/nossr50/skills/Taming.java @@ -1,34 +1,52 @@ package com.gmail.nossr50.skills; -import net.minecraft.server.EntityWolf; - -import org.bukkit.craftbukkit.entity.CraftWolf; +import org.bukkit.entity.AnimalTamer; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; +import org.bukkit.entity.Wolf; import org.bukkit.plugin.Plugin; -public class Taming { - public static String getOwnerName(Entity theWolf){ - CraftWolf cWolf = (CraftWolf)theWolf; - EntityWolf eWolf = (EntityWolf)cWolf.getHandle(); - - String playerName = eWolf.x(); - return playerName; - } - public static boolean hasOwner(Entity theWolf, Plugin pluginx){ - for(Player x : pluginx.getServer().getOnlinePlayers()){ - if(x != null && x.getName().equals(getOwnerName(theWolf))){ - return true; +public class Taming +{ + public static boolean ownerOnline(Wolf theWolf, Plugin pluginx){ + for(Player x : pluginx.getServer().getOnlinePlayers()) + { + if(x instanceof AnimalTamer) + { + AnimalTamer tamer = (AnimalTamer)x; + if(theWolf.getOwner() == tamer) + return true; } } return false; } - public static Player getOwner(Entity theWolf, Plugin pluginx){ - for(Player x : pluginx.getServer().getOnlinePlayers()){ - if(x != null && x.getName().equals(getOwnerName(theWolf))){ - return x; + + public static Player getOwner(Entity wolf, Plugin pluginx) + { + if(wolf instanceof Wolf) + { + Wolf theWolf = (Wolf)wolf; + for(Player x : pluginx.getServer().getOnlinePlayers()) + { + if(x instanceof AnimalTamer) + { + AnimalTamer tamer = (AnimalTamer)x; + if(theWolf.getOwner() == tamer) + return x; + } } } return null; } + + public static String getOwnerName(Wolf theWolf) + { + Player owner = (Player)theWolf.getOwner(); + if(owner != null) + { + return owner.getName(); + } + else + return "Offline Master"; + } } diff --git a/mcMMO/com/gmail/nossr50/skills/Unarmed.java b/mcMMO/com/gmail/nossr50/skills/Unarmed.java index 035264dd3..1b0fd0fa0 100644 --- a/mcMMO/com/gmail/nossr50/skills/Unarmed.java +++ b/mcMMO/com/gmail/nossr50/skills/Unarmed.java @@ -1,12 +1,12 @@ package com.gmail.nossr50.skills; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.config.LoadProperties; @@ -20,19 +20,18 @@ public class Unarmed { PP.setFistsPreparationMode(false); } int ticks = 2; - int x = PP.getUnarmedInt(); + int x = PP.getSkill("unarmed"); while(x >= 50){ x-=50; ticks++; } if(!PP.getBerserkMode() && Skills.cooldownOver(player, PP.getBerserkDeactivatedTimeStamp(), LoadProperties.berserkCooldown)){ - player.sendMessage(ChatColor.GREEN+"**BERSERK ACTIVATED**"); + player.sendMessage(Messages.getString("Skills.BerserkOn")); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Berserk!"); + y.sendMessage(Messages.getString("Skills.BerserkPlayer", new Object[] {player.getName()})); } - PP.setBerserkTicks(ticks * 1000); PP.setBerserkActivatedTimeStamp(System.currentTimeMillis()); PP.setBerserkDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setBerserkMode(true); @@ -43,47 +42,50 @@ public class Unarmed { { PlayerProfile PPa = Users.getProfile(attacker); int bonus = 0; - if (PPa.getUnarmedInt() >= 250) + if (PPa.getSkill("unarmed") >= 250) bonus+=2; - if (PPa.getUnarmedInt() >= 500) + if (PPa.getSkill("unarmed") >= 500) bonus+=2; event.setDamage(event.getDamage()+bonus); } public static void disarmProcCheck(Player attacker, Player defender) { PlayerProfile PP = Users.getProfile(attacker); - if(PP.getUnarmedInt() >= 1000){ - if(Math.random() * 4000 <= 1000){ - Location loc = defender.getLocation(); - if(defender.getItemInHand() != null && defender.getItemInHand().getTypeId() != 0) - { - attacker.sendMessage(ChatColor.DARK_RED+"You have hit with great force."); - defender.sendMessage(ChatColor.DARK_RED+"You have been disarmed!"); - ItemStack item = defender.getItemInHand(); - if(item != null) + if(attacker.getItemInHand().getTypeId() == 0) + { + if(PP.getSkill("unarmed") >= 1000) + { + if(Math.random() * 4000 <= 1000) + { + Location loc = defender.getLocation(); + if(defender.getItemInHand() != null && defender.getItemInHand().getTypeId() != 0) { - loc.getWorld().dropItemNaturally(loc, item); - ItemStack itemx = null; - defender.setItemInHand(itemx); + defender.sendMessage(Messages.getString("Skills.Disarmed")); + ItemStack item = defender.getItemInHand(); + if(item != null) + { + loc.getWorld().dropItemNaturally(loc, item); + ItemStack itemx = null; + defender.setItemInHand(itemx); + } } - } - } - } else { - if(Math.random() * 4000 <= PP.getUnarmedInt()){ - Location loc = defender.getLocation(); - if(defender.getItemInHand() != null && defender.getItemInHand().getTypeId() != 0) - { - attacker.sendMessage(ChatColor.DARK_RED+"You have hit with great force."); - defender.sendMessage(ChatColor.DARK_RED+"You have been disarmed!"); - ItemStack item = defender.getItemInHand(); - if(item != null) + } + } else { + if(Math.random() * 4000 <= PP.getSkill("unarmed")){ + Location loc = defender.getLocation(); + if(defender.getItemInHand() != null && defender.getItemInHand().getTypeId() != 0) { - loc.getWorld().dropItemNaturally(loc, item); - ItemStack itemx = null; - defender.setItemInHand(itemx); - } - } - } - } + defender.sendMessage(Messages.getString("Skills.Disarmed")); + ItemStack item = defender.getItemInHand(); + if(item != null) + { + loc.getWorld().dropItemNaturally(loc, item); + ItemStack itemx = null; + defender.setItemInHand(itemx); + } + } + } + } + } } } diff --git a/mcMMO/com/gmail/nossr50/skills/WoodCutting.java b/mcMMO/com/gmail/nossr50/skills/WoodCutting.java index 46cac5638..ff98f5051 100644 --- a/mcMMO/com/gmail/nossr50/skills/WoodCutting.java +++ b/mcMMO/com/gmail/nossr50/skills/WoodCutting.java @@ -10,6 +10,7 @@ import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.Plugin; +import com.gmail.nossr50.Messages; import com.gmail.nossr50.Users; import com.gmail.nossr50.m; import com.gmail.nossr50.mcMMO; @@ -20,49 +21,48 @@ import com.gmail.nossr50.config.*; public class WoodCutting { static int w = 0; private static boolean isdone = false; - private static mcMMO plugin; - public WoodCutting(mcMMO instance) { - plugin = instance; - } public static void woodCuttingProcCheck(Player player, Block block){ PlayerProfile PP = Users.getProfile(player); byte type = block.getData(); Material mat = Material.getMaterial(block.getTypeId()); if(player != null){ - if(Math.random() * 1000 <= PP.getWoodCuttingInt()){ + if(Math.random() * 1000 <= PP.getSkill("woodcutting")){ ItemStack item = new ItemStack(mat, 1, (short) 0, type); block.getWorld().dropItemNaturally(block.getLocation(), item); } } } - public static void treeFellerCheck(Player player, Block block, Plugin pluginx){ + public static void treeFellerCheck(Player player, Block block, Plugin pluginx) + { PlayerProfile PP = Users.getProfile(player); - if(m.isAxes(player.getItemInHand())){ - if(block != null){ + if(m.isAxes(player.getItemInHand())) + { + if(block != null) + { if(!m.abilityBlockCheck(block)) return; } /* * CHECK FOR AXE PREP MODE */ - if(PP.getAxePreparationMode()){ + if(PP.getAxePreparationMode()) + { PP.setAxePreparationMode(false); } int ticks = 2; - int x = PP.getWoodCuttingInt(); + int x = PP.getSkill("woodcutting"); while(x >= 50){ x-=50; ticks++; } if(!PP.getTreeFellerMode() && Skills.cooldownOver(player, PP.getTreeFellerDeactivatedTimeStamp(), LoadProperties.treeFellerCooldown)){ - player.sendMessage(ChatColor.GREEN+"**TREE FELLING ACTIVATED**"); + player.sendMessage(Messages.getString("Skills.TreeFellerOn")); for(Player y : pluginx.getServer().getOnlinePlayers()){ if(y != null && y != player && m.getDistance(player.getLocation(), y.getLocation()) < 10) - y.sendMessage(ChatColor.GREEN+player.getName()+ChatColor.DARK_GREEN+" has used "+ChatColor.RED+"Tree Feller!"); + y.sendMessage(Messages.getString("Skills.TreeFellerPlayer", new Object[] {player.getName()})); } - PP.setTreeFellerTicks(ticks * 1000); PP.setTreeFellerActivatedTimeStamp(System.currentTimeMillis()); PP.setTreeFellerDeactivatedTimeStamp(System.currentTimeMillis() + (ticks * 1000)); PP.setTreeFellerMode(true); @@ -73,12 +73,12 @@ public class WoodCutting { } } } - public static void treeFeller(Block block, Player player){ + public static void treeFeller(Block block, Player player, mcMMO plugin){ PlayerProfile PP = Users.getProfile(player); int radius = 1; - if(PP.getWoodCuttingXPInt() >= 500) + if(PP.getSkill("woodcutting") >= 500) radius++; - if(PP.getWoodCuttingXPInt() >= 950) + if(PP.getSkill("woodcutting") >= 950) radius++; ArrayList blocklist = new ArrayList(); ArrayList toAdd = new ArrayList(); @@ -93,9 +93,10 @@ public class WoodCutting { * Add blocks from the temporary 'toAdd' array list into the 'treeFeller' array list * We use this temporary list to prevent concurrent modification exceptions */ - for(Block x : toAdd){ - if(!Config.getInstance().isTreeFellerWatched(x)) - Config.getInstance().addTreeFeller(x); + for(Block x : toAdd) + { + if(!plugin.misc.treeFeller.contains(x)) + plugin.misc.treeFeller.add(x); } toAdd.clear(); } diff --git a/mcMMO/plugin.yml b/mcMMO/plugin.yml index a669614c2..f9e451610 100644 --- a/mcMMO/plugin.yml +++ b/mcMMO/plugin.yml @@ -1,3 +1,3 @@ name: mcMMO main: com.gmail.nossr50.mcMMO -version: 1.0.07 \ No newline at end of file +version: 1.0.33 \ No newline at end of file