• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

[List] Of codes that might be handy.

Znote

<?php echo $title; ?>
Staff member
Global Moderator
Premium User
Joined
Feb 14, 2008
Messages
7,030
Solutions
256
Reaction score
2,118
Location
Norway
GitHub
Znote
Here is a list of codes that might be useful for you.

First, you might want to learn to compile and modify sources on the TFS servers?
Take a look at this tutorial:
http://otland.net/f137/tutorial-how-compile-forgotten-server-latest-sources-166/


Will edit thread as time comes and add more codes.
You miss a handy code? Reply on this thread, and link it, and I will pin it.

Thread not finish yet. //If any mod want to complete it, please do so.

Credits: The credits does not go to me, once you click on the link your intrested it, you can read the credits for the specific code there.
 
Last edited:
Codes that has been improved, but not in public, or couldn't find in public, but got allowed by the creators:

House system for free account users:
Pazzur said:
Hi Znote,

In commands.cpp, you must find and delete these two pieces of code to make all players able to buy houses without premium:

Code:
							if(player->isPremium())
							{

and

Code:
							else
								player->sendCancelMessage(RET_YOUNEEDPREMIUMACCOUNT);
						}

Let me know if you need more help,
Pazzur

PS: Do you have new NPCs for TFS with travel system and color letters?


For 0.2 you need to edit the source:

in commands.cpp

houses part has to be like this:
Code:
			if(HouseTile* houseTile = dynamic_cast<HouseTile*>(tile))
			{
				if(House* house = houseTile->getHouse())
				{
					if(house->getDoorByPosition(pos))
					{
						if(!house->getHouseOwner())
						{
								uint32_t price = 0;
								for(HouseTileList::iterator it = house->getHouseTileBegin(); it != house->getHouseTileEnd(); it++)
									price += g_config.getNumber(ConfigManager::HOUSE_PRICE);
								if(price)
								{
									uint32_t money = g_game.getMoney(player);
									if(money >= price && g_game.removeMoney(player, price))
									{
										house->setHouseOwner(player->guid);
										player->sendTextMessage(MSG_INFO_DESCR, "You have successfully bought this house, be sure to have the money for the rent in your depot of this city.");
										return true;
									}
									else
										player->sendCancel("You do not have enough money.");
								}
								else
									player->sendCancel("That house doesn't contain any house tile.");
							}
						else
							player->sendCancel("This house alreadly has an owner.");
					}
					else
						player->sendCancel("You have to be looking at the door of the house you would like to buy.");
				}
				else
					player->sendCancel("You have to be looking at the door of the house you would like to buy.");
			}
			else
				player->sendCancel("You have to be looking at the door of the house you would like to buy.");
		}
		else
			player->sendCancel("You have to be looking at the door of the house you would like to buy.");
	}
	return false;
}
I dont have the premium part on my compiler anymore cause I already took it out but thats what it should look like.

This is patch 19 for tfs with free players able to buy houses (obviously all credits go to tfs team):
TheForgottenServer[Patched].exe

I don't know if this was the only thing changed in the .exe (or if it was even changed this way) for patch 20 but it works for me.

I saw this post a bit earlier, could you explain a bit more?

etc, go in commands.cpp, search for "something"

Replace with "something".

I would appreciate it :D
[/QUOTE]
 
Nice , i'm sure this will be useful to people XD

Note: makes me feel special that my old little script is in there :p
 
Credits: The credits does not go to me, once you click on the link your intrested it, you can read the credits for the specific code there.

But thats for appreciating the list. :)
 
hello ot members im having trouble on my server i got it online made new scripts but i dont know how to make a new GM character
if anyone knows pls tell thx.
 
Hail

I need help in script for add black skull in ot server 8.50 =XXX

I has added in my ot icon of protect zone but not skull ¬¬

Help please
 
Here is a list of codes that might be useful for you.

First, you might want to learn to compile and modify sources on the TFS servers?
Take a look at this tutorial:
http://otland.net/f137/tutorial-how-compile-forgotten-server-latest-sources-166/


Will edit thread as time comes and add more codes.
You miss a handy code? Reply on this thread, and link it, and I will pin it.

Thread not finish yet.

Credits: The credits does not go to me, once you click on the link your intrested it, you can read the credits for the specific code there.

Update it!
 
Back
Top