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

[Gesior AAC] 0.3.6 Character World Transfer Script v2

Norix

Hosting Service !
Joined
Jan 18, 2008
Messages
544
Reaction score
8
Location
Germany
Hi,
I've updated my Character World Transfer Script for Gesior AAC for TFS 0.3.6 to Version 2. Check Changelog for more information.
It looks like the Character World Transfer Page of Real Tibia. Please report any bugs here !

How to install:
1. Paste the script in accountmanagement.php file on line 672 (before //## CREATE CHARACTER on account ### )
2. Then go to line 41 and search for this:
PHP:
</div><table><td width="100%"></td><td>
Replace this part with this:
PHP:
</div><table><td width="100%" align=center>';
if($config['site']['worldtransfer'] == 1)
$main_content .= '<a href="?subtopic=accountmanagement&action=charactertransfer">Character World Transfer</a>';
$main_content .= '</td><td width=50%>
3. Go to config.php file and paste this after line 98:
PHP:
$config['site']['worldtransfer'] = 1;//1-Enable/0-Disable Character World Transfer
$config['site']['worldtransferprice'] = 10;//Price for Character World Transfer
$config['site']['transfermonths'] = 6;//Months for which you cannot make World Transfer with a character
4. Download this images: worldtrade.rar
Extract it and copy the folder to the images folder.

5. Execute this in phpmyadmin:
PHP:
ALTER TABLE `players` ADD `worldtransfer` int(11) NOT NULL DEFAULT '0';

Now here is the Script:
PHP:
//## Character World Transfer by Norix###
	if($config['site']['worldtransfer'] == 1) {
	if($action == "charactertransfer") {
		if(empty($_REQUEST['page'])) { $color1 = 'blue'; $color2 = 'green-blue'; $color3 = 'blue'; $color4 = 'blue'; $color5 = 'blue'; }
		if($_REQUEST['page'] == 'confirm') { $color1 = 'blue'; $color2 = 'green'; $color3 = 'green'; $color4 = 'green-blue'; $color5 = 'blue'; }
		if($_REQUEST['page'] == 'transfer') { $color1 = 'green'; $color2 = 'green'; $color3 = 'green'; $color4 = 'green'; $color5 = 'green'; }
		$main_content .= '<div id="ProgressBar" > <center><h2>Character World Transfer</h2></center><div id="MainContainer" ><div id="BackgroundContainer" ><img id="BackgroundContainerLeftEnd" src="http://otland.net/images/worldtrade/stonebar-left-end.gif" /><div id="BackgroundContainerCenter">
			<div id="BackgroundContainerCenterImage" style="background-image:url(images/worldtrade/stonebar-center.gif);" /></div></div><img id="BackgroundContainerRightEnd" src="http://otland.net/images/worldtrade/stonebar-right-end.gif" /></div>
			<img id="TubeLeftEnd" src="http://otland.net/images/worldtrade/progress-bar-tube-left-green.gif" /><img id="TubeRightEnd" src="http://otland.net/images/worldtrade/progress-bar-tube-right-'.$color1.'.gif" /><div id="FirstStep" class="Steps" ><div class="SingleStepContainer" >
			<img class="StepIcon" src="http://otland.net/images/worldtrade/progress-bar-icon-0-green.gif" /><div class="StepText" style="font-weight:bold;" >Select World</div></div></div><div id="StepsContainer1" ><div id="StepsContainer2" ><div class="Steps" style="width:50%" >
			<div class="TubeContainer" ><img class="Tube" src="http://otland.net/images/worldtrade/progress-bar-tube-'.$color2.'.gif" /></div><div class="SingleStepContainer" ><img class="StepIcon" src="http://otland.net/images/worldtrade/progress-bar-icon-3-'.$color3.'.gif" /><div class="StepText" style="font-weight:normal;" >Confirm Data</div>
			</div></div><div class="Steps" style="width:50%" ><div class="TubeContainer" ><img class="Tube" src="http://otland.net/images/worldtrade/progress-bar-tube-'.$color4.'.gif" /></div><div class="SingleStepContainer" ><img class="StepIcon" src="http://otland.net/images/worldtrade/progress-bar-icon-4-'.$color5.'.gif" />
			<div class="StepText" style="font-weight:normal;" >Transfer Result</div></div></div></div></div></div></div>';
		$user_premium_points = $account_logged->getCustomField('premium_points');
		$playerid = stripslashes(trim($_REQUEST['player_id']));
		$world_id = stripslashes(trim($_REQUEST['new_world']));
		if(empty($_REQUEST['page'])) {
			$player = $ots->createObject('Player');
			$player->load($playerid);
			$time = time();
			$maxtranstime = ($config['site']['transfermonths']*30*24*60*60);
			if(!empty($playerid)) {
				$worldid = (int) $_REQUEST['newworld_'.$player->getId().''];
				$house = $SQL->query('SELECT * FROM houses WHERE owner = '.$player->GetId().';')->fetch();
				$transfertime = ($time-$player->getCustomField('worldtransfer'));
				if($maxtranstime > $transfertime AND $player->getCustomField('worldtransfer') > 0) $time_img = no; else $time_img = yes;
				if($house) $house_img = no; else $house_img = yes;
				if($player->getVocation() < 1) $voc_img = no; else $voc_img = yes;
				if($player->getMarriage() > 1) $mar_img = no; else $mar_img = yes;
	
				if($user_premium_points < $config['site']['worldtransferprice']) $points_img = no; else $points_img = yes;
				$main_content .= 'In order to transfer your character to another game world, you have to fulfil the following requirements:<br/><ul>
					<li style="list-style-image:url(images/worldtrade/'.$mar_img.'.gif)" >You must divorce your spouse first.</li>
					<li style="list-style-image:url(images/worldtrade/'.$house_img.'.gif)" >Character owns no house.</li>
					<li style="list-style-image:url(images/worldtrade/'.$voc_img.'.gif)" >Character has a vocation.</li>
					<li style="list-style-image:url(images/worldtrade/'.$time_img.'.gif)" >Have not done Character World Transfer the last '.$config['site']['transfermonths'].' months.</li>
					<li style="list-style-image:url(images/worldtrade/'.$points_img.'.gif)" >Have atleast '.$config['site']['worldtransferprice'].' premium points on your account.</li></ul>';
			}
			$main_content .= '<form action="" method="post"><input type="hidden" name="player_id" value="'.$playerid.'"/><div class="TableContainer" ><table class="Table3" cellpadding="0" cellspacing="0" ><div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
				<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><div class="Text" >Character Data</div>
				<span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
				<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div></div><tr><td><div class="InnerTableContainer" ><table style="width:100%;" ><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div>
				<div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr class="LabelH" style="background-color:#D4C0A1;" ><td></td><td>Name</td><td>Current World</td><td>Possible Target World</td><td>Requirement Status</td></tr>';
			$account_players = $account_logged->getPlayersList();
			$account_players->orderBy('name');
			foreach($account_players as $account_player) {
				if($account_player->getId() == $playerid) { $border = 'border-style: solid; border-color: #D4C0A1; border-width: 2px;'; $checked = ' checked=checked'; } else { $border = ''; $checked = ''; }
				$main_content .= '<tr style="background-color:#F1E0C6;'.$border.'" ><td><input type="radio" name="player_id" value="'.$account_player->getId().'" '.$checked.' onClick="this.form.submit()"/></td><td>'.$account_player->getName().'</td><td>'.$config['site']['worlds'][$account_player->getWorld()].'</td><td><select name="newworld_'.$account_player->getId().'"><option value="" >(select your target game world)</option>';
				foreach($config['site']['worlds'] as $id => $world_n) {
					if($account_player->getWorld() != $id) {
						$main_content .= '<option value="'.$id.'" onClick="this.form.submit()"';
						if($id == $worldid AND $playerid == $account_player->getId())
						$main_content .= ' selected="selected"';
						$main_content .= '>'.$world_n.'</option>';
					}
				}
				$main_content .= '</select>';
				$house = $SQL->query('SELECT * FROM houses WHERE owner = '.$account_player->GetId().';')->fetch();
				$transfertime = ($time-$account_player->getCustomField('worldtransfer'));
				if(!$house AND $account_player->getVocation() >= 1 AND $account_player->getMarriage() <= 0 AND $user_premium_points >= $config['site']['worldtransferprice'] AND $transfertime >= $maxtranstime)
					$status = '<span class="green" >allowed</span>'; else $status = '<span class="red" >not allowed</span>';
				$main_content .= '</td><td><b>'.$status.'</b></td></tr>';
			}
			$main_content .= '</form><form action="?subtopic=accountmanagement&action=charactertransfer&page=confirm" method="post" ><input type="hidden" name="new_world" value="'.$worldid.'"/><input type="hidden" name="player_id" value="'.$playerid.'"/></table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
				<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></table></div></table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td width=50%>';
			if(!empty($playerid)) 
			$transfertime = ($time-$player->getCustomField('worldtransfer'));
			if(!empty($playerid)) 
			if(!$house AND $player->getVocation() >= 1 AND $player->getMarriage() <= 0 AND $user_premium_points >= $config['site']['worldtransferprice'] AND $transfertime >= $maxtranstime)
			
				$main_content .= '<div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div>';
				$main_content .= '</form></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
				<input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table>';
		}
		if ($_REQUEST['page'] == 'confirm') {
			$player = $ots->createObject('Player');
			$player->load($playerid);
			$main_content .= '<form action="?subtopic=accountmanagement&action=charactertransfer&page=transfer" method="post" ><div class="TableContainer" ><table class="Table4" cellpadding="0" cellspacing="0" ><div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
				<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
				<div class="Text" >Character Data</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
				<span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div></div><tr><td><div class="InnerTableContainer" ><table style="width:100%;" ><tr><td><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div>
				<div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr><td colspan="2" >Do you really want to transfer your character <b>'.$player->getName().'</b>:<br/></td></tr><tr><td class="LabelV" width="150" >Current World:</td>
				<td>'.$config['site']['worlds'][$player->getWorld()].'</td></tr><tr><td class="LabelV" >Target World:</td><td>'.$config['site']['worlds'][$world_id].'</td></tr></table></div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
				<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" >
				<div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr><td><b><span class="red" >Attention:</span></b><br/>If your character is successfully transferred to another game world, you cannot transfer it again within the next '.$config['site']['transfermonths'].' months !</td></tr></table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" >
				<div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr></td></tr></table></div></table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" >
				<input type="hidden" name="player_id" value="'.$playerid.'" ><input type="hidden" name="new_world" value="'.$world_id.'" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div>
				<input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td></tr></form></table><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=accountmanagement&action=charactertransfer" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" >
				<div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></td></tr></table><div></div>';
		}
		if ($_REQUEST['page'] == 'transfer') {
			$SQL->query('UPDATE `players` SET `world_id` = '.$world_id.', `worldtransfer` = '.$SQL->quote(time()).' WHERE `id` = '.$playerid.';');
			$account_logged->setCustomField('premium_points', $user_premium_points-$config['site']['worldtransferprice']);
			$main_content .= '<form action="?subtopic=accountmanagement&action=charactertransfer" method="post" ><div class="TableContainer" ><table class="Table4" cellpadding="0" cellspacing="0" ><div class="CaptionContainer" ><div class="CaptionInnerContainer" ><span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span>
				<span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span><span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span>
				<div class="Text" >Character Data</div><span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span><span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span>
				<span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span><span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span></div></div><tr><td><div class="InnerTableContainer" ><table style="width:100%;" ><tr><td><tr><td><div class="TableShadowContainerRightTop" >
				<div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div><div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr><td colspan="2" >
				<center><b>Character World Transfer successfully done.</b></td></tr></table></div></div><div class="TableShadowContainer" >  <div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div>
				<div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div></div></div></td></tr><tr><td><div class="TableShadowContainerRightTop" ><div class="TableShadowRightTop" style="background-image:url('.$layout_name.'/images/content/table-shadow-rt.gif);" ></div></div>
				<div class="TableContentAndRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-rm.gif);" ><div class="TableContentContainer" ><table class="TableContent" width="100%" ><tr><td><b><span class="red" >Attention:</span></b><br/>If your character is successfully transferred to another game world, you cannot transfer it again within the next '.$config['site']['transfermonths'].' months!</td></tr>
				</table></div></div><div class="TableShadowContainer" ><div class="TableBottomShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bm.gif);" ><div class="TableBottomLeftShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-bl.gif);" ></div><div class="TableBottomRightShadow" style="background-image:url('.$layout_name.'/images/content/table-shadow-br.gif);" ></div>
				</div></div></td></tr></td></tr></table></div></table></div></td></tr><br/><table style="width:100%;" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" >
				<div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Back" alt="Back" src="'.$layout_name.'/images/buttons/_sbutton_back.gif" ></div></div></td></tr></form></table></td></tr></table><div></div>';
		}
	}
	} else {
	$main_content .= 'Sorry, the World Transfer System is currently disabled by the admin. Please ask him for more information.';
	}
Changelog:
  • Version 2:
    -added Time Limit for making World Transfer on a character
    -added possibility to disable World Transfer in config.php

Credits goes to me for script and tibia.com for images !!

Please rep++!!

Your's Norix
 

Attachments

Last edited:
You don't have to add Script if you don't want to, so... Xd

At the Moment this Script doesnt Support à Time Limit but i will add this...

Your's Norix
 
Back
Top