One possible solution would change those functions in the client side to remove the extra text ' [.*]' before execute the action, or a better approach would be write the level on screen, in the position that you want in the function (client source code):
src/client/creature.cpp
C++:
void Creature:drawInformation
I did something similar in my client (OTCv8), but my goal was show the reset level from my players, the problem is that you must change your TFS too, in order to send the new information to the client:
View attachment 76172
I will post my code here, if you want to change it to level, idk if it is the best way to do it, but here it is:
src/client/creature.h
C++:
void setReset(uint32 value);
void resetInformationColor() { m_useCustomInformationColor = false; setHealthPercent(getHealthPercent()); }
uint32 m_reset;
CachedText m_resetCache;
src/client/protocolgameparse.cpp
C++:
CreaturePtr ProtocolGame::getCreature(const InputMessagePtr& msg, int type)
{
...
if (g_game.getFeature(Otc::GameTibia12Protocol) && creatureType == Proto::CreatureTypeSummonOwn)
msg->getU32(); // master
std::string name = g_game.formatCreatureName(msg->getString());
uint resets = msg->getU32();
...
if (creature) {
creature->setId(id);
creature->setName(name);
if (resets && resets > 0) {
creature->setReset(resets);
}
g_map.addCreature(creature);
}
...
Just add the level/reset code
uint resets = msg->getU32();
after the
std::string name = g_game.formatCreatureName(msg->getString());
and the code:
if (resets && resets > 0) { creature->setReset(resets); }
after
creature->setName(name);
.
And finally change the:
src/client/creature.cpp
Search for this:
C++:
m_nameCache.setFont(g_fonts.getFont("verdana-11px-rounded"));
m_nameCache.setAlign(Fw::AlignTopCenter);
And add this code after:
C++:
m_resetCache.setFont(g_fonts.getFont("verdana-11px-rounded"));
m_resetCache.setAlign(Fw::AlignTopCenter);
Then search for this:
C++:
textRect.moveBottomCenter(textCenter);
m_titleCache.draw(textRect, m_titleColor);
}
And add this code after:
[CODE=cpp]
if (m_resetCache.hasText()) {
Size titleSize = m_resetCache.getTextSize();
textRect.setSize(titleSize);
Rect extraTextRect = Rect(textRect.topLeft().x - (textRect.width() + 2), textRect.topLeft().y, titleSize);
m_resetCache.draw(extraTextRect, fillColor);
}
And finally search for this:
C++:
void Creature::setName(const std::string& name)
{
m_nameCache.setText(name);
m_name = name;
}
And add this code after:
[CODE=cpp]
void Creature::setReset(uint32 reset)
{
m_resetCache.setText(stdext::format("[%i]", reset));
m_reset = reset;
}
Você deve alterar seu TFS para enviar as novas informações também, aí está o meu exemplo:
SRC/ProtocolGame.cpp
[CÓDIGO]///// Adicionar mensagens comuns
void ProtocolGame::AddCreature(NetworkMessage& msg, const Creature* criatura, bool conhecido, uint32_t remover)
{
CreatureType_t creatureType = criatura->getType();
const Player* otherPlayer = criatura->getPlayer();
se (conhecido) {
msg.add<uint16_t>(0x62);
msg.add<uint32_t>(criatura->getID());
} else {
msg.add<uint16_t>(0x61);
msg.add<uint32_t>(remover);
msg.add<uint32_t>(criatura->getID());
msg.addByte(creatureType);
uint32_t resets = 0;
if (otherPlayer && otherPlayer->getReset() > 0) {
msg.addString(creature->getName());
resets = otherPlayer->getReset();
}
senão {
msg.addString(creature->getName());
}
msg.add<uint32_t>(redefinições);
}[/CÓDIGO]
Observe que adicionei este código:
C++:
uint32_t resets = 0;
if (otherPlayer && otherPlayer->getReset() > 0) {
msg.addString(creature->getName());
resets = otherPlayer->getReset();
}
senão {
msg.addString(creature->getName());
}
msg.add<uint32_t>(redefinições); [/CÓDIGO]
[/QUOTE]
amigo, meu sistema de reset é por armazenamento > 378378!! como seria? Estou tentando, mas não consigo :(