We need to supply more live info about the NPCs, so we can do more cool stuff.
Need Input
Seeing NPCs suddenly be dead isn’t very interesting; we want to see them take damage, know who they’re fighting, etc. So I made a quick laundry list of NPC details we should be able to track:
So out with the NPCLocation table, in with the LiveNPC table. I replaced the necessary logic, pulling what I needed from the NPC and Character classes. Lots of cut-paste-edit, with a couple of interesting bits:
firstActiveRound isn’t a concept inside of the server code, but we can track it this way: in the SQL, when a new NPC needs to be inserted, save the firstActiveRound as the same as the lastActiveRound (which will be the current
round); for updates, don’t touch it.
// Save live NPC dataif(Character.NPCList.Contains(ch))DAL.DBNPC.SaveLiveNpc(npc);
I wanted to track dead NPCs, as long as they were still in the world, to see if there are any cases where they stick around while dead. So rather than checking IsDead, I have to see if they’ve been removed from the global
NPC list yet.
Very Interesting
Matching Client
Of course, now that we’ve changed where the live NPC data is going, the client side will have to read from there. An easy change: