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

The Forgotten Server v0.2 (Mystic Spirit)

Status
Not open for further replies.
The TFS 0.2.22 EXE that works with latest RME .otb, that means it supports 8.4 maps. Just put the file from the attachment into your server folder.
Code:
Antivírus	Versão	Última Atualização	Resultado
a-squared	4.0.0.73	2009.01.20	[COLOR="Red"]Virus.Win32.Delf.LHZ!IK[/COLOR]
AhnLab-V3	2009.1.20.1	2009.01.19	-
AntiVir	7.9.0.57	2009.01.19	-
Authentium	5.1.0.4	2009.01.19	-
Avast	4.8.1281.0	2009.01.19	-
AVG	8.0.0.229	2009.01.20	-
BitDefender	7.2	2009.01.20	-
CAT-QuickHeal	10.00	2009.01.19	-
ClamAV	0.94.1	2009.01.19	-
Comodo	937	2009.01.19	-
DrWeb	4.44.0.09170	2009.01.20	-
eSafe	7.0.17.0	2009.01.19	-
eTrust-Vet	31.6.6315	2009.01.19	-
F-Prot	4.4.4.56	2009.01.19	-
F-Secure	8.0.14470.0	2009.01.20	-
Fortinet	3.117.0.0	2009.01.15	-
GData	19	2009.01.20	-
Ikarus	T3.1.1.45.0	2009.01.20	[COLOR="Red"]Virus.Win32.Delf.LHZ[/COLOR]
K7AntiVirus	7.10.595	2009.01.19	-
Kaspersky	7.0.0.125	2009.01.20	[COLOR="Red"]Trojan.Win32.Delf.hvm[/COLOR]
McAfee	5500	2009.01.19	-
McAfee+Artemis	5500	2009.01.19	-
NOD32	3779	2009.01.19	-
nProtect	2009.1.8.0	2009.01.20	-
Panda	9.5.1.2	2009.01.19	-
PCTools	4.4.2.0	2009.01.19	-
Prevx1	V2	2009.01.20	-
Rising	21.13.02.00	2009.01.19	-
SecureWeb-Gateway	6.7.6	2009.01.19	-
Sophos	4.37.0	2009.01.20	-
Sunbelt	3.2.1835.2	2009.01.16	-
Symantec	10	2009.01.20	-
TheHacker	6.3.1.5.224	2009.01.20	-
TrendMicro	8.700.0.1004	2009.01.19	-
VBA32	3.12.8.10	2009.01.19	-
ViRobot	2009.1.20.1567	2009.01.20	-
 
Code:
Antivírus	Versão	Última Atualização	Resultado
a-squared	4.0.0.73	2009.01.20	[COLOR="Red"]Virus.Win32.Delf.LHZ!IK[/COLOR]
AhnLab-V3	2009.1.20.1	2009.01.19	-
AntiVir	7.9.0.57	2009.01.19	-
Authentium	5.1.0.4	2009.01.19	-
Avast	4.8.1281.0	2009.01.19	-
AVG	8.0.0.229	2009.01.20	-
BitDefender	7.2	2009.01.20	-
CAT-QuickHeal	10.00	2009.01.19	-
ClamAV	0.94.1	2009.01.19	-
Comodo	937	2009.01.19	-
DrWeb	4.44.0.09170	2009.01.20	-
eSafe	7.0.17.0	2009.01.19	-
eTrust-Vet	31.6.6315	2009.01.19	-
F-Prot	4.4.4.56	2009.01.19	-
F-Secure	8.0.14470.0	2009.01.20	-
Fortinet	3.117.0.0	2009.01.15	-
GData	19	2009.01.20	-
Ikarus	T3.1.1.45.0	2009.01.20	[COLOR="Red"]Virus.Win32.Delf.LHZ[/COLOR]
K7AntiVirus	7.10.595	2009.01.19	-
Kaspersky	7.0.0.125	2009.01.20	[COLOR="Red"]Trojan.Win32.Delf.hvm[/COLOR]
McAfee	5500	2009.01.19	-
McAfee+Artemis	5500	2009.01.19	-
NOD32	3779	2009.01.19	-
nProtect	2009.1.8.0	2009.01.20	-
Panda	9.5.1.2	2009.01.19	-
PCTools	4.4.2.0	2009.01.19	-
Prevx1	V2	2009.01.20	-
Rising	21.13.02.00	2009.01.19	-
SecureWeb-Gateway	6.7.6	2009.01.19	-
Sophos	4.37.0	2009.01.20	-
Sunbelt	3.2.1835.2	2009.01.16	-
Symantec	10	2009.01.20	-
TheHacker	6.3.1.5.224	2009.01.20	-
TrendMicro	8.700.0.1004	2009.01.19	-
VBA32	3.12.8.10	2009.01.19	-
ViRobot	2009.1.20.1567	2009.01.20	-

Yes, we put there Trojan to h4x your RL account.
Sorry, we though none ever find out :(
 
Code:
Antivírus	Versão	Última Atualização	Resultado
a-squared	4.0.0.73	2009.01.20	[COLOR="Red"]Virus.Win32.Delf.LHZ!IK[/COLOR]
AhnLab-V3	2009.1.20.1	2009.01.19	-
AntiVir	7.9.0.57	2009.01.19	-
Authentium	5.1.0.4	2009.01.19	-
Avast	4.8.1281.0	2009.01.19	-
AVG	8.0.0.229	2009.01.20	-
BitDefender	7.2	2009.01.20	-
CAT-QuickHeal	10.00	2009.01.19	-
ClamAV	0.94.1	2009.01.19	-
Comodo	937	2009.01.19	-
DrWeb	4.44.0.09170	2009.01.20	-
eSafe	7.0.17.0	2009.01.19	-
eTrust-Vet	31.6.6315	2009.01.19	-
F-Prot	4.4.4.56	2009.01.19	-
F-Secure	8.0.14470.0	2009.01.20	-
Fortinet	3.117.0.0	2009.01.15	-
GData	19	2009.01.20	-
Ikarus	T3.1.1.45.0	2009.01.20	[COLOR="Red"]Virus.Win32.Delf.LHZ[/COLOR]
K7AntiVirus	7.10.595	2009.01.19	-
Kaspersky	7.0.0.125	2009.01.20	[COLOR="Red"]Trojan.Win32.Delf.hvm[/COLOR]
McAfee	5500	2009.01.19	-
McAfee+Artemis	5500	2009.01.19	-
NOD32	3779	2009.01.19	-
nProtect	2009.1.8.0	2009.01.20	-
Panda	9.5.1.2	2009.01.19	-
PCTools	4.4.2.0	2009.01.19	-
Prevx1	V2	2009.01.20	-
Rising	21.13.02.00	2009.01.19	-
SecureWeb-Gateway	6.7.6	2009.01.19	-
Sophos	4.37.0	2009.01.20	-
Sunbelt	3.2.1835.2	2009.01.16	-
Symantec	10	2009.01.20	-
TheHacker	6.3.1.5.224	2009.01.20	-
TrendMicro	8.700.0.1004	2009.01.19	-
VBA32	3.12.8.10	2009.01.19	-
ViRobot	2009.1.20.1567	2009.01.20	-

Lol, wtf! U know its Remote Control. Anyways, here's the Win32 Explanation:

Code:
Win32 is the 32-bit API for modern versions of Windows. The API consists of functions implemented, as with Win16, in system DLLs. The core DLLs of Win32 are kernel32.dll, user32.dll, and gdi32.dll. Win32 was introduced with Windows NT. The version of Win32 that was shipped with Windows 95 was initially referred to as Win32c, with the "c" standing for "compatibility", but this term was later abandoned by Microsoft in favour of Win32. In Windows NT 4.0 and its successors (including all modern Windows versions), Win32 calls are executed by two modules, csrss.exe (Client/Server Runtime Server Subsystem) in user mode and win32k.sys in kernel mode.
 
I need some information, the TFS 0.2 mystic spirit will have a new version or will be only in the beta?

Because some people said they have no further TFS 0.2 updates, only beta versions of TFS, this is true?

Sorry for the English, using translators
 
I need some information, the TFS 0.2 mystic spirit will have a new version or will be only in the beta?

Because some people said they have no further TFS 0.2 updates, only beta versions of TFS, this is true?

Sorry for the English, using translators

This is the Gold release of 0.2, there won't be any more feature updates to the 0.2 series, only critical bug fixes. This version comes with alot of fixes from the last release candidate, it does also include party experience share, the ghost command, many more configurable things and more Lua functions! You can expect the first alpha of 0.3 in a few weeks.
 
please post everything what u have changed and where because i want to compile it for linux .

Here's the Iomap.cpp:
PHP:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
// OTBM map loader
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "iomap.h"
#include "game.h"
#include "map.h"

#include "tile.h"
#include "item.h"
#include "container.h"
#include "depot.h"
#include "teleport.h"
#include "fileloader.h"
#include "town.h"

#include "beds.h"

typedef uint8_t attribute_t;
typedef uint32_t flags_t;

extern Game g_game;

/*
	OTBM_ROOTV2
	|
	|--- OTBM_MAP_DATA
	|	|
	|	|--- OTBM_TILE_AREA
	|	|	|--- OTBM_TILE
	|	|	|--- OTBM_TILE_SQUARE (not implemented)
	|	|	|--- OTBM_TILE_REF (not implemented)
	|	|	|--- OTBM_HOUSETILE
	|	|
	|	|--- OTBM_SPAWNS (not implemented)
	|	|	|--- OTBM_SPAWN (not implemented)
	|	|	|--- OTBM_MONSTER (not implemented)
	|	|
	|	|--- OTBM_TOWNS
	|	|	|--- OTBM_TOWN
	|	|
	|	|--- OTBM_WAYPOINTS
	|		|--- OTBM_WAYPOINT
	|
	|--- OTBM_ITEM_DEF (not implemented)
*/

bool IOMap::loadMap(Map* map, const std::string& identifier)
{
	FileLoader f;
	if(!f.openFile(identifier.c_str(), false, true))
	{
		std::stringstream ss;
		ss << "Could not open the file " << identifier << ".";
		setLastErrorString(ss.str());
		return false;
	}

	uint32_t type;
	PropStream propStream;

	NODE root = f.getChildNode((NODE)NULL, type);
	if(!f.getProps(root, propStream))
	{
		setLastErrorString("Could not read root property.");
		return false;
	}

	OTBM_root_header* root_header;
	if(!propStream.GET_STRUCT(root_header))
	{
		setLastErrorString("Could not read header.");
		return false;
	}

	if(root_header->version <= 0)
	{
		//In otbm version 1 the count variable after splashes/fluidcontainers and stackables
		//are saved as attributes instead, this solves alot of problems with items
		//that is changed (stackable/charges/fluidcontainer/splash) during an update.
		setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
		return false;
	}

	if(root_header->version > 2)
	{
		setLastErrorString("Unknown OTBM version detected.");
		return false;
	}

	if(root_header->majorVersionItems < 3)
	{
		setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
		return false;
	}

	if(root_header->majorVersionItems > (uint32_t)Items::dwMajorVersion)
	{
		setLastErrorString("The map was saved with a different items.otb version, an upgraded items.otb is required.");
		return false;
	}

	if(root_header->minorVersionItems < CLIENT_VERSION_810)
	{
		setLastErrorString("This map needs an updated items.otb.");
		return false;
	}

	if(root_header->minorVersionItems > (uint32_t)Items::dwMinorVersion)
		setLastErrorString("This map needs an updated items.otb.");

	std::cout << "> Map size: " << root_header->width << "x" << root_header->height << "." << std::endl;
	map->mapWidth = root_header->width;
	map->mapHeight = root_header->height;

	NODE nodeMap = f.getChildNode(root, type);
	if(type != OTBM_MAP_DATA)
	{
		setLastErrorString("Could not read data node.");
		return false;
	}

	if(!f.getProps(nodeMap, propStream))
	{
		setLastErrorString("Could not read map data attributes.");
		return false;
	}

	uint8_t attribute;
	std::string mapDescription, tmp;
	while(propStream.GET_UCHAR(attribute))
	{
		switch(attribute)
		{
			case OTBM_ATTR_DESCRIPTION:
			{
				if(!propStream.GET_STRING(mapDescription))
				{
					setLastErrorString("Invalid description tag.");
					return false;
				}
				break;
			}
			case OTBM_ATTR_EXT_SPAWN_FILE:
			{
				if(!propStream.GET_STRING(tmp))
				{
					setLastErrorString("Invalid spawn tag.");
					return false;
				}

				map->spawnfile = identifier.substr(0, identifier.rfind('/') + 1);
				map->spawnfile += tmp;
				break;
			}
			case OTBM_ATTR_EXT_HOUSE_FILE:
			{
				if(!propStream.GET_STRING(tmp))
				{
					setLastErrorString("Invalid house tag.");
					return false;
				}

				map->housefile = identifier.substr(0, identifier.rfind('/') + 1);
				map->housefile += tmp;
				break;
			}
			default:
			{
				setLastErrorString("Unknown header node.");
				return false;
			}
		}
	}

	Tile* tile = NULL;
	NODE nodeMapData = f.getChildNode(nodeMap, type);
	while(nodeMapData != NO_NODE)
	{
		if(f.getError() != ERROR_NONE)
		{
			setLastErrorString("Invalid map node.");
			return false;
		}

		if(type == OTBM_TILE_AREA)
		{
			if(!f.getProps(nodeMapData, propStream))
			{
				setLastErrorString("Invalid map node.");
				return false;
			}

			OTBM_Destination_coords* area_coord;
			if(!propStream.GET_STRUCT(area_coord))
			{
				setLastErrorString("Invalid map node.");
				return false;
			}

			int32_t base_x, base_y, base_z;
			base_x = area_coord->_x;
			base_y = area_coord->_y;
			base_z = area_coord->_z;

			NODE nodeTile = f.getChildNode(nodeMapData, type);
			while(nodeTile != NO_NODE)
			{
				if(f.getError() != ERROR_NONE)
				{
					setLastErrorString("Could not read node data.");
					return false;
				}

				if(type == OTBM_TILE || type == OTBM_HOUSETILE)
				{
					if(!f.getProps(nodeTile, propStream))
					{
						setLastErrorString("Could not read node data.");
						return false;
					}

					uint16_t px, py, pz;
					OTBM_Tile_coords* tile_coord;
					if(!propStream.GET_STRUCT(tile_coord))
					{
						setLastErrorString("Could not read tile position.");
						return false;
					}

					px = base_x + tile_coord->_x;
					py = base_y + tile_coord->_y;
					pz = base_z;

					bool isHouseTile = false;
					House* house = NULL;

					if(type == OTBM_TILE)
						tile = new Tile(px, py, pz);
					else if(type == OTBM_HOUSETILE)
					{
						uint32_t _houseid;
						if(!propStream.GET_ULONG(_houseid))
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Could not read house id.";
							setLastErrorString(ss.str());
							return false;
						}

						house = Houses::getInstance().getHouse(_houseid, true);
						if(!house)
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Could not create house id: " << _houseid;
							setLastErrorString(ss.str());
							return false;
						}

						tile = new HouseTile(px, py, pz, house);
						house->addTile(static_cast<HouseTile*>(tile));
						isHouseTile = true;
					}

					map->setTile(px, py, pz, tile);

					//read tile attributes
					uint8_t attribute;
					while(propStream.GET_UCHAR(attribute))
					{
						switch(attribute)
						{
							case OTBM_ATTR_TILE_FLAGS:
							{
								uint32_t flags;
								if(!propStream.GET_ULONG(flags))
								{
									std::stringstream ss;
									ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to read tile flags.";
									setLastErrorString(ss.str());
									return false;
								}

								if((flags & TILESTATE_PROTECTIONZONE) == TILESTATE_PROTECTIONZONE)
									tile->setFlag(TILESTATE_PROTECTIONZONE);
								else if((flags & TILESTATE_NOPVPZONE) == TILESTATE_NOPVPZONE)
									tile->setFlag(TILESTATE_NOPVPZONE);
								else if((flags & TILESTATE_PVPZONE) == TILESTATE_PVPZONE)
									tile->setFlag(TILESTATE_PVPZONE);

								if((flags & TILESTATE_NOLOGOUT) == TILESTATE_NOLOGOUT)
									tile->setFlag(TILESTATE_NOLOGOUT);

								break;
							}

							case OTBM_ATTR_ITEM:
							{
								Item* item = Item::CreateItem(propStream);
								if(!item)
								{
									std::stringstream ss;
									ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to create item.";
									setLastErrorString(ss.str());
									return false;
								}

								if(isHouseTile && !item->isNotMoveable())
								{
									std::cout << "[Warning - IOMap::loadMap] Movable item in house: " << house->getHouseId() << ", item type: " << item->getID() << std::endl;
									delete item;
									item = NULL;
								}
								else
								{
									tile->__internalAddThing(item);
									item->__startDecaying();
									item->setLoadedFromMap(true);
								}
								break;
							}

							default:
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Unknown tile attribute.";
								setLastErrorString(ss.str());
								return false;
								break;
						}
					}

					NODE nodeItem = f.getChildNode(nodeTile, type);
					while(nodeItem)
					{
						if(type == OTBM_ITEM)
						{
							PropStream propStream;
							f.getProps(nodeItem, propStream);

							Item* item = Item::CreateItem(propStream);
							if(!item)
							{
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to create item.";
								setLastErrorString(ss.str());
								return false;
							}

							if(item->unserializeItemNode(f, nodeItem, propStream))
							{
								if(isHouseTile && !item->isNotMoveable())
								{
									std::cout << "[Warning - IOMap::loadMap] Movable item in house: " << house->getHouseId() << ", item type: " << item->getID() << std::endl;
									delete item;
								}
								else
								{
									tile->__internalAddThing(item);
									item->__startDecaying();
									item->setLoadedFromMap(true);
								}
							}
							else
							{
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to load item " << item->getID() << ".";
								setLastErrorString(ss.str());
								delete item;
								return false;
							}
						}
						else
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Unknown node type.";
							setLastErrorString(ss.str());
						}

						nodeItem = f.getNextNode(nodeItem, type);
					}
				}
				else
				{
					setLastErrorString("Unknown tile node.");
					return false;
				}

				nodeTile = f.getNextNode(nodeTile, type);
			}
		}
		else if(type == OTBM_TOWNS)
		{
			NODE nodeTown = f.getChildNode(nodeMapData, type);
			while(nodeTown != NO_NODE)
			{
				if(type == OTBM_TOWN)
				{
					if(!f.getProps(nodeTown, propStream))
					{
						setLastErrorString("Could not read town data.");
						return false;
					}

					uint32_t townId = 0;
					if(!propStream.GET_ULONG(townId))
					{
						setLastErrorString("Could not read town id.");
						return false;
					}

					Town* town = Towns::getInstance().getTown(townId);
					if(!town)
					{
						town = new Town(townId);
						Towns::getInstance().addTown(townId, town);
					}

					std::string townName = "";
					if(!propStream.GET_STRING(townName))
					{
						setLastErrorString("Could not read town name.");
						return false;
					}

					town->setName(townName);
					OTBM_Destination_coords *town_coords;
					if(!propStream.GET_STRUCT(town_coords))
					{
						setLastErrorString("Could not read town coordinates.");
						return false;
					}

					town->setTemplePos(Position(town_coords->_x, town_coords->_y, town_coords->_z));
				}
				else
				{
					setLastErrorString("Unknown town node.");
					return false;
				}

				nodeTown = f.getNextNode(nodeTown, type);
			}
		}



		nodeMapData = f.getNextNode(nodeMapData, type);
	}

	return true;
}
 
Here's the Iomap.cpp:
PHP:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
// OTBM map loader
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "iomap.h"
#include "game.h"
#include "map.h"

#include "tile.h"
#include "item.h"
#include "container.h"
#include "depot.h"
#include "teleport.h"
#include "fileloader.h"
#include "town.h"

#include "beds.h"

typedef uint8_t attribute_t;
typedef uint32_t flags_t;

extern Game g_game;

/*
	OTBM_ROOTV2
	|
	|--- OTBM_MAP_DATA
	|	|
	|	|--- OTBM_TILE_AREA
	|	|	|--- OTBM_TILE
	|	|	|--- OTBM_TILE_SQUARE (not implemented)
	|	|	|--- OTBM_TILE_REF (not implemented)
	|	|	|--- OTBM_HOUSETILE
	|	|
	|	|--- OTBM_SPAWNS (not implemented)
	|	|	|--- OTBM_SPAWN (not implemented)
	|	|	|--- OTBM_MONSTER (not implemented)
	|	|
	|	|--- OTBM_TOWNS
	|	|	|--- OTBM_TOWN
	|	|
	|	|--- OTBM_WAYPOINTS
	|		|--- OTBM_WAYPOINT
	|
	|--- OTBM_ITEM_DEF (not implemented)
*/

bool IOMap::loadMap(Map* map, const std::string& identifier)
{
	FileLoader f;
	if(!f.openFile(identifier.c_str(), false, true))
	{
		std::stringstream ss;
		ss << "Could not open the file " << identifier << ".";
		setLastErrorString(ss.str());
		return false;
	}

	uint32_t type;
	PropStream propStream;

	NODE root = f.getChildNode((NODE)NULL, type);
	if(!f.getProps(root, propStream))
	{
		setLastErrorString("Could not read root property.");
		return false;
	}

	OTBM_root_header* root_header;
	if(!propStream.GET_STRUCT(root_header))
	{
		setLastErrorString("Could not read header.");
		return false;
	}

	if(root_header->version <= 0)
	{
		//In otbm version 1 the count variable after splashes/fluidcontainers and stackables
		//are saved as attributes instead, this solves alot of problems with items
		//that is changed (stackable/charges/fluidcontainer/splash) during an update.
		setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
		return false;
	}

	if(root_header->version > 2)
	{
		setLastErrorString("Unknown OTBM version detected.");
		return false;
	}

	if(root_header->majorVersionItems < 3)
	{
		setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
		return false;
	}

	if(root_header->majorVersionItems > (uint32_t)Items::dwMajorVersion)
	{
		setLastErrorString("The map was saved with a different items.otb version, an upgraded items.otb is required.");
		return false;
	}

	if(root_header->minorVersionItems < CLIENT_VERSION_810)
	{
		setLastErrorString("This map needs an updated items.otb.");
		return false;
	}

	if(root_header->minorVersionItems > (uint32_t)Items::dwMinorVersion)
		setLastErrorString("This map needs an updated items.otb.");

	std::cout << "> Map size: " << root_header->width << "x" << root_header->height << "." << std::endl;
	map->mapWidth = root_header->width;
	map->mapHeight = root_header->height;

	NODE nodeMap = f.getChildNode(root, type);
	if(type != OTBM_MAP_DATA)
	{
		setLastErrorString("Could not read data node.");
		return false;
	}

	if(!f.getProps(nodeMap, propStream))
	{
		setLastErrorString("Could not read map data attributes.");
		return false;
	}

	uint8_t attribute;
	std::string mapDescription, tmp;
	while(propStream.GET_UCHAR(attribute))
	{
		switch(attribute)
		{
			case OTBM_ATTR_DESCRIPTION:
			{
				if(!propStream.GET_STRING(mapDescription))
				{
					setLastErrorString("Invalid description tag.");
					return false;
				}
				break;
			}
			case OTBM_ATTR_EXT_SPAWN_FILE:
			{
				if(!propStream.GET_STRING(tmp))
				{
					setLastErrorString("Invalid spawn tag.");
					return false;
				}

				map->spawnfile = identifier.substr(0, identifier.rfind('/') + 1);
				map->spawnfile += tmp;
				break;
			}
			case OTBM_ATTR_EXT_HOUSE_FILE:
			{
				if(!propStream.GET_STRING(tmp))
				{
					setLastErrorString("Invalid house tag.");
					return false;
				}

				map->housefile = identifier.substr(0, identifier.rfind('/') + 1);
				map->housefile += tmp;
				break;
			}
			default:
			{
				setLastErrorString("Unknown header node.");
				return false;
			}
		}
	}

	Tile* tile = NULL;
	NODE nodeMapData = f.getChildNode(nodeMap, type);
	while(nodeMapData != NO_NODE)
	{
		if(f.getError() != ERROR_NONE)
		{
			setLastErrorString("Invalid map node.");
			return false;
		}

		if(type == OTBM_TILE_AREA)
		{
			if(!f.getProps(nodeMapData, propStream))
			{
				setLastErrorString("Invalid map node.");
				return false;
			}

			OTBM_Destination_coords* area_coord;
			if(!propStream.GET_STRUCT(area_coord))
			{
				setLastErrorString("Invalid map node.");
				return false;
			}

			int32_t base_x, base_y, base_z;
			base_x = area_coord->_x;
			base_y = area_coord->_y;
			base_z = area_coord->_z;

			NODE nodeTile = f.getChildNode(nodeMapData, type);
			while(nodeTile != NO_NODE)
			{
				if(f.getError() != ERROR_NONE)
				{
					setLastErrorString("Could not read node data.");
					return false;
				}

				if(type == OTBM_TILE || type == OTBM_HOUSETILE)
				{
					if(!f.getProps(nodeTile, propStream))
					{
						setLastErrorString("Could not read node data.");
						return false;
					}

					uint16_t px, py, pz;
					OTBM_Tile_coords* tile_coord;
					if(!propStream.GET_STRUCT(tile_coord))
					{
						setLastErrorString("Could not read tile position.");
						return false;
					}

					px = base_x + tile_coord->_x;
					py = base_y + tile_coord->_y;
					pz = base_z;

					bool isHouseTile = false;
					House* house = NULL;

					if(type == OTBM_TILE)
						tile = new Tile(px, py, pz);
					else if(type == OTBM_HOUSETILE)
					{
						uint32_t _houseid;
						if(!propStream.GET_ULONG(_houseid))
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Could not read house id.";
							setLastErrorString(ss.str());
							return false;
						}

						house = Houses::getInstance().getHouse(_houseid, true);
						if(!house)
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Could not create house id: " << _houseid;
							setLastErrorString(ss.str());
							return false;
						}

						tile = new HouseTile(px, py, pz, house);
						house->addTile(static_cast<HouseTile*>(tile));
						isHouseTile = true;
					}

					map->setTile(px, py, pz, tile);

					//read tile attributes
					uint8_t attribute;
					while(propStream.GET_UCHAR(attribute))
					{
						switch(attribute)
						{
							case OTBM_ATTR_TILE_FLAGS:
							{
								uint32_t flags;
								if(!propStream.GET_ULONG(flags))
								{
									std::stringstream ss;
									ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to read tile flags.";
									setLastErrorString(ss.str());
									return false;
								}

								if((flags & TILESTATE_PROTECTIONZONE) == TILESTATE_PROTECTIONZONE)
									tile->setFlag(TILESTATE_PROTECTIONZONE);
								else if((flags & TILESTATE_NOPVPZONE) == TILESTATE_NOPVPZONE)
									tile->setFlag(TILESTATE_NOPVPZONE);
								else if((flags & TILESTATE_PVPZONE) == TILESTATE_PVPZONE)
									tile->setFlag(TILESTATE_PVPZONE);

								if((flags & TILESTATE_NOLOGOUT) == TILESTATE_NOLOGOUT)
									tile->setFlag(TILESTATE_NOLOGOUT);

								break;
							}

							case OTBM_ATTR_ITEM:
							{
								Item* item = Item::CreateItem(propStream);
								if(!item)
								{
									std::stringstream ss;
									ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to create item.";
									setLastErrorString(ss.str());
									return false;
								}

								if(isHouseTile && !item->isNotMoveable())
								{
									std::cout << "[Warning - IOMap::loadMap] Movable item in house: " << house->getHouseId() << ", item type: " << item->getID() << std::endl;
									delete item;
									item = NULL;
								}
								else
								{
									tile->__internalAddThing(item);
									item->__startDecaying();
									item->setLoadedFromMap(true);
								}
								break;
							}

							default:
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Unknown tile attribute.";
								setLastErrorString(ss.str());
								return false;
								break;
						}
					}

					NODE nodeItem = f.getChildNode(nodeTile, type);
					while(nodeItem)
					{
						if(type == OTBM_ITEM)
						{
							PropStream propStream;
							f.getProps(nodeItem, propStream);

							Item* item = Item::CreateItem(propStream);
							if(!item)
							{
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to create item.";
								setLastErrorString(ss.str());
								return false;
							}

							if(item->unserializeItemNode(f, nodeItem, propStream))
							{
								if(isHouseTile && !item->isNotMoveable())
								{
									std::cout << "[Warning - IOMap::loadMap] Movable item in house: " << house->getHouseId() << ", item type: " << item->getID() << std::endl;
									delete item;
								}
								else
								{
									tile->__internalAddThing(item);
									item->__startDecaying();
									item->setLoadedFromMap(true);
								}
							}
							else
							{
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to load item " << item->getID() << ".";
								setLastErrorString(ss.str());
								delete item;
								return false;
							}
						}
						else
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Unknown node type.";
							setLastErrorString(ss.str());
						}

						nodeItem = f.getNextNode(nodeItem, type);
					}
				}
				else
				{
					setLastErrorString("Unknown tile node.");
					return false;
				}

				nodeTile = f.getNextNode(nodeTile, type);
			}
		}
		else if(type == OTBM_TOWNS)
		{
			NODE nodeTown = f.getChildNode(nodeMapData, type);
			while(nodeTown != NO_NODE)
			{
				if(type == OTBM_TOWN)
				{
					if(!f.getProps(nodeTown, propStream))
					{
						setLastErrorString("Could not read town data.");
						return false;
					}

					uint32_t townId = 0;
					if(!propStream.GET_ULONG(townId))
					{
						setLastErrorString("Could not read town id.");
						return false;
					}

					Town* town = Towns::getInstance().getTown(townId);
					if(!town)
					{
						town = new Town(townId);
						Towns::getInstance().addTown(townId, town);
					}

					std::string townName = "";
					if(!propStream.GET_STRING(townName))
					{
						setLastErrorString("Could not read town name.");
						return false;
					}

					town->setName(townName);
					OTBM_Destination_coords *town_coords;
					if(!propStream.GET_STRUCT(town_coords))
					{
						setLastErrorString("Could not read town coordinates.");
						return false;
					}

					town->setTemplePos(Position(town_coords->_x, town_coords->_y, town_coords->_z));
				}
				else
				{
					setLastErrorString("Unknown town node.");
					return false;
				}

				nodeTown = f.getNextNode(nodeTown, type);
			}
		}



		nodeMapData = f.getNextNode(nodeMapData, type);
	}

	return true;
}

yea like always i'm convinced to use simone ....
Code:
admin@ks27643:~/0.2$ make
g++ -I. -I/usr/include/libxml2 -I/usr/include/lua5.1 -Werror -Wall -O1 -D_THREAD_SAFE -D_REENTRANT -D__NO_HOMEDIR_CONF__ -D__USE_MYSQL__ -c iomap.cpp
iomap.cpp: In member function `bool IOMap::loadMap(Map*, const std::string&),:
iomap.cpp:211: b\u0142\u0105d: `OTBM_Destination_coords, was not declared in this scope
iomap.cpp:211: b\u0142\u0105d: `area_coord, was not declared in this scope
iomap.cpp:443: b\u0142\u0105d: `OTBM_Destination_coords, was not declared in this scope
iomap.cpp:443: b\u0142\u0105d: `town_coords, was not declared in this scope
make: *** [iomap.o] B\u0142\u0105d 1
admin@ks27643:~/0.2$
 
I have a problem..
There is a command called !changesex...
I want to remove it.. i tried to add in the commands.xml like this:

<command cmd="!changesex" group="1" acctype="5"/>
But players are still using it..
Can someone help me to remove this??
Thanks!
 
This is the Gold release of 0.2, there won't be any more feature updates to the 0.2 series, only critical bug fixes. This version comes with alot of fixes from the last release candidate, it does also include party experience share, the ghost command, many more configurable things and more Lua functions! You can expect the first alpha of 0.3 in a few weeks.

Thank you, Pietia.

Excuse me, I had not read the whole post of Talaturen.

Well, let's wait then. I am anxious to use the means Beta, but I will do some testing with him, nothing more just to hear it.

Again thank you and sorry for my post unnecessary ;)
 
I have a problem..
There is a command called !changesex...
I want to remove it.. i tried to add in the commands.xml like this:

<command cmd="!changesex" group="1" acctype="5"/>
But players are still using it..
Can someone help me to remove this??
Thanks!

set it to group 3
 
For when more or less this Parche 23 ¿? I am necessary to know it pleased
 
Here's the Iomap.cpp:
PHP:
//////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
// OTBM map loader
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"

#include "iomap.h"
#include "game.h"
#include "map.h"

#include "tile.h"
#include "item.h"
#include "container.h"
#include "depot.h"
#include "teleport.h"
#include "fileloader.h"
#include "town.h"

#include "beds.h"

typedef uint8_t attribute_t;
typedef uint32_t flags_t;

extern Game g_game;

/*
	OTBM_ROOTV2
	|
	|--- OTBM_MAP_DATA
	|	|
	|	|--- OTBM_TILE_AREA
	|	|	|--- OTBM_TILE
	|	|	|--- OTBM_TILE_SQUARE (not implemented)
	|	|	|--- OTBM_TILE_REF (not implemented)
	|	|	|--- OTBM_HOUSETILE
	|	|
	|	|--- OTBM_SPAWNS (not implemented)
	|	|	|--- OTBM_SPAWN (not implemented)
	|	|	|--- OTBM_MONSTER (not implemented)
	|	|
	|	|--- OTBM_TOWNS
	|	|	|--- OTBM_TOWN
	|	|
	|	|--- OTBM_WAYPOINTS
	|		|--- OTBM_WAYPOINT
	|
	|--- OTBM_ITEM_DEF (not implemented)
*/

bool IOMap::loadMap(Map* map, const std::string& identifier)
{
	FileLoader f;
	if(!f.openFile(identifier.c_str(), false, true))
	{
		std::stringstream ss;
		ss << "Could not open the file " << identifier << ".";
		setLastErrorString(ss.str());
		return false;
	}

	uint32_t type;
	PropStream propStream;

	NODE root = f.getChildNode((NODE)NULL, type);
	if(!f.getProps(root, propStream))
	{
		setLastErrorString("Could not read root property.");
		return false;
	}

	OTBM_root_header* root_header;
	if(!propStream.GET_STRUCT(root_header))
	{
		setLastErrorString("Could not read header.");
		return false;
	}

	if(root_header->version <= 0)
	{
		//In otbm version 1 the count variable after splashes/fluidcontainers and stackables
		//are saved as attributes instead, this solves alot of problems with items
		//that is changed (stackable/charges/fluidcontainer/splash) during an update.
		setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
		return false;
	}

	if(root_header->version > 2)
	{
		setLastErrorString("Unknown OTBM version detected.");
		return false;
	}

	if(root_header->majorVersionItems < 3)
	{
		setLastErrorString("This map needs to be upgraded by using the latest map editor version to be able to load correctly.");
		return false;
	}

	if(root_header->majorVersionItems > (uint32_t)Items::dwMajorVersion)
	{
		setLastErrorString("The map was saved with a different items.otb version, an upgraded items.otb is required.");
		return false;
	}

	if(root_header->minorVersionItems < CLIENT_VERSION_810)
	{
		setLastErrorString("This map needs an updated items.otb.");
		return false;
	}

	if(root_header->minorVersionItems > (uint32_t)Items::dwMinorVersion)
		setLastErrorString("This map needs an updated items.otb.");

	std::cout << "> Map size: " << root_header->width << "x" << root_header->height << "." << std::endl;
	map->mapWidth = root_header->width;
	map->mapHeight = root_header->height;

	NODE nodeMap = f.getChildNode(root, type);
	if(type != OTBM_MAP_DATA)
	{
		setLastErrorString("Could not read data node.");
		return false;
	}

	if(!f.getProps(nodeMap, propStream))
	{
		setLastErrorString("Could not read map data attributes.");
		return false;
	}

	uint8_t attribute;
	std::string mapDescription, tmp;
	while(propStream.GET_UCHAR(attribute))
	{
		switch(attribute)
		{
			case OTBM_ATTR_DESCRIPTION:
			{
				if(!propStream.GET_STRING(mapDescription))
				{
					setLastErrorString("Invalid description tag.");
					return false;
				}
				break;
			}
			case OTBM_ATTR_EXT_SPAWN_FILE:
			{
				if(!propStream.GET_STRING(tmp))
				{
					setLastErrorString("Invalid spawn tag.");
					return false;
				}

				map->spawnfile = identifier.substr(0, identifier.rfind('/') + 1);
				map->spawnfile += tmp;
				break;
			}
			case OTBM_ATTR_EXT_HOUSE_FILE:
			{
				if(!propStream.GET_STRING(tmp))
				{
					setLastErrorString("Invalid house tag.");
					return false;
				}

				map->housefile = identifier.substr(0, identifier.rfind('/') + 1);
				map->housefile += tmp;
				break;
			}
			default:
			{
				setLastErrorString("Unknown header node.");
				return false;
			}
		}
	}

	Tile* tile = NULL;
	NODE nodeMapData = f.getChildNode(nodeMap, type);
	while(nodeMapData != NO_NODE)
	{
		if(f.getError() != ERROR_NONE)
		{
			setLastErrorString("Invalid map node.");
			return false;
		}

		if(type == OTBM_TILE_AREA)
		{
			if(!f.getProps(nodeMapData, propStream))
			{
				setLastErrorString("Invalid map node.");
				return false;
			}

			OTBM_Destination_coords* area_coord;
			if(!propStream.GET_STRUCT(area_coord))
			{
				setLastErrorString("Invalid map node.");
				return false;
			}

			int32_t base_x, base_y, base_z;
			base_x = area_coord->_x;
			base_y = area_coord->_y;
			base_z = area_coord->_z;

			NODE nodeTile = f.getChildNode(nodeMapData, type);
			while(nodeTile != NO_NODE)
			{
				if(f.getError() != ERROR_NONE)
				{
					setLastErrorString("Could not read node data.");
					return false;
				}

				if(type == OTBM_TILE || type == OTBM_HOUSETILE)
				{
					if(!f.getProps(nodeTile, propStream))
					{
						setLastErrorString("Could not read node data.");
						return false;
					}

					uint16_t px, py, pz;
					OTBM_Tile_coords* tile_coord;
					if(!propStream.GET_STRUCT(tile_coord))
					{
						setLastErrorString("Could not read tile position.");
						return false;
					}

					px = base_x + tile_coord->_x;
					py = base_y + tile_coord->_y;
					pz = base_z;

					bool isHouseTile = false;
					House* house = NULL;

					if(type == OTBM_TILE)
						tile = new Tile(px, py, pz);
					else if(type == OTBM_HOUSETILE)
					{
						uint32_t _houseid;
						if(!propStream.GET_ULONG(_houseid))
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Could not read house id.";
							setLastErrorString(ss.str());
							return false;
						}

						house = Houses::getInstance().getHouse(_houseid, true);
						if(!house)
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Could not create house id: " << _houseid;
							setLastErrorString(ss.str());
							return false;
						}

						tile = new HouseTile(px, py, pz, house);
						house->addTile(static_cast<HouseTile*>(tile));
						isHouseTile = true;
					}

					map->setTile(px, py, pz, tile);

					//read tile attributes
					uint8_t attribute;
					while(propStream.GET_UCHAR(attribute))
					{
						switch(attribute)
						{
							case OTBM_ATTR_TILE_FLAGS:
							{
								uint32_t flags;
								if(!propStream.GET_ULONG(flags))
								{
									std::stringstream ss;
									ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to read tile flags.";
									setLastErrorString(ss.str());
									return false;
								}

								if((flags & TILESTATE_PROTECTIONZONE) == TILESTATE_PROTECTIONZONE)
									tile->setFlag(TILESTATE_PROTECTIONZONE);
								else if((flags & TILESTATE_NOPVPZONE) == TILESTATE_NOPVPZONE)
									tile->setFlag(TILESTATE_NOPVPZONE);
								else if((flags & TILESTATE_PVPZONE) == TILESTATE_PVPZONE)
									tile->setFlag(TILESTATE_PVPZONE);

								if((flags & TILESTATE_NOLOGOUT) == TILESTATE_NOLOGOUT)
									tile->setFlag(TILESTATE_NOLOGOUT);

								break;
							}

							case OTBM_ATTR_ITEM:
							{
								Item* item = Item::CreateItem(propStream);
								if(!item)
								{
									std::stringstream ss;
									ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to create item.";
									setLastErrorString(ss.str());
									return false;
								}

								if(isHouseTile && !item->isNotMoveable())
								{
									std::cout << "[Warning - IOMap::loadMap] Movable item in house: " << house->getHouseId() << ", item type: " << item->getID() << std::endl;
									delete item;
									item = NULL;
								}
								else
								{
									tile->__internalAddThing(item);
									item->__startDecaying();
									item->setLoadedFromMap(true);
								}
								break;
							}

							default:
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Unknown tile attribute.";
								setLastErrorString(ss.str());
								return false;
								break;
						}
					}

					NODE nodeItem = f.getChildNode(nodeTile, type);
					while(nodeItem)
					{
						if(type == OTBM_ITEM)
						{
							PropStream propStream;
							f.getProps(nodeItem, propStream);

							Item* item = Item::CreateItem(propStream);
							if(!item)
							{
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to create item.";
								setLastErrorString(ss.str());
								return false;
							}

							if(item->unserializeItemNode(f, nodeItem, propStream))
							{
								if(isHouseTile && !item->isNotMoveable())
								{
									std::cout << "[Warning - IOMap::loadMap] Movable item in house: " << house->getHouseId() << ", item type: " << item->getID() << std::endl;
									delete item;
								}
								else
								{
									tile->__internalAddThing(item);
									item->__startDecaying();
									item->setLoadedFromMap(true);
								}
							}
							else
							{
								std::stringstream ss;
								ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Failed to load item " << item->getID() << ".";
								setLastErrorString(ss.str());
								delete item;
								return false;
							}
						}
						else
						{
							std::stringstream ss;
							ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] Unknown node type.";
							setLastErrorString(ss.str());
						}

						nodeItem = f.getNextNode(nodeItem, type);
					}
				}
				else
				{
					setLastErrorString("Unknown tile node.");
					return false;
				}

				nodeTile = f.getNextNode(nodeTile, type);
			}
		}
		else if(type == OTBM_TOWNS)
		{
			NODE nodeTown = f.getChildNode(nodeMapData, type);
			while(nodeTown != NO_NODE)
			{
				if(type == OTBM_TOWN)
				{
					if(!f.getProps(nodeTown, propStream))
					{
						setLastErrorString("Could not read town data.");
						return false;
					}

					uint32_t townId = 0;
					if(!propStream.GET_ULONG(townId))
					{
						setLastErrorString("Could not read town id.");
						return false;
					}

					Town* town = Towns::getInstance().getTown(townId);
					if(!town)
					{
						town = new Town(townId);
						Towns::getInstance().addTown(townId, town);
					}

					std::string townName = "";
					if(!propStream.GET_STRING(townName))
					{
						setLastErrorString("Could not read town name.");
						return false;
					}

					town->setName(townName);
					OTBM_Destination_coords *town_coords;
					if(!propStream.GET_STRUCT(town_coords))
					{
						setLastErrorString("Could not read town coordinates.");
						return false;
					}

					town->setTemplePos(Position(town_coords->_x, town_coords->_y, town_coords->_z));
				}
				else
				{
					setLastErrorString("Unknown town node.");
					return false;
				}

				nodeTown = f.getNextNode(nodeTown, type);
			}
		}



		nodeMapData = f.getNextNode(nodeMapData, type);
	}

	return true;
}

But this can make debugs ye ?

I copy items.otb from RME 8.4 to TFS 0.2 and nothing change in sources and all work:> xd
 
Anyone know why he tell me > Do u need to Lern this Spell first.?
How can i change this?!
Please fast my Server is Online and without Spells Sux. xD
 
But this can make debugs ye ?

I copy items.otb from RME 8.4 to TFS 0.2 and nothing change in sources and all work:> xd

lol are u sure ???u are using 0.2 or 0.3 ? because 0.3 have the 8.4 maps support saved in rme.
 
Status
Not open for further replies.
Back
Top