diff options
Diffstat (limited to 'src/game-server/monster.cpp')
-rw-r--r-- | src/game-server/monster.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game-server/monster.cpp b/src/game-server/monster.cpp index 34920b91..ec9db792 100644 --- a/src/game-server/monster.cpp +++ b/src/game-server/monster.cpp @@ -430,6 +430,19 @@ int Monster::damage(Actor *source, const Damage &damage) KILLSTEAL_PROTECTION_TIME); } } + + if (mSpecy->getDamageCallback().isValid()) + { + Script *script = ScriptManager::currentState(); + script->setMap(getMap()); + script->prepare(mSpecy->getDamageCallback()); + script->push(this); + script->push(source); + script->push(HPLoss); + // TODO: add exact damage parameters as well + script->execute(); + } + return HPLoss; } |