• 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!

C++ (tfs1.x)Otxserv3 - path_8_6 Increase limit for effects/shotEffect/health/mana/skills

milbradt

New Member
Joined
Dec 25, 2011
Messages
177
Solutions
1
Reaction score
4
Hello guys
The topic name says it all!

I tried some things, but still something is missing.

Examples:
Code:
void ProtocolGame::sendDistanceShoot(const Position& from, const Position& to, uint8_t type)
void ProtocolGame::sendDistanceShoot(const Position& from, const Position& to, uint16_t type)
-------
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type)
void ProtocolGame::sendMagicEffect(const Position& pos, uint16_t type)
-------
void ProtocolGame::AddPlayerStats(NetworkMessage& msg)
{
    msg.addByte(0xA0);

    msg.add<uint16_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint16_t>::max()));
    msg.add<uint16_t>(std::min<int32_t>(player->getMaxHealth(), std::numeric_limits<uint16_t>::max()));

    msg.add<uint32_t>(player->getFreeCapacity());

    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF));

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());

    msg.add<uint16_t>(std::min<int32_t>(player->getMana(), std::numeric_limits<uint16_t>::max()));
    msg.add<uint16_t>(std::min<int32_t>(player->getMaxMana(), std::numeric_limits<uint16_t>::max()));

    msg.addByte(std::min<uint32_t>(player->getMagicLevel(), std::numeric_limits<uint8_t>::max()));
    msg.addByte(player->getMagicLevelPercent());

    msg.addByte(player->getSoul());

    msg.add<uint16_t>(player->getStaminaMinutes());
}

for:

void ProtocolGame::AddPlayerStats(NetworkMessage& msg)
{
    msg.addByte(0xA0);

    msg.add<uint32_t>(std::min<int32_t>(player->getHealth(), std::numeric_limits<uint32_t>::max()));
    msg.add<uint32_t>(std::min<int32_t>(player->getMaxHealth(), std::numeric_limits<uint32_t>::max()));

    msg.add<uint32_t>(player->getFreeCapacity());

    msg.add<uint32_t>(std::min<uint32_t>(player->getExperience(), 0x7FFFFFFF));

    msg.add<uint16_t>(player->getLevel());
    msg.addByte(player->getLevelPercent());

    msg.add<uint32_t>(std::min<int32_t>(player->getMana(), std::numeric_limits<uint32_t>::max()));
    msg.add<uint32_t>(std::min<int32_t>(player->getMaxMana(), std::numeric_limits<uint32_t>::max()));

    msg.addByte(std::min<uint32_t>(player->getMagicLevel(), std::numeric_limits<uint16_t>::max()));
    msg.addByte(player->getMagicLevelPercent());

    msg.addByte(player->getSoul());

    msg.add<uint16_t>(player->getStaminaMinutes());
}

Up

If anyone knows just the files needed to be modified, it would be a great help.
 
Last edited by a moderator:
Increase the health and mana points?
If you had done a search before you would have found out that the client also has it's limits, you can get abit more but not much and to get that would require ALOT of edits, not just the send and parse functions.

It would be quicker to use a percentage as your health system insted, that way you won't have any limits from the client but still need to rewrite abit of code.
The client nor TFS was never designed to handle health values etc in the million if not billion range.
 
Increase the health and mana points?
If you had done a search before you would have found out that the client also has it's limits, you can get abit more but not much and to get that would require ALOT of edits, not just the send and parse functions.

It would be quicker to use a percentage as your health system insted, that way you won't have any limits from the client but still need to rewrite abit of code.
The client nor TFS was never designed to handle health values etc in the million if not billion range.

Yes
But I removed the limit by modifying the client with a dll.
So you needed to know the files you would need to modify in 1.x sources

In 0.x sources the way to do this was like this:
protocolgame.cpp:
Replace:
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type)
for:
void ProtocolGame::sendMagicEffect(const Position& pos, uint16_t type)
Replace:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint8_t type) { msg->AddByte(0x83); msg->AddPosition(pos); msg->AddByte(type + 1); }
for:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint16_t type) { msg->AddByte(0x83); msg->AddPosition(pos); msg->AddU16(type + 1); }
protocolgame.h:
Replace:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint8_t type);
for:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint16_t type);
Replace:
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type);
for:
void ProtocolGame::sendMagicEffect(const Position& pos, uint16_t type);
game.cpp:
Replace:
void Game::addMagicEffect(const Position& pos, uint8_t effect, bool ghostMode /* = false */)
for:
void Game::addMagicEffect(const Position& pos, uint16_t effect, bool ghostMode /* = false */)
game.h:
Replace:
void Game::addMagicEffect(const Position& pos, uint8_t effect, bool ghostMode /* = false */);
for:
void Game::addMagicEffect(const Position& pos, uint16_t effect, bool ghostMode /* = false */);
player.h:
Replace:
void sendMagicEffect(const Position& pos, uint8_t type) const
For:
void sendMagicEffect(const Position& pos, uint16_t type) const
spectators.h
 
Last edited:
Yes
But I removed the limit by modifying the client with a dll.
So you needed to know the files you would need to modify in 1.x sources

In 0.x sources the way to do this was like this:
protocolgame.cpp:
Replace:
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type)
for:
void ProtocolGame::sendMagicEffect(const Position& pos, uint16_t type)
Replace:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint8_t type) { msg->AddByte(0x83); msg->AddPosition(pos); msg->AddByte(type + 1); }
for:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint16_t type) { msg->AddByte(0x83); msg->AddPosition(pos); msg->AddU16(type + 1); }
protocolgame.h:
Replace:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint8_t type);
for:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint16_t type);
Replace:
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type);
for:
void ProtocolGame::sendMagicEffect(const Position& pos, uint16_t type);
game.cpp:
Replace:
void Game::addMagicEffect(const Position& pos, uint8_t effect, bool ghostMode /* = false */)
for:
void Game::addMagicEffect(const Position& pos, uint16_t effect, bool ghostMode /* = false */)
game.h:
Replace:
void Game::addMagicEffect(const Position& pos, uint8_t effect, bool ghostMode /* = false */);
for:
void Game::addMagicEffect(const Position& pos, uint16_t effect, bool ghostMode /* = false */);
player.h:
Replace:
void sendMagicEffect(const Position& pos, uint8_t type) const
For:
void sendMagicEffect(const Position& pos, uint16_t type) const
spectators.h

Im not sure what you need to edit or not, but I bet it's more than that.
You need to use some tool I think VS has one, where you can find all references to those functions and update them from there.
 
Back
Top