Implement rudimentary NPC scripting framework and Lord Fuse boss fight

This commit is contained in:
2020-12-15 23:16:18 +01:00
parent 3359ca0c3e
commit d25e7ca4fc
3 changed files with 76 additions and 0 deletions

View File

@@ -404,6 +404,11 @@ void MobManager::killMob(CNSocket *sock, Mob *mob) {
// delay the despawn animation
mob->despawned = false;
// fire any triggered events
for (NPCEvent& event : NPCManager::NPCEvents)
if (event.trigger == ON_KILLED && event.npcType == mob->appearanceData.iNPCType)
event.handler(sock, mob);
auto it = TransportManager::NPCQueues.find(mob->appearanceData.iNPC_ID);
if (it == TransportManager::NPCQueues.end() || it->second.empty())
return;