From 81a9c02dcf02d3c43819d4000c78578fa615f650 Mon Sep 17 00:00:00 2001 From: Marco Date: Fri, 1 Mar 2024 02:15:49 -0300 Subject: [PATCH] refactor: white deer scripts to core --- .../scripts/creaturescripts/monster/white_deer_death.lua | 4 ++-- .../scripts/creaturescripts/monster/white_deer_scouts.lua | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) rename data-otservbr-global/scripts/creaturescripts/monster/white_deer.lua => data/scripts/creaturescripts/monster/white_deer_death.lua (90%) rename data-otservbr-global/scripts/creaturescripts/monster/white_deer_scout.lua => data/scripts/creaturescripts/monster/white_deer_scouts.lua (81%) diff --git a/data-otservbr-global/scripts/creaturescripts/monster/white_deer.lua b/data/scripts/creaturescripts/monster/white_deer_death.lua similarity index 90% rename from data-otservbr-global/scripts/creaturescripts/monster/white_deer.lua rename to data/scripts/creaturescripts/monster/white_deer_death.lua index 5fff12eaad4..cc9c9377a6e 100644 --- a/data-otservbr-global/scripts/creaturescripts/monster/white_deer.lua +++ b/data/scripts/creaturescripts/monster/white_deer_death.lua @@ -1,11 +1,11 @@ local config = { - -- ordered by chance, the last chance being 100 { chance = 30, monster = "Enraged White Deer", message = "The white deer summons all his strength and turns to fight!" }, { chance = 100, monster = "Desperate White Deer", message = "The white deer desperately tries to escape!" }, } local whiteDeerDeath = CreatureEvent("WhiteDeerDeath") -function whiteDeerDeath.onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) + +function whiteDeerDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified) local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true diff --git a/data-otservbr-global/scripts/creaturescripts/monster/white_deer_scout.lua b/data/scripts/creaturescripts/monster/white_deer_scouts.lua similarity index 81% rename from data-otservbr-global/scripts/creaturescripts/monster/white_deer_scout.lua rename to data/scripts/creaturescripts/monster/white_deer_scouts.lua index 8466df46af7..214c0ad5269 100644 --- a/data-otservbr-global/scripts/creaturescripts/monster/white_deer_scout.lua +++ b/data/scripts/creaturescripts/monster/white_deer_scouts.lua @@ -1,5 +1,6 @@ local whiteDeerScoutsDeath = CreatureEvent("WhiteDeerScoutsDeath") -function whiteDeerScoutsDeath.onDeath(creature, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified) + +function whiteDeerScoutsDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified) local targetMonster = creature:getMonster() if not targetMonster or targetMonster:getMaster() then return true @@ -16,6 +17,7 @@ function whiteDeerScoutsDeath.onDeath(creature, corpse, lasthitkiller, mostdamag targetMonster:say("The elves came too late to save the deer, however they might avenge it.", TALKTYPE_MONSTER_SAY) end + return true end whiteDeerScoutsDeath:register()