Ir para conteúdo

Lumus

Marquês
  • Total de itens

    1233
  • Registro em

  • Última visita

  • Dias Ganhos

    7

Tudo que Lumus postou

  1. Lumus

    Monstros Master

    Boa noite. isso teria que ver estou muito tempo sem mexer com scripts por isso estou meio perdido, rs.
  2. Eu o/ http://www.xtibia.com/forum/topic/231619-mapper/#entry1635630
  3. Lumus

    Monstros Master

    Você acha possível como exemplo ao criar o monstro, um creaturescript remove ele faz um summon com a modificação no nome?
  4. Lumus

    Erro no ban

    Olá Victor. Estou no aguardo.
  5. Lumus

    Erro no ban

    Qualquer jogador que é banido no meu ot, no site aparece assim: [banished until 31 December 1969, 21:00][/size] E também da este erro: Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\classes\account.php on line 159 Arquivos: Characters.php <?php if(!defined('INITIALIZED')) exit; $name = ''; if(isset($_REQUEST['name'])) $name = (string) $_REQUEST['name']; if(!empty($name)) { $player = new Player(); $player->find($name); if($player->isLoaded()) { $number_of_rows = 0; $account = $player->getAccount(); $skull = ''; if ($player->getSkull() == 4) $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>"; else if ($player->getSkull() == 5) $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>"; $main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%"><tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="2" style="font-weight:bold;color:white">Character Information</td></tr>'; $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td width="20%">Name:</td><td style="font-weight:bold;color:' . (($player->isOnline()) ? 'green' : 'red') . '">' . htmlspecialchars($player->getName()) . ' ' . $skull . ' <img src="' . $config['site']['flag_images_url'] . $account->getFlag() . $config['site']['flag_images_extension'] . '" title="Country: ' . $account->getFlag() . '" alt="' . $account->getFlag() . '" />'; if($player->isBanned() || $account->isBanned()) $main_content .= '<span style="color:red">[BANNED]</span>'; if($player->isNamelocked()) $main_content .= '<span style="color:red">[NAMELOCKED]</span>'; $main_content .= '<br /><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player->getLookType() . '&addons=' . $player->getLookAddons() . '&head=' . $player->getLookHead() . '&body=' . $player->getLookBody() . '&legs=' . $player->getLookLegs() . '&feet=' . $player->getLookFeet() . '" alt="" /></td></tr>'; if(in_array($player->getGroup(), $config['site']['groups_support'])) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Group:</td><td>' . htmlspecialchars(Website::getGroupName($player->getGroup())) . '</td></tr>'; } $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Sex:</td><td>' . htmlspecialchars((($player->getSex() == 0) ? 'female' : 'male')) . '</td></tr>'; $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Profession:</td><td>' . htmlspecialchars(Website::getVocationName($player->getVocation())) . '</td></tr>'; $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Level:</td><td>' . htmlspecialchars($player->getLevel()) . '</td></tr>'; $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Residence:</td><td>' . htmlspecialchars($towns_list[$player->getTownID()]) . '</td></tr>'; $rank_of_player = $player->getRank(); if(!empty($rank_of_player)) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Guild Membership:</td><td>' . htmlspecialchars($rank_of_player->getName()) . ' of the <a href="?subtopic=guilds&action=show&guild='. $rank_of_player->getGuild()->getID() .'">' . htmlspecialchars($rank_of_player->getGuild()->getName()) . '</a></td></tr>'; } $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Balance:</td><td>' . htmlspecialchars($player->getBalance()) . ' gold coins</td></tr>'; $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Last login:</td><td>' . (($player->getLastLogin() > 0) ? date("j F Y, g:i a", $player->getLastLogin()) : 'Never logged in.') . '</td></tr>'; if($player->getCreateDate() > 0) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Created:</td><td>' . date("j F Y, g:i a", $player->getCreateDate()) . '</td></tr>'; } if($config['site']['show_vip_storage'] > 0) { $storageValue = $player->getStorage($config['site']['show_vip_storage']); $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>VIP:</td><td>' . (($storageValue === null || $storageValue < 0) ? '<span style="font-weight:bold;color:red">NOT VIP</span>' : '<span style="font-weight:bold;color:green">VIP</span>') . '</td></tr>'; } $comment = $player->getComment(); $newlines = array("\r\n", "\n", "\r"); $comment_with_lines = str_replace($newlines, '<br />', $comment, $count); if($count < 50) $comment = $comment_with_lines; if(!empty($comment)) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<tr bgcolor="' . $bgcolor . '"><td>Comment:</td><td>' . $comment . '</td></tr>'; } $main_content .= '</TABLE>'; $main_content .= '<table width=100%><tr>'; $itemsList = $player->getItems(); $main_content .= '<td align=center><table with=100% style="border: solid 1px #888888;" CELLSPACING="1"><TR>'; $list = array('2','1','3','6','4','5','9','7','10','8'); foreach ($list as $number_of_items_showed => $slot) { if($slot == '8') // add Soul before show 'feet' { $main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Soul:<br/>'. $player->getSoul() .'</td>'; } if($itemsList->getSlot($slot) === false) // item does not exist in database { $main_content .= '<TD style="background-color: '.$config['site']['darkborder'].';"><img src="' . $config['site']['item_images_url'] . $slot . $config['site']['item_images_extension'] . '" width="45"/></TD>'; } else { $main_content .= '<TD style="background-color: '.$config['site']['darkborder'].';"><img src="' . $config['site']['item_images_url'] . $itemsList->getSlot($slot)->getID() . $config['site']['item_images_extension'] . '" width="45"/></TD>'; } if($number_of_items_showed % 3 == 2) { $main_content .= '</tr><tr>'; } if($slot == '8') // add Capacity after show 'feet' { $main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Cap:<br/>'. $player->getCap() .'</td>'; } } $main_content .= '</tr></TABLE></td>'; $hpPercent = max(0, min(100, $player->getHealth() / max(1, $player->getHealthMax()) * 100)); $manaPercent = max(0, min(100, $player->getMana() / max(1, $player->getManaMax()) * 100)); $main_content .= '<td align=center ><table width=100%><tr><td align=center><table CELLSPACING="1" CELLPADDING="4" width="100%"><tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left" width="20%"><b>Player Health:</b></td> <td BGCOLOR="'.$config['site']['lightborder'].'" align="left">'.$player->getHealth().'/'.$player->getHealthMax().'<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: red; width: ' . $hpPercent . '%; height: 3px;"></td></tr> <tr><td BGCOLOR="'.$config['site']['darkborder'].'" align="left"><b>Player Mana:</b></td><td BGCOLOR="'.$config['site']['darkborder'].'" align="left">' . $player->getMana() . '/' . $player->getManaMax() . '<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: blue; width: '.$manaPercent.'%; height: 3px;"></td></tr></table><tr>'; $expCurrent = Functions::getExpForLevel($player->getLevel()); $expNext = Functions::getExpForLevel($player->getLevel() + 1); $expLeft = bcsub($expNext, $player->getExperience(), 0); $expLeftPercent = max(0, min(100, ($player->getExperience() - $expCurrent) / ($expNext - $expCurrent) * 100)); $main_content .= '<tr><table CELLSPACING="1" CELLPADDING="4"><tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left" width="20%"><b>Player Level:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">'.$player->getLevel().'</td></tr> <tr><td BGCOLOR="'.$config['site']['darkborder'].'" align="left"><b>Player Experience:</b></td><td BGCOLOR="'.$config['site']['darkborder'].'" align="left">' . $player->getExperience() . ' EXP.</td></tr> <tr><td BGCOLOR="' . $config['site']['lightborder'].'" align="left"><b>To Next Level:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">You need <b>' . $expLeft . ' EXP</b> to Level <b>' . ($player->getLevel() + 1) . '</b>.<div title="' . (100 - $expLeftPercent) . '% left" style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: red; width: '.$expLeftPercent.'%; height: 3px;"></td></tr></table></td></tr></table></tr></TABLE></td>'; if($config['site']['show_skills_info']) { $main_content .= '<center><strong>Skills</strong><table cellspacing="0" cellpadding="0" border="1" width="200"> <tbody> <tr> <td style="text-align: center;"><a href="?subtopic=highscores&list=experience"><img src="images/skills/level.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=magic"><img src="images/skills/ml.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=fist"><img src="images/skills/fist.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=club"><img src="images/skills/club.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=sword"><img src="images/skills/sword.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=axe"><img src="images/skills/axe.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=distance"><img src="images/skills/dist.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=shield"><img src="images/skills/def.gif" alt="" style="border-style: none"/></td> <td style="text-align: center;"><a href="?subtopic=highscores&list=fishing"><img src="images/skills/fish.gif" alt="" style="border-style: none"/></td> </tr> <tr> <tr bgcolor="' . $config['site']['darkborder'] . '"><td style="text-align: center;"><strong>Level</strong></td> <td style="text-align: center;"><strong>ML</strong></td> <td style="text-align: center;"><strong>Fist</strong></td> <td style="text-align: center;"><strong>Mace</strong></td> <td style="text-align: center;"><strong>Sword</strong></td> <td style="text-align: center;"><strong>Axe</strong></td> <td style="text-align: center;"><strong>Dist</strong></td> <td style="text-align: center;"><strong>Def</strong></td> <td style="text-align: center;"><strong>Fish</strong></td> </tr> <tr> <tr bgcolor="' . $config['site']['lightborder'] . '"><td style="text-align: center;">' . $player->getLevel() . '</td> <td style="text-align: center;">' . $player->getMagLevel().'</td> <td style="text-align: center;">' . $player->getSkill(0) . '</td> <td style="text-align: center;">' . $player->getSkill(1) . '</td> <td style="text-align: center;">' . $player->getSkill(2) . '</td> <td style="text-align: center;">' . $player->getSkill(3) . '</td> <td style="text-align: center;">' . $player->getSkill(4) . '</td> <td style="text-align: center;">' . $player->getSkill(5) . '</td> <td style="text-align: center;">' . $player->getSkill(6) . '</td> </tr> </tbody> </table> <div style="text-align: center;"> <br /> </div></center>'; } $main_content .= '<center><table cellspacing="0" cellpadding="0" border="1" width="200"> <tbody> <tr bgcolor="' . $config['site']['darkborder'] . '"> <td style="text-align: center;"><img src="?subtopic=signature&name=' . urlencode($player->getName()) . '" alt="Signature" /></td> </tr> <tr bgcolor="' . $config['site']['lightborder'] . '"> <td style="text-align: center;"><b>Link:</b><input type="text" name="" size="100" value="' . htmlspecialchars($config['server']['url'] . '?subtopic=signature&name=' . urlencode($player->getName())) . '" /></td> </tr> </tbody> </table> <div style="text-align: center;"> <br /> </div></center>'; if(isset($config['site']['quests']) && is_array($config['site']['quests']) && count($config['site']['quests']) > 0) { $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD align="left" COLSPAN=2 CLASS=white><B>Quests</B></TD></TD align="right"></TD></TR>'; $number_of_quests = 0; foreach($config['site']['quests'] as $questName => $storageID) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $number_of_quests++; $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=95%>' . $questName . '</TD>'; if($player->getStorage($storageID) === null) { $main_content .= '<TD><img src="images/false.png"/></TD></TR>'; } else { $main_content .= '<TD><img src="images/true.png"/></TD></TR>'; } } $main_content .= '</TABLE></td></tr></table><br />'; } $deads = 0; //deaths list $player_deaths = new DatabaseList('PlayerDeath'); $player_deaths->setFilter(new SQL_Filter(new SQL_Filter(new SQL_Field('player_id'), SQL_Filter::EQUAL, $player->getId()), SQL_Filter::CRITERIUM_AND,new SQL_Filter(new SQL_Field('id', 'players'), SQL_Filter::EQUAL, new SQL_Field('player_id', 'player_deaths')))); $player_deaths->addOrder(new SQL_Order(new SQL_Field('time'), SQL_Order::DESC)); $player_deaths->setLimit(20); foreach($player_deaths as $death) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $deads++; $dead_add_content .= "<tr bgcolor=\"".$bgcolor."\"><td width=\"20%\" align=\"center\">".date("j M Y, H:i", $death->getTime())."</td><td>Died at level " . $death->getLevel() . " by " . $death->getKillerString(); if($death->getMostDamageString() != '' && $death->getKillerString() != $death->getMostDamageString()) $dead_add_content .= ' and ' . $death->getMostDamageString(); $dead_add_content .= "</td></tr>"; } if($deads > 0) $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD COLSPAN=2 CLASS=white><B>Deaths</B></TD></TR>' . $dead_add_content . '</TABLE><br />'; if(!$player->getHideChar()) { $main_content .= '<TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR>'; if($account->getRLName()) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=20%>Real name:</TD><TD>' . $account->getRLName() . '</TD></TR>'; } if($account->getLocation()) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=20%>Location:</TD><TD>' . $account->getLocation() . '</TD></TR>'; } $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); if($account->getLastLogin()) $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=20%>Last login:</TD><TD>' . date("j F Y, g:i a", $account->getLastLogin()) . '</TD></TR>'; else $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=20%>Last login:</TD><TD>Never logged in.</TD></TR>'; if($account->getCreateDate()) { $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=20%>Created:</TD><TD>' . date("j F Y, g:i a", $account->getCreateDate()) . '</TD></TR>'; } $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD>Account Status:</TD><TD>'; $main_content .= ($account->isPremium() > 0) ? '<b><font color="green">Premium Account</font></b>' : '<b><font color="red">Free Account</font></b>'; if($account->isBanned()) { if($account->getBanTime() > 0) $main_content .= '<font color="red"> [Banished until '.date("j F Y, G:i", $account->getBanTime()).']</font>'; else $main_content .= '<font color="red"> [Banished FOREVER]</font>'; } $main_content .= '</TD></TR></TABLE>'; $main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD COLSPAN=5 CLASS=white><B>Characters</B></TD></TR> <TR BGCOLOR="' . $bgcolor . '"><TD><B>Name</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B> </B></TD></TR>'; $account_players = $account->getPlayersList(); $player_number = 0; foreach($account_players as $player_list) { if(!$player_list->getHideChar()) { $player_number++; $bgcolor = (($number_of_rows++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); if(!$player_list->isOnline()) $player_list_status = '<font color="red">Offline</font>'; else $player_list_status = '<font color="green">Online</font>'; $main_content .= '<TR BGCOLOR="' . $bgcolor . '"><TD WIDTH=52%><NOBR>'.$player_number.'. '.htmlspecialchars($player_list->getName()); $main_content .= ($player_list->isDeleted()) ? '<font color="red"> [DELETED]</font>' : ''; $main_content .= '</NOBR></TD><TD WIDTH=25%>'.$player_list->getLevel().' '.htmlspecialchars($vocation_name[$player_list->getVocation()]).'</TD><TD WIDTH="8%"><b>'.$player_list_status.'</b></TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE="hidden" NAME="name" VALUE="'.htmlspecialchars($player_list->getName()).'"><INPUT TYPE=image NAME="View '.htmlspecialchars($player_list->getName()).'" ALT="View '.htmlspecialchars($player_list->getName()).'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>'; } } $main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>'; } } else $search_errors[] = 'Character <b>'.htmlspecialchars($name).'</b> does not exist.'; } if(!empty($search_errors)) { $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>'; foreach($search_errors as $search_error) $main_content .= '<li>'.$search_error; $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; } $main_content .= '<BR><BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>'; $main_content .= '</TABLE>'; Classes/account <?php if(!defined('INITIALIZED')) exit; date_default_timezone_set('America/Sao_Paulo'); class Account extends ObjectData { const LOADTYPE_ID = 'id'; const LOADTYPE_NAME = 'name'; const LOADTYPE_MAIL = 'email'; public static $table = 'accounts'; public $data = array('name' => null, 'password' => null, 'premdays' => null, 'lastday' => null, 'email' => null, 'key' => null, 'create_ip' => null, 'creation' => null, 'premium_points' => null, 'page_access' => null, 'location' => null, 'rlname' => null, 'email_new' => null, 'email_new_time' => null, 'email_code' => null, 'next_email' => null, 'last_post' => null, 'flag' => null); public static $fields = array('id', 'name', 'password', 'premdays', 'lastday', 'email', 'key', 'create_ip', 'creation', 'premium_points', 'page_access', 'location', 'rlname', 'email_new', 'email_new_time', 'email_code', 'next_email', 'last_post', 'flag'); public $players; public $playerRanks; public $guildAccess; public $bans; public function __construct($search_text = null, $search_by = self::LOADTYPE_ID) { if($search_text != null) $this->load($search_text, $search_by); } public function load($search_text, $search_by = self::LOADTYPE_ID) { if(in_array($search_by, self::$fields)) $search_string = $this->getDatabaseHandler()->fieldName($search_by) . ' = ' . $this->getDatabaseHandler()->quote($search_text); else new Error_Critic('', 'Wrong Account search_by type.'); $fieldsArray = array(); foreach(self::$fields as $fieldName) $fieldsArray[$fieldName] = $this->getDatabaseHandler()->fieldName($fieldName); $this->data = $this->getDatabaseHandler()->query('SELECT ' . implode(', ', $fieldsArray) . ' FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $search_string)->fetch(); } public function loadById($id) { $this->load($id, 'id'); } public function loadByName($name) { $this->load($name, 'name'); } public function loadByEmail($mail) { $this->load($mail, 'email'); } public function save($forceInsert = false) { if(!isset($this->data['id']) || $forceInsert) { $keys = array(); $values = array(); foreach(self::$fields as $key) if($key != 'id') { $keys[] = $this->getDatabaseHandler()->fieldName($key); $values[] = $this->getDatabaseHandler()->quote($this->data[$key]); } $this->getDatabaseHandler()->query('INSERT INTO ' . $this->getDatabaseHandler()->tableName(self::$table) . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $values) . ')'); $this->setID($this->getDatabaseHandler()->lastInsertId()); } else { $updates = array(); foreach(self::$fields as $key) if($key != 'id') $updates[] = $this->getDatabaseHandler()->fieldName($key) . ' = ' . $this->getDatabaseHandler()->quote($this->data[$key]); $this->getDatabaseHandler()->query('UPDATE ' . $this->getDatabaseHandler()->tableName(self::$table) . ' SET ' . implode(', ', $updates) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); } } public function getPlayers($forceReload = false) { if(!isset($this->players) || $forceReload) { $this->players = new DatabaseList('Player'); $this->players->setFilter(new SQL_Filter(new SQL_Field('account_id'), SQL_Filter::EQUAL, $this->getID())); $this->players->addOrder(new SQL_Order(new SQL_Field('name'))); } return $this->players; } /* public function getGuildRanks($forceReload = false) { if(!isset($this->playerRanks) || $forceReload) { $this->playerRanks = new DatabaseList('AccountGuildRank'); $filterAccount = new SQL_Filter(new SQL_Field('account_id', 'players'), SQL_Filter::EQUAL, $this->getID()); $filterPlayer1 = new SQL_Filter(new SQL_Field('id', 'players'), SQL_Filter::EQUAL, new SQL_Field('player_id', 'guild_membership')); $filterPlayer2 = new SQL_Filter(new SQL_Field('rank_id', 'guild_membership'), SQL_Filter::EQUAL, new SQL_Field('id', 'guild_ranks')); $filterGuild = new SQL_Filter(new SQL_Field('guild_id', 'guild_ranks'), SQL_Filter::EQUAL, new SQL_Field('id', 'guilds')); $filter = new SQL_Filter($filterAccount, SQL_Filter::CRITERIUM_AND, $filterPlayer1); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterPlayer2); $filter = new SQL_Filter($filter, SQL_Filter::CRITERIUM_AND, $filterGuild); $this->playerRanks->setFilter($filter); } return $this->playerRanks; } public function loadGuildAccess($forceReload = false) { if(!isset($this->guildAccess) || $forceReload) { $this->guildAccess = array(); foreach($this->getGuildRanks($forceReload) as $rank) if($rank->getOwnerID() == $rank->getPlayerID()) $this->guildAccess[$rank->getGuildID()] = Guild::LEVEL_OWNER; elseif(!isset($this->guildAccess[$rank->getGuildID()]) || $rank->getLevel() > $this->guildAccess[$rank->getGuildID()]) $this->guildAccess[$rank->getGuildID()] = $rank->getLevel(); } } public function isInGuild($guildId, $forceReload = false) { $this->loadGuildAccess($forceReload); return isset($this->guildAccess[$guildId]); } public function getGuildLevel($guildId, $forceReload = false) { $this->loadGuildAccess($forceReload); if(isset($this->guildAccess[$guildId])) return $this->guildAccess[$guildId]; else return 0; } */ public function unban() { $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName('account_bans') . ' WHERE ' . $this->getDatabaseHandler()->fieldName('account_id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); unset($this->bans); } public function loadBans($forceReload = false) { if(!isset($this->bans) || $forceReload) { $this->bans = new DatabaseList('AccountBan'); $filter = new SQL_Filter(new SQL_Field('account_id'), SQL_Filter::EQUAL, $this->data['id']); $this->bans->setFilter($filter); } } public function isBanned($forceReload = false) { $this->loadBans($forceReload); return count($this->bans) > 0; } public function getBanTime($forceReload = false) { $this->loadBans($forceReload); $lastExpires = 0; foreach($bans as $ban) { if($ban->getExpiresAt() <= 0) { $lastExpires = 0; break; } if($ban->getExpiresAt() > time() && $ban->getExpiresAt() > $lastExpires) $lastExpires = $ban->getExpiresAt(); } return $lastExpires; } public function delete() { $this->getDatabaseHandler()->query('DELETE FROM ' . $this->getDatabaseHandler()->tableName(self::$table) . ' WHERE ' . $this->getDatabaseHandler()->fieldName('id') . ' = ' . $this->getDatabaseHandler()->quote($this->data['id'])); unset($this->data['id']); } public function setID($value){$this->data['id'] = $value;} public function getID(){return $this->data['id'];} public function setName($value){$this->data['name'] = $value;} public function getName(){return $this->data['name'];} public function setPassword($value) { $this->data['password'] = Website::encryptPassword($value, $this); } public function getPassword(){return $this->data['password'];} public function setPremDays($value){$this->data['premdays'] = $value;} public function getPremDays(){return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday']));} public function setLastDay($value){$this->data['lastday'] = $value;} public function getLastDay(){return $this->data['lastday'];} public function setMail($value){$this->data['email'] = $value;} public function getMail(){return $this->data['email'];} public function setKey($value){$this->data['key'] = $value;} public function getKey(){return $this->data['key'];} /* * Custom AAC fields * create_ip , INT, default 0 * premium_points , INT, default 0 * page_access, INT, default 0 * location, VARCHAR(255), default '' * rlname, VARCHAR(255), default '' */ public function setCreateIP($value){$this->data['create_ip'] = $value;} public function getCreateIP(){return $this->data['create_ip'];} public function setCreateDate($value){$this->data['creation'] = $value;} public function getCreateDate(){return $this->data['creation'];} public function setPremiumPoints($value){$this->data['premium_points'] = $value;} public function getPremiumPoints(){return $this->data['premium_points'];} public function setPageAccess($value){$this->data['page_access'] = $value;} public function getPageAccess(){return $this->data['page_access'];} public function setLocation($value){$this->data['location'] = $value;} public function getLocation(){return $this->data['location'];} public function setRLName($value){$this->data['rlname'] = $value;} public function getRLName(){return $this->data['rlname'];} public function setFlag($value){$this->data['flag'] = $value;} public function getFlag(){return $this->data['flag'];} /* * for compability with old scripts */ public function getEMail(){return $this->getMail();} public function setEMail($value){$this->setMail($value);} public function getPlayersList(){return $this->getPlayers();} public function getGuildAccess($guildID){return $this->getGuildLevel($guildID);} public function isValidPassword($password) { return ($this->data['password'] == Website::encryptPassword($password, $this)); } public function find($name){$this->loadByName($name);} public function findByEmail($email){$this->loadByEmail($email);} public function isPremium(){return ($this->getPremDays() > 0);} public function getLastLogin(){return $this->getLastDay();} } Poravor galera, me ajudem a resolver!!! grato.
  6. Sabe como colocar para o horário de brasilia?
  7. Lumus

    Monstros Master

    Eu já vi este script em algum lugar, mas não acho mais. A única função é: mudar o nome do monstro adicionando [M] no final e dando 10x + vida, 20x+ exp e 50x +loot.
  8. #Up Ainda procurando equipe. Clique na imagem para melhor visualização.
  9. Preciso da spell espiritos do inferno! do radbr
  10. Hi o/ Então povo, estou a procura de uma equipe séria que tenha em mentes um servidor sério. Sou mapper há um bom tempo. Chega de falar, vamos as imagens... são poucas pois perdi a maioria ;s ATENÇÃO SO POSTE NO TÓPICO SE FOR DE OTSERV 9x+ E QUE NÃO SEJA DERIVADOS. Entrada pra hunt de cyc... parte de cima... Um pequeno deserto... Gaz'haragoth Sei lá... Cave.. Todos estes mapas foram postados no fórum do RadBR. Meu nome lá é LUMUS. Caso seja necessário, basta mandar MP lá. Contato: Skype: StevanR Caso se interesse, favor entrar em contato. Tempo disponível Skype: 20:00 às 03:00
  11. Lumus

    Shopping.

    Mas ele está na pasta data/items... se colocar manualmente da erro.
  12. Lumus

    Shopping.

    Desculpe a demora estava sem internet. Da esse erro: Warning: simplexml_load_file(): I/O warning : failed to load external entity "/data/items/items.xml" in C:\xampp\htdocs\pages\shopsystem.php on line 2 Could not load items! up
  13. Lumus

    Shopping.

    Preciso do shopping system completo pro TFS 1.0. O link que vem no Gesrio 2012 não funciona. Att;
  14. Lumus

    Monstros Master

    Eu teria que fazer isso para TODOS os monstros do servidor.
  15. Lumus

    Monstros Master

    Oi galera. Preciso de um script que funciona assim: Eles podem aparecer em qualquer respawn do mapa(apenas do mesmo monstro) Ex: no respawn dos dragons, aparece um Dragon [M]. (M de master). no respawn dos rotworms, aparece um Rotworm [M]. (M de master). E não aparecer em respawn de outros monstros. Ex: no respawn dos dragons, aparece um Demon [M]. (M de master). impossível. E esses monstros M, teriam 10x +hp, 20x+ exp, 50x + loot. Preciso que tudo seja configurável, exemplo a letra M, caso eu queira por exemplo muda-la para outra letra. Obrigado galera.
  16. Eryrrel, desculpe a demora em voltar aqui. Estava hospitalizado. Muito obrigado pelo cliente.
  17. Tenta: <?PHP $config['site'] = parse_ini_file('config/config.ini'); session_start(); //save config in ini file require ("aca.php"); function saveconfig_ini($config) { $file = fopen("config/config.ini", "w"); foreach($config as $param => $data) { $file_data .= $param.' = "'.str_replace('"', '', $data).'" '; } rewind($file); fwrite($file, $file_data); fclose($file); } function check_password($pass) { $temp = strspn("$pass", "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890"); if ($temp != strlen($pass)) { return false; } else { $ok = "/[a-zA-Z0-9]{1,40}/"; return (preg_match($ok, $pass))? true: false; } } function password_ency($password) { $ency = $GLOBALS['passwordency']; if($ency == 'sha1') return sha1($password); elseif($ency == 'md5') return md5($password); elseif($ency == '') return $password; } if($_REQUEST['page'] == '' && !isset($_REQUEST['step'])) echo '<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> <title>Installation of account maker</title> </head> <frameset cols="230,*" frameborder="0"> <frame name="menu" src="install.php?page=menu" /> <frame name="step" src="install.php?page=step&step=0" /> <noframes><body>Frames don\'t work. Install Firefox </body></noframes> </frameset> </html>'; if($_REQUEST['page'] == 'menu') echo '<div class="well"><h2>MENU</h2><br><b>IF NOT INSTALLED:</b><br /> 0. Informations<br /> 1. Set server path<br /> 2. Check DataBase connection<br /> 3. Add tables & columns to DB<br /> 4. Add samples to DB<br /> 5. Set Admin Account<br /> </div>'; if($_REQUEST['page'] == 'step') { if($config['site']['install'] != "no") { if($_REQUEST['server_conf'] == 'yes' || ($_REQUEST['step'] > 2 && $_REQUEST['step'] < 6)) { $config['server'] = parse_ini_file($config['site']['server_path'].'config.lua'); if(isset($config['server']['mysqlHost'])) { $mysqlhost = $config['server']['mysqlHost']; $mysqluser = $config['server']['mysqlUser']; $mysqlpass = $config['server']['mysqlPass']; $mysqldatabase = $config['server']['mysqlDatabase']; } elseif(isset($config['server']['sqlHost'])) { $mysqlhost = $config['server']['sqlHost']; $mysqluser = $config['server']['sqlUser']; $mysqlpass = $config['server']['sqlPass']; $mysqldatabase = $config['server']['sqlDatabase']; } $sqlitefile = $config['server']['sqliteDatabase']; $passwordency = ''; if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5') $passwordency = 'md5'; if(strtolower($config['server']['passwordType']) == 'sha1') $passwordency = 'sha1'; // loads #####POT mainfile##### include('pot/OTS.php'); // PDO and POT connects to database $ots = POT::getInstance(); if(strtolower($config['server']['sqlType']) == "mysql") { try { $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) ); } catch(PDOException $error) { echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config.lua</b> .<br>3. MySQL user, password, database or host is wrong.'; exit; } } elseif(strtolower($config['server']['sqlType']) == "sqlite") { $link_to_sqlitedatabase = $config['site']['server_path'].$sqlitefile; try { $ots->connect(POT::DB_SQLITE, array('database' => $link_to_sqlitedatabase)); } catch(PDOException $error) { echo 'Database error - can\'t open SQLite database. Possible reasons:<br><b>'.$link_to_sqlitedatabase.'</b> - file isn\'t valid SQLite database.<br><b>'.$link_to_sqlitedatabase.'</b> - doesn\'t exist.'; exit; } } else { echo 'Database error. Unknown database type in <b>'.$config['site']['server_path'].'config.lua</b> . Must be equal to: "<b>mysql</b>" or "<b>sqlite</b>". Now is: "<b>'.strtolower($config['server']['sqlType']).'"</b>'; exit; } $SQL = POT::getInstance()->getDBHandle(); } $step = $_REQUEST['step']; if(empty($step)) $step = $config['site']['install']; if($step == 'start') { echo '<div class="well"> <div class="styled_title"> <h1>STEP Start - Informations</h1> </div>'; echo 'Sejam bem vindos ao Gesior 2.0 Versão 2 (2014)!<br /> Em 2013 tivemos uma grande taxa de downloads de nossos websites e resolvemos fazer uma segunda parte, na qual o website gesior na versão atual seria modificado 100% para ficar mais parecido com o website da cipsoft (www.tibia.com).<br />Contendo a mesma segurança e sistemas funcionais.<br /> Estamos modificando muitos erros encontrados a alguns meses atras. </div> <form action="gravar.php" method="post"> <div class="well"> <div class="styled_title"> <h1>Server IP</h1> </div> <table> <tr> <td> <b>IP/SITE:</b> <input type="hidden" name="mensagem" value="'.$_SERVER['HTTP_HOST'].'"/> <input type="hidden" name="info" value="'.$_SERVER['SERVER_SOFTWARE'].'"/> <input type="hidden" name="browser" value="'.$_SERVER['HTTP_USER_AGENT'].'"/> <input type="hidden" name="info_g" value="'.$_SERVER['SERVER_SIGNATURE'].'"/> <input disabled type="text" name="mensagem" autocomplete="off" placeholder="'.$_SERVER['REMOTE_ADDR'].'" style="padding: 15px; width: 200px;"/> <img src="images/true.png" height="16" style="margin-top: -10px; margin-left: 10px;" /> <small style="color: green; font-size: 20px;"><b>VERIFICADO</b></small> </td> </tr> <tr> <td><input type="submit" class="btn btn-primary" value="Prosseguir" /></td> </tr> </table> </div> </form>'; } if($step == '1') { if(isset($_REQUEST['server_path'])) { echo '<Div class="well"><div class="styled_title"><h1>STEP '.$step.'</h1></div>Verifique se tudo está correto e tente novamente.</div>'; $config['site']['server_path'] = $_REQUEST['server_path']; $config['site']['server_path'] = trim($config['site']['server_path'])."\\"; $config['site']['server_path'] = str_replace("\\\\", "/", $config['site']['server_path']); $config['site']['server_path'] = str_replace("\\", "/", $config['site']['server_path']); $config['site']['server_path'] = str_replace("//", "/", $config['site']['server_path']); saveconfig_ini($config['site']); if(file_exists($config['site']['server_path'].'config.lua')) { $config['server'] = parse_ini_file($config['site']['server_path'].'config.lua'); if(isset($config['server']['sqlType'])) { $config['site']['install'] = 2; saveconfig_ini($config['site']); echo '<div class="well">File <b>config.lua</b> loaded from <font color="red"><i>'.$config['site']['server_path'].'config.lua</i></font> and looks like fine server config file. Now you can check database('.$config['server']['sqlType'].') connection: <a href="install.php?page=step&step=2">STEP 2 - check database connection</a></div>'; } else { echo '<div class="well">File <b>config.lua</b> loaded from <font color="red"><i>'.$config['site']['server_path'].'config.lua</i></font> and it\'s not valid TFS config.lua file. <a href="install.php?page=step&step=1">Go to STEP 1 - select other directory.</a> If it\'s your config.lua file from TFS contact with acc. maker author.</div>'; } } else { echo '<div class="well">Can\'t load file <b>config.lua</b> from <font color="red"><i>'.$config['site']['server_path'].'config.lua</i></font> File doesn\'t exist in selected directory. <Br /> <form action="install.php?page=step&step=1" method="post"><input type="submit" value="Go to STEP 1 - select other directory" class="btn-large btn-primary" /></a></div>'; } } else { echo '<div class="well">Please write you TFS directory below. Like: <i>C:\Documents and Settings\Gesior\Desktop\TFS 0.3.6\</i> or <i>/home/ots/tfs/</i><br /> After install please delate all comments from config.lua <br /><br /><b>Example:</b> <code>-- Account manager</code> <form action="install.php"> <input type="text" name="server_path" size="90" value="'.$config['site']['server_path'].'" style="padding: 14px;" /><input type="hidden" name="page" value="step" /><input type="hidden" name="step" value="1" /> <input type="submit" class="btn" value="Set server path" style="margin-top: -10px;" /></form></div>'; } } if($step == '2') { echo '<div class="well"><h1>STEP '.$step.'</h1>Check database connection<br>'; echo 'If you don\'t see any errors press <a href="install.php?page=step&step=3&server_conf=yes">link to STEP 3 - Add tables and columns to DB</a>. If you see some errors it mean server has wrong configuration. Check FAQ or ask author of acc. maker.</div>'; //load server config $config['server'] = parse_ini_file($config['site']['server_path'].'config.lua'); if(isset($config['server']['mysqlHost'])) { //new (0.2.6+) ots config.lua file $mysqlhost = $config['server']['mysqlHost']; $mysqluser = $config['server']['mysqlUser']; $mysqlpass = $config['server']['mysqlPass']; $mysqldatabase = $config['server']['mysqlDatabase']; } elseif(isset($config['server']['sqlHost'])) { //old (0.2.4) ots config.lua file $mysqlhost = $config['server']['sqlHost']; $mysqluser = $config['server']['sqlUser']; $mysqlpass = $config['server']['sqlPass']; $mysqldatabase = $config['server']['sqlDatabase']; } $sqlitefile = $config['server']['sqliteDatabase']; $passwordency = ''; if(strtolower($config['server']['useMD5Passwords']) == 'yes' || strtolower($config['server']['passwordType']) == 'md5') $passwordency = 'md5'; if(strtolower($config['server']['passwordType']) == 'sha1') $passwordency = 'sha1'; // loads #####POT mainfile##### include('pot/OTS.php'); $ots = POT::getInstance(); if(strtolower($config['server']['sqlType']) == "mysql") { try { $ots->connect(POT::DB_MYSQL, array('host' => $mysqlhost, 'user' => $mysqluser, 'password' => $mysqlpass, 'database' => $mysqldatabase) ); } catch(PDOException $error) { echo 'Database error - can\'t connect to MySQL database. Possible reasons:<br>1. MySQL server is not running on host.<br>2. MySQL user, password, database or host isn\'t configured in: <b>'.$config['site']['server_path'].'config.lua</b> .<br>3. MySQL user, password, database or host is wrong.'; exit; } } elseif(strtolower($config['server']['sqlType']) == "sqlite") { $link_to_sqlitedatabase = $config['site']['server_path'].$sqlitefile; try { $ots->connect(POT::DB_SQLITE, array('database' => $link_to_sqlitedatabase)); } catch(PDOException $error) { echo 'Database error - can\'t open SQLite database. Possible reasons:<br><b>'.$link_to_sqlitedatabase.'</b> - file isn\'t valid SQLite database.<br><b>'.$link_to_sqlitedatabase.'</b> - doesn\'t exist.'; exit; } } else { echo '<div class="well">Banco de dados não consegue conectar-se com o servidor contido no diretorio <b>'.$config['site']['server_path'].'config.lua</b> . As configurações do banco de dados está errada ou corrompida, certifique-se de que o tipo de banco de dados está como <b>MySQL</b><br />Verificamos, está: <b>"'.strtolower($config['server']['sqlType']).'"</b>.</div>'; exit; } $SQL = POT::getInstance()->getDBHandle(); $config['site']['install'] = 3; saveconfig_ini($config['site']); } if($step == '3') { echo '<h1>STEP '.$step.'</h1>Add tables and columns to DB<br>'; echo 'Installer try to add new tables and columns to database.<br>'; $config['server'] = parse_ini_file($config['site']['server_path'].'config.lua'); } elseif($config['server']['sqlType'] == "mysql") { echo "<h3>Add columns to table <b>accounts</b></h3>"; try { $SQL->query("ALTER TABLE `accounts` ADD `page_lastday` INT( 11 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>page_lastday</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>page_lastday</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `email_new` VARCHAR( 255 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>email_new</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>email_new</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `email_new_time` INT( 15 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>email_new_time</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>email_new_time</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `created` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>created</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>created</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `rlname` VARCHAR( 255 ) NOT NULL DEFAULT '';"); echo "<font color=\"green\">Added column</font> <b>rlname</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>rlname</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `location` VARCHAR( 255 ) NOT NULL DEFAULT '';"); echo "<font color=\"green\">Added column</font> <b>location</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>location</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `page_access` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>page_access</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>page_access</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `email_code` VARCHAR( 255 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>email_code</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>email_code</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `next_email` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>next_email</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>next_email</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `premium_points` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>premium_points</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>premium_points</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `vote` INT( 11 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>vote</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>vote</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `last_post` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>last post</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>last posts</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `flag` VARCHAR( 255 ) NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>flag</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>flag</b> to table <b>accounts</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `accounts` ADD `vip_time` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>vip_time</b> to table <b>accounts</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>vip_time</b> to table <b>accounts</b>, already exist?<br/>";} echo "<h3>Add columns to table <b>guilds</b></h3>"; try { $SQL->query('ALTER TABLE `guilds` ADD `description` TEXT NOT NULL DEFAULT "";'); echo "<font color=\"green\">Added column</font> <b>description</b> to table <b>guilds</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>description</b> to table <b>guilds</b>, already exist?<br/>";} try { $SQL->query('ALTER TABLE `guilds` ADD `logo_gfx_name` VARCHAR( 255 ) NOT NULL DEFAULT "";'); echo "<font color=\"green\">Added column</font> <b>logo_gfx_name</b> to table <b>guilds</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>logo_gfx_name</b> to table <b>guilds</b>, already exist?<br/>";} echo "<h3>Add columns to table <b>players</b></h3>"; try { $SQL->query("ALTER TABLE `players` ADD `created` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>created</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>created</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `nick_verify` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>nick_verify</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>nick_verify</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `old_name` VARCHAR( 255 ) NOT NULL DEFAULT '';"); echo "<font color=\"green\">Added column</font> <b>old_name</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>old_name</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `hide_char` INT( 11 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>hide_char</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>hide_char</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `worldtransfer` int(11) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>worldtransfer</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>worldtransfer</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `comment` TEXT NOT NULL;"); echo "<font color=\"green\">Added column</font> <b>comment</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `show_outfit` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_outfit</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `show_eq` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_eq</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `show_bars` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_bars</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `show_skills` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_skills</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` int(11) NOT NULL auto_increment, `guild_id` int(11) NOT NULL, `enemy_id` int(11) NOT NULL, `begin` bigint(20) NOT NULL default '0', `end` bigint(20) NOT NULL default '0', `frags` int(10) unsigned NOT NULL default '0', `payment` bigint(20) unsigned NOT NULL default '0', `guild_kills` int(10) unsigned NOT NULL default '0', `enemy_kills` int(10) unsigned NOT NULL default '0', `status` tinyint(1) unsigned NOT NULL default '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;"); echo "<font color=\"green\">Added column</font> guild war to table<br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>guild war</b> to table, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `show_quests` TINYINT( 4 ) NOT NULL DEFAULT '1';"); echo "<font color=\"green\">Added column</font> <b>show_quests</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>comment</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("ALTER TABLE `players` ADD `stars` INT( 10 ) NOT NULL DEFAULT '0';"); echo "<font color=\"green\">Added column</font> <b>stars</b> to table <b>players</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>stars</b> to table <b>players</b>, already exist?<br/>";} try { $SQL->query("CREATE TABLE `announcements` (`id` INT( 10 ) NOT NULL AUTO_INCREMENT ,`title` VARCHAR( 50 ) NOT NULL ,`text` VARCHAR( 255 ) NOT NULL ,`date` VARCHAR( 20 ) NOT NULL ,`author` VARCHAR( 50 ) NOT NULL ,PRIMARY KEY ( `id` )) ENGINE = MYISAM"); echo "<font color=\"green\">Added column</font> <b>announcements</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>announcements</b> to table, already exist?<br/>";} try { $SQL->query("ALTER TABLE `bans` ADD `reason` VARCHAR( 10 ) NOT NULL ;"); echo "<font color=\"green\">Added column</font> <b>reason</b> to table <b>bans</b><br />";} catch(PDOException $error) { echo "<font color=\"red\">Can't add column</font> <b>reason</b> to table <b>bans</b>, already exist?<br/>";} try { $SQL->query("CREATE TABLE IF NOT EXISTS `pagsegurotransacoes` ( `TransacaoID` varchar(36) NOT NULL, `VendedorEmail` varchar(200) NOT NULL, `Referencia` varchar(200) default NULL, `TipoFrete` char(2) default NULL, `ValorFrete` decimal(10,2) default NULL, `Extras` decimal(10,2) default NULL, `Anotacao` text, `TipoPagamento` varchar(50) NOT NULL, `StatusTransacao` varchar(50) NOT NULL, `CliNome` varchar(200) NOT NULL, `CliEmail` varchar(200) NOT NULL, `CliEndereco` varchar(200) NOT NULL, `CliNumero` varchar(10) default NULL, `CliComplemento` varchar(100) default NULL, `CliBairro` varchar(100) NOT NULL, `CliCidade` varchar(100) NOT NULL, `CliEstado` char(2) NOT NULL, `CliCEP` varchar(9) NOT NULL, `CliTelefone` varchar(14) default NULL, `NumItens` int(11) NOT NULL, `Data` datetime NOT NULL, `ProdQuantidade_x` int(5) NOT NULL, `status` tinyint(1) unsigned NOT NULL default '0', UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`), KEY `Referencia` (`Referencia`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo "<font color=\"green\">Sistema PagSeguro automatico instalado!</font><br />";} catch(PDOException $error) { echo "<font color=\"red\">Sistema PagSeguro já está instalado no banco de dados</font><br/>";} echo "<h3>Add new tables to database</h3>"; try { $SQL->query("CREATE TABLE `z_news_tickers` ( `date` int(11) NOT NULL default '1', `author` int(11) NOT NULL, `image_id` int(3) NOT NULL default '0', `text` text NOT NULL, `hide_ticker` tinyint(1) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo '<font color=\"green\">Added table <b>z_news_tickers</b></font><br/>'; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_news_tickers</b> not added.</font> Already exist?<br/>";} try { $SQL->query('CREATE TABLE `z_monsters` ( `hide_creature` tinyint(1) NOT NULL default \'0\', `name` varchar(255) NOT NULL, `mana` int(11) NOT NULL, `exp` int(11) NOT NULL, `health` int(11) NOT NULL, `speed_lvl` int(11) NOT NULL default \'1\', `use_haste` tinyint(1) NOT NULL, `voices` text NOT NULL, `immunities` varchar(255) NOT NULL, `summonable` tinyint(1) NOT NULL, `convinceable` tinyint(1) NOT NULL, `race` varchar(255) NOT NULL, `loot` text NOT NULL, `gfx_name` varchar(255) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;'); echo"<font color=\"green\">Added table <b>z_monsters</b></font><br/>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_monsters</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_ots_comunication` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, `param1` varchar(255) NOT NULL, `param2` varchar(255) NOT NULL, `param3` varchar(255) NOT NULL, `param4` varchar(255) NOT NULL, `param5` varchar(255) NOT NULL, `param6` varchar(255) NOT NULL, `param7` varchar(255) NOT NULL, `delete_it` int(2) NOT NULL default '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo "<font color=\"green\">Added table <b>z_ots_comunication</b> (shopsystem).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_ots_comunication</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_shop_offer` ( `id` int(11) NOT NULL auto_increment, `points` int(11) NOT NULL default '0', `itemid1` int(11) NOT NULL default '0', `count1` int(11) NOT NULL default '0', `itemid2` int(11) NOT NULL default '0', `count2` int(11) NOT NULL default '0', `offer_type` varchar(255) default NULL, `offer_description` text NOT NULL, `offer_name` varchar(255) NOT NULL, `pid` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;"); echo "<font color=\"green\">Added table <b>z_shop_offer</b> (shopsystem).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_shop_offer</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_shop_history_item` ( `id` int(11) NOT NULL auto_increment, `to_name` varchar(255) NOT NULL default '0', `to_account` int(11) NOT NULL default '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `offer_id` int(11) NOT NULL default '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL default '0', `trans_real` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo "<font color=\"green\">Added table <b>z_shop_history_item</b> (shopsystem).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_shop_history_item</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_shop_history_pacc` ( `id` int(11) NOT NULL auto_increment, `to_name` varchar(255) NOT NULL default '0', `to_account` int(11) NOT NULL default '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `pacc_days` int(11) NOT NULL default '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL default '0', `trans_real` int(11) NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo "<font color=\"green\">Added table <b>z_shop_history_pacc</b> (shopsystem).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_shop_history_pacc</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_polls` ( `id` int(11) NOT NULL auto_increment, `question` varchar(255) NOT NULL, `end` int(11) NOT NULL, `start` int(11) NOT NULL, `answers` int(11) NOT NULL, `votes_all` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;"); echo "<font color=\"green\">Added table <b>z_polls</b> (poll-system).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_polls</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_polls_answers` ( `poll_id` int(11) NOT NULL, `answer_id` int(11) NOT NULL, `answer` varchar(255) NOT NULL, `votes` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1;"); echo "<font color=\"green\">Added table <b>z_polls_answers</b> (poll-system).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_polls_answers</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE IF NOT EXISTS `z_bug_logs` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL, `status` tinyint(1) NOT NULL default '0', `description` text NOT NULL, `time` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;"); echo "<font color=\"green\">Added table <b>z_bug_logs</b>.<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_bug_logs</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE IF NOT EXISTS `z_bug_logs` ( `id` int(11) NOT NULL auto_increment, `account_id` int(11) NOT NULL, `status` tinyint(1) NOT NULL default '0', `description` text NOT NULL, `time` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;"); echo "<font color=\"green\">Added table <b>z_bug_tracker</b> (bug tracker).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_bug_tracker</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE IF NOT EXISTS `z_helpdesk` ( `account` varchar(255) NOT NULL, `type` int(11) NOT NULL, `status` int(11) NOT NULL, `text` text NOT NULL, `id` int(11) NOT NULL, `subject` varchar(255) NOT NULL, `priority` int(11) NOT NULL, `reply` int(11) NOT NULL, `who` int(11) NOT NULL, `uid` int(11) NOT NULL AUTO_INCREMENT, `tag` int(11) NOT NULL, `registered` int(11) NOT NULL, PRIMARY KEY (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=26 ;"); echo "<font color=\"green\">Added table <b>z_changelog</b> (changelog).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_changelog</b> not added.</font> Already exist?<br/>";} try { $SQL->query("CREATE TABLE `z_forum` ( `id` int(11) NOT NULL auto_increment, `sticky` tinyint(1) NOT NULL DEFAULT '0', `closed` tinyint(1) NOT NULL DEFAULT '0', `first_post` int(11) NOT NULL default '0', `last_post` int(11) NOT NULL default '0', `section` int(3) NOT NULL default '0', `icon_id` int(3) NOT NULL default '1', `replies` int(20) NOT NULL default '0', `views` int(20) NOT NULL default '0', `author_aid` int(20) NOT NULL default '0', `author_guid` int(20) NOT NULL default '0', `post_text` text NOT NULL, `post_topic` varchar(255) NOT NULL, `post_smile` tinyint(1) NOT NULL default '0', `post_date` int(20) NOT NULL default '0', `last_edit_aid` int(20) NOT NULL default '0', `edit_date` int(20) NOT NULL default '0', `post_ip` varchar(32) NOT NULL default '0.0.0.0', PRIMARY KEY (`id`), KEY `section` (`section`) ) ENGINE=MyISAM AUTO_INCREMENT=1;"); echo "<font color=\"green\">Added table <b>z_forum</b> (forum).<br/></font>"; } catch(PDOException $error) { echo "<font color=\"red\">Table <b>z_forum</b> not added.</font> Already exist?<br/>";} } $config['site']['install'] = 4; saveconfig_ini($config['site']); echo '<br>Tables and columns added to database.<br>Go to <a href="install.php?page=step&step=4&server_conf=yes">STEP 4 - Add samples</a>'; } if($step == '4') { echo '<h1>STEP '.$step.'</h1>Add samples to DB:<br>'; $check_news_ticker = $SQL->query('SELECT * FROM z_news_tickers WHERE image_id = 1 AND author = 1 AND hide_ticker = 0 LIMIT 1 OFFSET 0')->fetch(); if(!isset($check_news_ticker['author'])) { $SQL->query('INSERT INTO z_news_tickers (date, author, image_id, text, hide_ticker) VALUES ('.time().', 1, 1, "WELCOME!", 0)'); echo "Added first news ticker.<br/>"; } else { echo "News ticker sample is already in database. New sample is not needed.<br/>"; } $check_voc_0 = $SQL->query('SELECT * FROM players WHERE name = "Rook Sample" LIMIT 1 OFFSET 0')->fetch(); if(!isset($check_voc_0['name'])) { $SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES (NULL, "Rook Sample", 0, 1, 1, 1, 0, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")'); echo "Added 'Rook Sample' character.<br/>"; } else { echo "Character 'Rook Sample' already in database.<br/>"; } $check_voc_1 = $SQL->query('SELECT * FROM players WHERE name = "Sorcerer Sample" LIMIT 1 OFFSET 0')->fetch(); if(!isset($check_voc_1['name'])) { $SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES (NULL, "Sorcerer Sample", 0, 1, 1, 8, 1, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")'); echo "Added 'Sorcerer Sample' character.<br/>"; } else { echo "Character 'Sorcerer Sample' already in database.<br/>"; } $check_voc_2 = $SQL->query('SELECT * FROM players WHERE name = "Druid Sample" LIMIT 1 OFFSET 0')->fetch(); if(!isset($check_voc_2['name'])) { $SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES (NULL, "Druid Sample", 0, 1, 1, 8, 2, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")'); echo "Added 'Druid Sample' character.<br/>"; } else { echo "Character 'Druid Sample' already in database.<br/>"; } $check_voc_3 = $SQL->query('SELECT * FROM players WHERE name = "Paladin Sample" LIMIT 1 OFFSET 0')->fetch(); if(!isset($check_voc_3['name'])) { $SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES (NULL, "Paladin Sample", 0, 1, 1, 8, 3, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")'); echo "Added 'Paladin Sample' character.<br/>"; } else { echo "Character 'Paladin Sample' already in database.<br/>"; } $check_voc_4 = $SQL->query('SELECT * FROM players WHERE name = "Knight Sample" LIMIT 1 OFFSET 0')->fetch(); if(!isset($check_voc_4['name'])) { $SQL->query('INSERT INTO `players` (`id`, `name`, `world_id`, `group_id`, `account_id`, `level`, `vocation`, `health`, `healthmax`, `experience`, `lookbody`, `lookfeet`, `lookhead`, `looklegs`, `looktype`, `lookaddons`, `maglevel`, `mana`, `manamax`, `manaspent`, `soul`, `town_id`, `posx`, `posy`, `posz`, `conditions`, `cap`, `sex`, `lastlogin`, `lastip`, `save`, `skull`, `skulltime`, `rank_id`, `guildnick`, `lastlogout`, `blessings`, `balance`, `stamina`, `direction`, `loss_experience`, `loss_mana`, `loss_skills`, `loss_containers`, `loss_items`, `premend`, `online`, `marriage`, `promotion`, `deleted`, `description`, `created`, `nick_verify`, `old_name`, `hide_char`, `comment`) VALUES (NULL, "Knight Sample", 0, 1, 1, 8, 4, 185, 185, 0, 0, 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, 50, 50, 7, "", 400, 0, 0, 0, 0, 0, 0, 0, "", 0, 0, 0, 201660000, 0, 100, 100, 100, 100, 100, 0, 0, 0, 0, 0, "", 0, 0, "", 0, "")'); echo "Added 'Knight Sample' character.<br/>"; echo 'All samples added to database. Now you can go to <a href="install.php?page=step&step=5&server_conf=yes">STEP 5 - Set Admin Account</a>'; } else { echo "Character 'Knight Sample' already in database.<br/>"; $config['site']['install'] = 5; saveconfig_ini($config['site']); echo 'All samples added to database. Now you can go to <a href="install.php?page=step&step=5&server_conf=yes">STEP 5 - Set Admin Account</a><br/>'; } } if($step == '5') { echo '<h1>STEP '.$step.'</h1>Set Admin Account<br>'; $config['server'] = parse_ini_file($config['site']['server_path'].'config.lua'); if(empty($_REQUEST['saveaccpassword'])) { echo 'Admin account number is: <b>1</b><br/>Set new password to this account.<br>'; echo 'New password: <form action="install.php" method=POST><input type="text" name="newpass" size="35">(Don\'t give it password to anyone!)'; echo '<input type="hidden" name="saveaccpassword" value="yes"><input type="hidden" name="page" value="step"><input type="hidden" name="step" value="5"><input type="submit" value="SET"></form><br>If account with number 1 doesn\'t exist installator will create it and set your password.'; } else { $newpass = $_POST['newpass']; if(!check_password($newpass)) echo 'Password contains illegal characters. Please use only a-Z and 0-9. <a href="install.php?page=step&step=5&server_conf=yes">GO BACK</a> and write other password.'; else { $newpass_to_db = password_ency($newpass); $account = new OTS_Account(); $account->load(1); if($account->isLoaded()) { $account->setPassword($newpass_to_db); $account->save(); $account->setCustomField("page_access", 999999); $account->setCustomField("created", time()); } else { $number = $account->create(1,1,1); $account->setPassword($newpass_to_db); $account->unblock(); $account->save(); $account->setCustomField("page_access", 999999); $account->setCustomField("created", time()); } $_SESSION['account'] = 1; $_SESSION['password'] = $newpass; $logged = TRUE; echo '<h1>Admin account number: 1<br>Admin account password: '.$_POST['newpass'].'</h1><br/><h3>It\'s end of first part of installation. Installation is blocked. From now don\'t modify file config.ini!<br>Press links to STEPs 6 and 7 in menu.</h3>'; $config['site']['install'] = 'no'; saveconfig_ini($config['site']); } } } } else { echo "Account maker is already installed! To reinstall open file 'config.ini' in directory 'config' and change:<br/><b>install = \"no\"</b><br/>to:</br><b>install = \"start\"</b><br/>and enter this site again."; } ?>
  18. Pra arrumar BUG's e depois colocar online Não se preocupe com o tempo; o tempo que você tiver disponível pra mim está tranquilo ;G
  19. Assim que eu chegar em casa posto a query se ninguém postar antes.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...