Skip to content

Commit

Permalink
fix: gem atelier drop loot
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Jan 26, 2024
1 parent 28dbaef commit fc72bff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion data/libs/functions/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ function Player.sendWeatherEffect(self, groundEffect, fallEffect, thunderEffect)
if topCreature and topCreature:isPlayer() and topCreature:getAccountType() < ACCOUNT_TYPE_SENIORTUTOR then
position:sendMagicEffect(CONST_ME_BIGCLOUDS, self)
doTargetCombatHealth(0, self, COMBAT_ENERGYDAMAGE, -weatherConfig.minDMG, -weatherConfig.maxDMG, CONST_ME_NONE)
--self:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You were hit by lightning and lost some health.")
end
end
end
Expand Down
14 changes: 14 additions & 0 deletions data/scripts/eventcallbacks/monster/ondroploot_gem_atelier.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
local callback = EventCallback()

function callback.monsterOnDropLoot(monster, corpse)
if not monster or not corpse then
return
end
local player = Player(corpse:getCorpseOwner())
if not player or not player:canReceiveLoot() then
return
end
corpse:addLoot(monster:generateGemAtelierLoot())
end

callback:register()
3 changes: 2 additions & 1 deletion data/scripts/reward_chest/boss_death.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ function bossDeath.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUn
rolls = math.floor(rolls)
end

local playerLoot = monsterType:getBossReward(lootFactor, _ == 1, false, {})
local playerLoot = creature:generateGemAtelierLoot()
playerLoot = monsterType:getBossReward(lootFactor, _ == 1, false, playerLoot)
for _ = 2, rolls do
playerLoot = monsterType:getBossReward(lootFactor, false, true, playerLoot)
end
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/talkactions/god/zones.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function zones.onSay(player, words, param)
local params = string.split(param, ",")
local cmd = params[1]
if not cmd then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Command not found.")
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Command not found.")
return true
end

Expand Down

0 comments on commit fc72bff

Please sign in to comment.