Tweaks to SkullSplitter/SerratedStrikes

This commit is contained in:
nossr50 2012-02-14 10:33:49 -08:00
parent 441015d6a5
commit 939344816e
5 changed files with 30 additions and 42 deletions

View File

@ -358,35 +358,7 @@ public class Combat
}
}
/**
* Attempt to damage target for value dmg with reason CUSTOM
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
*/
public static void dealDamage(LivingEntity target, int dmg){
dealDamage(target, dmg, EntityDamageEvent.DamageCause.CUSTOM);
}
/**
* Attempt to damage target for value dmg with reason cause
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
* @param cause DamageCause to pass to damage event
*/
public static void dealDamage(LivingEntity target, int dmg, DamageCause cause) {
target.damage(dmg);
}
/**
* Attempt to damage target for value dmg with reason ENTITY_ATTACK with damager attacker
*
* @param target LivingEntity which to attempt to damage
* @param dmg Amount of damage to attempt to do
* @param attacker Player to pass to event as damager
*/
public static void dealDamage(LivingEntity target, int dmg, Player attacker) {
public static void dealDamage(LivingEntity target, int dmg) {
target.damage(dmg);
}

View File

@ -164,6 +164,7 @@ public class m
}
}
}
public static Integer getTier(Player player)
{
int i = player.getItemInHand().getTypeId();
@ -181,6 +182,7 @@ public class m
return 1; //UNRECOGNIZED
}
}
public static Integer getMaxDurability(Integer tier, ItemStack item)
{
int id = item.getTypeId();
@ -250,6 +252,7 @@ public class m
return health-newvalue;
}
}
public static boolean isInt(String string)
{
try
@ -262,6 +265,7 @@ public class m
}
return true;
}
public static void mcDropItem(Location location, int id)
{
if(location == null) return;
@ -270,6 +274,7 @@ public class m
ItemStack item = new ItemStack(mat, 1, (byte) 0, (byte) 0);
mcDropItem(location, item);
}
public static void mcDropItem(Location location, ItemStack itemStack) {
// We can't get the item until we spawn it and we want to make it cancellable, so we have a custom event.
McMMOItemSpawnEvent event = new McMMOItemSpawnEvent(location, itemStack);
@ -308,11 +313,7 @@ public class m
int id = is.getTypeId();
return id == 270 || id == 274 || id == 285 || id == 257 || id == 278;
}
// public boolean isGold(ItemStack is)
// {
// int id = is.getTypeId();
// return id == 283 || id == 284 || id == 285 || id == 286 || id == 294 || id == 314 || id == 315 || id == 316 || id == 317;
// }
public static void convertToMySQL()
{
if(!LoadProperties.useMySQL)
@ -525,4 +526,4 @@ public class m
}
}, 1);
}
}
}

View File

@ -69,6 +69,7 @@ public class Axes {
}
}
}
public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
{
Entity x = event.getEntity();
@ -118,6 +119,12 @@ public class Axes {
public static void applyAoeDamage(Player attacker, EntityDamageByEntityEvent event, Plugin pluginx)
{
int targets = 0;
int dmgAmount = (event.getDamage()/2);
//Setup minimum damage
if(dmgAmount < 1)
dmgAmount = 1;
if(event.getEntity() instanceof LivingEntity)
{
@ -135,6 +142,7 @@ public class Axes {
if(Party.getInstance().inSameParty(attacker, Taming.getOwner(hurrDurr, pluginx)))
continue;
}
//Damage nearby LivingEntities
if(derp instanceof LivingEntity && targets >= 1)
{
@ -154,18 +162,19 @@ public class Axes {
if(target.isDead())
continue;
if(targets >= 1 && derp.getWorld().getPVP() && !target.isDead())
if(targets >= 1 && derp.getWorld().getPVP())
{
Combat.dealDamage(target, event.getDamage() / 2, attacker);
Combat.dealDamage(target, dmgAmount);
target.sendMessage(ChatColor.DARK_RED+"Struck by CLEAVE!");
targets--;
continue;
}
}
}
else
{
LivingEntity target = (LivingEntity)derp;
Combat.dealDamage(target, event.getDamage() / 2, attacker);
Combat.dealDamage(target, dmgAmount);
targets--;
}
}

View File

@ -1119,7 +1119,7 @@ public class Fishing {
if(le instanceof Player)
return;
Combat.dealDamage(le, 1, event.getPlayer());
Combat.dealDamage(le, 1);
Location loc = le.getLocation();
/* Neutral Mobs */

View File

@ -113,6 +113,12 @@ public class Swords
{
int targets = 0;
int dmgAmount = (event.getDamage()/4);
//Setup minimum damage
if(dmgAmount < 1)
dmgAmount = 1;
if(event.getEntity() instanceof LivingEntity)
{
LivingEntity x = (LivingEntity) event.getEntity();
@ -146,7 +152,7 @@ public class Swords
continue;
if(targets >= 1 && derp.getWorld().getPVP())
{
Combat.dealDamage(target, event.getDamage() / 4, attacker);
Combat.dealDamage(target, dmgAmount);
target.sendMessage(ChatColor.DARK_RED+"Struck by Serrated Strikes!");
Users.getProfile(target).addBleedTicks(5);
targets--;
@ -159,7 +165,7 @@ public class Swords
pluginx.misc.addToBleedQue((LivingEntity)derp);
LivingEntity target = (LivingEntity)derp;
Combat.dealDamage(target, event.getDamage() / 4, attacker);
Combat.dealDamage(target, dmgAmount);
targets--;
}
}