mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-22 05:20:05 +00:00
Added ON_COMBAT trigger
This commit is contained in:
parent
81c2a2a8b3
commit
dc6de46a1f
@ -1731,6 +1731,10 @@ void MobManager::enterCombat(CNSocket *sock, Mob *mob) {
|
||||
for (auto& pwr : MobPowers)
|
||||
if (pwr.skillType == NanoManager::SkillTable[skillID].skillType)
|
||||
pwr.handle(mob, targetData, skillID, NanoManager::SkillTable[skillID].durationTime[0], NanoManager::SkillTable[skillID].powerIntensity[0]);
|
||||
|
||||
for (NPCEvent& event : NPCManager::NPCEvents) // trigger an ON_COMBAT
|
||||
if (event.trigger == ON_COMBAT && event.npcType == mob->appearanceData.iNPCType)
|
||||
event.handler(sock, mob);
|
||||
}
|
||||
|
||||
#pragma region Mob Powers
|
||||
|
@ -12,9 +12,9 @@
|
||||
|
||||
#define RESURRECT_HEIGHT 400
|
||||
|
||||
// placeholder; there's only one trigger type right now
|
||||
enum Trigger {
|
||||
ON_KILLED
|
||||
ON_KILLED,
|
||||
ON_COMBAT
|
||||
};
|
||||
|
||||
typedef void (*NPCEventHandler)(CNSocket*, BaseNPC*);
|
||||
|
Loading…
Reference in New Issue
Block a user