Advertisement
Corosus

Untitled

Nov 14th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.15 KB | None | 0 0
  1. public void playerKillEvent(EntityPlayer player, Entity killed) {
  2.        
  3.         int points = 20;
  4.        
  5.         if (player.username.contains("fakePlayer")) {
  6.             int ammoID = 0;
  7.             int giveAmount = 0;
  8.             if (player.inventory.mainInventory[1] != null && player.inventory.mainInventory[1].getItem() instanceof ItemGun) {
  9.                 ammoID = ((ItemGun)player.inventory.mainInventory[1].getItem()).ammoType.ordinal();
  10.                 if (player.worldObj.rand.nextInt(8) == 0) {
  11.                     giveAmount = ((ItemGun)player.inventory.mainInventory[1].getItem()).magSize * 2;
  12.                 }
  13.             }
  14.             ZCUtil.setAmmoData(player.username, ammoID, giveAmount + ZCUtil.getAmmoData(player.username, ammoID));
  15.            
  16.             c_EnhAI ent = (c_EnhAI)c_CoroAIUtil.playerToAILookup.get(player.username);
  17.             if (ent != null) {
  18.                 JobBase jb = ent.job.getJobClass();
  19.                 if (jb instanceof JobProtect) {
  20.                     String owner = ((JobProtect)jb).playerName;
  21.                     if (owner != null && owner.length() > 0) {
  22.                         EntityPlayer ownerPlayer = player.worldObj.getPlayerEntityByName(owner);
  23.                         if (ownerPlayer != null) {
  24.                             givePoints(ownerPlayer, points / 2);
  25.                         }
  26.                     }
  27.                 }
  28.             }
  29.         } else {
  30.             givePoints(player, points);
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement