Ir para conteúdo

gordonbays

Membro
  • Registro em

  • Última visita

Tudo que gordonbays postou

  1. Capernia Datapack: making the ultimate datapack for OTS (Open Tibia Server) Bom dia a todos, considerando que todas as datapacks presentes nesse fórum contém bugs absurdos e estão longe de serem confiáveis para um servidor final, eu convido todos a participarem e colaborarem nesse projeto chamado Capernia. O objetivo é unificar as ações em um único projeto e permitir que as correções realizadas isoladamente se propaguem para todos em tempo real. Vários problemas já foram corrigidos como a replicação de cristal coins da ferumbras e queda de servidor pelo método da parcel. Novos problemas são reportados diariamente e eu farei o possível para atender a todos. Se você tem interesse em contribuir ou utilizar o projeto Capernia acesse: https://github.com/gordonbay/capernia-ots-datapack Estabilidade: Como todos sabem não existe projeto "Full" ou "100%" e o mesmo está longe de existir porém você pode fazer a diferença agora reportando erros encontrados ou enviando as suas atualizações, entretanto tudo é realizado utilizando o idioma inglês e sem customizações. A build está marcada como buggy, o que significa que você deve utilizar esse projeto assumindo o risco, não me responsabilizo por falhas encontradas ou exploradas. Compilações: As compilações executáveis são fornecidas com a intenção de facilitar o processo para o usuário, em nenhum momento serão fornecidos os códigos de fontes considerando que o foco desse projeto é a datapack e as mesmas podem ser acessadas pelo projeto responsável pelo seu desenvolvimento nesse link: https://github.com/otland/forgottenserver Ferramentas Compatíveis: Para edição do mapa: http://www.tibiaking.com/forum/topic/22469-1091-remeres-map-editor/ Para edição de itens: https://github.com/ottools/ItemEditor Bugs Encontrados: Nenhum bug referente ao projeto será respondido nesse fórum sendo que o procedimento correto para o mesmo é através do link: https://github.com/gordonbay/capernia-ots-datapack/issues porém leia esse artigo antes de postar: https://github.com/gordonbay/capernia-ots-datapack/wiki/Issues Últimas atualizações: 0.0.9 (17/05/2016) Bugfixes: fix wrong monsters corpses as requested here #17 fix missing Yalahar gates and Captain Max not checking mission status in order to teleport a character. As described here #16 fix Edron's Bog Raider's missing spaws and wrong map textures as requested here #14 0.0.8 (14/05/2016) Enhancements: added 10.92 new itens and potions 0.0.7 (13/05/2016) Bugfixes: fix a bug on Ferumbras' Ascendant Quest as requested here #13 Enhancements: Reward Chest has been removed from Thais due violations of Capernia rules about custom content
  2. 100% não existe, todos tem muitos defeitos, você pode utilizar o projeto Capernia e reportar os erros que encontrar. https://github.com/gordonbay/capernia-ots-datapack atualmente ele está identico ao do Mitisuig porém eu ja corrigi diversos erros. Infelismente mesmo após tantos anos ainda não temos um datapack confiável pois cada um cria o seu e depois abandona, eu devenvolvi o projeto Capernia justamente para acabar com isso. Todos podem atualizar e participar do processo de construção do mesmo. Quanto a versão do servidor, todos utilizam a mesma (10.77) só alteram o código do TFS para aceitar outras versoes.
  3. Deu um trabalho mas consegui. index.php, insira essa linha $mysql... <?php //GATO PRO SHOP $mysqli = new mysqli("127.0.0.1", "USUARIO", "SENHA", "DB"); shopadmin.php <script> </script> <script type="text/javascript">function _delete(id){ if( confirm('Confirma a exclusão do item selecionado?') ) { location.href='?subtopic=shopadmin&action=delete&id=' + id + ''; } return false; }</script><style type="text/css"> hr{border:0;border-bottom:1px solid #D4C0A1;padding:3px;} h1.admshop{margin:0;padding:0;} label.admshop{float:left;width:100px;} div.clear{clear:both;} p.border{border-bottom:1px solid #D4C0A1;padding:3px;} form input, form select, form button, form reset{padding:3px;} input.bt{padding:3px 20px;cursor:pointer;} .success{color:green;} .error{color:red;} .bt2{padding:5px 30px;cursor:pointer;} </style> <?php /** * Systema By Dezon */ if(!defined('INITIALIZED')) exit; /* * Variável SQL */ $SQL = $GLOBALS['SQL']; /* * Funções */ function dropdown_offer_type($selected='item') { $return = null; if($selected == 'item') { $return = '<select id="selectid" onchange="michael()" name="offer_type"> <option value="item" selected="selected">Item</option> <option value="container">Container</option> <option value="mount">Mounts</option> <option value="addon">Addons</option> </select>'; } else if($selected == 'container') { $return = '<select id="selectid" onchange="michael()" name="offer_type"> <option value="item">Item</option> <option value="container" selected="selected">Container</option> <option value="mount">Mounts</option> <option value="addon">Addons</option> </select>'; } else if($selected == 'mount') { $return = '<select id="selectid" onchange="michael()" name="offer_type"> <option value="item">Item</option> <option value="container">Container</option> <option value="mount" selected="selected">Mounts</option> <option value="addon">Addons</option> </select>'; } else if($selected == 'addon') { $return = '<select id="selectid" onchange="michael()" name="offer_type"> <option value="item">Item</option> <option value="container">Container</option> <option value="mount">Mounts</option> <option value="addon" selected="selected">Addons</option> </select>'; } else { $return = '<select id="selectid" onchange="michael()" name="offer_type"> <option value="item" selected="selected">Item</option> <option value="container">Container</option> <option value="mount">Mounts</option> <option value="addon">Addons</option> </select>'; } return $return; } if($group_id_of_acc_logged >= $config['site']['access_admin_panel']) { #################### # ATUALIZAÇÃO 2015 # #################### $items_menu = '<p><a href="?subtopic=shopadmin">Shop admin</a> | <a href="?subtopic=shopadmin&action=new">Nova oferta</a> | <a href="?subtopic=shopadmin&action=list">Listar ofertas</a> | <a href="?subtopic=shopadmin&action=points">Adicionar pontos</a></p><hr />'; switch($action) { /******************************************************************************************/ // Essa ação, vai listar todos os registros do que está // sendo vendido no seu shopping (as ofertas) /******************************************************************************************/ case 'list': $ofertas = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_offer').' ORDER BY id DESC;'); $result .= $items_menu; $result .= '<TABLE BGCOLOR="#D4C0A1" BORDER="0" CELLPADDING="4" CELLSPACING="1" WIDTH="100%">'; $result .= '<tr bgcolor="#505050"><td class="white"><strong>Items cadastrados no \'Shop Offer\'</strong></td><tr>'; $result .= '<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="1" WIDTH="100%">'; $result .= '<TR BGCOLOR="#F1E0C6"><td><strong>ID</strong></td><td><strong>Nome da oferta</strong></td><td><strong>Imagem</strong></td><td><strong>Ações</strong></td></TR>'; while($data = $ofertas->fetch()) { $result .= '<tr BGCOLOR="#F1E0C6">'; $result .= '<td>'.$data['id'].'</td>'; $result .= '<td>'.$data['offer_name'].'</td>'; $result .= '<td align="center"><img src="./images/items/'.$data['itemid1'].$config['site']['item_images_extension'].'" /></td>'; $result .= '<td><a href="?subtopic=shopadmin&action=edit&id='.$data['id'].'">[editar]</a>&nbsp;<a href="javascript:void( _delete('.$data['id'].') );">[excluir]</a></td>'; $result .= '</tr>'; } $result .= '</table>'; $result .= '</table>'; $main_content .= $result; break; //lista as ofertas /******************************************************************************************/ // Essa ação é chamada quando abre a tela // de edição da oferta selecionada /******************************************************************************************/ case 'edit': $main_content .= $items_menu; $id = is_numeric($_GET['id']) ? $_GET['id'] : header('Location: ?subtopic=shopadmin'); // anti-inject simples by Dezon $dados = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_offer').' WHERE id='.$id)->fetch(); /* if($dados['offer_type'] == 'item') { $dropdown = '<select id="selectid" onchange="michael()" name="offer_type"><option value="item" selected="selected">Item</option><option value="container">Container</option></select>'; } else if($dados['offer_type'] == 'container') { $dropdown = '<select id="selectid" onchange="michael()" name="offer_type"><option value="item">Item</option><option value="container" selected="selected">Container</option></select>'; } */ $dropdown = dropdown_offer_type($dados['offer_type']); $main_content .= <<<EOD <h1 class="admshop"><strong>Editar/Atualizar oferta</strong></h1> <form method="post" action="?subtopic=shopadmin&action=shop_edit"> <input type="hidden" name="id_offer" value="{$dados['id']}" /> <p class="border"><strong>Nome / Descrição da oferta</strong></p> <p id="addon"><label class="admshop">Addon: </label><select onchange="changes()" id="addons" name="addon"></p> <option value="" selected="selected"></option> <option value="1">Citizen</option> <option value="2">Hunter</option> <option value="3">Mage</option> <option value="4">Knight</option> <option value="5">Noblewoman</option> <option value="6">Summoner</option> <option value="7">Warrior</option> <option value="8">Barbarian</option> <option value="9">Druid</option> <option value="10">Wizard</option> <option value="11">Oriental</option> <option value="12">Pirate</option> <option value="13">Assassin</option> <option value="14">Beggar</option> <option value="15">Shaman</option> <option value="16">Norsewoman</option> <option value="17">Nightmare</option> <option value="18">Jester</option> <option value="19">Brotherhood</option> <option value="20">Demonhunter</option> <option value="21">Yalaharian</option> <option value="22">Warmaster</option> <option value="23">Wayfarer</option> <option value="24">Afflicted</option> <option value="25">Elementalist</option> <option value="26">Deepling</option> <option value="27">Insectoid</option> <option value="28">Entrepreneur</option> <option value="29">Crystal warlord</option> <option value="30">Soil guardian</option> <option value="31">Demon</option> <option value="32">Cave explorer</option> <option value="33">Dream warden</option> <option value="34">Glooth engineer</option> <option value="35">Champion</option> <option value="36">Conjurer</option> <option value="37">Beastmaster</option> <option value="38">Chaos acolyte</option> <option value="39">Death herald</option> <option value="40">Ranger</option> <option value="41">Ceremonial garb</option> <option value="42">Puppeteer</option> <option value="43">Spirit caller</option> <option value="44">Evoker</option> <option value="45">Seaweaver</option> <option value="46">Recruiter</option> <option value="47">Sea dog</option> <option value="48">Royal pumpkin</option> <option value="49">Rift warrior</option> <option value="50">Winter warden</option> <option value="51">Philosopher</option> </select> <p id="mountdrop"><label class="admshop">Mount: </label><select onchange="changesdrop()" id="mountvalor" name="mount"></p> <option value="1">Widow Queen</option> <option value="2">Racing Bird</option> <option value="3">War Bear</option> <option value="4">Black Sheep</option> <option value="5">Midnight Panther</option> <option value="6">Draptor</option> <option value="7">Titanica</option> <option value="8">Tin Lizzard</option> <option value="9">Blazebringer</option> <option value="10">Rapid Boar</option> <option value="11">Stampor</option> <option value="12">Undead Cavebear</option> <option value="13">Donkey</option> <option value="14">Tiger Slug</option> <option value="15">Uniwheel</option> <option value="16">Crystal Wolf</option> <option value="17">War Horse</option> <option value="18">Kingly Deer</option> <option value="19">Tamed Panda</option> <option value="20">Dromedary</option> <option value="21">Scorpion King</option> <option value="22">Rented Horse</option> <option value="23">Armoured War Horse</option> <option value="24">Shadow Draptor</option> <option value="25">Rented Horse</option> <option value="26">Rented Horse</option> <option value="27">Lady Bug</option> <option value="28">Manta Ray</option> <option value="29">Ironblight</option> <option value="30">Magma Crawler</option> <option value="31">Dragonling</option> <option value="32">Gnarlhound</option> <option value="33">Crimson Ray</option> <option value="34">Steelbeak</option> <option value="35">Water Buffalo</option> <option value="36">Armoured Scorpion</option> <option value="37">Armoured Dragonling</option> <option value="38">Ursagrodon</option> <option value="39">Hellgrip</option> <option value="40">Noble Lion</option> <option value="41">Desert King</option> <option value="42">Shock Head</option> <option value="43">Walker</option> <option value="44">Azudocus</option> <option value="45">Carpacosaurus</option> <option value="46">Death Crawler</option> <option value="47">Flamesteed</option> <option value="48">Jade Lion</option> <option value="49">Jade Pincer</option> <option value="50">Nethersteed</option> <option value="51">Tempest</option> <option value="52">Winter King</option> <option value="53">Doombringer</option> <option value="54">Woodland Prince</option> <option value="55">Hailtorm Fury</option> <option value="56">Siegebreaker</option> <option value="57">Poisonbane</option> <option value="58">Blackpelt</option> <option value="59">Golden Dragonfly</option> <option value="60">Steel Bee</option> <option value="61">Copper Fly</option> <option value="62">Tundra Rambler</option> <option value="63">Highland Yak</option> <option value="64">Glacier Vagabond</option> <option value="65">Flying Divan</option> <option value="66">Magic Carpet</option> <option value="67">Floating Kashmir</option> <option value="68">Ringtail Waccoon</option> <option value="69">Night Waccoon</option> <option value="70">Emerald Waccoon</option> <option value="71">Glooth Glider</option> <option value="72">Shadow Hart</option> <option value="73">Black Stag</option> <option value="74">Emperor Deer</option> <option value="75">Flitterkatzen</option> <option value="76">Venompaw</option> <option value="77">Batcat</option> <option value="78">Sea Devil</option> <option value="79">Coralripper</option> <option value="80">Plumfish</option> <option value="81">Gorongra</option> <option value="82">Noctungra</option> <option value="83">Silverneck</option> <option value="84">Slagsnare</option> <option value="85">Nightstinger</option> <option value="86">Razorcreep</option> <option value="87">Rift Runner</option> <option value="88">Nightdweller</option> <option value="89">Frostflare</option> <option value="90">Cinderhoof</option> <option value="91">Mouldpincer</option> <option value="92">Bloodcurl</option> <option value="93">Leafscuttler</option> </select> <p><label class="admshop">Oferta: </label><input type="text" name="offer_name" size="50" maxlength="100" value="{$dados['offer_name']}" /></p> <p><label class="admshop">Descrição: </label><input type="text" name="offer_description" size="50" maxlength="1000" value="{$dados['offer_description']}" /></p> <p><label class="admshop">Qtde. pontos: </label><input type="text" name="points" size="5" maxlength="9" value="{$dados['points']}" /></p> <p class="border"><strong>Tipo da oferta</strong></p> <p><label class="admshop">Tipo: </label>{$dropdown}</p> <div id="michael3" style=""> <p class="border"><strong>Configuração de item normal, armor, shield, legs, etc</strong></p> <p><label class="admshop">ID Item 1: </label><input id="id1" type="text" name="itemid1" size="20" value="{$dados['itemid1']}" /></p> <p><label class="admshop">Qtde. Item 1: </label><input id="count1" type="text" name="count1" size="10" value="{$dados['count1']}" /></p> <p class="border"><strong>Configuração de item container, BP com Runas, BP com Small Stones, etc</strong></p> <p><label class="admshop">ID Item 2: </label><input id="count2" type="text" name="itemid2" size="10" value="{$dados['itemid2']}" /></p> <p><label class="admshop">Qtde. Item 2: </label><input type="text" name="count2" size="10" value="{$dados['count2']}" /></p> </div> <p class="border"><br /></p> <input type="submit" value="Salvar edição" class="bt" /> </form> <div class="clear"></div> <script> document.getElementById("addons").selectedIndex = {$dados['itemid1']}; document.getElementById("addons").selectedIndex = {$dados['itemid1']}; if(document.getElementById('selectid').value == "mount") { document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'none'; document.getElementById('mountdrop').style.display = 'block'; } if(document.getElementById('selectid').value == "addon") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'block'; } if(document.getElementById('selectid').value != "addon" && document.getElementById('selectid').value != "mount") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'block'; document.getElementById('addon').style.display = 'none'; } function changes() { var mytextbox = document.getElementById('id1'); var mydropdown = document.getElementById('addons'); mytextbox.value = mydropdown.value; } function changesdrop() { var mytextbox = document.getElementById('id1'); var mydropdown = document.getElementById('mountvalor'); mytextbox.value = mydropdown.value; } function changes() { var mytextbox = document.getElementById('id1'); var mydropdown = document.getElementById('addons'); mytextbox.value = mydropdown.value; } function michael() { if(document.getElementById('selectid').value == "mount") { document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'none'; document.getElementById('mountdrop').style.display = 'block'; } if(document.getElementById('selectid').value == "addon") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'block'; } if(document.getElementById('selectid').value != "addon" && document.getElementById('selectid').value != "mount") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'block'; document.getElementById('addon').style.display = 'none'; } } </script> <?php EOD; break; case 'shop_edit': $id = $_POST['id_offer']; $points = trim($_POST['points']); $itemid1 = $_POST['itemid1']; $count1 = trim($_POST['count1']); $itemid2 = trim($_POST['itemid2']); $count2 = trim($_POST['count2']); $offer_type = trim($_POST['offer_type']); $offer_description = trim($_POST['offer_description']); $offer_name = trim($_POST['offer_name']); if(isset($_POST['id_offer'])) { $mysqli->query("UPDATE z_shop_offer SET points = '$points', itemid1 = '$itemid1', points = '$points', count1 = '$count1', itemid2 = '$itemid2', count2 = '$count2', offer_type = '$offer_type', offer_description = '$offer_description', offer_name = '$offer_name' WHERE id = '$id'"); echo '<strong class="success">Oferta editada com sucesso!</strong><br /><br /><a href="?subtopic=shopadmin&action=list">Voltar</a>'; } break; case 'delete': $id = is_numeric($_GET['id']) ? $_GET['id'] : header('Location: ?subtopic=shopadmin'); $SQL->query('DELETE FROM '.$SQL->tableName('z_shop_offer').' WHERE id='.$id); header('Location: ?subtopic=shopadmin&action=list'); break; //exclui items /******************************************************************************************/ // Ação que é chamada quando você salva uma nova oferta /******************************************************************************************/ case 'shop_save': $id = $_POST['id_offer']; $points = trim($_POST['points']); $itemid1 = $_POST['itemid1']; $count1 = trim($_POST['count1']); $itemid2 = trim($_POST['itemid2']); $count2 = trim($_POST['count2']); $offer_type = trim($_POST['offer_type']); $offer_description = trim($_POST['offer_description']); $offer_name = trim($_POST['offer_name']); if(isset($_POST['id_offer'])) { $mysqli->query("INSERT INTO z_shop_offer (points,itemid1,count1,itemid2,count2,offer_type,offer_description,offer_name) VALUES ('$points','$itemid1','$count1','$itemid2','$count2','$offer_type','$offer_description','$offer_name')"); echo '<strong class="success">Oferta cadastrada com sucesso!</strong><br /><br /><a href="?subtopic=shopadmin&action=list">Voltar</a>'; } break; //salva a oferta no banco de dados /******************************************************************************************/ // Essa ação é chamada na tela de nova oferta, // é nela que o formulário de cadastro é // gerado e exibido na tela /******************************************************************************************/ case 'new': $main_content .= $items_menu; $dropdown = dropdown_offer_type(null); $main_content .= <<<EOD <h1 class="admshop"><strong>Cadastrar Novo Item</strong></h1> <form method="post" action="?subtopic=shopadmin&action=shop_save"> <input type="hidden" name="id_offer" value="{$dados['id']}" /> <p class="border"><strong>Nome / Descrição da oferta</strong></p> <p id="addon"><label class="admshop">Addon: </label><select onchange="changes()" id="addons" name="addon"></p> <option value="" selected="selected"></option> <option value="1">Citizen</option> <option value="2">Hunter</option> <option value="3">Mage</option> <option value="4">Knight</option> <option value="5">Noblewoman</option> <option value="6">Summoner</option> <option value="7">Warrior</option> <option value="8">Barbarian</option> <option value="9">Druid</option> <option value="10">Wizard</option> <option value="11">Oriental</option> <option value="12">Pirate</option> <option value="13">Assassin</option> <option value="14">Beggar</option> <option value="15">Shaman</option> <option value="16">Norsewoman</option> <option value="17">Nightmare</option> <option value="18">Jester</option> <option value="19">Brotherhood</option> <option value="20">Demonhunter</option> <option value="21">Yalaharian</option> <option value="22">Warmaster</option> <option value="23">Wayfarer</option> <option value="24">Afflicted</option> <option value="25">Elementalist</option> <option value="26">Deepling</option> <option value="27">Insectoid</option> <option value="28">Entrepreneur</option> <option value="29">Crystal warlord</option> <option value="30">Soil guardian</option> <option value="31">Demon</option> <option value="32">Cave explorer</option> <option value="33">Dream warden</option> <option value="34">Glooth engineer</option> <option value="35">Champion</option> <option value="36">Conjurer</option> <option value="37">Beastmaster</option> <option value="38">Chaos acolyte</option> <option value="39">Death herald</option> <option value="40">Ranger</option> <option value="41">Ceremonial garb</option> <option value="42">Puppeteer</option> <option value="43">Spirit caller</option> <option value="44">Evoker</option> <option value="45">Seaweaver</option> <option value="46">Recruiter</option> <option value="47">Sea dog</option> <option value="48">Royal pumpkin</option> <option value="49">Rift warrior</option> <option value="50">Winter warden</option> <option value="51">Philosopher</option> </select> <p id="mountdrop"><label class="admshop">Mount: </label><select onchange="changesdrop()" id="mountvalor" name="mount"></p> <option value="1">Widow Queen</option> <option value="2">Racing Bird</option> <option value="3">War Bear</option> <option value="4">Black Sheep</option> <option value="5">Midnight Panther</option> <option value="6">Draptor</option> <option value="7">Titanica</option> <option value="8">Tin Lizzard</option> <option value="9">Blazebringer</option> <option value="10">Rapid Boar</option> <option value="11">Stampor</option> <option value="12">Undead Cavebear</option> <option value="13">Donkey</option> <option value="14">Tiger Slug</option> <option value="15">Uniwheel</option> <option value="16">Crystal Wolf</option> <option value="17">War Horse</option> <option value="18">Kingly Deer</option> <option value="19">Tamed Panda</option> <option value="20">Dromedary</option> <option value="21">Scorpion King</option> <option value="22">Rented Horse</option> <option value="23">Armoured War Horse</option> <option value="24">Shadow Draptor</option> <option value="25">Rented Horse</option> <option value="26">Rented Horse</option> <option value="27">Lady Bug</option> <option value="28">Manta Ray</option> <option value="29">Ironblight</option> <option value="30">Magma Crawler</option> <option value="31">Dragonling</option> <option value="32">Gnarlhound</option> <option value="33">Crimson Ray</option> <option value="34">Steelbeak</option> <option value="35">Water Buffalo</option> <option value="36">Armoured Scorpion</option> <option value="37">Armoured Dragonling</option> <option value="38">Ursagrodon</option> <option value="39">Hellgrip</option> <option value="40">Noble Lion</option> <option value="41">Desert King</option> <option value="42">Shock Head</option> <option value="43">Walker</option> <option value="44">Azudocus</option> <option value="45">Carpacosaurus</option> <option value="46">Death Crawler</option> <option value="47">Flamesteed</option> <option value="48">Jade Lion</option> <option value="49">Jade Pincer</option> <option value="50">Nethersteed</option> <option value="51">Tempest</option> <option value="52">Winter King</option> <option value="53">Doombringer</option> <option value="54">Woodland Prince</option> <option value="55">Hailtorm Fury</option> <option value="56">Siegebreaker</option> <option value="57">Poisonbane</option> <option value="58">Blackpelt</option> <option value="59">Golden Dragonfly</option> <option value="60">Steel Bee</option> <option value="61">Copper Fly</option> <option value="62">Tundra Rambler</option> <option value="63">Highland Yak</option> <option value="64">Glacier Vagabond</option> <option value="65">Flying Divan</option> <option value="66">Magic Carpet</option> <option value="67">Floating Kashmir</option> <option value="68">Ringtail Waccoon</option> <option value="69">Night Waccoon</option> <option value="70">Emerald Waccoon</option> <option value="71">Glooth Glider</option> <option value="72">Shadow Hart</option> <option value="73">Black Stag</option> <option value="74">Emperor Deer</option> <option value="75">Flitterkatzen</option> <option value="76">Venompaw</option> <option value="77">Batcat</option> <option value="78">Sea Devil</option> <option value="79">Coralripper</option> <option value="80">Plumfish</option> <option value="81">Gorongra</option> <option value="82">Noctungra</option> <option value="83">Silverneck</option> <option value="84">Slagsnare</option> <option value="85">Nightstinger</option> <option value="86">Razorcreep</option> <option value="87">Rift Runner</option> <option value="88">Nightdweller</option> <option value="89">Frostflare</option> <option value="90">Cinderhoof</option> <option value="91">Mouldpincer</option> <option value="92">Bloodcurl</option> <option value="93">Leafscuttler</option> </select> <p><label class="admshop">Oferta: </label><input type="text" name="offer_name" size="50" maxlength="100" value="{$dados['offer_name']}" /></p> <p><label class="admshop">Descrição: </label><input type="text" name="offer_description" size="50" maxlength="1000" value="{$dados['offer_description']}" /></p> <p><label class="admshop">Qtde. pontos: </label><input type="text" name="points" size="5" maxlength="9" value="{$dados['points']}" /></p> <p class="border"><strong>Tipo da oferta</strong></p> <p><label class="admshop">Tipo: </label>{$dropdown}</p> <div id="michael3" style=""> <p class="border"><strong>Configuração de item normal, armor, shield, legs, etc</strong></p> <p><label class="admshop">ID Item 1: </label><input id="id1" type="text" name="itemid1" size="20" value="{$dados['itemid1']}" /></p> <p><label class="admshop">Qtde. Item 1: </label><input id="count1" type="text" name="count1" size="10" value="{$dados['count1']}" /></p> <p class="border"><strong>Configuração de item container, BP com Runas, BP com Small Stones, etc</strong></p> <p><label class="admshop">ID Item 2: </label><input id="count2" type="text" name="itemid2" size="10" value="{$dados['itemid2']}" /></p> <p><label class="admshop">Qtde. Item 2: </label><input type="text" name="count2" size="10" value="{$dados['count2']}" /></p> </div> <p class="border"><br /></p> <input type="submit" value="Salvar" class="bt" /> </form> <div class="clear"></div> <script> if(document.getElementById('selectid').value == "mount") { document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'none'; document.getElementById('mountdrop').style.display = 'block'; } if(document.getElementById('selectid').value == "addon") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'block'; } if(document.getElementById('selectid').value != "addon" && document.getElementById('selectid').value != "mount") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'block'; document.getElementById('addon').style.display = 'none'; } function changes() { var mytextbox = document.getElementById('id1'); var mydropdown = document.getElementById('addons'); mytextbox.value = mydropdown.value; } function changesdrop() { var mytextbox = document.getElementById('id1'); var mydropdown = document.getElementById('mountvalor'); mytextbox.value = mydropdown.value; } function changes() { var mytextbox = document.getElementById('id1'); var mydropdown = document.getElementById('addons'); mytextbox.value = mydropdown.value; } function michael() { if(document.getElementById('selectid').value == "mount") { document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'none'; document.getElementById('mountdrop').style.display = 'block'; } if(document.getElementById('selectid').value == "addon") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'none'; document.getElementById('addon').style.display = 'block'; } if(document.getElementById('selectid').value != "addon" && document.getElementById('selectid').value != "mount") { document.getElementById('mountdrop').style.display = 'none'; document.getElementById('michael3').style.display = 'block'; document.getElementById('addon').style.display = 'none'; } } </script> EOD; #/\ Deixe assim !!! break; //form de cadastro para nova oferta /******************************************************************************************/ // Ação responsável por abrir a tela de pontos /******************************************************************************************/ case 'points': $main_content .= $items_menu; $main_content .= <<<EOD <h1 class="admshop"><strong>Adicionar pontos à um Character <small><i>(Char)</i></small></strong></h1> <form method="post" action="?subtopic=shopadmin&action=points_add"> <p class="border"><strong>Entre com o nome do Char</strong></p> <p><label class="admshop">Character <small><i>(Char)</i></small>: </label><input type="text" name="char_name" size="30" maxlength="50" /></p> <p class="border"><strong>Entre a quantidade de pontos</strong></p> <p><label class="admshop">Qtde. pontos: </label><input type="text" name="char_points" size="5" maxlength="9" /></p> <p class="border"><br /></p> <input type="submit" value="Salvar" class="bt" /> </form> <div class="clear"></div> EOD; #/\ Deixe assim !!! break; case 'points_add': $player = stripslashes(ucwords(strtolower(trim($_POST['char_name'])))); $points = is_numeric($_POST['char_points']) ? $_POST['char_points'] : 0; if(strlen($player) > 0){ $data = $SQL->query("SELECT * FROM `players` WHERE `name` = '".$player."';")->fetch(); if($data['account_id']){ $SQL->query("UPDATE `accounts` SET `premium_points` = `premium_points` + '".$points."' WHERE `id` = '".$data['account_id']."'"); $main_content .= '<strong class="success">Pontos adicionados com sucesso à: <i>'.$player.'</i></strong><br /><br /><a href="?subtopic=shopadmin">Voltar</a>'; }else{ $main_content .= '<strong class="error">O character indicado não existe.</strong><br /><br /><a href="?subtopic=shopadmin&action=points">Voltar</a>'; } }else{ $main_content .= '<strong class="error">Preencha o nome do Character.</strong><br /><br /><a href="?subtopic=shopadmin&action=points">Voltar</a>'; } break; /******************************************************************************************/ // Por padrão, essa ação é chamada e exibe somente // os botões para cada ação do sistema /******************************************************************************************/ default: $main_content .= <<<EOD <h1 class="admshop" align="center"><strong>Bem vindo ao Administrador do Shop!</strong></h1> <hr /> <center> <button type="button" class="bt2" onclick="location.href='?subtopic=shopadmin&action=new'">Nova oferta</button> <button type="button" class="bt2" onclick="location.href='?subtopic=shopadmin&action=list'">Listar ofertas</button> <button type="button" class="bt2" onclick="location.href='?subtopic=shopadmin&action=points'">Adicionar pontos</button> <p>&nbsp;</p> <small><i>Sistema desenvolvido por Dezon e Mitsuig<br />© 2016</i></small> </center> EOD; #/\ Deixe assim !!! break; } //Fim do sistema } else { // Caso o usuário tente usar o administrador e esse, // não tiver acesso, será exibido na tela essa mensagem: $main_content .= 'Sorry, you have not the rights to access this page.'; } ?> shopsystem.php completo: <?php if(!defined('INITIALIZED')) exit; if($config['site']['shop_system']) { if($logged) { $user_premium_points = $account_logged->getCustomField('premium_points'); } else { $user_premium_points = 'Login first'; } function getItemByID($id) { $id = (int) $id; $SQL = $GLOBALS['SQL']; $data = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_offer').' WHERE '.$SQL->fieldName('id').' = '.$SQL->quote($id).';')->fetch(); if($data['offer_type'] == 'item') { $offer['id'] = $data['id']; $offer['type'] = $data['offer_type']; $offer['item_id'] = $data['itemid1']; $offer['item_count'] = $data['count1']; $offer['points'] = $data['points']; $offer['description'] = $data['offer_description']; $offer['name'] = $data['offer_name']; } elseif($data['offer_type'] == 'knight') { $offer['id'] = $data['id']; $offer['type'] = $data['offer_type']; $offer['item_id'] = $data['itemid1']; $offer['item_count'] = $data['count1']; $offer['points'] = $data['points']; $offer['description'] = $data['offer_description']; $offer['name'] = $data['offer_name']; } elseif($data['offer_type'] == 'mount') { $offer['id'] = $data['id']; $offer['type'] = $data['offer_type']; $offer['item_id'] = $data['itemid1']; $offer['item_count'] = $data['count1']; $offer['points'] = $data['points']; $offer['description'] = $data['offer_description']; $offer['name'] = $data['offer_name']; } elseif($data['offer_type'] == 'addon') { $offer['id'] = $data['id']; $offer['type'] = $data['offer_type']; $offer['item_id'] = $data['itemid1']; $offer['item_count'] = $data['count1']; $offer['points'] = $data['points']; $offer['description'] = $data['offer_description']; $offer['name'] = $data['offer_name']; } elseif($data['offer_type'] == 'premmium') { $offer['id'] = $data['id']; $offer['type'] = $data['offer_type']; $offer['item_id'] = $data['itemid1']; $offer['item_count'] = $data['count1']; $offer['points'] = $data['points']; $offer['description'] = $data['offer_description']; $offer['name'] = $data['offer_name']; } return $offer; } function getOfferArray() { $offer_list = $GLOBALS['SQL']->query('SELECT * FROM '.$GLOBALS['SQL']->tableName('z_shop_offer').';'); $i_item = 0; $i_knight = 0; $i_mount = 0; $i_addon = 0; $i_container = 0; while($data = $offer_list->fetch()) { if($data['offer_type'] == 'item') { $offer_array['item'][$i_item]['id'] = $data['id']; $offer_array['item'][$i_item]['item_id'] = $data['itemid1']; $offer_array['item'][$i_item]['item_count'] = $data['count1']; $offer_array['item'][$i_item]['points'] = $data['points']; $offer_array['item'][$i_item]['description'] = $data['offer_description']; $offer_array['item'][$i_item]['name'] = $data['offer_name']; $i_item++; } if($data['offer_type'] == 'knight') { $offer_array['knight'][$i_item]['id'] = $data['id']; $offer_array['knight'][$i_item]['item_id'] = $data['itemid1']; $offer_array['knight'][$i_item]['item_count'] = $data['count1']; $offer_array['knight'][$i_item]['points'] = $data['points']; $offer_array['knight'][$i_item]['description'] = $data['offer_description']; $offer_array['knight'][$i_item]['name'] = $data['offer_name']; $i_knight++; } elseif($data['offer_type'] == 'mount') { $offer_array['mount'][$i_mount]['id'] = $data['id']; $offer_array['mount'][$i_mount]['container_id'] = $data['itemid1']; $offer_array['mount'][$i_mount]['container_count'] = $data['count1']; $offer_array['mount'][$i_mount]['item_id'] = $data['itemid1']; $offer_array['mount'][$i_mount]['item_count'] = $data['count2']; $offer_array['mount'][$i_mount]['points'] = $data['points']; $offer_array['mount'][$i_mount]['description'] = $data['offer_description']; $offer_array['mount'][$i_mount]['name'] = $data['offer_name']; $i_mount++; } elseif($data['offer_type'] == 'addon') { $offer_array['addon'][$i_addon]['id'] = $data['id']; $offer_array['addon'][$i_addon]['container_id'] = $data['itemid1']; $offer_array['addon'][$i_addon]['container_count'] = $data['count1']; $offer_array['addon'][$i_addon]['item_id'] = $data['itemid1']; $offer_array['addon'][$i_addon]['item_count'] = $data['count2']; $offer_array['addon'][$i_addon]['points'] = $data['points']; $offer_array['addon'][$i_addon]['description'] = $data['offer_description']; $offer_array['addon'][$i_addon]['name'] = $data['offer_name']; $i_addon++; } elseif($data['offer_type'] == 'container') { $offer_array['container'][$i_container]['id'] = $data['id']; $offer_array['container'][$i_container]['container_id'] = $data['itemid1']; $offer_array['container'][$i_container]['container_count'] = $data['count1']; $offer_array['container'][$i_container]['item_id'] = $data['itemid2']; $offer_array['container'][$i_container]['item_count'] = $data['count2']; $offer_array['container'][$i_container]['points'] = $data['points']; $offer_array['container'][$i_container]['description'] = $data['offer_description']; $offer_array['container'][$i_container]['name'] = $data['offer_name']; $i_container++; } } return $offer_array; } if(($action == '') or ($action == 'item') or ($action == 'knight') or ($action == 'mount') or ($action == 'addon') or ($action == 'container')) { unset($_SESSION['viewed_confirmation_page']); $offer_list = getOfferArray(); if(empty($action)) { if(count($offer_list['item']) > 0) $action = 'item'; if(count($offer_list['knight']) > 0) $action = 'knight'; elseif(count($offer_list['mount']) > 0) $action = 'mount'; elseif(count($offer_list['addon']) > 0) $action = 'addon'; elseif(count($offer_list['container']) > 0) $action = 'container'; } function selectcolor($value) { if($GLOBALS['action'] == $value) return '#505050; color: #FFFFFF'; else return '#303030; color: #aaaaaa'; } if((count($offer_list['item']) > 0) or (count($offer_list['mount']) > 0) or (count($offer_list['addon']) > 0) or (count($offer_list['container']) > 0) or (count($offer_list['knight']) > 0)) { $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=0 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white colspan="2"><B>Choose a categorie: </B>'; if(count($offer_list['container']) > 0) $main_content .= '<a href="?subtopic=shopsystem&action=container" style="padding: 5px 5px 7px 5px; margin: 5px 1px 0px 1px; background-color: '.selectcolor('container').';">Premium Account<img src="images/items/7.gif"/></a>'; if(count($offer_list['item']) > 0) $main_content .= '<a href="?subtopic=shopsystem&action=item" style="padding: 5px 5px 7px 5px; margin: 5px 1px 0px 1px; background-color: '.selectcolor('item').';">Items<img src="images/items/2160.gif"/></a>'; if(count($offer_list['knight']) > 0) $main_content .= '<a href="?subtopic=shopsystem&action=knight" style="padding: 5px 5px 7px 5px; margin: 5px 1px 0px 1px; background-color: '.selectcolor('knight').';">Knight<img src="images/items/knight13.gif"/></a>'; if(count($offer_list['mount']) > 0) $main_content .= '<a href="?subtopic=shopsystem&action=mount" style="padding: 5px 5px 7px 5px; margin: 5px 1px 0px 1px; background-color: '.selectcolor('mount').';">Mounts<img src="images/mount.gif"/></a>'; if(count($offer_list['addon']) > 0) $main_content .= '<a href="?subtopic=shopsystem&action=addon" style="padding: 5px 5px 7px 5px; margin: 5px 1px 0px 1px; background-color: '.selectcolor('addon').';">Addons<img src="images/addon.gif"/></a>'; $main_content .= '</TD></TR></TD></TR></table><table BORDER=0 CELLPaDDING="4" CELLSPaCING="1" style="width:100%;font-weight:bold;text-align:center;"><tr style="background:#505050;"><td colspan="3" style="height:px;"></td></tr></table>'; } //show list of items offers if((count($offer_list['item']) > 0) and ($action == 'item')) { $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="'.$config['site']['vdarkborder'].'"><td width="8%" align="center" class="white"><b>Points</b></td><td width="9%" align="center" class="white"><b>Picture</b></td><td width="350" align="left" class="white"><b>Description</b></td><td width="250" align="center" class="white"><b>Select product</b></td></tr>'; foreach($offer_list['item'] as $item) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="'.$bgcolor.'"><td align="center"><b>'.$item['points'].'</b></td><td align="center"><img src="' . $config['site']['item_images_url'] . $item['item_id'] . $config['site']['item_images_extension'] . '"></td><td><b>'.htmlspecialchars($item['name']).'</b> ('.$item['points'].' points)<br />'.htmlspecialchars($item['description']).'</td><td align="center">'; if(!$logged) { $main_content .= '<b>Login to buy</b>'; } else { $main_content .= '<form action="?subtopic=shopsystem&action=select_player" method="POST" name="itemform_'.$item['id'].'"><input type="hidden" name="buy_id" value="'.$item['id'].'"><div class="navibutton"><a href="" onClick="itemform_'.$item['id'].'.submit();return false;">BUY</a></div></form>'; } $main_content .= '</td></tr>'; } $main_content .= '</table>'; } //show list of knight offers if((count($offer_list['knight']) > 0) and ($action == 'knight')) { $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="'.$config['site']['vdarkborder'].'"><td width="8%" align="center" class="white"><b>Points</b></td><td width="9%" align="center" class="white"><b>Picture</b></td><td width="350" align="left" class="white"><b>Description</b></td><td width="250" align="center" class="white"><b>Select product</b></td></tr>'; foreach($offer_list['knight'] as $knight) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="'.$bgcolor.'"><td align="center"><b>'.$knight['points'].'</b></td><td align="center"><img src="' . $config['site']['knight_images_url'] . $knight['knight_id'] . $config['site']['knight_images_extension'] . '"></td><td><b>'.htmlspecialchars($knight['name']).'</b> ('.$knight['points'].' points)<br />'.htmlspecialchars($knight['description']).'</td><td align="center">'; if(!$logged) { $main_content .= '<b>Login to buy</b>'; } else { $main_content .= '<form action="?subtopic=shopsystem&action=select_player" method="POST" name="knightform_'.$knight['id'].'"><input type="hidden" name="buy_id" value="'.$knight['id'].'"><div class="navibutton"><a href="" onClick="knightform_'.$knight['id'].'.submit();return false;">BUY</a></div></form>'; } $main_content .= '</td></tr>'; } $main_content .= '</table>'; } //show list of mount offers if((count($offer_list['mount']) > 0) and ($action == 'mount')) { $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="'.$config['site']['vdarkborder'].'"><td width="8%" align="center" class="white"><b>Points</b></td><td width="9%" align="center" class="white"><b>Picture</b></td><td width="350" align="left" class="white"><b>Description</b></td><td width="250" align="center" class="white"><b>Select product</b></td></tr>'; foreach($offer_list['mount'] as $mount) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="'.$bgcolor.'"><td align="center"><b>'.$mount['points'].'</b></td><td align="center"><img src="' . $config['site']['mounts_images_url'] . $mount['id'] . $config['site']['item_images_extension'] . '"></td><td><b>'.htmlspecialchars($mount['name']).'</b> ('.$mount['points'].' points)<br />'.htmlspecialchars($mount['description']).'</td><td align="center">'; if(!$logged) { $main_content .= '<b>Login to buy</b>'; } else { $main_content .= '<form action="?subtopic=shopsystem&action=select_player" method="POST" name="itemform_'.$mount['id'].'"><input type="hidden" name="buy_id" value="'.$mount['id'].'"><div class="navibutton"><a href="" onClick="itemform_'.$mount['id'].'.submit();return false;">BUY</a></div></form>'; } $main_content .= '</td></tr>'; } $main_content .= '</table>'; } //show list of addon offers if((count($offer_list['addon']) > 0) and ($action == 'addon')) { $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="'.$config['site']['vdarkborder'].'"><td width="8%" align="center" class="white"><b>Points</b></td><td width="9%" align="center" class="white"><b>Picture</b></td><td width="350" align="left" class="white"><b>Description</b></td><td width="250" align="center" class="white"><b>Select product</b></td></tr>'; foreach($offer_list['addon'] as $addon) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<tr bgcolor="'.$bgcolor.'"><td align="center"><b>'.$addon['points'].'</b></td><td align="center"><img src="' . $config['site']['addons_images_url'] . $addon['id'] . $config['site']['item_images_extension'] . '"></td><td><b>'.htmlspecialchars($addon['name']).'</b> ('.$addon['points'].' points)<br />'.htmlspecialchars($addon['description']).'</td><td align="center">'; if(!$logged) { $main_content .= '<b>Login to buy</b>'; } else { $main_content .= '<form action="?subtopic=shopsystem&action=select_player" method="POST" name="itemform_'.$addon['id'].'"><input type="hidden" name="buy_id" value="'.$addon['id'].'"><div class="navibutton"><a href="" onClick="itemform_'.$addon['id'].'.submit();return false;">BUY</a></div></form>'; } $main_content .= '</td></tr>'; } $main_content .= '</table>'; } //show list of containers offers if((count($offer_list['container']) > 0) and ($action == 'container')) { if(!is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"><tr bgcolor="'.$config['site']['vdarkborder'].'"><td width="8%" align="center" class="white"><b>Points</b></td><td width="9%" align="center" class="white"><b>Picture</b></td><td width="350" align="left" class="white"><b>Description</b></td><td width="250" align="center" class="white"><b>Select product</b></td></tr>'; foreach($offer_list['container'] as $container) { $main_content .= '<tr bgcolor="'.$bgcolor.'"><td align="center"><b>'.$container['points'].'</b></td><td align="center"><img src="' . $config['site']['item_images_url'] . $container['item_id'] . $config['site']['item_images_extension'] . '"></td><td><b>'.htmlspecialchars($container['name']).'</b> ('.$container['points'].' points)<br />'.htmlspecialchars($container['description']).'</td><td align="center">'; if(!$logged) { $main_content .= '<b>Login to buy</b>'; } else { $main_content .= '<form action="?subtopic=shopsystem&action=select_player" method="POST" name="contform_'.$container['id'].'"><input type="hidden" name="buy_id" value="'.$container['id'].'"><div class="navibutton"><a href="" onClick="contform_'.$container['id'].'.submit();return false;">BUY</a></div></form>'; } $main_content .= '</td></tr>'; } $main_content .= '</table>'; } //Finish container if((count($offer_list['item']) > 0) or (count($offer_list['mount']) > 0) or (count($offer_list['addon']) > 0) or (count($offer_list['container']) > 0) or (count($offer_list['knight']) > 0)) { $main_content .= '<table BORDER=0 CELLPaDDING="4" CELLSPaCING="1" style="width:100%;font-weight:bold;text-align:center;"> <tr style="background:#505050;"> <td colspan="3" style="height:px;"></td> </tr> </table>'; } } if($action == 'select_player') { unset($_SESSION['viewed_confirmation_page']); if(!$logged) { $errormessage .= 'Please login first.'; } else { $buy_id = (int) $_REQUEST['buy_id']; if(empty($buy_id)) { $errormessage .= 'Please <a href="?subtopic=shopsystem">select item</a> first.'; } else { $buy_offer = getItemByID($buy_id); if(isset($buy_offer['id'])) //item exist in database { if($user_premium_points >= $buy_offer['points']) { $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"> <tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="2" class="white"><b>Selected Offer</b></td></tr> <tr bgcolor="'.$config['site']['lightborder'].'"><td width="100"><b>Name:</b></td><td width="550">'.htmlspecialchars($buy_offer['name']).'</td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td width="100"><b>Description:</b></td><td width="550">'.htmlspecialchars($buy_offer['description']).'</td></tr> </table><br /> <form action="?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_id" value="'.$buy_id.'"> <table border="0" cellpadding="4" cellspacing="1" width="100%"> <tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="2" class="white"><b>Give item to player from your account</b></td></tr> <tr bgcolor="'.$config['site']['lightborder'].'"><td width="110"><b>Name:</b></td><td width="550"><select name="buy_name">'; $players_from_logged_acc = $account_logged->getPlayersList(); if(count($players_from_logged_acc) > 0) { foreach($players_from_logged_acc as $player) { $main_content .= '<option>'.htmlspecialchars($player->getName()).'</option>'; } } else { $main_content .= 'You don\'t have any character on your account.'; } $main_content .= '</select>&nbsp;<input type="submit" value="Give"></td></tr> </table> </form><br /><form action="?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_id" value="'.$buy_id.'"> <table border="0" cellpadding="4" cellspacing="1" width="100%"> <tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="2" class="white"><b>Give item to other player</b></td></tr> <tr bgcolor="'.$config['site']['lightborder'].'"><td width="110"><b>To player:</b></td><td width="550"><input type="text" name="buy_name"> - name of player</td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td width="110"><b>From:</b></td><td width="550"><input type="text" name="buy_from">&nbsp;<input type="submit" value="Give"> - your nick, \'empty\' = Anonymous</td></tr> </table><br /> </form>'; } else { $errormessage .= 'For this item you need <b>'.$buy_offer['points'].'</b> points. You have only <b>'.$user_premium_points.'</b> premium points. Please <a href="?subtopic=shopsystem">select other item</a> or buy premium points.'; } } else { $errormessage .= 'Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="?subtopic=shopsystem">select item</a> again.'; } } } if(!empty($errormessage)) { $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Informations</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.$errormessage.'</b></TD></TR> </table>'; } } elseif($action == 'confirm_transaction') { if(!$logged) { $errormessage .= 'Please login first.'; } else { $buy_id = (int) $_POST['buy_id']; $buy_name = trim($_POST['buy_name']); $buy_from = trim($_POST['buy_from']); if(empty($buy_from)) { $buy_from = 'Anonymous'; } if(empty($buy_id)) { $errormessage .= 'Please <a href="?subtopic=shopsystem">select item</a> first.'; } else { if(!check_name($buy_from)) { $errormessage .= 'Invalid nick ("from player") format. Please <a href="?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a> or contact with administrator.'; } else { $buy_offer = getItemByID($buy_id); if(isset($buy_offer['id'])) //item exist in database { if($user_premium_points >= $buy_offer['points']) { if(check_name($buy_name)) { $buy_player = new Player(); $buy_player->find($buy_name); if($buy_player->isLoaded()) { $buy_player_account = $buy_player->getAccount(); if($_SESSION['viewed_confirmation_page'] == 'yes' && $_POST['buy_confirmed'] == 'yes') { if($buy_offer['type'] == 'item') { $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' ('.$SQL->fieldName('id').','.$SQL->fieldName('name').','.$SQL->fieldName('type').','.$SQL->fieldName('action').','.$SQL->fieldName('param1').','.$SQL->fieldName('param2').','.$SQL->fieldName('param3').','.$SQL->fieldName('param4').','.$SQL->fieldName('param5').','.$SQL->fieldName('param6').','.$SQL->fieldName('param7').','.$SQL->fieldName('delete_it').') VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote('login').', '.$SQL->quote('give_item').', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote('').', '.$SQL->quote('').', '.$SQL->quote('item').', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote($buy_offer['id']).', '.$SQL->quote(1).');'; $SQL->query($sql); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' ('.$SQL->fieldName('id').','.$SQL->fieldName('to_name').','.$SQL->fieldName('to_account').','.$SQL->fieldName('from_nick').','.$SQL->fieldName('from_account').','.$SQL->fieldName('price').','.$SQL->fieldName('offer_id').','.$SQL->fieldName('trans_state').','.$SQL->fieldName('trans_start').','.$SQL->fieldName('trans_real').') VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote('wait').', '.$SQL->quote(time()).', '.$SQL->quote(0).');'; $SQL->query($save_transaction); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Item added!</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.htmlspecialchars($buy_offer['name']).'</b> added to player <b>'.htmlspecialchars($buy_player->getName()).'</b> items (he will get this items after relog) for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="?subtopic=shopsystem">GO TO MAIN SHOP SITE</a></TD></TR> </table>'; } if($buy_offer['type'] == 'knight') { $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' ('.$SQL->fieldName('id').','.$SQL->fieldName('name').','.$SQL->fieldName('type').','.$SQL->fieldName('action').','.$SQL->fieldName('param1').','.$SQL->fieldName('param2').','.$SQL->fieldName('param3').','.$SQL->fieldName('param4').','.$SQL->fieldName('param5').','.$SQL->fieldName('param6').','.$SQL->fieldName('param7').','.$SQL->fieldName('delete_it').') VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote('login').', '.$SQL->quote('give_item').', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote('').', '.$SQL->quote('').', '.$SQL->quote('item').', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote($buy_offer['id']).', '.$SQL->quote(1).');'; $SQL->query($sql); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' ('.$SQL->fieldName('id').','.$SQL->fieldName('to_name').','.$SQL->fieldName('to_account').','.$SQL->fieldName('from_nick').','.$SQL->fieldName('from_account').','.$SQL->fieldName('price').','.$SQL->fieldName('offer_id').','.$SQL->fieldName('trans_state').','.$SQL->fieldName('trans_start').','.$SQL->fieldName('trans_real').') VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote('wait').', '.$SQL->quote(time()).', '.$SQL->quote(0).');'; $SQL->query($save_transaction); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Item added!</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.htmlspecialchars($buy_offer['name']).'</b> added to player <b>'.htmlspecialchars($buy_player->getName()).'</b> items (he will get this items after relog) for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="?subtopic=shopsystem">GO TO MAIN SHOP SITE</a></TD></TR> </table>'; } elseif($buy_offer['type'] == 'mount') { $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' ('.$SQL->fieldName('id').','.$SQL->fieldName('name').','.$SQL->fieldName('type').','.$SQL->fieldName('action').','.$SQL->fieldName('param1').','.$SQL->fieldName('param2').','.$SQL->fieldName('param3').','.$SQL->fieldName('param4').','.$SQL->fieldName('param5').','.$SQL->fieldName('param6').','.$SQL->fieldName('param7').','.$SQL->fieldName('delete_it').') VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote('login').', '.$SQL->quote('give_item').', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote('').', '.$SQL->quote('').', '.$SQL->quote('mount').', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote($buy_offer['id']).', '.$SQL->quote(1).');'; $SQL->query($sql); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' ('.$SQL->fieldName('id').','.$SQL->fieldName('to_name').','.$SQL->fieldName('to_account').','.$SQL->fieldName('from_nick').','.$SQL->fieldName('from_account').','.$SQL->fieldName('price').','.$SQL->fieldName('offer_id').','.$SQL->fieldName('trans_state').','.$SQL->fieldName('trans_start').','.$SQL->fieldName('trans_real').') VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote('wait').', '.$SQL->quote(time()).', '.$SQL->quote(0).');'; $SQL->query($save_transaction); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Item added!</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.htmlspecialchars($buy_offer['name']).'</b> added to player <b>'.htmlspecialchars($buy_player->getName()).'</b> items (he will get this items after relog) for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="?subtopic=shopsystem">GO TO MAIN SHOP SITE</a></TD></TR> </table>'; } elseif($buy_offer['type'] == 'addon') { $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' ('.$SQL->fieldName('id').','.$SQL->fieldName('name').','.$SQL->fieldName('type').','.$SQL->fieldName('action').','.$SQL->fieldName('param1').','.$SQL->fieldName('param2').','.$SQL->fieldName('param3').','.$SQL->fieldName('param4').','.$SQL->fieldName('param5').','.$SQL->fieldName('param6').','.$SQL->fieldName('param7').','.$SQL->fieldName('delete_it').') VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote('login').', '.$SQL->quote('give_item').', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote('').', '.$SQL->quote('').', '.$SQL->quote('addons').', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote($buy_offer['id']).', '.$SQL->quote(1).');'; $SQL->query($sql); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' ('.$SQL->fieldName('id').','.$SQL->fieldName('to_name').','.$SQL->fieldName('to_account').','.$SQL->fieldName('from_nick').','.$SQL->fieldName('from_account').','.$SQL->fieldName('price').','.$SQL->fieldName('offer_id').','.$SQL->fieldName('trans_state').','.$SQL->fieldName('trans_start').','.$SQL->fieldName('trans_real').') VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote('wait').', '.$SQL->quote(time()).', '.$SQL->quote(0).');'; $SQL->query($save_transaction); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Item added!</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.htmlspecialchars($buy_offer['name']).'</b> added to player <b>'.htmlspecialchars($buy_player->getName()).'</b> items (he will get this items after relog) for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="?subtopic=shopsystem">GO TO MAIN SHOP SITE</a></TD></TR> </table>'; } elseif($buy_offer['type'] == 'container') { $sql = 'INSERT INTO '.$SQL->tableName('z_ots_comunication').' ('.$SQL->fieldName('id').','.$SQL->fieldName('name').','.$SQL->fieldName('type').','.$SQL->fieldName('action').','.$SQL->fieldName('param1').','.$SQL->fieldName('param2').','.$SQL->fieldName('param3').','.$SQL->fieldName('param4').','.$SQL->fieldName('param5').','.$SQL->fieldName('param6').','.$SQL->fieldName('param7').','.$SQL->fieldName('delete_it').') VALUES (NULL, '.$SQL->quote($buy_player->getName()).', '.$SQL->quote('login').', '.$SQL->quote('give_item').', '.$SQL->quote($buy_offer['item_id']).', '.$SQL->quote($buy_offer['item_count']).', '.$SQL->quote($buy_offer['container_id']).', '.$SQL->quote($buy_offer['container_count']).', '.$SQL->quote('container').', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote($buy_offer['id']).', '.$SQL->quote(1).');'; $SQL->query($sql); $save_transaction = 'INSERT INTO '.$SQL->tableName('z_shop_history_item').' ('.$SQL->fieldName('id').','.$SQL->fieldName('to_name').','.$SQL->fieldName('to_account').','.$SQL->fieldName('from_nick').','.$SQL->fieldName('from_account').','.$SQL->fieldName('price').','.$SQL->fieldName('offer_id').','.$SQL->fieldName('trans_state').','.$SQL->fieldName('trans_start').','.$SQL->fieldName('trans_real').') VALUES ('.$SQL->lastInsertId().', '.$SQL->quote($buy_player->getName()).', '.$SQL->quote($buy_player_account->getId()).', '.$SQL->quote($buy_from).', '.$SQL->quote($account_logged->getId()).', '.$SQL->quote($buy_offer['points']).', '.$SQL->quote($buy_offer['name']).', '.$SQL->quote('wait').', '.$SQL->quote(time()).', '.$SQL->quote(0).');'; $SQL->query($save_transaction); $account_logged->setCustomField('premium_points', $user_premium_points-$buy_offer['points']); $user_premium_points = $user_premium_points - $buy_offer['points']; $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Container of items added!</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.htmlspecialchars($buy_offer['name']).'</b> added to player <b>'.htmlspecialchars($buy_player->getName()).'</b> items (he will get this container with items after relog) for <b>'.$buy_offer['points'].' premium points</b> from your account.<br />Now you have <b>'.$user_premium_points.' premium points</b>.<br /><a href="?subtopic=shopsystem">GO TO MAIN SHOP SITE</a></TD></TR> </table>'; } } else { $set_session = TRUE; $_SESSION['viewed_confirmation_page'] = 'yes'; $main_content .= '<table border="0" cellpadding="4" cellspacing="1" width="100%"> <tr bgcolor="'.$config['site']['vdarkborder'].'"><td colspan="3" class="white"><b>Confirm Transaction</b></td></tr> <tr bgcolor="'.$config['site']['lightborder'].'"><td width="100"><b>Name:</b></td><td width="550" colspan="2">'. htmlspecialchars($buy_offer['name']).'</td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td width="100"><b>Description:</b></td><td width="550" colspan="2">'. htmlspecialchars($buy_offer['description']).'</td></tr> <tr bgcolor="'.$config['site']['lightborder'].'"><td width="100"><b>Cost:</b></td><td width="550" colspan="2"><b>'. htmlspecialchars($buy_offer['points']).' premium points</b> from your account</td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td width="100"><b>For Player:</b></td><td width="550" colspan="2"><font color="red">'.htmlspecialchars($buy_player->getName()).'</font></td></tr> <tr bgcolor="'.$config['site']['lightborder'].'"><td width="100"><b>From:</b></td><td width="550" colspan="2"><font color="red">'.htmlspecialchars($buy_from).'</font></td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td colspan="3"></td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td width="100"><b>Transaction?</b></td><td width="275" align="left"> <form action="?subtopic=shopsystem&action=confirm_transaction" method="POST"><input type="hidden" name="buy_confirmed" value="yes"><input type="hidden" name="buy_id" value="'.$buy_id.'"><input type="hidden" name="buy_from" value="'.htmlspecialchars($buy_from).'"><input type="hidden" name="buy_name" value="'.htmlspecialchars($buy_name).'"><input type="submit" value="Accept"></form></td> <td align="right"><form action="?subtopic=shopsystem" method="POST"><input type="submit" value="Cancel"></form></td></tr> <tr bgcolor="'.$config['site']['darkborder'].'"><td colspan="3"></td></tr> </table> '; } } else { $errormessage .= 'Player with name <b>'.htmlspecialchars($buy_name).'</b> doesn\'t exist. Please <a href="?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a>.'; } } else { $errormessage .= 'Invalid name format. Please <a href="?subtopic=shopsystem&action=select_player&buy_id='.$buy_id.'">select other name</a> or contact with administrator.'; } } else { $errormessage .= 'For this item you need <b>'.$buy_offer['points'].'</b> points. You have only <b>'.$user_premium_points.'</b> premium points. Please <a href="?subtopic=shopsystem">select other item</a> or buy premium points.'; } } else { $errormessage .= 'Offer with ID <b>'.$buy_id.'</b> doesn\'t exist. Please <a href="?subtopic=shopsystem">select item</a> again.'; } } } } if(!empty($errormessage)) { $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Informations</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.$errormessage.'</b></TD></TR> </table>'; } if(!$set_session) { unset($_SESSION['viewed_confirmation_page']); } } elseif($action == 'show_history') { if(!$logged) { $errormessage .= 'Please login first.'; } else { $items_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($items_history_received)) { foreach($items_history_received as $item_received) { if($account_logged->getId() == $item_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $items_received_text .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td><font color="'.$char_color.'">'.htmlspecialchars($item_received['to_name']).'</font></td><td>'; if($account_logged->getId() == $item_received['from_account']) $items_received_text .= '<i>Your account</i>'; else $items_received_text .= htmlspecialchars($item_received['from_nick']); $items_received_text .= '</td><td>'.htmlspecialchars($item_received['offer_id']).'</td><td>'.date("j F Y, H:i:s", $item_received['trans_start']).'</td>'; if($item_received['trans_real'] > 0) $items_received_text .= '<td>'.date("j F Y, H:i:s", $item_received['trans_real']).'</td>'; else $items_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>'; $items_received_text .= '</tr>'; } } $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'"></TD></TR> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><center><B>Transactions History</B></center></TD></TR> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'"></TD></TR> </table><br>'; if(!empty($items_received_text)) { $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white colspan="5"><B>Item Transactions</B></TD></TR> <tr bgcolor="'.$config['site']['darkborder'].'"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Bought on page</b></td><td><b>Received on OTS</b></td></tr> '.$items_received_text.' </table><br />'; } if(empty($items_received_text)) $errormessage .= 'You did not buy/receive any item.'; } if(!empty($errormessage)) { $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Informations</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b>'.$errormessage.'</b></TD></TR> </table>'; } } $main_content .= '<br><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=left CLASS=white><B>Premium Points</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['lightborder'].'" ALIGN=left><b><font color="green">You have premium points: </font></b>'.$user_premium_points.'</TD></TR> </table>'; } else $main_content .= '<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4> <TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" ALIGN=center CLASS=white ><B>Shop Information</B></TD></TR> <TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><center>Shop is currently closed. [to admin: edit it in \'config/config.php\']</TD></TR> </table>'; shop.lua -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 18 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication") if(result_plr ~= false) then repeat local id = tonumber(result.getDataInt(result_plr, "id")) local action = tostring(result.getDataString(result_plr, "action")) local delete = tonumber(result.getDataInt(result_plr, "delete_it")) local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name"))) if(cid) then local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1")) local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2")) local container_id = tonumber(result.getDataInt(result_plr, "param3")) local container_count = tonumber(result.getDataInt(result_plr, "param4")) local add_item_type = tostring(result.getDataString(result_plr, "param5")) local add_item_name = tostring(result.getDataString(result_plr, "param6")) local adddonn = tostring(result.getDataString(result_plr, "param7")) local received_item = 0 local full_weight = 0 -- Script para addons e montaria full pelo Gesior -- if(add_item_type == 'mount') then local player = Player(cid) if (getPlayerStorageValue(cid,1) == -1) then player:addMount(itemtogive_id) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE) doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from the shop.') db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid,25,"You Already have this Mount.") end return TRUE end -- fim do script -- -- Script para addons e montaria full pelo Gesior -- if(add_item_type == 'addons') then local player = Player(cid) if (getPlayerStorageValue(cid,adddonn) == -1) then local outfits = { --[outfit] = {id_female, id_male} ["1"] = {136, 128}, ["2"] = {137, 129}, ["3"] = {138, 130}, ["4"] = {139, 131}, ["5"] = {140, 132}, ["6"] = {141, 133}, ["7"] = {142, 134}, ["8"] = {147, 143}, ["9"] = {148, 144}, ["10"] = {149, 145}, ["11"] = {150, 146}, ["12"] = {155, 151}, ["13"] = {156, 152}, ["14"] = {157, 153}, ["15"] = {158, 154}, ["16"] = {252, 251}, ["17"] = {269, 268}, ["18"] = {270, 273}, ["19"] = {279, 278}, ["20"] = {288, 289}, ["21"] = {324, 325}, ["22"] = {336, 335}, ["23"] = {366, 367}, ["24"] = {431, 430}, ["25"] = {433, 432}, ["26"] = {464, 463}, ["27"] = {466, 465}, ["28"] = {471, 472}, ["29"] = {513, 512}, ["30"] = {514, 516}, ["31"] = {542, 541}, ["32"] = {575, 574}, ["33"] = {578, 577}, ["34"] = {618, 610}, ["35"] = {632, 633}, ["36"] = {635, 634}, ["37"] = {637, 636}, ["38"] = {664, 665}, ["39"] = {667, 666}, ["40"] = {683, 684}, ["41"] = {694, 695}, ["42"] = {696, 697}, ["43"] = {698, 699}, ["44"] = {724, 725}, ["45"] = {732, 733}, ["46"] = {745, 746}, ["47"] = {749, 750}, ["48"] = {759, 760}, ["49"] = {845, 846}, ["50"] = {852, 853}, ["51"] = {874, 873} } local param = string.lower(itemtogive_id) if (not player:hasOutfit(outfits[param][1], 3) or not player:hasOutfit(outfits[param][1], 2)) then player:getPosition():sendMagicEffect(CONST_ME_GIFT_WRAPS) player:removeItem(addondoll_id, 1) player:addOutfitAddon(outfits[param][1], 3) player:addOutfitAddon(outfits[param][2], 3) player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu Addon full foi adicionado!") else player:sendTextMessage(MESSAGE_INFO_DESCR, "ja tem esse addon!") end doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from The fullprojectibia Shop.') db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid,25,"You Already have this Outfit.") end return TRUE end -- fim do script -- if(add_item_type == 'container') then container_weight = getItemWeight(container_id, 1) if(isItemRune(itemtogive_id)) then items_weight = container_count * getItemWeight(itemtogive_id, 1) else items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeight(itemtogive_id, itemtogive_count) if(isItemRune(itemtogive_id)) then full_weight = getItemWeight(itemtogive_id, 1) else full_weight = getItemWeight(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if(full_weight <= free_cap) then if(add_item_type == 'container') then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while(iter ~= container_count) do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from The fullprojectibia Shop.') db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, ' '.. add_item_name ..' from Th3 Insanity is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, ' '.. add_item_name ..' Th3 Insanity is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end until not result.next(result_plr) result.free(result_plr) end return true end outfits.xml <?xml version="1.0" encoding="UTF-8"?> <outfits> <!-- Female outfits --> <outfit type="0" looktype="136" name="Citizen" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="137" name="Hunter" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="138" name="Mage" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="139" name="Knight" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="140" name="Noblewoman" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="141" name="Summoner" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="142" name="Warrior" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="147" name="Barbarian" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="148" name="Druid" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="149" name="Wizard" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="150" name="Oriental" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="155" name="Pirate" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="156" name="Assassin" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="157" name="Beggar" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="158" name="Shaman" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="252" name="Norsewoman" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="269" name="Nightmare" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="270" name="Jester" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="279" name="Brotherhood" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="288" name="Demonhunter" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="324" name="Yalaharian" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="329" name="Wife" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="336" name="Warmaster" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="366" name="Wayfarer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="431" name="Afflicted" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="433" name="Elementalist" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="464" name="Deepling" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="466" name="Insectoid" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="471" name="Entrepreneur" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="513" name="Crystal Warlord" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="514" name="Soil Guardian" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="542" name="Demon" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="575" name="Cave Explorer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="578" name="Dream Warden" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="618" name="Glooth Engineer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="620" name="Jersey" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="632" name="Champion" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="635" name="Conjurer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="636" name="Beastmaster" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="664" name="Chaos Acolyte" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="666" name="Death Herald" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="683" name="Ranger" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="694" name="Ceremonial Garb" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="696" name="Puppeteer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="698" name="Spirit Caller" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="724" name="Evoker" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="732" name="Seaweaver" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="745" name="Recruiter" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="749" name="Sea Dog" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="759" name="Royal Pumpkin" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="845" name="Rift Warrior" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="852" name="Winter Warden" premium="no" unlocked="yes" enabled="yes" /> <outfit type="0" looktype="874" name="Philosopher" premium="no" unlocked="yes" enabled="yes" /> <!-- Male outfits --> <outfit type="1" looktype="128" name="Citizen" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="129" name="Hunter" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="130" name="Mage" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="131" name="Knight" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="132" name="Nobleman" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="133" name="Summoner" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="134" name="Warrior" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="143" name="Barbarian" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="144" name="Druid" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="145" name="Wizard" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="146" name="Oriental" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="151" name="Pirate" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="152" name="Assassin" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="153" name="Beggar" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="154" name="Shaman" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="251" name="Norseman" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="268" name="Nightmare" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="273" name="Jester" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="278" name="Brotherhood" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="289" name="Demonhunter" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="325" name="Yalaharian" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="328" name="Husband" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="335" name="Warmaster" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="367" name="Wayfarer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="430" name="Afflicted" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="432" name="Elementalist" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="463" name="Deepling" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="465" name="Insectoid" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="472" name="Entrepreneur" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="512" name="Crystal Warlord" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="516" name="Soil Guardian" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="541" name="Demon" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="574" name="Cave Explorer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="577" name="Dream Warden" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="610" name="Glooth Engineer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="619" name="Jersey" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="633" name="Champion" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="634" name="Conjurer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="637" name="Beastmaster" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="665" name="Chaos Acolyte" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="667" name="Death Herald" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="684" name="Ranger" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="695" name="Ceremonial Garb" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="697" name="Puppeteer" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="699" name="Spirit Caller" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="725" name="Evoker" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="733" name="Seaweaver" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="746" name="Recruiter" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="750" name="Sea Dog" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="760" name="Royal Pumpkin" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="846" name="Rift Warrior" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="853" name="Winter Warden" premium="no" unlocked="yes" enabled="yes" /> <outfit type="1" looktype="873" name="Philosopher" premium="no" unlocked="yes" enabled="yes" /> </outfits> Observações: O código ta feio mesmo, uma conexão a mais no mysql n vai matar ninguém, aqui funcionou perfeitamente. Você terá q renomear os gifs dos outfits e addons para 1,2,3... seguindo a ordem que está ai. O código tem limitações, não verifica se o jogador já tem uma addon ou mount, outro dia irei concluir isso. Futuramente é interessante chamar a função de salvar o jogador pois se o ot cair sem ter salvo a pessoa perde o que comprou.
  4. Eu ja realizei essa correção, amanhã farei o pull da mesma. https://github.com/gordonbay/capernia-ots-datapack basta substituir o global.otbm pelo meu. Eu não sei se ja corrigiu isso mas caso não tenha substitua a sua pasta spells e npc pela que está nesse git: https://github.com/gordonbay/capernia-ots-datapack
  5. Criei também um git pois achei muito vaga as descrições dos outros projetos criados aqui, além disso eu sou coordenador de projetos então isso deve ajudar em algo, a partir de amanhã começarei a aplicar as correções que já havia aplicado no meu servidor. O projeto chama Capernia e não tem nenhuma relação com o meu servidor apesar do nome igual. O objetivo vai além de corrigir as falhas nessa datapack, estaremos analisando outros códigos para montar um conteúdo mais completo. Inglês será o idioma padrão. https://github.com/gordonbay/capernia-ots-datapack https://gitter.im/gordonbay/capernia-ots-datapack
  6. Tem github esse projeto? Já fiz várias correções no datapack, é uma pena ficarem apenas pra mim, gostaria de compartilhar.
  7. Funcionando e atualizado tfs 1.2: talkactions.xml
  8. Bom dia, estou a procura de uma pessoa para ajudar em um projeto que sonho a algum tempo, reviver um antigo servidor chamado capernia. O mesmo era 8.6 e sua principal característica era o rate semelhante ao tibia original. Eu iniciei um novo projeto 10.91, já tenho site (http://capernia2.com) e servidor VPS contratado (capernia2.com:7171), o servidor já está em funcionamento desde hoje 27/04/2016 porém obviamente precisa de polimento. No momento estou precisando de um programador LUA e um divulgador que de preferência que possam também ajudar nos custos do servidor dedicado (R$ 70,00). Eu sou programador PHP mas domino vários outros códigos e estou achando o LUA tranquilo mas sozinho não dá.

Informação Importante

Confirmação de Termo