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

Compiling TFS 1.3 + Client with more effect than 255

Icaraii

Well-Known Member
Joined
Jan 5, 2020
Messages
469
Solutions
1
Reaction score
58
Hi, I know it's a lot to ask, but does anyone have a compiled TFS 1.3 and a client that can support more than 255 effects to share with the community?

I have a custom server and at this server I made 504 different spells sprites, however the client only goes to 255. I'm terrible at compiling, I've tried to compile the TFS 1.3 and the otclient, but it didn't work.

I've got a lot of scripts for the TFS 1.3, client version 10.98 and not being able to solve this problem I either going to lose the scripts or the sprites.
 
IN OTC active
Lua:
g_game.enableFeature(GameMagicEffectU16)

In Server
remplace all uint8_t to uint16_t.
in this archives

  • protocolgame.h
  • protocolgame.cpp
  • player.h
  • luascript.cpp
  • game.h
  • game.cpp
  • const.h
  • combat.h
  • combat.cpp


example

void Game::addMagicEffect(const Position& pos, uint8_t effect)
to
void Game::addMagicEffect(const Position& pos, uint16_t effect)

remplace here

Code:
params.impactEffect = static_cast<uint8_t>(value);
uint8_t impactEffect = CONST_ME_NONE;
enum MagicEffectClasses : uint8_t {
void Game::addMagicEffect(const Position& pos, uint8_t effect)
void Game::addMagicEffect(const SpectatorVec& spectators, const Position& pos, uint8_t effect)
        void addMagicEffect(const Position& pos, uint8_t effect);
        static void addMagicEffect(const SpectatorVec& spectators, const Position& pos, uint8_t effect);
    params.impactEffect = getNumber<uint8_t>(L, 7);
    params.impactEffect = getNumber<uint8_t>(L, 6);
void sendMagicEffect(const Position& pos, uint8_t type) const {
void sendMagicEffect(const Position& pos, uint8_t type);
Code:
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type)

msg.addByte(type); to msg.add<uint16_t>(type);
 
Last edited:
IN OTC active
Lua:
g_game.enableFeature(GameMagicEffectU16)

In Server
remplace all uint8_t to uint16_t.
in this archives

  • protocolgame.h
  • protocolgame.cpp
  • player.h
  • luascript.cpp
  • game.h
  • game.cpp
  • const.h
  • combat.h
  • combat.cpp


example



remplace here

Code:
params.impactEffect = static_cast<uint8_t>(value);
uint8_t impactEffect = CONST_ME_NONE;
enum MagicEffectClasses : uint8_t {
void Game::addMagicEffect(const Position& pos, uint8_t effect)
void Game::addMagicEffect(const SpectatorVec& spectators, const Position& pos, uint8_t effect)
        void addMagicEffect(const Position& pos, uint8_t effect);
        static void addMagicEffect(const SpectatorVec& spectators, const Position& pos, uint8_t effect);
    params.impactEffect = getNumber<uint8_t>(L, 7);
    params.impactEffect = getNumber<uint8_t>(L, 6);
void sendMagicEffect(const Position& pos, uint8_t type) const {
void sendMagicEffect(const Position& pos, uint8_t type);
Code:
void ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type)

msg.addByte(type); to msg.add<uint16_t>(type);
I'm compiling it now, but where is this part?

Lua:
params.impactEffect = static_cast<uint8_t>(value);
uint8_t impactEffect = CONST_ME_NONE;
enum MagicEffectClasses : uint8_t {
void Game::addMagicEffect(const Position& pos, uint8_t effect)
void Game::addMagicEffect(const SpectatorVec& spectators, const Position& pos, uint8_t effect)
        void addMagicEffect(const Position& pos, uint8_t effect);
        static void addMagicEffect(const SpectatorVec& spectators, const Position& pos, uint8_t effect);
    params.impactEffect = getNumber<uint8_t>(L, 7);
    params.impactEffect = getNumber<uint8_t>(L, 6);
void sendMagicEffect(const Position& pos, uint8_t type) const {
void sendMagicEffect(const Position& pos, uint8_t type);

And should I replace the code above for this one:

Code:
oid ProtocolGame::sendMagicEffect(const Position& pos, uint8_t type)

msg.addByte(type); to msg.add<uint16_t>(type);

Or should I just replace the unit8_t to unit16_t?
 
1.- but where is this part?
  • protocolgame.h
  • protocolgame.cpp
  • player.h
  • luascript.cpp
  • game.h
  • game.cpp
  • const.h
  • combat.h
  • combat.cpp
look for
an remplace square red for uint16_t

1691328101107.png

here
1691328138476.png
 
Last edited:
1.- but where is this part?
  • protocolgame.h
  • protocolgame.cpp
  • player.h
  • luascript.cpp
  • game.h
  • game.cpp
  • const.h
  • combat.h
  • combat.cpp
look for
an remplace square red for uint16_t

View attachment 77311

here
View attachment 77312
I've opened all the files you listed and replace all unit8_t to unit16_t. When I'm done compiling I'll let you know if I run into any issue, thanks.
Post automatically merged:

1.- but where is this part?
  • protocolgame.h
  • protocolgame.cpp
  • player.h
  • luascript.cpp
  • game.h
  • game.cpp
  • const.h
  • combat.h
  • combat.cpp
look for
an remplace square red for uint16_t

View attachment 77311

here
View attachment 77312
I followed a video on the youtube teaching how to compile TFS. (
)

I used the TFS version on this Github (GitHub - otland/forgottenserver: A free and open-source MMORPG server emulator written in C++ (https://github.com/otland/forgottenserver))

Did everything right, changed all the unit8_t to unit16_t on the files you mentioned and follow the video just like it did, however the compilation failed.

Microsoft visual studio build log:

Do you know what I did wrong? There's a lot of messagens with "unit16_t" and I don't know if thats actually an error or just warning.
 
Last edited:
1691351250221.png1691351260210.png1691351278116.png1691351291554.png1691351302050.png
Post automatically merged:

1691351350686.png
Post automatically merged:

Sorry I don't know how to go from private to public, only 1 comment.tested in 1.5 nekiro
 
View attachment 77330View attachment 77331View attachment 77332View attachment 77333View attachment 77334
Post automatically merged:

View attachment 77335
Post automatically merged:

Sorry I don't know how to go from private to public, only 1 comment.tested in 1.5 nekiro
Should I also change :

C++:
        case COMBAT_PARAM_DISTANCEEFFECT: {
            params.distanceEffect = static_cast<uint8_t>(value);
            return true;

to:

C++:
        case COMBAT_PARAM_DISTANCEEFFECT: {
            params.distanceEffect = static_cast<uint16_t>(value);
            return true;

So I can have more distance effects as well?
Post automatically merged:

Should I change this line in const.h?

C++:
enum MagicEffectsType_t : uint8_t

to

C++:
enum MagicEffectsType_t : uint16_t
 
Last edited:
Back
Top