|
|
|
|
@ -37,11 +37,34 @@ public class VoidDagger extends LOTRItemDagger {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
public void onKillEntity(EntityLivingBase entityKilled, EntityLivingBase killer) {
|
|
|
|
|
if (killer instanceof EntityPlayer) {
|
|
|
|
|
EntityPlayer player = (EntityPlayer) killer;
|
|
|
|
|
LOTRFaction faction = getFaction(player);
|
|
|
|
|
entityKilled.worldObj.playSoundAtEntity(player, "mob.zombie.unfect", 1F,1F);
|
|
|
|
|
|
|
|
|
|
// God forgive me for a million If Statements instead of a Switch Case
|
|
|
|
|
if (!entityKilled.worldObj.isRemote && entityKilled instanceof EntityPlayer) {
|
|
|
|
|
CorruptMan entity = new CorruptMan(entityKilled.worldObj);
|
|
|
|
|
entity.copyLocationAndAnglesFrom(entityKilled);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
|
ItemStack armor = entityKilled.getEquipmentInSlot(i + 1); // Armor slots
|
|
|
|
|
entity.setCurrentItemOrArmor(i + 1, armor);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ItemStack mainWeapon = ((LOTREntityMan) entityKilled).npcItemsInv.getMeleeWeapon(); // Main hand weapon
|
|
|
|
|
entity.npcItemsInv.setIdleItem(mainWeapon);
|
|
|
|
|
entity.npcItemsInv.setMeleeWeapon(mainWeapon);
|
|
|
|
|
entity.setHealth(20);
|
|
|
|
|
entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 9999, 0));
|
|
|
|
|
entity.setCustomNameTag(((EntityPlayer) entityKilled).getDisplayName());
|
|
|
|
|
|
|
|
|
|
entityKilled.worldObj.removeEntity(entityKilled);
|
|
|
|
|
entity.onSpawnWithEgg((IEntityLivingData) null);
|
|
|
|
|
|
|
|
|
|
entityKilled.worldObj.spawnEntityInWorld(entity);
|
|
|
|
|
entityKilled.worldObj.playAuxSFXAtEntity(null, 1016, (int) entity.posX, (int) entity.posY, (int) entity.posZ, 0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!entityKilled.worldObj.isRemote && entityKilled instanceof LOTREntityOrc) {
|
|
|
|
|
CorruptOrc corruptOrc = new CorruptOrc(entityKilled.worldObj);
|
|
|
|
|
corruptOrc.copyLocationAndAnglesFrom(entityKilled);
|
|
|
|
|
@ -86,7 +109,6 @@ public class VoidDagger extends LOTRItemDagger {
|
|
|
|
|
entityKilled.worldObj.spawnEntityInWorld(entity);
|
|
|
|
|
entityKilled.worldObj.playAuxSFXAtEntity(null, 1016, (int) entity.posX, (int) entity.posY, (int) entity.posZ, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (entityKilled instanceof LOTREntityHobbit) {
|
|
|
|
|
CorruptHobbit entity = new CorruptHobbit(entityKilled.worldObj);
|
|
|
|
|
entity.copyLocationAndAnglesFrom(entityKilled);
|
|
|
|
|
|