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

Help with Magic effect limit

Pawcio6

Member
Joined
Sep 26, 2009
Messages
143
Solutions
4
Reaction score
15
Hello
I work on TFS 0.3.6 and latest otclient.I changed in server side all uint8_t to uint16_t in " addMagicEffect " and " sendMagicEffect " and removed limit with magic_effect_last but still cant view more than 255 . Dont know what should i change here
Code:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint16_t type)
{
    msg->AddByte(0x83);
    msg->AddPosition(pos);
    msg->AddByte(type + 1);
}
after changing first addbyte any magic effects dont show , tried edit second addbyte to AddU16 but it dont delete the limit. I must change something in otclient source or files ? should i edit something here ?
Code:
void Game::addMagicEffect(const SpectatorVec& list, const Position& pos, uint16_t effect, bool ghostMode/* = false*/)
{
    if(ghostMode)
        return;

    Player* player = NULL;
    for(SpectatorVec::const_iterator it = list.begin(); it != list.end(); ++it)
    {
        if((player = (*it)->getPlayer()))
            player->sendMagicEffect(pos, effect);
    }
}
Please help and sorry for my poor english :D
Thank you
 
Change second byte to uint16 and on the client side make it read uint16 instead of byte.
 
can you explain to me, more information how can you do it? i really need too :(
 
Change:
PHP:
msg->AddByte(type + 1);

To:
PHP:
msg->AddU16(type + 1);

And to same change in client source.
 
all uint8_t to uint16_t in " addMagicEffect " and " sendMagicEffect "

Code:
void ProtocolGame::AddMagicEffect(NetworkMessage_ptr msg,const Position& pos, uint16_t type)
{
    msg->AddByte(0x83);
    msg->AddPosition(pos);
    msg->AddU16(type + 1);
}

otclient source change

Code:
    int effectId;
    if(g_game.getFeature(Otc::GameMagicEffectU16))
        effectId = msg->getU16();
    else
        effectId = msg->getU8();

to

Code:
    int effectId;
        effectId = msg->getU16();
 
Back
Top