Added custom values for mob combat multipliers.

This commit is contained in:
GJ 2012-02-26 01:53:54 -05:00
parent 6b0c46b634
commit 3a1ee58339
5 changed files with 57 additions and 32 deletions

View File

@ -18,6 +18,7 @@ Version 1.3.00-dev
+ Added Fast Food Service subskill to Taming
+ Added size limit to Tree Feller in config as Tree Feller Threshold
+ Added /addlevels command
+ Added config values for XP multipliers for different hostile mobs
+ Re-added mcMMO reporting damage events
= Fixed bug where Swords command showed Bleed Length twice instead of Bleed Chance
= Fixed bug where Tree Feller wasn't checking for Tree Feller permission

View File

@ -395,11 +395,13 @@ public class Combat
int xp = 0;
if(entity instanceof LivingEntity)
{
LivingEntity le = (LivingEntity)entity;
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())
int hpLeft = le.getHealth();
int xpinc = 0;
int damage = event.getDamage();
if(hpLeft < damage)
{
if(hpLeft > 0)
xpinc = hpLeft;
@ -407,39 +409,38 @@ public class Combat
xpinc = 0;
}
else
xpinc = event.getDamage();
xpinc = damage;
if(entity instanceof Animals)
{
xp = (int) (xpinc * 1);
} else
xp = (int) (xpinc * LoadProperties.animalXP);
else
{
if(entity instanceof Enderman)
xp = (xpinc * 2);
else if(entity instanceof Creeper)
xp = (xpinc * 4);
xp = (int) (xpinc * LoadProperties.endermanXP);
else if(entity instanceof Creeper)
xp = (int) (xpinc * LoadProperties.creeperXP);
else if(entity instanceof Silverfish)
xp = (xpinc * 3);
xp = (int) (xpinc * LoadProperties.silverfishXP);
else if(entity instanceof CaveSpider)
xp = (xpinc * 3);
xp = (int) (xpinc * LoadProperties.cavespiderXP);
else if(entity instanceof Spider)
xp = (xpinc * 3);
xp = (int) (xpinc * LoadProperties.spiderXP);
else if(entity instanceof Skeleton)
xp = (xpinc * 2);
xp = (int) (xpinc * LoadProperties.skeletonXP);
else if(entity instanceof Zombie)
xp = (xpinc * 2);
xp = (int) (xpinc * LoadProperties.zombieXP);
else if(entity instanceof PigZombie)
xp = (xpinc * 3);
xp = (int) (xpinc * LoadProperties.pigzombieXP);
else if(entity instanceof Slime)
xp = (xpinc * 2);
xp = (int) (xpinc * LoadProperties.slimeXP);
else if(entity instanceof Ghast)
xp = (xpinc * 3);
xp = (int) (xpinc * LoadProperties.ghastXP);
else if(entity instanceof Blaze)
xp = (xpinc * 3);
xp = (int) (xpinc * LoadProperties.blazeXP);
else if(entity instanceof EnderDragon)
xp = (xpinc * 8);
xp = (int) (xpinc * LoadProperties.enderdragonXP);
else if(entity instanceof MagmaCube)
xp = (xpinc * 2);
xp = (int) (xpinc * LoadProperties.magmacubeXP);
}
}
return xp;

View File

@ -88,7 +88,8 @@ public class LoadProperties {
miningxpmodifier, repairxpmodifier, woodcuttingxpmodifier,
fishingxpmodifier, unarmedxpmodifier, herbalismxpmodifier,
excavationxpmodifier, archeryxpmodifier, swordsxpmodifier,
axesxpmodifier, acrobaticsxpmodifier;
axesxpmodifier, acrobaticsxpmodifier, animalXP, creeperXP, skeletonXP, spiderXP, ghastXP, slimeXP,
zombieXP, pigzombieXP, endermanXP, cavespiderXP, silverfishXP, blazeXP, magmacubeXP, enderdragonXP;
public static List<ExcavationTreasure> excavationFromDirt = new ArrayList<ExcavationTreasure>();
public static List<ExcavationTreasure> excavationFromGrass = new ArrayList<ExcavationTreasure>();
@ -421,6 +422,21 @@ public class LoadProperties {
aDisplayNames = readBoolean("Commands.a.Display_Names", true);
pDisplayNames = readBoolean("Commands.p.Display_Names", true);
animalXP = readDouble("Experience.Combat.Multiplier.Animals", 1.0);
creeperXP = readDouble("Experience.Combat.Multiplier.Creeper", 4.0);
skeletonXP = readDouble("Experience.Combat.Multiplier.Skeleton", 2.0);
spiderXP = readDouble("Experience.Combat.Multiplier.Spider", 3.0);
ghastXP = readDouble("Experience.Combat.Multiplier.Ghast", 3.0);
slimeXP = readDouble("Experience.Combat.Multiplier.Slime", 2.0);
zombieXP = readDouble("Experience.Combat.Multiplier.Zombie", 2.0);
pigzombieXP = readDouble("Experience.Combat.Multiplier.Pig_Zombie", 3.0);
endermanXP = readDouble("Experience.Combat.Multiplier.Enderman", 2.0);
cavespiderXP = readDouble("Experience.Combat.Multiplier.Cave_Spider", 3.0);
silverfishXP = readDouble("Experience.Combat.Multiplier.Silverfish", 3.0);
blazeXP = readDouble("Experience.Combat.Multiplier.Blaze", 3.0);
magmacubeXP = readDouble("Experience.Combat.Multiplier.Magma_Cube", 2.0);
enderdragonXP = readDouble("Experience.Combat.Multiplier.Ender_Dragon", 8.0);
// Load treasures
Map<String, Treasure> treasures = new HashMap<String, Treasure>();

View File

@ -343,12 +343,4 @@ public class mcEntityListener implements Listener
}
}
}
public boolean isPlayer(Entity entity){
if (entity instanceof Player) {
return true;
} else{
return false;
}
}
}

View File

@ -223,7 +223,22 @@ Experience:
Animal_Taming:
Wolf: 250
Milking: 50
Combat:
Multiplier:
Animals: 1.0
Creeper: 4.0
Skeleton: 2.0
Spider: 3.0
Zombie: 2.0
Pig_Zombie: 3.0
Enderman: 2.0
Cave_Spider: 3.0
Silverfish: 3.0
Blaze: 3.0
Magma_Cube: 2.0
Ender_Dragon: 8.0
Slime: 2.0
Ghast: 3.0
#
# Settings for Fishing
###