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

[9.1] The Forgotten Server v0.2.11pl2 (Mystic Spirit)

Status
Not open for further replies.
God cannot cast spells... and the god command /n npc name isn't working... what i do? how i fix?
 
Go into your potions file and change the instances of doTransformItem to doRemoveItem

I did it, and now the potions dont dissapear. It's like infinite mana potions, here is the script if u can help..

Code:
local ultimateHealthPot = 8473
local greatHealthPot = 7591
local greatManaPot = 7590
local greatSpiritPot = 8472
local strongHealthPot = 7588
local strongManaPot = 7589
local healthPot = 7618
local manaPot = 7620
local smallHealthPot = 8704
local antidotePot = 8474
local greatEmptyPot = 7635
local strongEmptyPot = 7634
local emptyPot = 7636

local antidote = createCombatObject()
setCombatParam(antidote, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(antidote, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(antidote, COMBAT_PARAM_TARGETCASTERORTOPMOST, TRUE)
setCombatParam(antidote, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(antidote, COMBAT_PARAM_DISPEL, CONDITION_POISON)

local exhaust = createConditionObject(CONDITION_EXHAUST_HEAL)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))
-- 1000 - 100 due to exact condition timing. -100 doesn't hurt us, and players don't have reminding ~50ms exhaustion.

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(itemEx.uid ~= cid or itemEx.itemid ~= 1) then
		return TRUE
	end

	if(getCreatureCondition(cid, CONDITION_EXHAUST_HEAL) == TRUE) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
		return TRUE
	end

	if(item.itemid == antidotePot) then
		if(doCombat(cid, antidote, numberToVariant(cid)) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, emptyPot)
	elseif(item.itemid == smallHealthPot) then
		if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 50, 100, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, emptyPot)
	elseif(item.itemid == healthPot) then
		if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 100, 200, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, emptyPot)
	elseif(item.itemid == manaPot) then
		if(doTargetCombatMana(0, cid, 70, 130, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, emptyPot)
	elseif(item.itemid == strongHealthPot) then
		if(not(isKnight(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by paladins and knights of level 50 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, strongEmptyPot)
	elseif(item.itemid == strongManaPot) then
		if(not(isSorcerer(cid) or isDruid(cid) or isPaladin(cid)) or (getPlayerLevel(cid) < 50)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by sorcerers, druids and paladins of level 50 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, strongEmptyPot)
	elseif(item.itemid == greatSpiritPot) then
		if(not(isPaladin(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by paladins of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 200, 400, CONST_ME_MAGIC_BLUE) == LUA_ERROR or doTargetCombatMana(0, cid, 110, 190, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, greatEmptyPot)
	elseif(item.itemid == greatHealthPot) then
		if(not(isKnight(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by knights of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 500, 700, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, greatEmptyPot)
	elseif(item.itemid == greatManaPot) then
		if(not(isSorcerer(cid) or isDruid(cid)) or (getPlayerLevel(cid) < 80)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by sorcerers and druids of level 80 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatMana(0, cid, 200, 300, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, greatEmptyPot)
	elseif(item.itemid == ultimateHealthPot) then
		if(not(isKnight(cid)) or (getPlayerLevel(cid) < 130)) and not(getPlayerGroupId(cid) >= 2) then
			doCreatureSay(cid, "This potion can only be consumed by knights of level 130 or higher.", TALKTYPE_ORANGE_1)
			return TRUE
		end

		if(doTargetCombatHealth(0, cid, COMBAT_HEALING, 800, 1000, CONST_ME_MAGIC_BLUE) == LUA_ERROR) then
			return FALSE
		end
		doAddCondition(cid, exhaust)
		doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
		doRemoveItem(item.uid, greatEmptyPot)
	end
	return TRUE
end

thanks a lot.
:)
 
archlinux.fr - outil collaboratif

g++ -c -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o obj/luascript.o luascript.cpp
luascript.cpp: In static member function 'static int32_t LuaScriptInterface::luaGetPlayersByIPAddress(lua_State*)':
luascript.cpp:6538:11: error: variable 'mask' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

make: *** [obj/luascript.o] Error 1

In luascript.cpp, change:
PlayerVector players = g_game.getPlayersByIP(ip);
to
PlayerVector players = g_game.getPlayersByIP(ip, mask);
 
Ty

In luascript.cpp, change:
PlayerVector players = g_game.getPlayersByIP(ip);
to
PlayerVector players = g_game.getPlayersByIP(ip, mask);

Thank you very much for the help Talaturen is somewhat hard to build me another error appeared again.

archlinux.fr - outil collaboratif

Code:
make
g++ -c -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o obj/monster.o monster.cpp
monster.cpp: In member function 'virtual void Monster::doAttacking(uint32_t)':
monster.cpp:655:7: error: variable 'outOfRange' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

make: *** [obj/monster.o] Error 1
 
No, you don't need to update your map, it should already work. I don't know how you will be able to use new sprites without a map editor for 9.1 yet though, but there are two new map editors in development.
It's simple. Dunno function's name to set it on ot startup, something on globalevents, on blank place something like that:
doCreateItem(blank place pos,new item id)
.
I'm feeling like old tibia mapper ;o like 7.1
You can test new looktypes by "/newtype x" and use them to creating new monsters.

How about mapeditor? Shall you create your own one for tfs only?
 
That's because he is thinking of 0.3/0.4.

99mjht.png
 
Thank you very much for the help Talaturen is somewhat hard to build me another error appeared again.

archlinux.fr - outil collaboratif

Code:
make
g++ -c -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o obj/monster.o monster.cpp
monster.cpp: In member function 'virtual void Monster::doAttacking(uint32_t)':
monster.cpp:655:7: error: variable 'outOfRange' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

make: *** [obj/monster.o] Error 1

Apply this patch in monster.cpp:
54Rmw.png
 
Archlinux is different from Ubuntu and Debian: (

Apply this patch in monster.cpp:
https://i.imgur.com/54Rmw.png

There is something wrong with the makefile even though I've installed all dependencies on archlinux, these libraries have different names and directory.

then repair the file monster.cpp gave me this error.

archlinux.fr - outil collaboratif

Code:
/usr/bin/ld: cannot find -llua5.1
/usr/bin/ld: cannot find -llua5.1-sql-mysql
collect2: ld returned 1 exit status
make: *** [forgottenserver] Error 1

The libraries that tries to include the makefile (/usr/include/llua5.1) in arch linux does not create this folder when installing the LUA library.

Try to compile LUA and anyway this folder does not appear, but could give me account where these files are installed (lua.h luaconf.h lauxlib.h lualib.h lua.hpp) in /usr/include
so what I did was create the directory / usr/include/llua5.1 and create some symlinks for the files.

For the compiled files also need ".so" that also found and did the same with the command

Code:
sudo ln -s /usr/lib/liblua.* /usr/lib/lua/5.1

but there is still unresolved errors :-(

Code:
g++ -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o forgottenserver obj/actions.o obj/admin.o obj/allocator.o obj/ban.o obj/baseevents.o obj/beds.o obj/creature.o obj/creatureevent.o obj/chat.o obj/combat.o obj/commands.o obj/condition.o obj/configmanager.o obj/connection.o obj/container.o obj/cylinder.o obj/database.o obj/databasemysql.o obj/databasesqlite.o obj/depot.o obj/exception.o obj/fileloader.o obj/game.o obj/globalevent.o obj/gui.o obj/house.o obj/housetile.o obj/ioguild.o obj/iologindata.o obj/iomap.o obj/iomapserialize.o obj/inputbox.o obj/item.o obj/items.o obj/logger.o obj/luascript.o obj/mailbox.o obj/map.o obj/md5.o obj/monster.o obj/monsters.o obj/mounts.o obj/movement.o obj/networkmessage.o obj/npc.o obj/otserv.o obj/outfit.o obj/outputmessage.o obj/party.o obj/player.o obj/playerbox.o obj/position.o obj/protocol.o obj/protocolgame.o obj/protocollogin.o obj/protocolold.o obj/quests.o obj/raids.o obj/rsa.o obj/scheduler.o obj/scriptmanager.o obj/server.o obj/sha1.o obj/spawn.o obj/spells.o obj/status.o obj/talkaction.o obj/tasks.o obj/teleport.o obj/textlogger.o obj/thing.o obj/tile.o obj/tools.o obj/trashholder.o obj/vocation.o obj/waitlist.o obj/weapons.o -I"." -I"/usr/lib/lua/5.1" -I"/usr/lib/lua/5.1/luasql" -lxml2 -lpthread -llua -lgmp -luasql_mysql -lsqlite3 -lmysqlclient -lboost_thread -lboost_system -lboost_regex -lpthread -ldl
/usr/bin/ld: cannot find -luasql_mysql
collect2: ld returned 1 exit status
make: *** [forgottenserver] Error 1

Try to make some changes to the makefile without success archlinux.fr - outil collaboratif

Code:
-lxml2 -lpthread -llua -lgmp -mysql -lsqlite3 -lmysqlclient -lboost_thread -lboost_system -lboost_regex -lpthread -ldl
obj/luascript.o: In function `LuaScriptInterface::initState()':
luascript.cpp:(.text+0xa5b5): undefined reference to `luaopen_luasql_mysql'
collect2: ld devolvió el estado de salida 1
make: *** [forgottenserver] Error 1
 
There is something wrong with the makefile even though I've installed all dependencies on archlinux, these libraries have different names and directory.

then repair the file monster.cpp gave me this error.

archlinux.fr - outil collaboratif

Code:
/usr/bin/ld: cannot find -llua5.1
/usr/bin/ld: cannot find -llua5.1-sql-mysql
collect2: ld returned 1 exit status
make: *** [forgottenserver] Error 1

The libraries that tries to include the makefile (/usr/include/llua5.1) in arch linux does not create this folder when installing the LUA library.

Try to compile LUA and anyway this folder does not appear, but could give me account where these files are installed (lua.h luaconf.h lauxlib.h lualib.h lua.hpp) in /usr/include
so what I did was create the directory / usr/include/llua5.1 and create some symlinks for the files.

For the compiled files also need ".so" that also found and did the same with the command

Code:
sudo ln -s /usr/lib/liblua.* /usr/lib/lua/5.1

but there is still unresolved errors :-(

Code:
g++ -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o forgottenserver obj/actions.o obj/admin.o obj/allocator.o obj/ban.o obj/baseevents.o obj/beds.o obj/creature.o obj/creatureevent.o obj/chat.o obj/combat.o obj/commands.o obj/condition.o obj/configmanager.o obj/connection.o obj/container.o obj/cylinder.o obj/database.o obj/databasemysql.o obj/databasesqlite.o obj/depot.o obj/exception.o obj/fileloader.o obj/game.o obj/globalevent.o obj/gui.o obj/house.o obj/housetile.o obj/ioguild.o obj/iologindata.o obj/iomap.o obj/iomapserialize.o obj/inputbox.o obj/item.o obj/items.o obj/logger.o obj/luascript.o obj/mailbox.o obj/map.o obj/md5.o obj/monster.o obj/monsters.o obj/mounts.o obj/movement.o obj/networkmessage.o obj/npc.o obj/otserv.o obj/outfit.o obj/outputmessage.o obj/party.o obj/player.o obj/playerbox.o obj/position.o obj/protocol.o obj/protocolgame.o obj/protocollogin.o obj/protocolold.o obj/quests.o obj/raids.o obj/rsa.o obj/scheduler.o obj/scriptmanager.o obj/server.o obj/sha1.o obj/spawn.o obj/spells.o obj/status.o obj/talkaction.o obj/tasks.o obj/teleport.o obj/textlogger.o obj/thing.o obj/tile.o obj/tools.o obj/trashholder.o obj/vocation.o obj/waitlist.o obj/weapons.o -I"." -I"/usr/lib/lua/5.1" -I"/usr/lib/lua/5.1/luasql" -lxml2 -lpthread -llua -lgmp -luasql_mysql -lsqlite3 -lmysqlclient -lboost_thread -lboost_system -lboost_regex -lpthread -ldl
/usr/bin/ld: cannot find -luasql_mysql
collect2: ld returned 1 exit status
make: *** [forgottenserver] Error 1

Try to make some changes to the makefile without success archlinux.fr - outil collaboratif

Code:
-lxml2 -lpthread -llua -lgmp -mysql -lsqlite3 -lmysqlclient -lboost_thread -lboost_system -lboost_regex -lpthread -ldl
obj/luascript.o: In function `LuaScriptInterface::initState()':
luascript.cpp:(.text+0xa5b5): undefined reference to `luaopen_luasql_mysql'
collect2: ld devolvió el estado de salida 1
make: *** [forgottenserver] Error 1

You need to compile LuaSQL too.
 
Man can i use Code:Bl to compile it? Do you have a tutorial Dev++ is too old.
 
You need to compile LuaSQL too.

Well I have not put in more efforts to compile archlinux but I decided to update my ubuntu 10.10 to 11.04 and try to compile and again with an error:

Code:
g++ -c -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o obj/database.o database.cpp
In file included from database.cpp:34:0:
databasesqlite.h:24:21: fatal error: sqlite3.h: No existe el fichero o el directorio
compilation terminated.
make: *** [obj/database.o] Error 1
 
Well I have not put in more efforts to compile archlinux but I decided to update my ubuntu 10.10 to 11.04 and try to compile and again with an error:

Code:
g++ -c -I"." -I"/usr/include/libxml2" -I"/usr/include/lua5.1" -I"/usr/include/mysql" -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__ENABLE_SERVER_DIAGNOSTIC__ -D__USE_MYSQL__ -D__USE_SQLITE__ -Werror -Wall -O2 -o obj/database.o database.cpp
In file included from database.cpp:34:0:
databasesqlite.h:24:21: fatal error: sqlite3.h: No existe el fichero o el directorio
compilation terminated.
make: *** [obj/database.o] Error 1

What I was missing a library fix

Code:
sudo apt-get install libsqlite3-dev
 
Finally I could compile on ubuntu but fails to run

Code:
The Forgotten Server - Version 0.2.11pl2 (Mystic Spirit).
A server developed by Talaturen, Kornholijo, Elf, and Fallen.
Visit our forum for updates, support, and resources: http://otland.net/.

>> Loading config
>> Loading RSA key
>> Testing SQL connection... SQLite.
>> Loading bans
>> Loading vocations
>> Loading commands
>> Loading items
>> Loading script systems
>> Loading monsters
>> Loading outfits
>> Loading admin protocol config
>> Loading experience stages
>> Using plaintext passwords
>> Checking world type... PVP
>> Loading map
> Map size: 1000x1000.
> Map loading time: 1.112 seconds.
Notice: Map load (relational) took: 1.424 s
>> Initializing gamestate
> ERROR: Failed to load lastMotd.txt
> ERROR: Failed to load playersRecord.txt
[ServicePort::open] Error: Address already in use
[ServicePort::open] Error: Address already in use
>> Loaded all modules, server starting up...
>> Forgotten Server Online!

forgottenserver: /usr/include/boost/thread/pthread/recursive_mutex.hpp:67: void boost::recursive_mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed.
Abort
 
Status
Not open for further replies.
Back
Top