Skip to content

Commit

Permalink
feat: add chance to drop soul prism
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipePaluco committed Dec 7, 2024
1 parent 71e5a78 commit c61916e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
7 changes: 4 additions & 3 deletions data-otservbr-global/lib/others/soulpit.lua
Original file line number Diff line number Diff line change
@@ -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)",
Expand Down
17 changes: 12 additions & 5 deletions data/scripts/eventcallbacks/monster/ondroploot_soul_core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit c61916e

Please sign in to comment.