From b9b3d88b23d15bf8bd7e1b372be630da192236b9 Mon Sep 17 00:00:00 2001 From: Luan Santos Date: Fri, 29 Sep 2023 23:36:53 -0700 Subject: [PATCH] fix: add back missing method (#1655) --- data/libs/functions/creature.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/data/libs/functions/creature.lua b/data/libs/functions/creature.lua index ec4aa41c5bd..d43a31f287d 100644 --- a/data/libs/functions/creature.lua +++ b/data/libs/functions/creature.lua @@ -223,3 +223,14 @@ function Creature.getKillers(self, onlyPlayers) end return killers end + +function Creature:addEventStamina(target) + local player = self:getPlayer() + local monster = target:getMonster() + if player and monster and monster:getName() == staminaBonus.target then + local playerId = player:getId() + if not staminaBonus.eventsTrainer[playerId] then + staminaBonus.eventsTrainer[playerId] = addEvent(addStamina, staminaBonus.period, playerId) + end + end +end