otland / forgottenserver

A free and open-source MMORPG server emulator written in C++
https://otland.net
GNU General Public License v2.0
1.55k stars 1.04k forks source link

Fix creature icons #4746

Closed ArturKnopik closed 3 weeks ago

ArturKnopik commented 4 weeks ago

Pull Request Prelude

Changes Proposed

Add monster icon when creature appears on the screen

Issues addressed:

Creatures with icons when appears on screen have no icons

How test:

1) create monster 2) add icons to monster 3) move 20 tile away from monster 4) go back 5) icons are still visible

local test = Action()

function test.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local m = Game.createMonster("Rat", player:getPosition())
    m:setSpecialIcon(5,1)
    m:setIcon(CREATURE_ICON_PIGEON,1)
    m:setIcon(CREATURE_ICON_QUESTION,1)
    return true
end

test:id(45595)
test:register()