|
|
@ -615,7 +615,6 @@ public class ManageNPCMsg extends ClientNetMsg { |
|
|
|
writer.putInt(inventory.size()); //placeholder for item cnt
|
|
|
|
writer.putInt(inventory.size()); //placeholder for item cnt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Item i : inventory) { |
|
|
|
for (Item i : inventory) { |
|
|
|
|
|
|
|
|
|
|
|
Item.serializeForClientMsgWithoutSlot(i, writer); |
|
|
|
Item.serializeForClientMsgWithoutSlot(i, writer); |
|
|
@ -763,27 +762,46 @@ public class ManageNPCMsg extends ClientNetMsg { |
|
|
|
writer.putInt(0); |
|
|
|
writer.putInt(0); |
|
|
|
writer.putInt(1); |
|
|
|
writer.putInt(1); |
|
|
|
writer.putInt(1); |
|
|
|
writer.putInt(1); |
|
|
|
writer.put((byte) 0); |
|
|
|
|
|
|
|
long curTime = System.currentTimeMillis() / 1000; |
|
|
|
long curTime = System.currentTimeMillis() / 1000; |
|
|
|
long upgradeTime = mob.getTimeToSpawnSiege() / 1000; |
|
|
|
long upgradeTime = (mob.deathTime + (mob.spawnTime * 1000)) / 1000; |
|
|
|
long timeLife = upgradeTime - curTime; |
|
|
|
long timeLife = upgradeTime - curTime; |
|
|
|
|
|
|
|
if (upgradeTime * 1000 > System.currentTimeMillis()) { |
|
|
|
writer.putInt(900); |
|
|
|
if(mob.npcOwner.isAlive()) { |
|
|
|
writer.putInt(900); |
|
|
|
writer.put((byte) 0);//shows respawning timer
|
|
|
|
writer.putInt((int) timeLife); //time remaining?
|
|
|
|
writer.putInt(mob.spawnTime); |
|
|
|
|
|
|
|
writer.putInt(mob.spawnTime); |
|
|
|
|
|
|
|
writer.putInt((int) timeLife); //time remaining for mob that is dead
|
|
|
|
writer.putInt(0); |
|
|
|
writer.putInt(0); |
|
|
|
writer.put((byte) 0); |
|
|
|
writer.put((byte) 0); |
|
|
|
writer.putString(mob.getNameOverride().isEmpty() ? mob.getName() : mob.getNameOverride()); |
|
|
|
writer.putString(mob.getNameOverride().isEmpty() ? mob.getName() : mob.getNameOverride()); |
|
|
|
writer.put((byte) 0); |
|
|
|
writer.put((byte) 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
writer.put((byte) 0);//shows respawning timer
|
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.putInt(0); //time remaining for mob that is dead
|
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.put((byte) 0); |
|
|
|
|
|
|
|
writer.putString(mob.getNameOverride().isEmpty() ? mob.getName() : mob.getNameOverride()); |
|
|
|
|
|
|
|
writer.put((byte) 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
//nothing required for countdown for a mob that is alive
|
|
|
|
|
|
|
|
writer.put((byte) 1);//shows "Standing By"
|
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.putInt(0); |
|
|
|
|
|
|
|
writer.put((byte) 0); |
|
|
|
|
|
|
|
writer.putString(mob.getNameOverride().isEmpty() ? mob.getName() : mob.getNameOverride()); |
|
|
|
|
|
|
|
writer.put((byte) 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}catch(Exception e){ |
|
|
|
}catch(Exception e){ |
|
|
|
e.printStackTrace(); |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|