From c61916ec78f96ad2c0b988337da2fc8c714c6cf3 Mon Sep 17 00:00:00 2001 From: Felipe Paluco Date: Sat, 7 Dec 2024 09:45:13 -0300 Subject: [PATCH] feat: add chance to drop soul prism --- data-otservbr-global/lib/others/soulpit.lua | 7 ++++--- .../monster/ondroploot_soul_core.lua | 17 ++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/data-otservbr-global/lib/others/soulpit.lua b/data-otservbr-global/lib/others/soulpit.lua index 752a207f401..15ed59d7681 100644 --- a/data-otservbr-global/lib/others/soulpit.lua +++ b/data-otservbr-global/lib/others/soulpit.lua @@ -1,8 +1,9 @@ SoulPit = { SoulCoresConfiguration = { - chanceToGetSameMonsterSoulCore = 30, -- 30% - chanceToDropSoulCore = 50, -- 50% - chanceToGetOminousSoulCore = 5, -- 5% + chanceToGetSameMonsterSoulCore = 15, -- 15% + chanceToDropSoulCore = 10, -- 10% + chanceToGetOminousSoulCore = 3, -- 3% + chanceToDropSoulPrism = 8, -- 8% monsterVariationsSoulCore = { ["Horse"] = "horse soul core (taupe)", ["Brown Horse"] = "horse soul core (brown)", diff --git a/data/scripts/eventcallbacks/monster/ondroploot_soul_core.lua b/data/scripts/eventcallbacks/monster/ondroploot_soul_core.lua index eafa067bc98..aeb086cfd47 100644 --- a/data/scripts/eventcallbacks/monster/ondroploot_soul_core.lua +++ b/data/scripts/eventcallbacks/monster/ondroploot_soul_core.lua @@ -8,7 +8,7 @@ function callback.monsterOnDropLoot(monster, corpse) if not player or not player:canReceiveLoot() then return end - if monster:getMonsterForgeClassification() == FORGE_NORMAL_MONSTER then + if monster:getMonsterForgeClassification() ~= FORGE_FIENDISH_MONSTER then return end @@ -36,15 +36,22 @@ function callback.monsterOnDropLoot(monster, corpse) end if soulCoreId then - lootTable = { - [soulCoreId] = { - count = 1, - }, + lootTable[soulCoreId] = { + count = 1, } else return {} end end + + if math.random(100) < SoulPit.SoulCoresConfiguration.chanceToDropSoulPrism then + local soulPrismId = getItemIdByName("soul prism") + if soulPrismId then + lootTable[soulPrismId] = { + count = 1, + } + end + end corpse:addLoot(mType:generateLootRoll({}, lootTable, player)) end