Skip to content

Commit

Permalink
Merge branch 'feat/soulpit' of https://github.com/opentibiabr/canary
Browse files Browse the repository at this point in the history
…into feat/soulpit
  • Loading branch information
phacUFPE committed Dec 9, 2024
2 parents 384f35d + c61916e commit e68559d
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,9 +1,10 @@
SoulPit = {
registeredMonstersSpell = {},
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 e68559d

Please sign in to comment.