mehah / otclient

An alternative tibia client for otserv written in C++20 and Lua, made with a modular system that uses lua scripts for ingame interface and functionality, making otclient flexible and easy to customize
Other
245 stars 178 forks source link

Vip list group #730

Open Riverlance opened 3 months ago

Riverlance commented 3 months ago

Priority

Missing Content

Area

What is missing?

image

The feature Otc::GameVipGroups is not implemented, as shown below:

image image

Code of Conduct

luanluciano93 commented 3 months ago

Can you explain better? the feature is automatically activated in versions 12+ https://github.com/mehah/otclient/blob/11cc1536ebd9b39b4bb77cfb7c544e5d28f945b3/modules/game_features/features.lua#L184

Riverlance commented 3 months ago

Can you explain better? the feature is automatically activated in versions 12+

https://github.com/mehah/otclient/blob/11cc1536ebd9b39b4bb77cfb7c544e5d28f945b3/modules/game_features/features.lua#L184

Sure. It is activated indeed, although it is not implemented.

When you write lines like:

msg->getU8(); // Group ID
msg->getString(); // Group name
msg->getU8(); // Can edit group? (bool)

You are receiving data from server about vip groups, but doing nothing with them. You need to assign them to variables, then use into a function that should pass through a Lua callback which will implement the visual of groups on Vip List mini window. See id, name, status, desc, iconId, notifyLogin used on g_game.processVipAdd to see how it should be done.


  1. The correct would be something like myVariable = msg->getU8();, not just msg->getU8(); without signing it to a variable nor using it.
  2. And then using myVariable in g_game.processVipAdd (in case of ProtocolGame::parseVipAdd) or in g_game.processVipStateChange (in case of ProtocolGame::parseVipLogout).
  3. Finally, it should be implemented on Lua in g_game.onAddVip (in case of g_game.processVipAdd) or in g_game.onVipStateChange (in case of g_game.processVipStateChange).
  4. Once you have the data about groups on Vip List mini window Lua module, you can use it to implement the visual in this mini window.