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

Feature Reborn System | Reset level, increase power, set exclusive items, spells, houses, web and more!

Stellow

C++/C#/PHP/LUA
Joined
Oct 23, 2008
Messages
1,106
Reaction score
214
Location
Germany
GitHub
eubrunomiguel
This is a reborn system, on which player reaches level X and then goes back to level 8, you choose how and what status will be available.

This system was designed to TFS 1.2, but can be adapted to any version, the only difference is maybe a function name. Comment if you have problem adapting to your source.

I have attached sources, and few .lua files such as action and movements, to help you make your configurations

Here is the list of features:

- Storage of Rebirths database, this can be handy when creating new websites page
- Rebirth information when looking at a character
- Increase in damage and spells damage by rebirth
- Bonus on acquired health and mana on level up
- Exclusive houses based on rebirth level
- Exclusive spells based on rebirth level
- Exclusive items based on rebirth level
- Doors and teleport access based on rebirth level
- Simple highscore Gesior page
- Lua rebirth functions
- Configuration on config.lua on basic rebirth status, such as required level, damage bonus, percentage of level and hp

Pictures:







Coding:

The c++ code is all labeled with REBIRTH, so if you Ctrl + F for it, you will find it all.

To add houses rebirth requirements, add this to houses.xml:
Code:
 reqrebirth="10"

To add rebirth requirements to spells, add this to spells.xml:
Code:
rebirth="1"

To add rebirth requirements to items, add this to weapons.xml:
Code:
rebirth="1" unproperly="0" -- 0 means that it must fit the requirements to wield

To make custom doors, use a regular quest door, and set action id to 10000 + required reborns, 10010 for 10 reborns for example.

To make custom tiles or teleport, do the same process on the action id.

config.lua configuration:
Code:
rebornLevel = 500000 -- min level to reborn
rebornStats = 5 -- % more hp and mp on every reset ()
rebornDmg = 10 -- % attack bonus per reborn. 10 = 1%, 100 = 10%, 1000 = 100%. accumulative, keep it low!!!!

Files:

https://www.dropbox.com/sh/323ahk3obcrhk21/AAAu1Qz96A1PCFS_8pu5dy7Qa?dl=0
 
This looks cool man and nicely written nice!
 
Just need to create a ranking for the site '-'
for TFS 1x
Code:
<?php
    $result = $SQL->query("SELECT `players`.`name`, `player_storage`.`value` FROM `players` JOIN `player_storage` ON `players`.`id` = `player_storage`.`player_id` WHERE `player_storage`.`key` = 378378 
    ORDER BY CAST(`player_storage`.`value` AS UNSIGNED) DESC LIMIT 30 ;");
        $main_content .= '<div style="text-align: center; font-weight: bold;"><h2>Top Rebirths on ' . $config['server']['serverName'] . '</h2></div> 
<center><table border="0" cellspacing="1" cellpadding="4" width="100%"> 
    <tr bgcolor="'.$config['site']['vdarkborder'].'"> 
        <td width="10%"><b><font color=white><center>Pos</font></center></b></td> 
        <td width="30%"><b><font color=white><center>Player Name</center></b></font></td> 
        <td width="20%"><b><font color=white><center>Level</center></b></font></td> 
        <td width="20%"><b><font color=white><center>Rank</center></b></font></td> 
    </tr>'; 
    $i = 0; 
    foreach ($result as $entry)
    { 
    $i++; 
    $main_content .= '<tr bgcolor="' . (is_int($i / 2) ? $config['site']['lightborder'] : $config['site']['darkborder']). '"> ';
    $main_content .= '
    <td><center>'.$i.' </center></td>
    <td><b><center><a href="?subtopic=characters&name='.$entry['name'].'">'.$entry['name'].'</a></center></b></td>
    <td><center>'. $entry["value"] .'</center></td>';
$rank = $entry["value"];
if ($rank >= 0){$rank_name = 'None';} 
if ($rank >= 1){$rank_name = 'Prestige 1';} 
if ($rank >= 2){$rank_name = 'Prestige 2';} 
if ($rank >= 3){$rank_name = 'Prestige 3';} 
if ($rank >= 4){$rank_name = 'Prestige 4';} 
if ($rank >= 5){$rank_name = 'Prestige 5';} 
if ($rank >= 6){$rank_name = 'Prestige 6';} 
if ($rank >= 7){$rank_name = 'Prestige 7';} 
if ($rank >= 8){$rank_name = 'Prestige 8';} 

    $main_content .= "<td><center>".$rank_name."</center></td></td></tr>";
    } 
    $main_content .= '</table><br />'; 
?>
 
Add this highscore:
Code:
<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/headline-highscores.gif" alt="Contentbox headline">
<?php
if(!defined('INITIALIZED'))
    exit;

$list = 'experience';
if(isset($_REQUEST['list']))
    $list = $_REQUEST['list'];

$page = 0;
if(isset($_REQUEST['page']))
    $page = min(50, $_REQUEST['page']);

$vocation = '';
if(isset($_REQUEST['vocation']))
    $vocation = $_REQUEST['vocation'];

switch($list)
{
    case "fist":
        $id=Highscores::SKILL_FIST;
        $list_name='Fist Fighting';
        break;
    case "club":
        $id=Highscores::SKILL_CLUB;
        $list_name='Club Fighting';
        break;
    case "sword":
        $id=Highscores::SKILL_SWORD;
        $list_name='Sword Fighting';
        break;
    case "axe":
        $id=Highscores::SKILL_AXE;
        $list_name='Axe Fighting';
        break;
    case "distance":
        $id=Highscores::SKILL_DISTANCE;
        $list_name='Distance Fighting';
        break;
    case "shield":
        $id=Highscores::SKILL_SHIELD;
        $list_name='Shielding';
        break;
    case "fishing":
        $id=Highscores::SKILL_FISHING;
        $list_name='Fishing';
        break;
    case "magic":
        $id=Highscores::SKILL__MAGLEVEL;
        $list_name='Magic';
        break;
    default:
        $id=Highscores::SKILL__LEVEL;
        $list_name='Experience';
        break;
}
$world_name = $config['server']['serverName'];

$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Rank</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if($list == "experience")
    $main_content .= '<TD CLASS=whites><b><center>Experience</center></B></TD>';
//$main_content .= '</TR><TR>';
$main_content .= '</TR>';
$number_of_rows = 0;
foreach($skills as $skill)
{
    if($list == "magic")
        $value = $skill->getMagLevel();
    elseif($list == "experience")
        $value = $skill->getLevel();
    else
        $value = $skill->getScore();
    $bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
    $main_content .= '<tr bgcolor="'.$bgcolor.'"><td style="text-align:right">'.($offset + $number_of_rows).'.</td><td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline()>0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td><td><center>'.$value.'</center></td>';
    if($list == "experience")
        $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';
    $main_content .= '</tr>';
}
$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if($page > 0)
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page - 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
if($page < 50)
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page + 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="'.$config['site']['lightborder'].'"><TD><A HREF="?subtopic=highscores&list=experience" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance" CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club" CLASS="size_xs">Club</A><BR><A HREF="?subtopic=highscores&list=sword" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
 
I don't get it, what is so special about this "rebirth system"?
Everything you mentioned can be done without even touching the sources.
 
Not everything, and even if it does, performance wouldn't be the same.
Well I won't argue about performance because I know c++ code is much simpler to write for implementing new systems, but this could have been handle simply using onLook and storages because player is passed to the call back functions in spells, weapons and so forth.
 
Can someone help me to install this on TFS 1.2 please? What should i do?
 

Similar threads

Back
Top