Another WIP for 1.2.00, still a lot of work to be done.

This commit is contained in:
nossr50 2011-11-28 05:17:01 -08:00
parent e2c97780ee
commit a334787209
27 changed files with 733 additions and 167 deletions

View File

@ -1,5 +1,12 @@
Changelog: Changelog:
#Versions without changelogs probably had very small misc fixes, like tweaks to the source code #Versions without changelogs probably had very small misc fixes, like tweaks to the source code
Version 1.2.00
New mobs added to xp tables
Party leaders can now give bonus xp to nearby party members when grouped provided they are more skilled than their underlings
Animals now give xp to combat skills (those poor sheep ;_;)
Removed unnecessary sorcery permissions from plugin.yml
Added 'Arcane Forging' subskill to Repair
Version 1.1.17 Version 1.1.17
XP gained in combat is now softcapped by the remaining health of the entity you are damaging, preventing many exploits. XP gained in combat is now softcapped by the remaining health of the entity you are damaging, preventing many exploits.
Players in Creative mode no longer gain XP Players in Creative mode no longer gain XP
@ -9,6 +16,7 @@ Enemies should no longer grant XP when hit during their death
Fixed an exploit that led to unlimited ability use Fixed an exploit that led to unlimited ability use
Possibly fixed a bug where the same player would be listed multiple times in mctop Possibly fixed a bug where the same player would be listed multiple times in mctop
Added author and description to plugin.yml Added author and description to plugin.yml
/mmoedit and /addxp are useable from the console now /mmoedit and /addxp are useable from the console now
Swearword's statistics tracking removed (He stopped the service, so its gone now.. On a positive note, I did find out 1000-1500 servers installed mcMMO a day) Swearword's statistics tracking removed (He stopped the service, so its gone now.. On a positive note, I did find out 1000-1500 servers installed mcMMO a day)

View File

@ -122,42 +122,9 @@ public class Combat
} }
} }
if(event.getEntity() instanceof Monster && !pluginx.misc.mobSpawnerList.contains(event.getEntity())) if(!pluginx.misc.mobSpawnerList.contains(event.getEntity()))
{ {
//Prevent XP from being handed out if the Monster is dead int xp = getXp(event.getEntity(), event);
Monster monster = (Monster)event.getEntity();
if(monster.getHealth() < 1)
return;
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob
int hpLeft = monster.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
xpinc = event.getDamage();
else
xpinc = hpLeft;
int xp = 0;
if(event.getEntity() instanceof Enderman)
xp = (xpinc * 3);
if(event.getEntity() instanceof Creeper)
xp = (xpinc * 4);
if(event.getEntity() instanceof Silverfish)
xp = (xpinc * 3);
if(event.getEntity() instanceof CaveSpider)
xp = (xpinc * 3);
if(event.getEntity() instanceof Spider)
xp = (xpinc * 3);
if(event.getEntity() instanceof Skeleton)
xp = (xpinc * 2);
if(event.getEntity() instanceof Zombie)
xp = (xpinc * 2);
if(event.getEntity() instanceof PigZombie)
xp = (xpinc * 3);
if(event.getEntity() instanceof Slime)
xp = (xpinc * 3);
if(event.getEntity() instanceof Ghast)
xp = (xpinc * 3);
if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker)) if(m.isSwords(attacker.getItemInHand()) && mcPermissions.getInstance().swords(attacker))
PPa.addXP(SkillType.SWORDS, xp*10, attacker); PPa.addXP(SkillType.SWORDS, xp*10, attacker);
@ -232,48 +199,13 @@ public class Combat
} }
if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity())) if(!event.getEntity().isDead() && !pluginx.misc.mobSpawnerList.contains(event.getEntity()))
{ {
int xp = 0; int xp = getXp(event.getEntity(), event);
if(event.getEntity() instanceof Monster)
{
//Prevent XP from being handed out if the Monster is dead
Monster monster = (Monster)event.getEntity();
if(monster.getHealth() < 1)
return;
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob
int hpLeft = monster.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
xpinc = event.getDamage();
else
xpinc = hpLeft;
if(event.getEntity() instanceof Creeper)
xp = (xpinc * 6);
if(event.getEntity() instanceof Enderman)
xp = (xpinc * 5);
if(event.getEntity() instanceof Silverfish)
xp = (xpinc * 3);
if(event.getEntity() instanceof CaveSpider)
xp = (xpinc * 3);
if(event.getEntity() instanceof Spider)
xp = (xpinc * 5);
if(event.getEntity() instanceof Skeleton)
xp = (xpinc * 3);
if(event.getEntity() instanceof Zombie)
xp = (xpinc * 3);
if(event.getEntity() instanceof PigZombie)
xp = (xpinc * 4);
if(event.getEntity() instanceof Slime)
xp = (xpinc * 4);
if(event.getEntity() instanceof Ghast)
xp = (xpinc * 4);
Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master); Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master);
}
if(event.getEntity() instanceof Player) if(event.getEntity() instanceof Player)
{ {
xp = (event.getDamage() * 2); xp = (event.getDamage() * 2);
Users.getProfile(master).addXP(SkillType.TAMING, xp*10, master); Users.getProfile(master).addXP(SkillType.TAMING, (int)((xp*10)*1.5), master);
} }
Skills.XpCheckSkill(SkillType.TAMING, master); Skills.XpCheckSkill(SkillType.TAMING, master);
} }
@ -380,42 +312,10 @@ public class Combat
/* /*
* Defender is Monster * Defender is Monster
*/ */
if(!pluginx.misc.mobSpawnerList.contains(x) && x instanceof Monster) if(!pluginx.misc.mobSpawnerList.contains(x))
{ {
//Prevent XP from being handed out if the Monster is dead int xp = getXp(event.getEntity(), event);
Monster monster = (Monster)x; PPa.addXP(SkillType.ARCHERY, xp*10, attacker);
if(monster.getHealth() < 1)
return;
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the mob
int hpLeft = monster.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
xpinc = event.getDamage();
else
xpinc = hpLeft;
//XP
if(x instanceof Creeper)
PPa.addXP(SkillType.ARCHERY, (xpinc * 4)*10, attacker);
if(x instanceof Enderman)
PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker);
if(x instanceof Silverfish)
PPa.addXP(SkillType.ARCHERY, (xpinc * 2)*10, attacker);
if(x instanceof CaveSpider)
PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker);
if(x instanceof Spider)
PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker);
if(x instanceof Skeleton)
PPa.addXP(SkillType.ARCHERY, (xpinc * 2)*10, attacker);
if(x instanceof Zombie)
PPa.addXP(SkillType.ARCHERY, (xpinc * 2)*10, attacker);
if(x instanceof PigZombie)
PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker);
if(x instanceof Slime)
PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker);
if(x instanceof Ghast)
PPa.addXP(SkillType.ARCHERY, (xpinc * 3)*10, attacker);
} }
/* /*
* Attacker is Player * Attacker is Player
@ -470,4 +370,51 @@ public class Combat
//If it made it this far, pvp is enabled //If it made it this far, pvp is enabled
return true; return true;
} }
public static int getXp(Entity entity, EntityDamageEvent event)
{
int xp = 0;
if(entity instanceof LivingEntity)
{
LivingEntity le = (LivingEntity)entity;
//Prevent a ridiculous amount of XP being granted by capping it at the remaining health of the entity
int hpLeft = le.getHealth(), xpinc = 0;
if(hpLeft < event.getDamage())
xpinc = event.getDamage();
else
xpinc = hpLeft;
if(entity instanceof Animals)
{
xp = (int) (xpinc * 1.5);
} else
{
if(entity instanceof Enderman)
xp = (xpinc * 3);
else if(entity instanceof Creeper)
xp = (xpinc * 4);
else if(entity instanceof Silverfish)
xp = (xpinc * 3);
else if(entity instanceof CaveSpider)
xp = (xpinc * 3);
else if(entity instanceof Spider)
xp = (xpinc * 3);
else if(entity instanceof Skeleton)
xp = (xpinc * 2);
else if(entity instanceof Zombie)
xp = (xpinc * 2);
else if(entity instanceof PigZombie)
xp = (xpinc * 3);
else if(entity instanceof Slime)
xp = (xpinc * 2);
else if(entity instanceof Ghast)
xp = (xpinc * 3);
else if(entity instanceof Blaze)
xp = (xpinc * 3);
else if(entity instanceof EnderDragon)
xp = (xpinc * 8);
}
}
return xp;
}
} }

View File

@ -28,7 +28,6 @@ import com.gmail.nossr50.skills.*;
import com.gmail.nossr50.datatypes.PlayerProfile; import com.gmail.nossr50.datatypes.PlayerProfile;
public class Item { public class Item {
public static void itemchecks(Player player, Plugin plugin) public static void itemchecks(Player player, Plugin plugin)

View File

@ -52,6 +52,9 @@ public class Leaderboard
Tree Archery = new Tree(); Tree Archery = new Tree();
Tree Unarmed = new Tree(); Tree Unarmed = new Tree();
Tree Taming = new Tree(); Tree Taming = new Tree();
Tree Fishing = new Tree();
Tree Enchanting = new Tree();
Tree Alchemy = new Tree();
Tree PowerLevel = new Tree(); Tree PowerLevel = new Tree();
//Add Data To Trees //Add Data To Trees
@ -139,6 +142,9 @@ public class Leaderboard
leaderWrite(Axes.inOrder(), SkillType.AXES); //$NON-NLS-1$ leaderWrite(Axes.inOrder(), SkillType.AXES); //$NON-NLS-1$
leaderWrite(Acrobatics.inOrder(), SkillType.ACROBATICS); //$NON-NLS-1$ leaderWrite(Acrobatics.inOrder(), SkillType.ACROBATICS); //$NON-NLS-1$
leaderWrite(Taming.inOrder(), SkillType.TAMING); //$NON-NLS-1$ leaderWrite(Taming.inOrder(), SkillType.TAMING); //$NON-NLS-1$
leaderWrite(Fishing.inOrder(), SkillType.FISHING); //$NON-NLS-1$
leaderWrite(Alchemy.inOrder(), SkillType.ALCHEMY); //$NON-NLS-1$
leaderWrite(Enchanting.inOrder(), SkillType.ENCHANTING); //$NON-NLS-1$
leaderWrite(PowerLevel.inOrder(), SkillType.ALL); //$NON-NLS-1$ leaderWrite(PowerLevel.inOrder(), SkillType.ALL); //$NON-NLS-1$
} }
public static void leaderWrite(PlayerStat[] ps, SkillType skillType) public static void leaderWrite(PlayerStat[] ps, SkillType skillType)

View File

@ -42,6 +42,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.skills.Repair;
import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.skills.Skills;
import com.gmail.nossr50.spout.SpoutStuff; import com.gmail.nossr50.spout.SpoutStuff;
@ -312,9 +313,16 @@ public class Commands
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair2_0"), mcLocale.getString("m.EffectsRepair2_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair2_0"), mcLocale.getString("m.EffectsRepair2_1")}));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair3_0"), mcLocale.getString("m.EffectsRepair3_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair3_0"), mcLocale.getString("m.EffectsRepair3_1")}));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair4_0", new Object[]{LoadProperties.repairdiamondlevel}), mcLocale.getString("m.EffectsRepair4_1")})); player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair4_0", new Object[]{LoadProperties.repairdiamondlevel}), mcLocale.getString("m.EffectsRepair4_1")}));
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] {mcLocale.getString("m.EffectsRepair5_0"), mcLocale.getString("m.EffectsRepair5_1")}));
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] {mcLocale.getString("m.YourStats")})); player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] {mcLocale.getString("m.YourStats")}));
player.sendMessage(mcLocale.getString("m.RepairRepairMastery", new Object[] {repairmastery})); player.sendMessage(mcLocale.getString("m.RepairRepairMastery", new Object[] {repairmastery}));
player.sendMessage(mcLocale.getString("m.RepairSuperRepairChance", new Object[] {percentage})); player.sendMessage(mcLocale.getString("m.RepairSuperRepairChance", new Object[] {percentage}));
player.sendMessage(mcLocale.getString("m.ArcaneForgingRank", new Object[] {Repair.getArcaneForgingRank(PP)}));
player.sendMessage(mcLocale.getString("m.ArcaneEnchantKeepChance", new Object[] {Repair.getEnchantChance(Repair.getArcaneForgingRank(PP))}));
player.sendMessage(mcLocale.getString("m.ArcaneEnchantDowngradeChance", new Object[] {Repair.getDowngradeChance(Repair.getArcaneForgingRank(PP))}));
player.sendMessage(mcLocale.getString("m.ArcaneForgingMilestones"));
player.sendMessage(mcLocale.getString("m.ArcaneForgingMilestones2"));
} }
else if(label.equalsIgnoreCase("unarmed")){ else if(label.equalsIgnoreCase("unarmed")){
String percentage, arrowpercentage; String percentage, arrowpercentage;
@ -1040,6 +1048,8 @@ public class Commands
player.sendMessage(ChatColor.GOLD+"-=GATHERING SKILLS=-"); player.sendMessage(ChatColor.GOLD+"-=GATHERING SKILLS=-");
if(mcPermissions.getInstance().excavation(target)) if(mcPermissions.getInstance().excavation(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION)));
if(mcPermissions.getInstance().fishing(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PPt.getSkillLevel(SkillType.FISHING), PPt.getSkillXpLevel(SkillType.FISHING), PPt.getXpToLevel(SkillType.FISHING)));
if(mcPermissions.getInstance().herbalism(target)) if(mcPermissions.getInstance().herbalism(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM)));
if(mcPermissions.getInstance().mining(target)) if(mcPermissions.getInstance().mining(target))
@ -1064,6 +1074,10 @@ public class Commands
player.sendMessage(ChatColor.GOLD+"-=MISC SKILLS=-"); player.sendMessage(ChatColor.GOLD+"-=MISC SKILLS=-");
if(mcPermissions.getInstance().acrobatics(target)) if(mcPermissions.getInstance().acrobatics(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS)));
if(mcPermissions.getInstance().alchemy(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AlchemySkill"), PPt.getSkillLevel(SkillType.ALCHEMY), PPt.getSkillXpLevel(SkillType.ALCHEMY), PPt.getXpToLevel(SkillType.ALCHEMY)));
if(mcPermissions.getInstance().enchanting(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.EnchantingSkill"), PPt.getSkillLevel(SkillType.ENCHANTING), PPt.getSkillXpLevel(SkillType.ENCHANTING), PPt.getXpToLevel(SkillType.ENCHANTING)));
if(mcPermissions.getInstance().repair(target)) if(mcPermissions.getInstance().repair(target))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
@ -1087,6 +1101,8 @@ public class Commands
player.sendMessage(header+"-=GATHERING SKILLS=-"); player.sendMessage(header+"-=GATHERING SKILLS=-");
if(mcPermissions.getInstance().excavation(player)) if(mcPermissions.getInstance().excavation(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION)));
if(mcPermissions.getInstance().fishing(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING)));
if(mcPermissions.getInstance().herbalism(player)) if(mcPermissions.getInstance().herbalism(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM)));
if(mcPermissions.getInstance().mining(player)) if(mcPermissions.getInstance().mining(player))
@ -1114,6 +1130,10 @@ public class Commands
player.sendMessage(header+"-=MISC SKILLS=-"); player.sendMessage(header+"-=MISC SKILLS=-");
if(mcPermissions.getInstance().acrobatics(player)) if(mcPermissions.getInstance().acrobatics(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS)));
if(mcPermissions.getInstance().alchemy(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AlchemySkill"), PP.getSkillLevel(SkillType.ALCHEMY), PP.getSkillXpLevel(SkillType.ALCHEMY), PP.getXpToLevel(SkillType.ALCHEMY)));
if(mcPermissions.getInstance().enchanting(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.EnchantingSkill"), PP.getSkillLevel(SkillType.ENCHANTING), PP.getSkillXpLevel(SkillType.ENCHANTING), PP.getXpToLevel(SkillType.ENCHANTING)));
if(mcPermissions.getInstance().repair(player)) if(mcPermissions.getInstance().repair(player))
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR))); player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR)));
} }
@ -1204,7 +1224,7 @@ public class Commands
{ {
if(p != null && x+1 >= Pinstance.partyCount(player, Bukkit.getServer().getOnlinePlayers())) if(p != null && x+1 >= Pinstance.partyCount(player, Bukkit.getServer().getOnlinePlayers()))
{ {
if(Pinstance.isPartyLeader(p, PP.getParty())) if(Pinstance.isPartyLeader(p.getName(), PP.getParty()))
{ {
tempList+=ChatColor.GOLD+p.getName(); tempList+=ChatColor.GOLD+p.getName();
x++; x++;
@ -1217,7 +1237,7 @@ public class Commands
} }
if(p != null && x < Pinstance.partyCount(player, Bukkit.getServer().getOnlinePlayers())) if(p != null && x < Pinstance.partyCount(player, Bukkit.getServer().getOnlinePlayers()))
{ {
if(Pinstance.isPartyLeader(p, PP.getParty())) if(Pinstance.isPartyLeader(p.getName(), PP.getParty()))
{ {
tempList+=ChatColor.GOLD+p.getName()+", "; tempList+=ChatColor.GOLD+p.getName()+", ";
x++; x++;
@ -1253,7 +1273,7 @@ public class Commands
{ {
if(PP.inParty()) if(PP.inParty())
{ {
if(Pinstance.isPartyLeader(player, PP.getParty())) if(Pinstance.isPartyLeader(player.getName(), PP.getParty()))
{ {
Pinstance.lockParty(PP.getParty()); Pinstance.lockParty(PP.getParty());
player.sendMessage(mcLocale.getString("Party.Locked")); player.sendMessage(mcLocale.getString("Party.Locked"));
@ -1269,7 +1289,7 @@ public class Commands
{ {
if(PP.inParty()) if(PP.inParty())
{ {
if(Pinstance.isPartyLeader(player, PP.getParty())) if(Pinstance.isPartyLeader(player.getName(), PP.getParty()))
{ {
Pinstance.unlockParty(PP.getParty()); Pinstance.unlockParty(PP.getParty());
player.sendMessage(mcLocale.getString("Party.Unlocked")); player.sendMessage(mcLocale.getString("Party.Unlocked"));
@ -1297,7 +1317,7 @@ public class Commands
{ {
if(args[0].equalsIgnoreCase("password")) if(args[0].equalsIgnoreCase("password"))
{ {
if(Pinstance.isPartyLeader(player, PP.getParty())) if(Pinstance.isPartyLeader(player.getName(), PP.getParty()))
{ {
if(Pinstance.isPartyLocked(PP.getParty())) if(Pinstance.isPartyLocked(PP.getParty()))
{ {
@ -1313,7 +1333,7 @@ public class Commands
} }
} else if(args[0].equalsIgnoreCase("kick")) } else if(args[0].equalsIgnoreCase("kick"))
{ {
if(Pinstance.isPartyLeader(player, PP.getParty())) if(Pinstance.isPartyLeader(player.getName(), PP.getParty()))
{ {
if(Pinstance.isPartyLocked(PP.getParty())) if(Pinstance.isPartyLocked(PP.getParty()))
{ {
@ -1351,7 +1371,7 @@ public class Commands
} }
} else if(args[0].equalsIgnoreCase("owner")) } else if(args[0].equalsIgnoreCase("owner"))
{ {
if(Pinstance.isPartyLeader(player, PP.getParty())) if(Pinstance.isPartyLeader(player.getName(), PP.getParty()))
{ {
Player tPlayer = null; Player tPlayer = null;
if(Bukkit.getServer().getPlayer(args[1]) != null) tPlayer = Bukkit.getServer().getPlayer(args[1]); if(Bukkit.getServer().getPlayer(args[1]) != null) tPlayer = Bukkit.getServer().getPlayer(args[1]);

View File

@ -27,10 +27,13 @@ import java.util.logging.Logger;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.gmail.nossr50.config.LoadProperties; import com.gmail.nossr50.config.LoadProperties;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.m; import com.gmail.nossr50.m;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@ -954,6 +957,30 @@ public class PlayerProfile
{ {
if(thisplayer.getGameMode() == GameMode.CREATIVE) if(thisplayer.getGameMode() == GameMode.CREATIVE)
return; return;
double bonusModifier = 0;
String leaderName = "";
if(inParty())
{
for(Player x : Party.getInstance().getPartyMembers(thisplayer))
{
if(x.isOnline() && !x.getName().equals(thisplayer.getName()) && Party.getInstance().isPartyLeader(x.getName(), this.getParty()))
{
leaderName = x.getName();
if(m.getDistance(thisplayer.getLocation(), x.getLocation()) < 25)
{
PlayerProfile PartyLeader = Users.getProfile(x);
if(PartyLeader.getSkillLevel(skillType) >= this.getSkillLevel(skillType))
{
int leaderLevel = PartyLeader.getSkillLevel(skillType);
int difference = leaderLevel - this.getSkillLevel(skillType);
bonusModifier = (difference*0.75D)/100D;
}
}
}
}
}
if(skillType == SkillType.ALL) if(skillType == SkillType.ALL)
{ {
for(SkillType x : SkillType.values()) for(SkillType x : SkillType.values())
@ -1002,6 +1029,18 @@ public class PlayerProfile
break; break;
} }
xp=xp*LoadProperties.xpGainMultiplier; xp=xp*LoadProperties.xpGainMultiplier;
if(bonusModifier > 0)
{
if(bonusModifier >= 3)
bonusModifier = 3;
double trueBonus = bonusModifier * xp;
double oldxp = xp;
xp+=trueBonus;
double percent = (trueBonus/oldxp)*100;
thisplayer.sendMessage(ChatColor.GREEN+"XP: "+oldxp+" Bonus XP: "+trueBonus+" Total: "+xp+ChatColor.GOLD+" [Master: "+leaderName+" " +" +"+(int)percent+"%]");
}
skillsXp.put(skillType, skillsXp.get(skillType)+xp); skillsXp.put(skillType, skillsXp.get(skillType)+xp);
lastgained = skillType; lastgained = skillType;
} }

View File

@ -19,10 +19,13 @@ package com.gmail.nossr50.datatypes;
public enum SkillType public enum SkillType
{ {
ACROBATICS, ACROBATICS,
ALCHEMY,
ALL, //This one is just for convenience ALL, //This one is just for convenience
ARCHERY, ARCHERY,
AXES, AXES,
EXCAVATION, EXCAVATION,
ENCHANTING,
FISHING,
HERBALISM, HERBALISM,
MINING, MINING,
REPAIR, REPAIR,

View File

@ -25,9 +25,14 @@ import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.craftbukkit.command.ColouredConsoleSender; import org.bukkit.craftbukkit.command.ColouredConsoleSender;
import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Fish;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerFishEvent;
import org.bukkit.event.player.PlayerFishEvent.State;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerListener; import org.bukkit.event.player.PlayerListener;
@ -36,6 +41,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent; import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.material.MaterialData;
import com.gmail.nossr50.Item; import com.gmail.nossr50.Item;
import com.gmail.nossr50.Users; import com.gmail.nossr50.Users;
@ -50,6 +56,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.mcLocale; import com.gmail.nossr50.locale.mcLocale;
import com.gmail.nossr50.party.Party; import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.skills.Fishing;
import com.gmail.nossr50.skills.Herbalism; import com.gmail.nossr50.skills.Herbalism;
import com.gmail.nossr50.skills.Repair; import com.gmail.nossr50.skills.Repair;
import com.gmail.nossr50.skills.Skills; import com.gmail.nossr50.skills.Skills;
@ -66,6 +73,22 @@ public class mcPlayerListener extends PlayerListener
plugin = instance; plugin = instance;
} }
//Fishing stuff
public void onPlayerFish(PlayerFishEvent event)
{
Player player = event.getPlayer();
if(mcPermissions.getInstance().fishing(player))
{
if(event.getState() == State.CAUGHT_FISH)
{
if(event.getCaught() instanceof CraftItem)
{
Fishing.getFishingResults(player, event);
}
}
}
}
public void onPlayerPickupItem(PlayerPickupItemEvent event) public void onPlayerPickupItem(PlayerPickupItemEvent event)
{ {
if(Users.getProfile(event.getPlayer()).getBerserkMode()) if(Users.getProfile(event.getPlayer()).getBerserkMode())
@ -124,9 +147,7 @@ public class mcPlayerListener extends PlayerListener
public void onPlayerJoin(PlayerJoinEvent event) public void onPlayerJoin(PlayerJoinEvent event)
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
if(mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd) if(mcPermissions.getInstance().motd(player) && LoadProperties.enableMotd)
{ {
player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), LoadProperties.mcmmo})); player.sendMessage(mcLocale.getString("mcPlayerListener.MOTD", new Object[] {plugin.getDescription().getVersion(), LoadProperties.mcmmo}));

View File

@ -355,3 +355,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -349,3 +349,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -349,3 +349,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE ES AHORA {0}x!!
Commands.xplock.locked=[[GOLD]]Tu BARRA DE EXP esta bloqueada a {0}! Commands.xplock.locked=[[GOLD]]Tu BARRA DE EXP esta bloqueada a {0}!
Commands.xplock.unlocked=[[GOLD]]Tu BARRA DE EXP esta ahora [[GREEN]]DESBLOQUEADA[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Tu BARRA DE EXP esta ahora [[GREEN]]DESBLOQUEADA[[GOLD]]!
Commands.xplock.invalid=[[RED]]Ese no es un nombre de habilidad valido! Try /xplock mining Commands.xplock.invalid=[[RED]]Ese no es un nombre de habilidad valido! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -328,3 +328,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -349,3 +349,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -355,3 +355,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -349,3 +349,23 @@ Commands.xprate.started2=[[GOLD]]mcMMO XP RATE IS NOW {0}x!!
Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}! Commands.xplock.locked=[[GOLD]]Your XP BAR is now locked to {0}!
Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Your XP BAR is now [[GREEN]]UNLOCKED[[GOLD]]!
Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining Commands.xplock.invalid=[[RED]]That is not a valid skillname! Try /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -364,3 +364,23 @@ Commands.xprate.started2=[[GOLD]]XP RATE AGORA
Commands.xplock.locked=[[GOLD]]Sua barra de XP BAR está travada em {0}! Commands.xplock.locked=[[GOLD]]Sua barra de XP BAR está travada em {0}!
Commands.xplock.unlocked=[[GOLD]]Sua barra de XP foi [[GREEN]]DESTRAVADA[[GOLD]]! Commands.xplock.unlocked=[[GOLD]]Sua barra de XP foi [[GREEN]]DESTRAVADA[[GOLD]]!
Commands.xplock.invalid=[[RED]]Nao existe habilidade com esse nome! Tente /xplock mining Commands.xplock.invalid=[[RED]]Nao existe habilidade com esse nome! Tente /xplock mining
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -341,3 +341,23 @@ Party.CouldNotKick=[[DARK_RED]]
Party.NotInYourParty=[[DARK_RED]]{0} не в группе Party.NotInYourParty=[[DARK_RED]]{0} не в группе
Party.CouldNotSetOwner=[[DARK_RED]]Вы не можете отдать лидерство игроку {0} Party.CouldNotSetOwner=[[DARK_RED]]Вы не можете отдать лидерство игроку {0}
mcMMO.Description=[[DARK_AQUA]]Q: Что это?,[[GOLD]]mcMMO это [[RED]]ОПЕН СУРС[[GOLD]] RPG мод для сервера Bukkit от пользователя [[BLUE]]nossr50,[[GOLD]]Здесь было добавлено много умений для Minecraft сервера.,[[GOLD]]Вы можете прокачать их разными способами,[[GOLD]]Вы хотите найти больше информации о умении [[GREEN]]/SKILLNAME[[GOLD]] ?,[[DARK_AQUA]]Q: Что я должен сделать?,[[GOLD]]Для примера... in [[DARK_AQUA]]Шахтёрство[[GOLD]] вы получите [[RED]]2-ой дроп[[GOLD]] или способность [[RED]]"Супер разрушитель"[[GOLD]] ,которая активируется [[GOLD]]нажатием правой кнопки мыши на некоторое время,[[GOLD]]связанное с вашим уровнем умения. Поднять уровень [[BLUE]]Шахтёрства,[[GOLD]]легко просто копайте руды и камни! mcMMO.Description=[[DARK_AQUA]]Q: Что это?,[[GOLD]]mcMMO это [[RED]]ОПЕН СУРС[[GOLD]] RPG мод для сервера Bukkit от пользователя [[BLUE]]nossr50,[[GOLD]]Здесь было добавлено много умений для Minecraft сервера.,[[GOLD]]Вы можете прокачать их разными способами,[[GOLD]]Вы хотите найти больше информации о умении [[GREEN]]/SKILLNAME[[GOLD]] ?,[[DARK_AQUA]]Q: Что я должен сделать?,[[GOLD]]Для примера... in [[DARK_AQUA]]Шахтёрство[[GOLD]] вы получите [[RED]]2-ой дроп[[GOLD]] или способность [[RED]]"Супер разрушитель"[[GOLD]] ,которая активируется [[GOLD]]нажатием правой кнопки мыши на некоторое время,[[GOLD]]связанное с вашим уровнем умения. Поднять уровень [[BLUE]]Шахтёрства,[[GOLD]]легко просто копайте руды и камни!
m.SkillAlchemy=ALCHEMY
m.SkillEnchanting=ENCHANTING
m.SkillFishing=FISHING
mcPlayerListener.AlchemySkill=Alchemy:
mcPlayerListener.EnchantingSkill=Enchanting:
mcPlayerListener.FishingSkill=Fishing:
Skills.AlchemyUp=[[YELLOW]]Alchemy skill increased by {0}. Total ({1})
Skills.EnchantingUp=[[YELLOW]]Enchanting skill increased by {0}. Total ({1})
Skills.FishingUp=[[YELLOW]]Fishing skill increased by {0}. Total ({1})
Repair.LostEnchants=[[RED]]You were not skilled enough to keep any enchantments.
Repair.ArcanePerfect=[[GREEN]]You have sustained the arcane energies in this item.
Repair.Downgraded=[[RED]]Arcane power has decreased for this item.
Repair.ArcaneFailed=[[RED]]Arcane power has permanently left the item.
m.EffectsRepair5_0=Arcane Forging
m.EffectsRepair5_1=Repair magic items
m.ArcaneForgingRank=[[RED]]Arcane Forging: [[YELLOW]]Rank {0}/4
m.ArcaneEnchantKeepChance=[[GRAY]]AF Success Rate: [[YELLOW]]{0}%
m.ArcaneEnchantDowngradeChance=[[GRAY]]AF Downgrade Chance: [[YELLOW]]{0}%
m.ArcaneForgingMilestones=[[GOLD]][TIP] AF Rank Ups: [[GRAY]]Rank 1 = 100+, Rank 2 = 250+,
m.ArcaneForgingMilestones2=[[GRAY]] Rank 3 = 500+, Rank 4 = 750+

View File

@ -141,6 +141,7 @@ public class mcMMO extends JavaPlugin
pm.registerEvent(Event.Type.PLAYER_INTERACT, playerListener, Priority.Monitor, 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_RESPAWN, playerListener, Priority.Normal, this);
pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, playerListener, Priority.Normal, this); pm.registerEvent(Event.Type.PLAYER_PICKUP_ITEM, playerListener, Priority.Normal, this);
pm.registerEvent(Event.Type.PLAYER_FISH, playerListener, Priority.Normal, this);
//Block Stuff //Block Stuff
pm.registerEvent(Event.Type.BLOCK_DAMAGE, blockListener, Priority.Highest, this); pm.registerEvent(Event.Type.BLOCK_DAMAGE, blockListener, Priority.Highest, this);

View File

@ -265,6 +265,27 @@ public class mcPermissions
return true; return true;
} }
} }
public boolean fishing(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.fishing");
} else {
return true;
}
}
public boolean alchemy(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.alchemy");
} else {
return true;
}
}
public boolean enchanting(Player player) {
if (permissionsEnabled) {
return permission(player, "mcmmo.skills.enchanting");
} else {
return true;
}
}
public boolean woodcutting(Player player) { public boolean woodcutting(Player player) {
if (permissionsEnabled) { if (permissionsEnabled) {
return permission(player, "mcmmo.skills.woodcutting"); return permission(player, "mcmmo.skills.woodcutting");

View File

@ -211,7 +211,7 @@ public class Party
informPartyMembersQuit(player); informPartyMembersQuit(player);
String party = PP.getParty(); String party = PP.getParty();
if(isPartyLeader(player, party)) if(isPartyLeader(player.getName(), party))
{ {
if(isPartyLocked(party)) { if(isPartyLocked(party)) {
unlockParty(party); unlockParty(party);
@ -376,7 +376,7 @@ public class Party
} }
public boolean canInvite(Player player, PlayerProfile PP) { public boolean canInvite(Player player, PlayerProfile PP) {
return (isPartyLocked(PP.getParty()) && !isPartyLeader(player, PP.getParty())) ? false : true; return (isPartyLocked(PP.getParty()) && !isPartyLeader(player.getName(), PP.getParty())) ? false : true;
} }
public boolean isParty(String partyName) { public boolean isParty(String partyName) {
@ -387,11 +387,11 @@ public class Party
return this.partyPlayers.get(partyName).isEmpty(); return this.partyPlayers.get(partyName).isEmpty();
} }
public boolean isPartyLeader(Player player, String partyName) { public boolean isPartyLeader(String playerName, String partyName) {
if(this.partyPlayers.get(partyName) != null) if(this.partyPlayers.get(partyName) != null)
{ {
if(this.partyPlayers.get(partyName).get(player.getName()) == null) return false; if(this.partyPlayers.get(partyName).get(playerName) == null) return false;
return this.partyPlayers.get(partyName).get(player.getName()); return this.partyPlayers.get(partyName).get(playerName);
} }
else else
return false; return false;

View File

@ -0,0 +1,5 @@
package com.gmail.nossr50.skills;
public class Alchemy {
}

View File

@ -0,0 +1,5 @@
package com.gmail.nossr50.skills;
public class Enchanting {
}

View File

@ -0,0 +1,183 @@
package com.gmail.nossr50.skills;
import org.bukkit.Material;
import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerFishEvent;
import org.bukkit.inventory.ItemStack;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
public class Fishing {
//Return the fishing tier for the player
public static int getFishingLootTier(PlayerProfile PP)
{
int lvl = PP.getSkillLevel(SkillType.FISHING);
if(lvl < 100)
{
return 1;
} else if (lvl >= 100 && lvl < 300)
{
return 2;
} else if (lvl >= 300 && lvl < 600)
{
return 3;
} else if (lvl >= 600 && lvl < 900)
{
return 4;
} else
{
return 5;
}
}
public static short getItemMaxDurability(Material mat)
{
//Return the max durability of an item
//KEY
//TOOLS
//GOLD = 33, WOOD = 60, STONE = 132, IRON = 251, DIAMOND = 1562
//HELMETS
//LEATHER = 34, CHAINMAIL = 67, GOLD = 68, IRON = 136, DIAMOND = 272
//CHESTPLATES
//LEATHER = 49, CHAINMAIL = 96, GOLD = 96, IRON = 192, DIAMOND = 384
//LEGGINGS
//LEATHER = 46, CHAINMAIL = 92, GOLD = 92, IRON = 184, DIAMOND = 368
//BOOTS
//LEATHER = 40, CHAINMAIL = 79, GOLD = 80, IRON = 160, DIAMOND = 320
switch(mat)
{
//Leather Items
case LEATHER_BOOTS:
return (short) 40;
case LEATHER_LEGGINGS:
return (short) 46;
case LEATHER_HELMET:
return (short) 34;
case LEATHER_CHESTPLATE:
return (short) 49;
default:
return 0;
}
}
public static void getFishingResults(Player player, PlayerFishEvent event)
{
switch(getFishingLootTier(Users.getProfile(player)))
{
case 1:
getFishingResultsTier1(player, event);
Users.getProfile(player).addXP(SkillType.FISHING, 200, player);
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 1));
break;
case 2:
getFishingResultsTier2(player, event);
Users.getProfile(player).addXP(SkillType.FISHING, 400, player);
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 2));
break;
case 3:
getFishingResultsTier3(player, event);
Users.getProfile(player).addXP(SkillType.FISHING, 600, player);
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 3));
break;
case 4:
getFishingResultsTier4(player, event);
Users.getProfile(player).addXP(SkillType.FISHING, 800, player);
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 4));
break;
case 5:
getFishingResultsTier5(player, event);
Users.getProfile(player).addXP(SkillType.FISHING, 1000, player);
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.RAW_FISH, 5));
break;
}
Skills.XpCheckSkill(SkillType.FISHING, player);
}
private static void getFishingResultsTier1(Player player, PlayerFishEvent event)
{
//About 12 items for Tier 1
int randomNum = (int)(Math.random() * 14);
CraftItem theCatch = (CraftItem)event.getCaught();
switch(randomNum)
{
//Armors
case 1:
theCatch.setItemStack(new ItemStack(Material.LEATHER_BOOTS, 1));
break;
case 2:
theCatch.setItemStack(new ItemStack(Material.LEATHER_HELMET, 1));
break;
case 3:
theCatch.setItemStack(new ItemStack(Material.LEATHER_LEGGINGS, 1));
break;
case 4:
theCatch.setItemStack(new ItemStack(Material.LEATHER_CHESTPLATE, 1));
break;
//Tools
//WOOD TOOLS
case 5:
theCatch.setItemStack(new ItemStack(Material.WOOD_AXE, 1));
break;
case 6:
theCatch.setItemStack(new ItemStack(Material.WOOD_PICKAXE, 1));
break;
case 7:
theCatch.setItemStack(new ItemStack(Material.WOOD_SWORD, 1));
break;
case 8:
theCatch.setItemStack(new ItemStack(Material.WOOD_HOE, 1));
break;
case 9:
theCatch.setItemStack(new ItemStack(Material.WOOD_SPADE, 1));
break;
//STONE TOOLS
case 10:
theCatch.setItemStack(new ItemStack(Material.STONE_AXE, 1));
break;
case 11:
theCatch.setItemStack(new ItemStack(Material.STONE_PICKAXE, 1));
break;
case 12:
theCatch.setItemStack(new ItemStack(Material.STONE_SWORD, 1));
break;
case 13:
theCatch.setItemStack(new ItemStack(Material.STONE_HOE, 1));
break;
case 14:
theCatch.setItemStack(new ItemStack(Material.STONE_SPADE, 1));
break;
}
//Change durability to random value
theCatch.getItemStack().setDurability((short) (Math.random() * Fishing.getItemMaxDurability(theCatch.getItemStack().getType()))); //Change the damage value
}
private static void getFishingResultsTier2(Player player, PlayerFishEvent event)
{
}
private static void getFishingResultsTier3(Player player, PlayerFishEvent event)
{
}
private static void getFishingResultsTier4(Player player, PlayerFishEvent event)
{
}
private static void getFishingResultsTier5(Player player, PlayerFishEvent event)
{
}
}

View File

@ -16,6 +16,8 @@
*/ */
package com.gmail.nossr50.skills; package com.gmail.nossr50.skills;
import net.minecraft.server.Enchantment;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Statistic; import org.bukkit.Statistic;
@ -254,7 +256,14 @@ public class Mining
{ {
PlayerProfile PP = Users.getProfile(player); PlayerProfile PP = Users.getProfile(player);
if(LoadProperties.toolsLoseDurabilityFromAbilities) if(LoadProperties.toolsLoseDurabilityFromAbilities)
{
if(player.getItemInHand().getEnchantments().containsKey(Enchantment.DURABILITY))
{
}
m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss); m.damageTool(player, (short) LoadProperties.abilityDurabilityLoss);
}
Location loc = block.getLocation(); Location loc = block.getLocation();
Material mat = Material.getMaterial(block.getTypeId()); Material mat = Material.getMaterial(block.getTypeId());
int xp = 0; int xp = 0;

View File

@ -19,6 +19,7 @@ package com.gmail.nossr50.skills;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -55,6 +56,21 @@ public class Repair {
short durabilityBefore = player.getItemInHand().getDurability(); short durabilityBefore = player.getItemInHand().getDurability();
short durabilityAfter = 0; short durabilityAfter = 0;
short dif = 0; short dif = 0;
//Stuff for keeping enchants
Enchantment[] enchants = new Enchantment[is.getEnchantments().size()];
int[] enchantsLevel = new int[is.getEnchantments().size()];
int pos = 0;
for(Enchantment x : is.getEnchantments().keySet())
{
enchants[pos] = x;
enchantsLevel[pos] = is.getEnchantmentLevel(x);
pos++;
}
System.out.println("[mcMMO] Enchantments stored!");
if(block != null && mcPermissions.getInstance().repair(player)){ if(block != null && mcPermissions.getInstance().repair(player)){
if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){ if(player.getItemInHand().getDurability() > 0 && player.getItemInHand().getAmount() < 2){
/* /*
@ -66,7 +82,9 @@ public class Repair {
*/ */
if(isDiamondArmor(is) && hasItem(player, rDiamond) && PP.getSkillLevel(SkillType.REPAIR) >= LoadProperties.repairdiamondlevel){ if(isDiamondArmor(is) && hasItem(player, rDiamond) && PP.getSkillLevel(SkillType.REPAIR) >= LoadProperties.repairdiamondlevel){
removeItem(player, rDiamond); removeItem(player, rDiamond);
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 6); //Boost XP dif = (short) (dif * 6); //Boost XP
@ -81,7 +99,9 @@ public class Repair {
* IRON ARMOR * IRON ARMOR
*/ */
removeItem(player, rIron); removeItem(player, rIron);
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 2); //Boost XP dif = (short) (dif * 2); //Boost XP
@ -93,7 +113,9 @@ public class Repair {
//GOLD ARMOR //GOLD ARMOR
} else if (isGoldArmor(is) && hasItem(player, rGold)){ } else if (isGoldArmor(is) && hasItem(player, rGold)){
removeItem(player, rGold); removeItem(player, rGold);
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
dif = (short) (dif * 4); //Boost XP of Gold to around Iron dif = (short) (dif * 4); //Boost XP of Gold to around Iron
@ -123,7 +145,9 @@ public class Repair {
/* /*
* Repair Durability and calculate dif * Repair Durability and calculate dif
*/ */
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is)) if(m.isShovel(is))
@ -142,6 +166,7 @@ public class Repair {
* Repair Durability and calculate dif * Repair Durability and calculate dif
*/ */
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is)) if(m.isShovel(is))
@ -160,6 +185,7 @@ public class Repair {
* Repair Durability and calculate dif * Repair Durability and calculate dif
*/ */
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
durabilityAfter = (short) (player.getItemInHand().getDurability()-getRepairAmount(is, player)); durabilityAfter = (short) (player.getItemInHand().getDurability()-getRepairAmount(is, player));
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
if(m.isShovel(is)) if(m.isShovel(is))
@ -178,6 +204,7 @@ public class Repair {
* DIAMOND TOOLS * DIAMOND TOOLS
*/ */
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
removeItem(player, rDiamond); removeItem(player, rDiamond);
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
@ -194,6 +221,7 @@ public class Repair {
SpoutStuff.playRepairNoise(player); SpoutStuff.playRepairNoise(player);
} else if(isGoldTools(is) && hasItem(player, rGold)){ } else if(isGoldTools(is) && hasItem(player, rGold)){
player.getItemInHand().setDurability(getRepairAmount(is, player)); player.getItemInHand().setDurability(getRepairAmount(is, player));
removeItem(player, rGold); removeItem(player, rGold);
durabilityAfter = player.getItemInHand().getDurability(); durabilityAfter = player.getItemInHand().getDurability();
dif = (short) (durabilityBefore - durabilityAfter); dif = (short) (durabilityBefore - durabilityAfter);
@ -212,6 +240,15 @@ public class Repair {
} else { } else {
needMoreVespeneGas(is, player); needMoreVespeneGas(is, player);
} }
//This will solve the issue with swords not repairing properly
if(is.getType() == Material.WOOD_SWORD || is.getType() == Material.STONE_SWORD || is.getType() == Material.IRON_SWORD ||
is.getType() == Material.GOLD_SWORD || is.getType() == Material.DIAMOND_SWORD)
{
player.getItemInHand().getData().setData((byte)player.getItemInHand().getDurability());
}
player.sendMessage("Current Durability Value: "+player.getItemInHand().getDurability());
} }
} else { } else {
@ -222,6 +259,111 @@ public class Repair {
* GIVE SKILL IF THERE IS ENOUGH XP * GIVE SKILL IF THERE IS ENOUGH XP
*/ */
Skills.XpCheckSkill(SkillType.REPAIR, player); Skills.XpCheckSkill(SkillType.REPAIR, player);
addEnchants(player.getItemInHand(), enchants, enchantsLevel, PP, player);
}
}
public static int getArcaneForgingRank(PlayerProfile PP)
{
int rank = 0;
if(PP.getSkillLevel(SkillType.REPAIR) >= 750)
{
rank = 4;
} else if (PP.getSkillLevel(SkillType.REPAIR) >= 500)
{
rank = 3;
} else if(PP.getSkillLevel(SkillType.REPAIR) >= 250)
{
rank = 2;
} else if (PP.getSkillLevel(SkillType.REPAIR) >= 100)
{
rank = 1;
}
return rank;
}
public static void addEnchants(ItemStack is, Enchantment[] enchants, int[] enchantsLvl, PlayerProfile PP, Player player)
{
if(is.getEnchantments().keySet().size() == 0)
return;
int pos = 0;
int rank = getArcaneForgingRank(PP);
if(rank == 0)
{
player.sendMessage(mcLocale.getString("Repair.LostEnchants"));
return;
}
boolean failure = false, downgrade = false;
for(Enchantment x : enchants)
{
if(x.canEnchantItem(is))
{
if(Math.random() * 100 <= getEnchantChance(rank))
{
if(enchantsLvl[pos] > 1)
{
if(Math.random() * 100 <= getDowngradeChance(rank))
{
is.addEnchantment(x, enchantsLvl[pos]-1);
downgrade = true;
} else
{
is.addEnchantment(x, enchantsLvl[pos]);
}
}
else {
is.addEnchantment(x, enchantsLvl[pos]);
}
} else {
failure = true;
}
}
pos++;
}
if(failure == false && downgrade == false)
{
player.sendMessage(mcLocale.getString("Repair.ArcanePerfect"));
} else {
if(failure == false)
player.sendMessage("Repair.ArcaneFailed");
if(downgrade == false)
player.sendMessage("Repair.Downgraded");
}
}
public static int getEnchantChance(int rank)
{
switch(rank)
{
case 4:
return 40;
case 3:
return 30;
case 2:
return 20;
case 1:
return 10;
default:
return 0;
}
}
public static int getDowngradeChance(int rank)
{
switch(rank)
{
case 4:
return 15;
case 3:
return 25;
case 2:
return 50;
case 1:
return 75;
default:
return 100;
} }
} }
public static boolean isArmor(ItemStack is){ public static boolean isArmor(ItemStack is){

View File

@ -226,7 +226,7 @@ public class mmoHelper
} else { } else {
bar = (GenericLivingEntity)bars[index]; bar = (GenericLivingEntity)bars[index];
} }
bar.setEntity(name, Party.getInstance().isPartyLeader(Bukkit.getServer().getPlayer(name), Users.getProfile(Bukkit.getServer().getPlayer(name)).getParty()) ? ChatColor.GREEN + "@" : ""); bar.setEntity(name, Party.getInstance().isPartyLeader(name, Users.getProfile(Bukkit.getServer().getPlayer(name)).getParty()) ? ChatColor.GREEN + "@" : "");
//bar.setTargets(show_pets ? getPets(Bukkit.getServer().getPlayer(name)) : null); //bar.setTargets(show_pets ? getPets(Bukkit.getServer().getPlayer(name)) : null);
index++; index++;
} }

View File

@ -1,6 +1,6 @@
name: mcMMO name: mcMMO
main: com.gmail.nossr50.mcMMO main: com.gmail.nossr50.mcMMO
version: 1.1.17 version: 1.2.00 WIP #1
softdepend: [Spout] softdepend: [Spout]
author: nossr50 author: nossr50
description: mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience. description: mcMMO takes core Minecraft game mechanics and expands them to add an extensive RPG experience, the goal of the project has always been a quality RPG experience. Everything in mcMMO is carefully thought out and is constantly improving. mcMMO adds eleven skills to train in and level in, while also offering a high level of customization for server admins. There are countless features, including custom sounds, graphical elements, and more added when running mcMMO in conjunction with Spout. I carefully read feedback and evaluate the mechanics of mcMMO in every update to provide an ever-evolving experience.
@ -196,8 +196,9 @@ permissions:
mcmmo.skills.*: mcmmo.skills.*:
description: Implies all mcmmo.skills permissions. description: Implies all mcmmo.skills permissions.
children: children:
mcmmo.skills.sorcery.*: true mcmmo.skills.alchemy: true
mcmmo.skills.curative.*: true mcmmo.skills.enchanting: true
mcmmo.skills.fishing: true
mcmmo.skills.taming: true mcmmo.skills.taming: true
mcmmo.skills.mining: true mcmmo.skills.mining: true
mcmmo.skills.woodcutting: true mcmmo.skills.woodcutting: true
@ -209,30 +210,6 @@ permissions:
mcmmo.skills.swords: true mcmmo.skills.swords: true
mcmmo.skills.axes: true mcmmo.skills.axes: true
mcmmo.skills.acrobatics: true mcmmo.skills.acrobatics: true
mcmmo.skills.sorcery.*:
description: Implies all mcmmo.skills.sorcery permissions.
children:
mcmmo.skills.sorcery: true
mcmmo.skills.sorcery.water: true
mcmmo.skills.sorcery.water.thunder: true
mcmmo.skills.curative.*:
description: Implies all mcmmo.skills.curative permissions.
children:
mcmmo.skills.curative: true
mcmmo.skills.curative.heal.other: true
mcmmo.skills.curative.heal.self: true
mcmmo.skills.sorcery:
description:
mcmmo.skills.sorcery.water:
description:
mcmmo.skills.sorcery.water.thunder:
description:
mcmmo.skills.curative:
description:
mcmmo.skills.curative.heal.other:
description:
mcmmo.skills.curative.heal.self:
description:
mcmmo.skills.taming: mcmmo.skills.taming:
description: description:
mcmmo.skills.mining: mcmmo.skills.mining: