Browse Source

NPCs in buildings show correct spawn times and progress

master
FatBoy-DOTC 2 years ago
parent
commit
76f3d2599b
  1. 5
      src/engine/net/client/msg/ManageCityAssetsMsg.java
  2. 906
      src/engine/net/client/msg/ManageNPCMsg.java

5
src/engine/net/client/msg/ManageCityAssetsMsg.java

@ -744,8 +744,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg { @@ -744,8 +744,9 @@ public class ManageCityAssetsMsg extends ClientNetMsg {
if (!npcHire.isAlive()){
writer.put((byte) 1); // 1 SHOWs respawning
writer.putInt(10); // Seconds in respawn.
writer.putInt(20);
int respawnRemaining = (int)(((Mob)npcHire).deathTime + ((Mob)npcHire).spawnTime * 1000 - System.currentTimeMillis()) / 1000;
writer.putInt(respawnRemaining); // Seconds in respawn remaining.
writer.putInt(((Mob)npcHire).spawnTime); // max seconds for respawn
}
else
writer.put((byte)0);

906
src/engine/net/client/msg/ManageNPCMsg.java

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save