Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight loot to quickloot #2868

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions data/libs/functions/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1154,3 +1154,10 @@ function onDeathForDamagingPlayers(creature, func)
end
end
end

function setLootHighlight(position)
position:sendMagicEffect(CONST_ME_LOOT_HIGHLIGHT)
addEvent(function()
position:removeMagicEffect(CONST_ME_LOOT_HIGHLIGHT)
end, 60000)
end
1 change: 1 addition & 0 deletions data/scripts/eventcallbacks/monster/ondroploot__base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function callback.monsterOnDropLoot(monster, corpse)
end
local existingSuffix = corpse:getAttribute(ITEM_ATTRIBUTE_LOOTMESSAGE_SUFFIX) or ""
corpse:setAttribute(ITEM_ATTRIBUTE_LOOTMESSAGE_SUFFIX, existingSuffix .. msgSuffix)
setLootHighlight(corpse:getPosition())
end

callback:register()
2 changes: 2 additions & 0 deletions src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5452,6 +5452,8 @@ void Game::playerQuickLoot(uint32_t playerId, const Position &pos, uint16_t item
}
}

g_game().removeMagicEffect(corpse->getPosition(), CONST_ME_LOOT_HIGHLIGHT);

if (pos.x == 0xffff && !browseField && !corpse->isRewardCorpse()) {
uint32_t worth = item->getWorth();
ObjectCategory_t category = getObjectCategory(item);
Expand Down
1 change: 1 addition & 0 deletions src/lua/functions/core/game/lua_enums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ void LuaEnums::initConstMeEnums(lua_State* L) {
registerEnum(L, CONST_ME_DIVINE_EMPOWERMENT);
registerEnum(L, CONST_ME_WATER_FLOATING_THRASH);
registerEnum(L, CONST_ME_AGONY);
registerEnum(L, CONST_ME_LOOT_HIGHLIGHT);
}

void LuaEnums::initConstAniEnums(lua_State* L) {
Expand Down
Loading