How to make your server client 8.61 Tutorial

Evil Mark

Excellent OT User
Joined
Nov 23, 2008
Messages
1,681
Reaction score
28
If you can't compile it on your own, I can compile this on your computer with your source folder for you for the price of 15 Euro.

Go to resources.h and scroll all the way to the bottom and replace your code with this.

Code:
#define CLIENT_VERSION_MIN 861
#define CLIENT_VERSION_MAX 862
#define CLIENT_VERSION_STRING "Only clients with protocol 8.61 and 8.62 are allowed!"

#define STATUS_SERVER_NAME "TheForgottenServer"
#define STATUS_SERVER_VERSION "0.3.5"
#define STATUS_SERVER_CODENAME "Crying Damson"
#define STATUS_SERVER_PROTOCOL "8.62"

Then goto itemloader.h and search for this
CLIENT_VERSION_854 = 16,

When you have found that line replace it with
Code:
	CLIENT_VERSION_854 = 16,
	CLIENT_VERSION_855 = 17,
	CLIENT_VERSION_856 = 18,
	CLIENT_VERSION_857 = 19,
	CLIENT_VERSION_860 = 20,
	CLIENT_VERSION_861 = 21,
        CLIENT_VERSION_862 = 22




items.cpp:
Search for
Code:
else if(Items::dwMinorVersion != CLIENT_VERSION_854)
and


Replace:
Code:
	else if(Items::dwMinorVersion != CLIENT_VERSION_854)
	{
		std::cout << "[Error - Items::loadFromOtb] Another (client) version of items.otb is required." << std::endl;
		return ERROR_INVALID_FORMAT;
	}
WITH

Code:
	else if(Items::dwMinorVersion != [B][COLOR="Red"]19[/COLOR][/B])
	{
		std::cout << "[Error - Items::loadFromOtb] Another (client) version of items.otb is required." << std::endl;
		return ERROR_INVALID_FORMAT;
	}







now go to protocolgame.cpp, and search for
Code:
void ProtocolGame::parseAttack(NetworkMessage& msg)
REPLACE
Code:
void ProtocolGame::parseAttack(NetworkMessage& msg)
{
	uint32_t creatureId = msg.GetU32();
	addGameTask(&Game::playerSetAttackedCreature, player->getID(), creatureId);
}
WITH

Code:
void ProtocolGame::parseAttack(NetworkMessage& msg)
{
	uint32_t creatureId = msg.GetU32();
[B][COLOR="Red"]	msg.GetU32();
	msg.GetU32();[/COLOR][/B]
	addGameTask(&Game::playerSetAttackedCreature, player->getID(), creatureId);
}







Protocolgame.cpp

Search for
Code:
void ProtocolGame::sendCancelTarget()
and

REPLACE
Code:
void ProtocolGame::sendCancelTarget()
{
	NetworkMessage_ptr msg = getOutputBuffer();
	if(msg)
	{
		TRACK_MESSAGE(msg);
		msg->AddByte(0xA3);
	}
}

WITH

Code:
void ProtocolGame::sendCancelTarget()
{
	NetworkMessage_ptr msg = getOutputBuffer();
	if(msg)
	{
		TRACK_MESSAGE(msg);
		msg->AddByte(0xA3);
		[B][COLOR="Red"]msg->AddU32(0);[/COLOR][/B]
	}





In spells.cpp go to
Code:
bool RuneSpell::executeUse(Player* player, Item* item, const PositionEx& posFrom,
and replace:
Code:
g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getCharges()) - 1));
with this:

Code:
g_game.transformItem(item, item->getID(), std::max((int32_t)0, ((int32_t)item->getItemCount()) - 1));



Adding the new effects to the game!
tools.cpp

search for
Code:
{"insects",		MAGIC_EFFECT_INSECTS}
and replace
Code:
	{"insects",		MAGIC_EFFECT_INSECTS},
};
With
Code:
	{"insects",		MAGIC_EFFECT_INSECTS},
	{"dragonhead",		MAGIC_EFFECT_DRAGONHEAD}
};





go to const.h and search for
Code:
MAGIC_EFFECT_INSECTS		= 0x44, //68
Replace
Code:
	MAGIC_EFFECT_INSECTS		= 0x44, //68
	MAGIC_EFFECT_LAST		= MAGIC_EFFECT_INSECTS,
With
Code:
	MAGIC_EFFECT_INSECTS		= 0x44, //68
        MAGIC_EFFECT_DRAGONHEAD		= 0x45, //69
	MAGIC_EFFECT_LAST		= MAGIC_EFFECT_DRAGONHEAD,




How to fix bug of npc don't buy items with charges (ex: potions)

In npc.cpp search:

Lua:
li.itemId = intValue;
After add:

Lua:
const ItemType& it = Item::items[li.itemId];
Search:

Lua:
if(readXMLInteger(tmpNode, "subtype", intValue))
li.subType = intValue;
After add:

Lua:
else
{
if(it.stackable)
li.subType = 1;
else if(it.isFluidContainer() || it.isSplash())
li.subType = 0;
}

COMPILE/Rebuild ALL
You're done!



XML Codes & Stuff you need for your server as it has been updated (Inside Server DATA folder)

@Use this Item.otb and Download the Itemx XML Below (It's attached)
  • items.otb: items.rar
    It has all the new items, and attribtes fixed for the old items (potions, runes and empty potions). This items.otb is kind of useless without RME, though. But you can still summon the new items with /i command.



You must remove this row on all runes in your spells.xml.
Code:
	<item id="2261"  name="destroy field rune">
		<attribute key="runeSpellName" value="adito grav" />
		<attribute key="weight" value="120" />
 [B]delete-> [/B] [COLOR="Red"]<attribute key="charges" value="1" />[/COLOR]
	</item>

outfit.xml

Lua:
<?xml version="1.0"?>
<outfits>
	<outfit id="1">
		<list gender="0" lookType="136" name="Citizen"/>
		<list gender="1" lookType="128" name="Citizen"/>
	</outfit>

	<outfit id="2">
		<list gender="0" lookType="137" name="Hunter"/>
		<list gender="1" lookType="129" name="Hunter"/>
	</outfit>

	<outfit id="3">
		<list gender="0" lookType="138" name="Mage"/>
		<list gender="1" lookType="130" name="Mage"/>
	</outfit>

	<outfit id="4">
		<list gender="0" lookType="139" name="Knight"/>
		<list gender="1" lookType="131" name="Knight"/>
	</outfit>

	<outfit id="5" premium="yes">
		<list gender="0" lookType="140" name="Noblewoman"/>
		<list gender="1" lookType="132" name="Nobleman"/>
	</outfit>

	<outfit id="6" premium="yes">
		<list gender="0" lookType="141" name="Summoner"/>
		<list gender="1" lookType="133" name="Summoner"/>
	</outfit>

	<outfit id="7" premium="yes">
		<list gender="0" lookType="142" name="Warrior"/>
		<list gender="1" lookType="134" name="Warrior"/>
	</outfit>

	<outfit id="8" premium="yes">
		<list gender="0" lookType="147" name="Barbarian"/>
		<list gender="1" lookType="143" name="Barbarian"/>
	</outfit>

	<outfit id="9" premium="yes">
		<list gender="0" lookType="148" name="Druid"/>
		<list gender="1" lookType="144" name="Druid"/>
	</outfit>

	<outfit id="10" premium="yes">
		<list gender="0" lookType="149" name="Wizard"/>
		<list gender="1" lookType="145" name="Wizard"/>
	</outfit>

	<outfit id="11" premium="yes">
		<list gender="0" lookType="150" name="Oriental"/>
		<list gender="1" lookType="146" name="Oriental"/>
	</outfit>

	<outfit id="12" premium="yes">
		<list gender="0" lookType="155" name="Pirate"/>
		<list gender="1" lookType="151" name="Pirate"/>
	</outfit>

	<outfit id="13" premium="yes">
		<list gender="0" lookType="156" name="Assassin"/>
		<list gender="1" lookType="152" name="Assassin"/>
	</outfit>

	<outfit id="14" premium="yes">
		<list gender="0" lookType="157" name="Beggar"/>
		<list gender="1" lookType="153" name="Beggar"/>
	</outfit>

	<outfit id="15" premium="yes">
		<list gender="0" lookType="158" name="Shaman"/>
		<list gender="1" lookType="154" name="Shaman"/>
	</outfit>

	<outfit id="16" premium="yes">
		<list gender="0" lookType="252" name="Norsewoman"/>
		<list gender="1" lookType="251" name="Norseman"/>
	</outfit>

	<outfit id="17" premium="yes">
		<list gender="0" lookType="269" name="Nightmare"/>
		<list gender="1" lookType="268" name="Nightmare"/>
	</outfit>

	<outfit id="18" premium="yes">
		<list gender="0" lookType="270" name="Jester"/>
		<list gender="1" lookType="273" name="Jester"/>
	</outfit>

	<outfit id="19" premium="yes">
		<list gender="0" lookType="279" name="Brotherhood"/>
		<list gender="1" lookType="278" name="Brotherhood"/>
	</outfit>

	<outfit id="20" premium="yes">
		<list gender="0" lookType="288" name="Demonhunter"/>
		<list gender="1" lookType="289" name="Demonhunter"/>
	</outfit>

	<outfit id="21" premium="yes">
		<list gender="0" lookType="324" name="Yalaharian"/>
		<list gender="1" lookType="325" name="Yalaharian"/>
	</outfit>

	<outfit id="22" premium="yes">
		<list gender="0" lookType="336" name="Warmaster"/>
		<list gender="1" lookType="335" name="Warmaster"/>
	</outfit>

	<outfit id="23" default="0">
		<list gender="0" lookType="329" name="Wife"/>
		<list gender="1" lookType="328" name="Husband"/>
	</outfit>

	<outfit id="24" premium="yes">
		<list gender="0" lookType="366" name="Wayfarer"/>
		<list gender="1" lookType="367" name="Wayfarer"/>
	</outfit>
</outfits>



REP+ If you want too, because it took alot of time organizing this thread.

NOTE! It's been tested and no bugs found so far..

Known bugs:
None
 

Attachments

Last edited:

manerinhu

I'm very very MaNeRiNhU
Joined
Jan 14, 2008
Messages
78
Reaction score
1
Location
Behind you!
probably it will happen a lot of bugs, and it's not necessary to compile twice
only a compile all is enough
 
OP
Evil Mark

Evil Mark

Excellent OT User
Joined
Nov 23, 2008
Messages
1,681
Reaction score
28
probably it will happen a lot of bugs, and it's not necessary to compile twice
only a compile all is enough
Yeh, I just compile twice because I always wanna be on the safe side incase I didnt compile it the first time <_<
 

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,895
Reaction score
814
There are changes in protocol and Tibia.dat, so you will debug :)
Yeh, I just compile twice because I always wanna be on the safe side incase I didnt compile it the first time <_<
there is no safe side here - if it doesn't compile: it will show errors.
if it shows errors the first time, it's won't work if you try it all over again.
 
Last edited:
OP
Evil Mark

Evil Mark

Excellent OT User
Joined
Nov 23, 2008
Messages
1,681
Reaction score
28
There are changes in protocol and Tibia.dat, so you will debug :)


there is no safe side here - if it doesn't compile: it will show errors.
if it shows errors the first time, it's won't work if you try it all over again.
It does compile mate, I didn't do any huge edits or anything like that :thumbup:
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,579
Reaction score
843
Location
Caribbean Sea
<.< just wait for TFS update
 

KylerXX

Intermediate OT User
Joined
Jun 24, 2010
Messages
439
Reaction score
28
hmm? but the first part I explained better than you xdd.
 

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
99
Location
Brazil
I hope in tfs 8.60 it dont have too much noob bugs :S (like on equip bug)
 
OP
Evil Mark

Evil Mark

Excellent OT User
Joined
Nov 23, 2008
Messages
1,681
Reaction score
28
Well, nobody said it was flawless. Atleast now we know it has a bug hehe :)
 

Chev

C++ /lua scripter
Joined
May 22, 2010
Messages
181
Reaction score
6
Location
Poland
To work succesfull it, we need new items.otb (more items do crash-client if we see it) and fix any actions (min: attack player, monster die...)
 

ChiSka

Avera.Sytes.Net
Joined
Jul 15, 2009
Messages
865
Reaction score
17
There are changes in protocol and Tibia.dat, so you will debug :)


there is no safe side here - if it doesn't compile: it will show errors.
if it shows errors the first time, it's won't work if you try it all over again.
Yea i done it and debug more

When i opened the guild channel can't login the char again anytime i try it debug before open
 
Top