• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Event triggered when creating certain item on the screen.

lord vortexx

New Member
Joined
Dec 14, 2008
Messages
92
Reaction score
3
Is there any way for me to know that a certain item has been played on the screen?

For example, when you launch a Magic Wall, or throw rubbish underneath the player, do you have any way of knowing that?

Thank you so much
 
onAddItem, movements, I suppose is the one you're looking for
 
There is no event that is triggered specially for the creation of an item on the map.
However, you should be able to register a listener to ProtocolGame.onOpcode (https://github.com/edubart/otclient...6964635d/src/client/protocolgameparse.cpp#L55) to catch the opcode Proto::GameServerCreateOnMap and parse it in lua. Afterwards return false so as to let the client parse the opcode as well.

Otherwise you could add a event to Map::addThing using g_lua.callGlobalField or callLuaField.
 
Could you give me an example? I tried to add in the map.cpp following other calls, but without success, error at the time of compiling.
 
Back
Top