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

Nostalrius 7.7

Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/saveserver.lua:eek:nSay
data/talkactions/scripts/saveserver.lua:10: attempt to call field 'saveGameState' (a nil value)
stack traceback:
[C]: in function 'saveGameState'
data/talkactions/scripts/saveserver.lua:10: in function <data/talkactions/scripts/saveserver.lua:1>

hi i know its been a longtime but i get this error after doing all you say
i think u can change "Game.saveGameState()" to "saveServer()" in scripts without add sources and it may works
 
i think u can change "Game.saveGameState()" to "saveServer()" in scripts without add sources and it may works
Saving server...
Saved house items in: 3.016 s




now im trying to find any script to exchange gold/plat/crystal coins

did u think i can try any from tfs 1.2 or 1.3 since nostalrius is based on it
 
Hi all. I am new to OT hosting and generally to compiling large projects wit c++. Two days ago i managed to make the ansible script work in the basic tutorial, and I think I nearly nailed compiling this project with this repo (which i forked and made some corrections).

Here's the fork of the basic ansible script:

And here's the repo which gets pulled by the ansible script:

I noticed that it won't compile with gcc due to some flags, so I switched to clang.
Everything good until linking starts.

Code:
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["make", "-j2"], "delta": "0:02:57.619479", "end": "2023-11-07 21:58:55.429315", "msg": "non-zero return code", "rc": 2, "start": "2023-11-07 21:55:57.809836", "stderr": "/usr/bin/ld: CMakeFiles/tfs.dir/src/combat.cpp.o: in function `ValueCallback::getMinMaxValues(Player*, CombatDamage&, bool) const':\ncombat.cpp:(.text+0x4cf): undefined reference to `lua_pcallk'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/combat.cpp.o: in function `TargetCallback::onTargetCombat(Creature*, Creature*) const':\ncombat.cpp:(.text+0x2d97): undefined reference to `lua_pcallk'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::load()':\nconfigmanager.cpp:(.text+0xcb): undefined reference to `lua_pcallk'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::getGlobalBoolean(lua_State*, char const*, bool)':\nconfigmanager.cpp:(.text+0xd23): undefined reference to `lua_getglobal'\n/usr/bin/ld: configmanager.cpp:(.text+0xd6f): undefined reference to `lua_rawlen'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::getGlobalString[abi:cxx11](lua_State*, char const*, char const*)':\nconfigmanager.cpp:(.text+0xeaf): undefined reference to `lua_getglobal'\n/usr/bin/ld: configmanager.cpp:(.text+0xf33): undefined reference to `lua_rawlen'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::getGlobalNumber(lua_State*, char const*, int)':\nconfigmanager.cpp:(.text+0x103c): undefined reference to `lua_getglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::protectedCall(lua_State*, int, int)':\nluascript.cpp:(.text+0x1705): undefined reference to `lua_pcallk'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::getEvent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':\nluascript.cpp:(.text+0x1b31): undefined reference to `lua_getglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x1bdd): undefined reference to `lua_setglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::getMetaEvent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':\nluascript.cpp:(.text+0x1d57): undefined reference to `lua_getglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::getStackTrace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':\nluascript.cpp:(.text+0x2183): undefined reference to `lua_getglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x2256): undefined reference to `lua_callk'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerFunctions()':\nluascript.cpp:(.text+0x4ae5): undefined reference to `lua_setglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x4b19): undefined reference to `lua_setglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x4b4d): undefined reference to `lua_setglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x4b81): undefined reference to `lua_setglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x4bb5): undefined reference to `lua_setglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o:luascript.cpp:(.text+0x4be9): more undefined references to `lua_setglobal' follow\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::luaIsInArray(lua_State*)':\nluascript.cpp:(.text+0x51bda): undefined reference to `lua_compare'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::luaAddEvent(lua_State*)':\nluascript.cpp:(.text+0x52382): undefined reference to `lua_getglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x523b6): undefined reference to `lua_getglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x5241e): undefined reference to `lua_callk'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerGlobalVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)':\nluascript.cpp:(.text+0x52de8): undefined reference to `lua_setglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerGlobalBoolean(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':\nluascript.cpp:(.text+0x52e4d): undefined reference to `lua_setglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerGlobalMethod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int (*)(lua_State*))':\nluascript.cpp:(.text+0x52ea8): undefined reference to `lua_setglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':\nluascript.cpp:(.text+0x530b2): undefined reference to `lua_setglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)':\nluascript.cpp:(.text+0x530fa): undefined reference to `lua_getglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerMethod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int (*)(lua_State*))':\nluascript.cpp:(.text+0x53179): undefined reference to `lua_getglobal'\n/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int (*)(lua_State*))':\nluascript.cpp:(.text+0x54bfc): undefined reference to `lua_setglobal'\n/usr/bin/ld: luascript.cpp:(.text+0x54c9d): undefined reference to `lua_getglobal'\nclang: error: linker command failed with exit code 1 (use -v to see invocation)\nmake[2]: *** [CMakeFiles/tfs.dir/build.make:1239: tfs] Error 1\nmake[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/tfs.dir/all] Error 2\nmake: *** [Makefile:91: all] Error 2", "stderr_lines": ["/usr/bin/ld: CMakeFiles/tfs.dir/src/combat.cpp.o: in function `ValueCallback::getMinMaxValues(Player*, CombatDamage&, bool) const':", "combat.cpp:(.text+0x4cf): undefined reference to `lua_pcallk'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/combat.cpp.o: in function `TargetCallback::onTargetCombat(Creature*, Creature*) const':", "combat.cpp:(.text+0x2d97): undefined reference to `lua_pcallk'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::load()':", "configmanager.cpp:(.text+0xcb): undefined reference to `lua_pcallk'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::getGlobalBoolean(lua_State*, char const*, bool)':", "configmanager.cpp:(.text+0xd23): undefined reference to `lua_getglobal'", "/usr/bin/ld: configmanager.cpp:(.text+0xd6f): undefined reference to `lua_rawlen'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::getGlobalString[abi:cxx11](lua_State*, char const*, char const*)':", "configmanager.cpp:(.text+0xeaf): undefined reference to `lua_getglobal'", "/usr/bin/ld: configmanager.cpp:(.text+0xf33): undefined reference to `lua_rawlen'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/configmanager.cpp.o: in function `ConfigManager::getGlobalNumber(lua_State*, char const*, int)':", "configmanager.cpp:(.text+0x103c): undefined reference to `lua_getglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::protectedCall(lua_State*, int, int)':", "luascript.cpp:(.text+0x1705): undefined reference to `lua_pcallk'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::getEvent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':", "luascript.cpp:(.text+0x1b31): undefined reference to `lua_getglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x1bdd): undefined reference to `lua_setglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::getMetaEvent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':", "luascript.cpp:(.text+0x1d57): undefined reference to `lua_getglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::getStackTrace(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':", "luascript.cpp:(.text+0x2183): undefined reference to `lua_getglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x2256): undefined reference to `lua_callk'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerFunctions()':", "luascript.cpp:(.text+0x4ae5): undefined reference to `lua_setglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x4b19): undefined reference to `lua_setglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x4b4d): undefined reference to `lua_setglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x4b81): undefined reference to `lua_setglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x4bb5): undefined reference to `lua_setglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o:luascript.cpp:(.text+0x4be9): more undefined references to `lua_setglobal' follow", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::luaIsInArray(lua_State*)':", "luascript.cpp:(.text+0x51bda): undefined reference to `lua_compare'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::luaAddEvent(lua_State*)':", "luascript.cpp:(.text+0x52382): undefined reference to `lua_getglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x523b6): undefined reference to `lua_getglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x5241e): undefined reference to `lua_callk'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerGlobalVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)':", "luascript.cpp:(.text+0x52de8): undefined reference to `lua_setglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerGlobalBoolean(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':", "luascript.cpp:(.text+0x52e4d): undefined reference to `lua_setglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerGlobalMethod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int (*)(lua_State*))':", "luascript.cpp:(.text+0x52ea8): undefined reference to `lua_setglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerTable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':", "luascript.cpp:(.text+0x530b2): undefined reference to `lua_setglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerVariable(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double)':", "luascript.cpp:(.text+0x530fa): undefined reference to `lua_getglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerMethod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int (*)(lua_State*))':", "luascript.cpp:(.text+0x53179): undefined reference to `lua_getglobal'", "/usr/bin/ld: CMakeFiles/tfs.dir/src/luascript.cpp.o: in function `LuaScriptInterface::registerClass(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int (*)(lua_State*))':", "luascript.cpp:(.text+0x54bfc): undefined reference to `lua_setglobal'", "/usr/bin/ld: luascript.cpp:(.text+0x54c9d): undefined reference to `lua_getglobal'", "clang: error: linker command failed with exit code 1 (use -v to see invocation)", "make[2]: *** [CMakeFiles/tfs.dir/build.make:1239: tfs] Error 1", "make[1]: *** [CMakeFiles/Makefile2:86: CMakeFiles/tfs.dir/all] Error 2", "make: *** [Makefile:91: all] Error 2"]

From googling a bit it seems like a problem with lua. I checked which libs tfs 1.2 used back then but they haven't changed much. It has always been

- liblua5.2-dev
- libluajit-5.1-dev

Any tips? The reason behind is... I wanted to make this out of nostalgia for old tibia and to make it easier for everyone :)
 
Hello, community.

I'm releasing here my clone of RealOTS 7.7, it's based on TFS 1.2 and comes with everything needed to setup a true 7.7 clone, including formulas and monsters behavior, this server has been running a few times, and since I don't have purpose with it anymore, and my friends agreed with me on releasing it, well, here it is.

Please, make sure to report any issue I might have done during the upload.

TwistedScorpio/Nostalrius (https://github.com/TwistedScorpio/Nostalrius)

In a few moments I will be uploading the map editor required.
Where can I download TFS 1.2? Do you recommend still using it?
 
Where can I download TFS 1.2? Do you recommend still using it?
TFS 1.2 is 10.98 server, you can download it here:
but it's just older - more bugs, less features - version of TFS 1.4:
TFS 1.4 is already 2 years old and newer versions of TFS (1.6+) use 12+ Tibia protocol.

TFS 1.4 with some bug fixes/features and compilation working on Windows 10+/new Linuxes is on branch compilation of my repository:
 
Sorry to be a pest but would someone be able to upload a compiled Nostalrius for Windows x64 based off the latest version on the GitHub? [GitHub - Ezzz-dev/Nostalrius: Nostalrius is a 7.7 Tibia Clone Project based on The Forgotten Server 1.2 and CipSoft files. (https://github.com/Ezzz-dev/Nostalrius)]

I've been able to get a server running locally (I'm only wanting to play locally myself) using some of those pre compiled versions found on page 6 of this thread. But those versions didn't include any of the fixes related to spells cast by monsters (dragons are very tame for example).

If someone can do so and upload I'd massively appreciate it.



Once that's done I'll repay the community and write up a detailed tutorial for anyone like myself who just wants to know how to connect the database, server and website (account creation) for playing locally. I can also include my updated NPCs-- Sam and other weapon merchants now buy and sell almost all equipment available in the game at a similar price to Antica in 7.72 based off my memory. This emulates the market and allows you to profit and upgrade your equipment.

I've also been looking for handy ways to introduce a "pause" button for offline single player versions of old-school Tibia. The best I've come up with so far is to have the temple NPC sell (1gp) a modified stealth ring that lasts forever and change all the monsters in-game to not be able to see invisible characters... So whenever your dog starts barking at you for food you can equip your "pause" ring and not worry about dying AFK regardless of where you are on the map (and mentally agree with yourself not to use it to cheat). Lack of pause functionality is the main reason I can't play online Tibia anymore, too old, too much crap going on around me irl.


Thanks in advance.

-- Edit --

Thank you Ezzz, appreciate the release. Really easy to set up and is running well.
where can I find this tutorial? :D
 
Hello

I've managed to write a Dockerfile to complete build and run the source of archived repository of Nostalrius available on Github

However before building we need to change 2 things:


After that you can build and run the image above with Docker commands :)

Important to say that I had to downgrade the alpine image and some libs to versions used in the epoch this code was made
AND on the first build of this Dockerfile it will take a few minutes to complete because I had to manually download and build Boost version 1.53.0, because it was not avaliable on alpine images repos back in time.

So keep in mind that this is not intended for production environments, due to outdated versions in general

Code:
FROM alpine:3.10

RUN apk update
RUN apk upgrade
RUN apk add libzmq=4.3.3-r0 zlib=1.2.11-r1 zlib-dev=1.2.11-r1 bzip2-dev=1.0.6-r7 linux-headers=4.19.36-r0 make=4.2.1-r2 cmake=3.14.5-r0 gcc=8.3.0-r0 g++=8.3.0-r0 gmp-dev=6.1.2-r1 --repository="https://dl-cdn.alpinelinux.org/alpine/v3.10/main/"

RUN wget https://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz/download -O boost.tar.gz
RUN tar -zxf boost.tar.gz
#RUN rm -rf boost.tar.gz
WORKDIR boost_1_53_0
RUN chmod +x bootstrap.sh
RUN ./bootstrap.sh || cat bootstrap.log
RUN ./b2 --prefix=/usr/local

ENV BOOST_ROOT=/boost_1_53_0/
ENV BOOST_LIBRARYDIR=/boost_1_53_0/libs/
ENV BOOST_INCLUDEDIR=/boost_1_53_0/
ENV LUA_INCLUDE_DIR=/usr/include/luajit-2.1/

RUN apk add mariadb-dev lua-dev pugixml-dev git
RUN apk add luajit=2.1.0_beta3-r4 luajit-dev=2.1.0_beta3-r4 --repository="https://dl-cdn.alpinelinux.org/alpine/v3.10/main/"

COPY cmake /otserv/cmake/
COPY src /otserv/src/
COPY CMakeLists.txt /otserv/CMakeLists.txt

WORKDIR /otserv/src

RUN cmake ..
RUN make

RUN mv tfs ../
WORKDIR /otserv

COPY data ./data/
COPY config.lua .

EXPOSE 7171

ENTRYPOINT ./tfs

If you have a problem about sha1 cipher while server connects to MySql when running, update your password on your DB with the following statement:
ALTER USER 'username' IDENTIFIED WITH mysql_native_password BY 'password';
 
Last edited:
help visual studio 2017
C++:
1>c:\nostalrius-master\src\protocollogin.cpp(87): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\winsock2.h(1831): note: zobacz deklarację „inet_addr”
------------
1>rsa.obj : error LNK2001: nierozpoznany symbol zewnętrzny __gmpz_export
1>..\theforgottenserver.exe : fatal error LNK1120: liczba nierozpoznanych elementów zewnętrznych: 72
1>Kompilowanie projektu „theforgottenserver.vcxproj” wykonane — NIEPOWODZENIE.
========== Ponowna kompilacja: 0 zakończono powodzeniem, 1 zakończono niepowodzeniem, 0 pominięto ==========
 
I compiled it on Ubuntu 22.04 but when I enter the normal player, I can't see the NPCs.

1746551843200.webp

Has anyone experienced this?

#Solved
C++:
if (!creature->isInvisible() || (!otherPlayer && player->canSeeInvisibility())) {
 
Will check it out, thank you.

Edit
Got it to work now, thank you for that! :) Also noticed that for some reason the last item in the items.srv list doesn't get loaded by the map editor, so when I was wracking my brains on why it wasn't working with a single item I added multiple of the same item with different IDs and it worked. xD So that's how I noticed it.

My last question, then I won't bother people with any more, is how do I add the floor reset on my tiles? I see there are these blue texture on a lot of areas and can be shown/hidden in RME if I enable/disable special tiles, but I simply cannot find where to add them myself, any hints? :)
I had the same problem. Do you know exactly which items are crashing RME?
 
Honestly that was quite a while ago and I don't really remember, wish I could be more helpful. >_<
 
I just dont remember if it used to be like that, but i saw some youtube and it seems that he dont gain defense for run.

C++:
int32_t Monster::getDefense()
{
    int32_t totalDefense = mType->info.defense + 1;
    int32_t defenseSkill = mType->info.skill;

    /*fightMode_t attackMode = FIGHTMODE_BALANCED;

    if ((followCreature || !attackedCreature) && earliestAttackTime <= OTSYS_TIME()) {
        attackMode = FIGHTMODE_DEFENSE;
    }

    if (attackMode == FIGHTMODE_ATTACK) {
        totalDefense -= 4 * totalDefense / 10;
    } else if (attackMode == FIGHTMODE_DEFENSE) {
        totalDefense += 8 * totalDefense / 10;
    }*/

    if (totalDefense) {
        int32_t formula = (5 * (defenseSkill) + 50) * totalDefense;
        int32_t randresult = rand() % 100;

        totalDefense = formula * ((rand() % 100 + randresult) / 2) / 10000.;
    }

    return totalDefense;
}

Edit this code in monster.cpp and when the monster goes to run it will keep its defense like full health.
this balanced mode equals the defense that is in the monster folder.
This way it will be like the real Tibia 7.7?
 
Well, i use this for the fight mode that varies the monsters in each attack cycle.

In mine, i increased the damage of the knight and the paladin.

But if i leave it as it was, it will be difficult for the knight to do damage to the Giant Spider, for example.

But in this model that i made, when the monster goes for the full attack, the player has a higher chance of doing damage.

This part of the commented script is what sets the full def of the monster, if a monster is running with low health it will be more difficult to finish it, now this model varies.

My ex:
C++:
int32_t Monster::getDefense() 
{
    int32_t totalDefense = defense + 1;
    int32_t defenseSkill = skill;
    fightMode_t attackMode = fightMode;

    if ((followCreature || !attackedCreature) && earliestAttackTime <= OTSYS_TIME()) {
        attackMode = FIGHTMODE_DEFENSE;
    }

    if (attackMode == FIGHTMODE_ATTACK) {
        totalDefense -= 6 * totalDefense / 10;
    } else if (attackMode == FIGHTMODE_BALANCED) {
        totalDefense = static_cast<int32_t>(totalDefense / 1.5);
    } else if (attackMode == FIGHTMODE_DEFENSE) {
        totalDefense += 2 * totalDefense / 10;
    }

    if (totalDefense) {
        int32_t formula = (5 * (defenseSkill) + 50) * totalDefense;
        int32_t randresult = rand() % 100;

        totalDefense = formula * ((rand() % 100 + randresult) / 2) / 10000.;
    }
    return totalDefense;
}
}
 
Last edited:
Would this be the attack formula?

C++:
int32_t Combat::getTotalDamage(int32_t attackSkill, int32_t attackValue, fightMode_t fightMode)
{
    return -static_cast<int32_t>(ceil(((5 * attackSkill + 50) * attackValue *
        (fightMode == FIGHTMODE_ATTACK ? 1.2 : (fightMode == FIGHTMODE_BALANCED ? 1.0 : 0.6)) *
        (rand() % 100 + rand() % 100)) / 2.0 / 10000.0));
}
 
I didn't find anything about monster attacks, would I have to create this function?
 
help visual studio 2017
C++:
1>c:\nostalrius-master\src\protocollogin.cpp(87): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\winsock2.h(1831): note: zobacz deklarację „inet_addr”
------------
1>rsa.obj : error LNK2001: nierozpoznany symbol zewnętrzny __gmpz_export
1>..\theforgottenserver.exe : fatal error LNK1120: liczba nierozpoznanych elementów zewnętrznych: 72
1>Kompilowanie projektu „theforgottenserver.vcxproj” wykonane — NIEPOWODZENIE.
========== Ponowna kompilacja: 0 zakończono powodzeniem, 1 zakończono niepowodzeniem, 0 pominięto ==========
Cool. But can someone help?
Post automatically merged:

windows build please 64bits
 
Last edited:
Back
Top