Líderes
Conteúdo Popular
Exibindo conteúdo com a maior reputação em 02/21/11 em todas áreas
-
[Talkaction] System Moves V2 147/151 - Xotservx
victorvs e um outro reagiu a italomfr por um tópico no fórum
Bom galera, eu tinha postado esse script como resposta no Topico do xOtservx então um Usuario me pediu para criar um topico pra melhorar a visualização. Bom, o Script é o mesmo que o do xotservx entao qualquer Erro reporte no Topico dele. Link disponivel no Final do Topico Sobre os creditos vão 100% ao xOtservx eu só adicionei + pokemons. Então vo explicar o que fiz: Adicionei os Pokemons seguindo a Pokedex e o Nome das magias apartir de um arquivo chamado " AA - svke pokedex " Encontrado na pasta Pokedex do servidor Pokemon Dash Arquivo Anexado pra quem quiser. Aqui vai o Script agora com 147/151 Pokes: OBS - Não configurei, Cd, Atkmin, Atkmax, Damage nem nada. Só adicionei as magias aos Pokemons. Caso achen inutil ignoren o Topico Pois eu cresci sabendo que são pequenas atitudes que mudan as coisas ^^ V2 Do Script Galera Agora com 147/151 Pokes com Todos Ataques na Tabela. Agora falta adicionar as Magias restantes os Lvs, Cds, St, Atkmin e Atkmax fora o Damagetype Topico para duvidas quanto a instalação do script: Aqui AA - svke pokedex.txt2 pontos -
[Talkactions] Slot Spy System
Vodkart e um outro reagiu a topmaster por um tópico no fórum
Ola a todos venho aqui hoje para postar meu primero script, sua finalidade é mostrar os equipamentos que seus jogadores estao usando Primeiramente adicione essa tag em data/talkactions/talkactions.xml <talkaction log="yes" access="5" words="/slots" event="script" value="slots.lua"/> Logo depois crie um arquivo chamado slots.lua em talkactions/scripts --[[ By: TopMaster First Script ]]-- function onSay(cid, words, param, channel) if not param or param == "" or not getPlayerByName(param) then return doPlayerSendTextMessage(cid, 27, "Player Not Found.") end local p = getPlayerByName(param) local sloname = {"Head", "Necklace", "Backpack", "Armor", "Right", "Left", "Legs", "Feet", "Ring", "Ammo"} tx = "" for i = 1, 10 do s = getPlayerSlotItem(p, i).itemid if s ~= 0 then tx = tx .. "[" .. string.upper(sloname[i]) .. "] = " .. string.upper(getItemNameById(getPlayerSlotItem(p, i).itemid)) .. "\n" else tx = tx .. "[" .. string.upper(sloname[i]) .. "] = EMPTY\n" end end tx = "[" .. getCreatureName(p) .. "]\n\n" .. tx doPlayerPopupFYI(cid, tx) return true end Imagem Modo de usar Apenas use o comando /slots nome do jogador por exemplo, /slots Dante. Bom é isso espero que gostem e comentem vlw.2 pontos -
[Gesior Acc] Pagseguro Entregando Pontos Automaticamente
Rafu reagiu a walefxavier por um tópico no fórum
@Edit ________________________________________________________________ No Seu Htdocs va em Config/config.php e coloque isso no final: // Sistema automatico Pagseguro by tatu_hunter // Seu email cadastrado no pagseguro $config['pagseguro']['email'] = 'seu e-mail'; // Valor unitario do produto ou seja valor de cada ponto // Exemplo de valores // 100 = R$ 1,00 // 235 = R$ 2,35 // 4254 = R$ 42,54 $config['pagseguro']['produtoValor'] = '100'; // Token gerado no painel do pagseguro $config['pagseguro']['token'] = 'SEU TOKEN PAGSEGURO AQUI'; Como ja havia dito no outro topico,crie um arquivo chamado retPagseguro.php Dentro adicione isso: <?php include('config-and-functions.php'); define('TOKEN', $config['pagseguro']['token']); // Incluindo o arquivo da biblioteca include('retorno.php'); // Função que captura os dados do retorno function retorno_automatico ( $VendedorEmail, $TransacaoID, $Referencia, $TipoFrete, $ValorFrete, $Anotacao, $DataTransacao, $TipoPagamento, $StatusTransacao, $CliNome, $CliEmail, $CliEndereco, $CliNumero, $CliComplemento, $CliBairro, $CliCidade, $CliEstado, $CliCEP, $CliTelefone, $produtos, $NumItens) { global $config; if(strtolower($StatusTransacao) == 'aprovado') { $account_logged = $ots->createObject('Account'); $account_logged->find($Referencia); if($account_logged->isLoaded()) { $pontos = $account_logged->getCustomField("premium_points"); $account_logged->setCustomField("premium_points", $pontos + $produtos[0]['ProdQuantidade']); $nome = $Referencia.'-'.date('d-m-Y',$_SERVER['REQUEST_TIME']).'.txt'; if(file_exists('logsPagseguro/'.$nome)) $nome = $Referencia.'-2-'.date('d-m-Y',$_SERVER['REQUEST_TIME']).'.txt'; $arquivo = fopen('logsPagseguro/'.$nome, "w+"); $dados = "Conta: ".$Referencia."\n"; $dados = "Email: ".$CliEmail."\n"; $dados .= "Total de Points: ".$produtos[0]['ProdQuantidade']."\n"; $dados .= "Hora da Transação: ". date('d-m-Y H:i:s', $_SERVER['REQUEST_TIME']).""; fwrite($arquivo, $dados); fclose($arquivo); } } } // A partir daqui, é só HTML: ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> </head> <body> <h1>Pedido em processamento</h1> <p>Recebemos seu pedido e estamos aguardando pela confirmação do pagamento. Obrigado por comprar conosco.</p> </body> </html> Depois crie um arquivo chamado retorno.php e adicione o seguinte: <?php if (!defined('TOKEN')) define ('TOKEN', ''); /** * RetornoPagSeguro * * Classe de manipulação para o retorno do post do pagseguro * * @package PagSeguro */ class RetornoPagSeguro { /** * _preparaDados * * Prepara os dados vindos do post e converte-os para url, adicionando * o token do usuario quando necessario. * * @internal é usado pela {@see RetornoPAgSeguro::verifica} para gerar os, * dados que serão enviados pelo PagSeguro * * @access private * * @param array $post Array contendo os posts do pagseguro * @param bool $confirmacao Controlando a adicao do token no post * @return string */ function _preparaDados($post, $confirmacao=true) { if ('array' !== gettype($post)) $post=array(); if ($confirmacao) { $post['Comando'] = 'validar'; $post['Token'] = TOKEN; } $retorno=array(); foreach ($post as $key=>$value){ if('string'!==gettype($value)) $post[$key]=''; $value=urlencode(stripslashes($value)); $retorno[]="{$key}={$value}"; } return implode('&', $retorno); } /** * _tipoEnvio * * Checa qual será a conexao de acordo com a versao do PHP * preferencialmente em CURL ou via socket * * em CURL o retorno será: * <code> array ('curl','https://pagseguro.uol.com.br/Security/NPI/Default.aspx') </code> * já em socket o retorno será: * <code> array ('fsocket', '/Security/NPI/Default.aspx', $objeto-de-conexao) </code> * se não encontrar nenhum nem outro: * <code> array ('','') </code> * * @access private * @global string $_retPagSeguroErrNo Numero de erro do pagseguro * @global string $_retPagSeguroErrStr Texto descritivo do erro do pagseguro * @return array Array com as configurações * */ function _tipoEnvio() { //Prefira utilizar a função CURL do PHP //Leia mais sobre CURL em: http://us3.php.net/curl global $_retPagSeguroErrNo, $_retPagSeguroErrStr; if (function_exists('curl_exec')) return array('curl', 'https://pagseguro.uol.com.br/Security/NPI/Default.aspx'); elseif ((PHP_VERSION >= 4.3) && ($fp = @fsockopen('ssl://pagseguro.uol.com.br', 443, $_retPagSeguroErrNo, $_retPagSeguroErrStr, 30))) return array('fsocket', '/Security/NPI/Default.aspx', $fp); elseif ($fp = @fsockopen('pagseguro.uol.com.br', 80, $_retPagSeguroErrNo, $_retPagSeguroErrStr, 30)) return array('fsocket', '/Security/NPI/Default.aspx', $fp); return array ('', ''); } /** * not_null * * Extraido de OScommerce 2.2 com base no original do pagseguro, * Checa se o valor e nulo * * @access public * * @param mixed $value Variável a ser checada se é nula * @return bool */ function not_null($value) { if (is_array($value)) { if (sizeof($value) > 0) { return true; } else { return false; } } else { if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) { return true; } else { return false; } } } /** * verifica * * Verifica o tipo de conexão aberta e envia os dados vindos * do post * * @access public * * @use RetornoPagSeguro::_tipoenvio() * @global string $_retPagSeguroErrNo Numero de erro do pagseguro * @global string $_retPagSeguroErrStr Texto descritivo do erro do pagseguro * @param array $post Array contendo os posts do pagseguro * @param bool $tipoEnvio (opcional) Verifica o tipo de envio do post * @return bool */ function verifica($post, $tipoEnvio=false) { global $_retPagSeguroErrNo, $_retPagSeguroErrStr; if ('array' !== gettype($tipoEnvio)) $tipoEnvio = RetornoPagSeguro::_tipoEnvio(); $spost=RetornoPagSeguro::_preparaDados($post); if (!in_array($tipoEnvio[0], array('curl', 'fsocket'))) return false; $confirma = false; if ($tipoEnvio[0] === 'curl') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $tipoEnvio[1]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $spost); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($ch); if (!RetornoPagSeguro::not_null($resp)) { curl_setopt($ch, CURLOPT_URL, $tipoEnvio[1]); $resp = curl_exec($ch); } curl_close($ch); $confirma = (strcmp ($resp, 'VERIFICADO') == 0); } elseif ($tipoEnvio[0] === 'fsocket') { if (!$tipoEnvio[2]) { die ("{$_retPagSeguroErrStr} ($_retPagSeguroErrNo)"); } else { $cabecalho = "POST {$tipoEnvio[1]} HTTP/1.0\r\n"; $cabecalho .= "Content-Type: application/x-www-form-urlencoded\r\n"; $cabecalho .= "Content-Length: " . strlen($spost) . "\r\n\r\n"; $resp = ''; fwrite ($tipoEnvio[2], "{$cabecalho}{$spost}"); while (!feof($tipoEnvio[2])) { $resp = fgets ($tipoEnvio[2], 1024); if (strcmp ($resp, 'VERIFICADO') == 0) { $confirma = (strcmp ($resp, 'VERIFICADO') == 0); $confirma=true; break; } } fclose ($tipoEnvio[2]); } } if ($confirma && function_exists('retorno_automatico')) { $itens = array ( 'VendedorEmail', 'TransacaoID', 'Referencia', 'TipoFrete', 'ValorFrete', 'Anotacao', 'DataTransacao', 'TipoPagamento', 'StatusTransacao', 'CliNome', 'CliEmail', 'CliEndereco', 'CliNumero', 'CliComplemento', 'CliBairro', 'CliCidade', 'CliEstado', 'CliCEP', 'CliTelefone', 'NumItens', ); foreach ($itens as $item) { if (!isset($post[$item])) $post[$item] = ''; if ($item=='ValorFrete') $post[$item] = str_replace(',', '.', $post[$item]); } $produtos = array (); for ($i=1;isset($post["ProdID_{$i}"]);$i++) { $produtos[] = array ( 'ProdID' => $post["ProdID_{$i}"], 'ProdDescricao' => $post["ProdDescricao_{$i}"], 'ProdValor' => (double) (str_replace(',', '.', $post["ProdValor_{$i}"])), 'ProdQuantidade' => $post["ProdQuantidade_{$i}"], 'ProdFrete' => (double) (str_replace(',', '.', $post["ProdFrete_{$i}"])), 'ProdExtras' => (double) (str_replace(',', '.', $post["ProdExtras_{$i}"])), ); } retorno_automatico ( $post['VendedorEmail'], $post['TransacaoID'], $post['Referencia'], $post['TipoFrete'], $post['ValorFrete'], $post['Anotacao'], $post['DataTransacao'], $post['TipoPagamento'], $post['StatusTransacao'], $post['CliNome'], $post['CliEmail'], $post['CliEndereco'], $post['CliNumero'], $post['CliComplemento'], $post['CliBairro'], $post['CliCidade'], $post['CliEstado'], $post['CliCEP'], $post['CliTelefone'], $produtos, $post['NumItens'] ); } return $confirma; } } if ($_POST) { RetornoPagSeguro::verifica($_POST); die(); } ?> No seu buypoints.php,basta colocar isso: <?php if(!$logged) if($action == "logout") $main_content .= '<div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Logout Successful</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td>You have logged out of your '.$config['server']['serverName'].' account. In order to view your account you need to <a href="?subtopic=accountmanagement" >log in</a> again.</td></tr> </table> </div> </table></div></td></tr>'; else $main_content .= 'Please enter your account name and your password.<br/><a href="?subtopic=createaccount" >Create an account</a> if you do not have one yet.<br/><br/><form action="?subtopic=accountmanagement" method="post" ><div class="TableContainer" > <table class="Table1" cellpadding="0" cellspacing="0" > <div class="CaptionContainer" > <div class="CaptionInnerContainer" > <span class="CaptionEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionBorderTop" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <div class="Text" >Account Login</div> <span class="CaptionVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></span> <span class="CaptionBorderBottom" style="background-image:url('.$layout_name.'/images/content/table-headline-border.gif);" ></span> <span class="CaptionEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> <span class="CaptionEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></span> </div> </div> <tr> <td> <div class="InnerTableContainer" > <table style="width:100%;" ><tr><td class="LabelV" ><span >Account Name:</span></td><td style="width:100%;" ><input type="password" name="account_login" SIZE="10" maxlength="10" ></td></tr><tr><td class="LabelV" ><span >Password:</span></td><td><input type="password" name="password_login" size="30" maxlength="29" ></td></tr> </table> </div> </table></div></td></tr><br/><table width="100%" ><tr align="center" ><td><table border="0" cellspacing="0" cellpadding="0" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Submit" alt="Submit" src="'.$layout_name.'/images/buttons/_sbutton_submit.gif" ></div></div></td><tr></form></table></td><td><table border="0" cellspacing="0" cellpadding="0" ><form action="?subtopic=lostaccount" method="post" ><tr><td style="border:0px;" ><div class="BigButton" style="background-image:url('.$layout_name.'/images/buttons/sbutton.gif)" ><div onMouseOver="MouseOverBigButton(this);" onMouseOut="MouseOutBigButton(this);" ><div class="BigButtonOver" style="background-image:url('.$layout_name.'/images/buttons/sbutton_over.gif);" ></div><input class="ButtonText" type="image" name="Account lost?" alt="Account lost?" src="'.$layout_name.'/images/buttons/_sbutton_accountlost.gif" ></div></div></td></tr></form></table></td></tr></table>'; else { $main_content .= ' <form target="pagseguro" method="post" action="https://pagseguro.uol.com.br/checkout/checkout.jhtml"> <input type="hidden" name="email_cobranca" value="'. $config['pagseguro']['email']. '"> <input type="hidden" name="tipo" value="CP"> <input type="hidden" name="moeda" value="BRL"> <input type="hidden" name="item_id_1" value="1"> <input type="hidden" name="item_descr_1" value="Pontos na account de nome: '.$account_logged->getCustomField("name").'"> <input type="hidden" name="item_valor_1" value="'. $config['pagseguro']['produtoValor'] .'"> <input type="hidden" name="item_frete_1" value="0"> <input type="hidden" name="item_peso_1" value="0"> <input type="hidden" name="ref_transacao" value="'.$account_logged->getCustomField("name").'"> <table border="0" cellpadding="4" cellspacing="1" width="100%" id="#estilo"><tbody> <tr bgcolor="#505050" class="white"> <th colspan="2"><strong>Escolha a quantidade de pontos que deseja comprar</strong></th> </tr> <tr> <td width="10%">Sua conta</td> <td><strong>'.$account_logged->getCustomField("name").'</strong></td> </tr> <tr> <td width="10%">Pontos</td> <td> <input name="item_quant_1" type="text" value="1" size="5" maxlength="5"> </td> </tr> <tr> <td colspan="2"> <input type="image" src="https://p.simg.uol.com.br/out/pagseguro/i/botoes/carrinhoproprio/btnFinalizar.jpg" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!" /> </td> </tr> </tbody></table></form>'; } ?> Para finalizar: Adicione no seu phpmyadmin,na parte SQL,a seguinte database: CREATE TABLE `retorno_automatico` ( `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, `status` tinyint(1) unsigned NOT NULL default '0', UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`), KEY `Referencia` (`Referencia`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; E essa outra aqui : CREATE TABLE `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, `status` tinyint(1) unsigned NOT NULL default '0', UNIQUE KEY `TransacaoID` (`TransacaoID`,`StatusTransacao`), KEY `Referencia` (`Referencia`), KEY `status` (`status`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; :XTibia_smile:1 ponto -
Opções Do Comando /attr
darkrayfury reagiu a Doidin por um tópico no fórum
É galera eu acho que todos sabem que o comando /attr serve para mudar coisas no server, semprecisar ter que derrubar ele para poder alterar... Para usar ele é bem simples, basta usar virado para o "alvo" que no caso é o player ou algum item, vamos logo as opções do comando: Opções para se usar em items: Opções para se usar em players: Sempre que for usar o comando você deve informar para qual numero você irá alterar, exemplo: /attr group 5 Espero que tenham entendido, abraços...1 ponto -
Hello "..getCreatureName()..", estou aqui pra te ensinar um script bem útil, porém simples. Nome: Auction House with NPC Créditos : Gesior.pl da OTLand Categoria: Fácil Descrição: Vocês ja viram em alguns MMORPG's que existe o sistema de Auction House, voce quer vender um item, mas esta sem tempo? Isso terminou, deixe seu item com o Auctioner e ele venderá para voce. offer of Player name mostra as ofertas de um player em uma janela de trade search Item name mostra as 5 melhores ofertas de um item Não sabe usar? Digite how to use. Vamos ao tutorial? 1. Crie um arquivo LUA em data/npc/scripts com o nome de Auctioner.lua e adicione o seguinte código: -- shop system function getOfferOfPlayer(name) local offer = {} local result_items = db.getResult("SELECT `id`, `name`, `item_name`, `itemid`, `subType`, `count`, `price` FROM `ots_playersshopsystem` WHERE `name` = " .. db.escapeString(name) .. " AND `count` > '0' AND `itemid` != '66'") if(result_items:getID() ~= -1) then while(true) do table.insert(offer, {id = result_items:getDataInt("id"), name = result_items:getDataString("name"), item_name = result_items:getDataString("item_name"), itemid = result_items:getDataInt("itemid"), subType = result_items:getDataInt("subType"), count = result_items:getDataInt("count"), price = result_items:getDataInt("price")}) if not(result_items:next()) then break end end result_items:free() end return offer end function getOfferOfItem(item_name) local offer = {} result_items = db.getResult("SELECT `id`, `name`, `item_name`, `itemid`, `subType`, `count`, `price` FROM `ots_playersshopsystem` WHERE `item_name` = " .. db.escapeString(item_name) .. " AND `count` > '0' AND `itemid` != '66' ORDER BY `price` ASC LIMIT 5") if(result_items:getID() ~= -1) then while(true) do table.insert(offer, {id = result_items:getDataInt("id"), name = result_items:getDataString("name"), item_name = result_items:getDataString("item_name"), itemid = result_items:getDataInt("itemid"), subType = result_items:getDataInt("subType"), count = result_items:getDataInt("count"), price = result_items:getDataInt("price")}) if not(result_items:next()) then break end end result_items:free() end return offer end function addItemToOffer(name, itemid, subType, count) local inDB_id = 0 local result_offers = db.getResult("SELECT `id`, `count` FROM `ots_playersshopsystem` WHERE `name` = " .. db.escapeString(name) .. " AND `itemid` = '" .. itemid .. "' AND `subType` = '" .. subType .. "' AND `itemid` != '66'") if(result_offers:getID() ~= -1) then inDB_id = result_offers:getDataInt("id") result_offers:free() end if inDB_id ~= 0 then db.executeQuery("UPDATE `ots_playersshopsystem` SET `count` = `ots_playersshopsystem`.`count` + " .. count .." WHERE `id` = '" .. inDB_id .. "' AND `subType` = '" .. subType .. "' AND `itemid` != '66'") else db.executeQuery("INSERT INTO `ots_playersshopsystem` (`id`, `name`, `item_name`, `itemid`, `subType`, `count`, `price`) VALUES (NULL, " .. db.escapeString(name) .. ", " .. db.escapeString(getItemNameById(itemid)) .. ", '" .. itemid .. "', '" .. subType .. "', '" .. count .. "', 1000000)") end return true end function removeItemsFromOffer(name, itemid, subType, count) db.executeQuery("UPDATE `ots_playersshopsystem` SET `count` = `ots_playersshopsystem`.`count` - " .. count .." WHERE `name` = " .. db.escapeString(name) .. " AND `itemid` = '" .. itemid .. "' AND `subType` = '" .. subType .. "' AND `itemid` != '66'") return true end function changePriceOfItem(name, itemid, subType, price) db.executeQuery("UPDATE `ots_playersshopsystem` SET `price` = " .. price .." WHERE `name` = " .. db.escapeString(name) .. " AND `itemid` = '" .. itemid .. "' AND `subType` = '" .. subType .. "' AND `itemid` != '66'") return true end function getItemWithId(id) local item = {id=0} local result_items = db.getResult("SELECT `id`, `name`, `item_name`, `itemid`, `subType`, `count`, `price` FROM `ots_playersshopsystem` WHERE `id` = '" .. id .. "' AND `count` > 0 AND `itemid` != '66'") if (result_items:getID() ~= -1) then item = {id = result_items:getDataInt("id"), name = result_items:getDataString("name"), item_name = result_items:getDataString("item_name"), itemid = result_items:getDataInt("itemid"), subType = result_items:getDataInt("subType"), count = result_items:getDataInt("count"), price = result_items:getDataInt("price")} result_items:free() end return item end function getItemWithItemId(name, itemid, subType) local item = {id=0, subType=0} local result_items = db.getResult("SELECT `id`, `name`, `item_name`, `itemid`, `subType`, `count`, `price` FROM `ots_playersshopsystem` WHERE `name` = " .. db.escapeString(name) .. " AND `itemid` = '" .. itemid .. "' AND `subType` = '" .. subType .. "' AND `count` > 0 AND `itemid` != '66'") if(result_items:getID() ~= -1) then item = {id = result_items:getDataInt("id"), name = result_items:getDataString("name"), item_name = result_items:getDataString("item_name"), itemid = result_items:getDataInt("itemid"), subType = result_items:getDataInt("subType"), count = result_items:getDataInt("count"), price = result_items:getDataInt("price")} result_items:free() end return item end function getCash(name) local cash = 0 local result_items = db.getResult("SELECT `id`, `count` FROM `ots_playersshopsystem` WHERE `name` = " .. db.escapeString(name) .. " AND `itemid` = '66'") if(result_items:getID() ~= -1) then cash = result_items:getDataInt("count") result_items:free() else db.executeQuery("INSERT INTO `ots_playersshopsystem` (`id`, `name`, `item_name`, `itemid`, `count`, `price`) VALUES ('', " .. db.escapeString(name) .. ", 'Player Cash', '66', '0', '0')") end return cash end function setCash(name, count) db.executeQuery("UPDATE `ots_playersshopsystem` SET `count` = " .. count ..", `price` = " .. count .." WHERE `name` = " .. db.escapeString(name) .. " AND `itemid` = '66'") return true end function addPlayerItemFromShop(cid, itemid, amount, subType) local amount = amount or 1 local subType = subType or 0 if(isItemStackable(itemid) == TRUE) then local item = doCreateItemEx(itemid, amount) local ret = doPlayerAddItemEx(cid, item) if(ret ~= RETURNVALUE_NOERROR) then return {}, 0 end return {item}, amount end local items = {} local ret = 0 local a = 0 for i = 1, amount do items[i] = doCreateItemEx(itemid, subType) ret = doPlayerAddItemEx(cid, items[i]) if(ret ~= RETURNVALUE_NOERROR) then break end a = a + 1 end return items, a end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) shop_offers = {} shop_last_item = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end npcHandler:say('I don\'t understand. Ask me for {how to use} to get available actions.', cid) end function onBuyItemNPC(cid, itemid, subType, amount) if(isItemRune(itemid) ~= TRUE and isItemStackable(itemid) ~= TRUE) then subType = 0 end if(NPCHANDLER_CONVBEHAVIOR ~= CONVERSATION_DEFAULT) then npcHandler.talkStart[cid] = os.time() else npcHandler.talkStart = os.time() end local offers = shop_offers[cid] local item = {id=0} for i = 1, #offers do if itemid == offers[i].itemid and subType == offers[i].subType then item = getItemWithId(offers[i].id) break end end if (not (item.id > 0)) then npcHandler:say('This item is not available in this player offer.', cid) closeShopWindow(cid) return true end local amount2 = amount if amount2 > item.count then amount2 = item.count end if item.name == getCreatureName(cid) then local boughtItems, i = addPlayerItemFromShop(cid, item.itemid, amount2, item.subType) if i == item.count then closeShopWindow(cid) end if(i < amount) then if(i > 0) then removeItemsFromOffer(item.name, item.itemid, item.subType, i) if amount == amount2 then npcHandler:say('Here you are your ' .. i .. ' of requested ' .. amount .. ' ' .. item.item_name .. ', because you do not have enought capacity for all.', cid) else npcHandler:say('Here you are your ' .. i .. ' of requested ' .. amount .. ' ' .. item.item_name .. ', because I do not have more your items of this type.', cid) end else npcHandler:say('You do not have capacity for this item.', cid) end else removeItemsFromOffer(item.name, item.itemid, item.subType, i) npcHandler:say('Here you are your ' .. amount .. ' ' .. item.item_name .. '.', cid) end else if (getPlayerMoney(cid) < amount * item.price) then if(amount == 1) then npcHandler:say(item.item_name .. ' cost ' .. item.price .. ' gp, you got only ' .. getPlayerMoney(cid) .. ' gp.', cid) else npcHandler:say(amount .. ' ' .. item.item_name ..'s cost ' .. amount * item.price .. ' gp, you got only ' .. getPlayerMoney(cid) .. ' gp.', cid) end return true end local boughtItems, i = addPlayerItemFromShop(cid, item.itemid, amount2, item.subType) if i == item.count then closeShopWindow(cid) end if(i < amount) then if(i > 0) then removeItemsFromOffer(item.name, item.itemid, item.subType, i) doPlayerRemoveMoney(cid, i * item.price) setCash(item.name, getCash(item.name)+i * item.price) if amount == amount2 then npcHandler:say('Here you are ' .. i .. ' of requested ' .. amount .. ' ' .. item.item_name .. ' for ' .. i * item.price .. ' gp, because you do not have enought capacity for all.', cid) else npcHandler:say('Here you are ' .. i .. ' of requested ' .. amount .. ' ' .. item.item_name .. ' for ' .. i * item.price .. ' gp, because I do not have more for sell.', cid) end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. i .. "x " .. item.item_name .. ".") else npcHandler:say('You do not have capacity for this item.', cid) end else removeItemsFromOffer(item.name, item.itemid, item.subType, i) doPlayerRemoveMoney(cid, i * item.price) setCash(item.name, getCash(item.name)+i * item.price) npcHandler:say('Here you are ' .. amount .. ' ' .. item.item_name .. ' for ' .. i * item.price .. ' gp.', cid) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. i .. "x " .. item.item_name .. ".") end end return true end function onSellItemNPC(cid, itemid, subType, amount) return true end function showOfferOfPlayerNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local name = '' if keywords[1] == 'my offer' or keywords[1] == 'get item' then name = getCreatureName(cid) npcHandler:say('You can take your items if you don\'t want sell them.', cid) else name = string.sub(message, 10) npcHandler:say('Offer of ' .. name .. '.', cid) end local offer = getOfferOfPlayer(name) shop_offers[cid] = offer local itemWindow = {} local item = {} for i = 1, #offer do if keywords[1] == 'my offer' or keywords[1] == 'get item' then item = {id = offer[i].itemid, buy = 1, sell = 0, subType = offer[i].subType, name = offer[i].item_name .. "(" .. offer[i].count .. ")"} else item = {id = offer[i].itemid, buy = offer[i].price, sell = 0, subType = offer[i].subType, name = offer[i].item_name .. "(" .. offer[i].count .. ")"} end table.insert(itemWindow, item) end closeShopWindow(cid) openShopWindow(cid, itemWindow, function(cid, itemid, subType, amount) onBuyItemNPC(cid, itemid, subType, amount) end, function(cid, itemid, subType, amount) onSellItemNPC(cid, itemid, subType, amount) end) npcHandler:resetNpc() return true end function showOfferOfItemNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local item_name = string.sub(message, 8) local offer = getOfferOfItem(item_name) local msg = '' if #offer == 0 then msg = "Can\'t find offer of item with name >" .. item_name .. "<" else msg = "Cheapest offers of " .. item_name .. ":\n" for i = 1, #offer do if offer[i].subType > 0 then msg = msg .. offer[i].price .. " gp (charges: " .. offer[i].subType .. ") - " .. offer[i].name else msg = msg .. offer[i].price .. " gp - " .. offer[i].name end if #offer ~= i then msg = msg .. "\n" end end end selfSay(msg, cid) npcHandler:resetNpc() return true end function addItemToOfferNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local number = 0 for word in string.gmatch(tostring(message), "(%w+)") do if tostring(tonumber(word)) == word then number = tonumber(word) end end if (parameters.setprice == true) then local item_db = getItemWithItemId(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType) if number < 1 then number = 1 end changePriceOfItem(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType, number) item_db = getItemWithItemId(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType) if tonumber(item_db.subType) > 0 then npcHandler:say('Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' (charges: ' .. item_db.subType .. ') in offer, price for each is now ' .. item_db.price .. ' gp. Say {set price} to change price of items.', cid) else npcHandler:say('Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' in offer, price for each is now ' .. item_db.price .. ' gp. Say {set price} to change price of items.', cid) end shop_last_item[cid] = {} npcHandler:resetNpc() elseif (parameters.setprice == false) then item_db = getItemWithItemId(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType) npcHandler:say('Ok. I do not change price for ' .. getItemNameById(shop_last_item[cid].itemid) ..'. It is ' .. item_db.price .. ' gp/each now.', cid) shop_last_item[cid] = {} npcHandler:resetNpc() else local item = getPlayerSlotItem(cid, 5) if (item.itemid == 0) then npcHandler:say('Your left hand (under BP slot) is empty.', cid) npcHandler:resetNpc() return true end if (isItemContainer(item.itemid) == TRUE and getContainerItem(uid, 0).uid > 0) then npcHandler:say('In your left hand (under BP slot) is not empty container. You can add to offer only items and empty containers.', cid) npcHandler:resetNpc() return true end if number < 1 then number = 1 end if (item.type > 0 and not(isItemStackable(item.itemid) == TRUE)) then number = 1 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You can\'t sell more then one ' .. getItemNameById(item.itemid) .. ' (charges: ' .. item.type .. '). Sorry.') end local to_remove = number if (number > getPlayerItemCount(cid, item.itemid)) then number = getPlayerItemCount(cid, item.itemid) end if (isItemStackable(item.itemid) == TRUE) then item.type = 0 end if (number == 1) and (isItemStackable(item.itemid) == TRUE) then doRemoveItem(item.uid, number) elseif (number == 1) and not(isItemStackable(item.itemid) == TRUE) then doRemoveItem(item.uid, 1) else doPlayerRemoveItem(cid, item.itemid, number) end addItemToOffer(getCreatureName(cid), item.itemid, item.type, number) item_db = getItemWithItemId(getCreatureName(cid), item.itemid, item.type) shop_last_item[cid] = {itemid = item.itemid, subType = item.type} if item.type > 0 then npcHandler:say('Added ' .. number .. ' ' .. getItemNameById(item.itemid) .. ' (charges: ' .. item.type .. ') to your offer. Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' (charges: ' .. item_db.subType .. ') in offer, price for each is ' .. item_db.price .. '. Do you want to change price? Say {no} or {price xxx}, where xxx is number of gp.', cid) else npcHandler:say('Added ' .. number .. ' ' .. getItemNameById(item.itemid) .. ' to your offer. Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' in offer, price for each is ' .. item_db.price .. '. Do you want to change price? Say {no} or {price xxx}, where xxx is number of gp.', cid) end end return true end function setItemPriceNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local number = 0 for word in string.gmatch(tostring(message), "(%w+)") do if tostring(tonumber(word)) == word then number = tonumber(word) end end if (parameters.setprice == true) then local item_db = getItemWithItemId(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType) if number < 1 then number = 1 end changePriceOfItem(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType, number) item_db = getItemWithItemId(getCreatureName(cid), shop_last_item[cid].itemid, shop_last_item[cid].subType) if item_db.subType > 0 then npcHandler:say('Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' (charges: ' .. item_db.subType .. ') in offer, price for each is now ' .. item_db.price .. ' gp. Say {set price} to change price of items.', cid) else npcHandler:say('Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' in offer, price for each is now ' .. item_db.price .. ' gp. Say {set price} to change price of items.', cid) end shop_last_item[cid] = {} npcHandler:resetNpc() else if number > 0 then -- player said offer ID local item_db = getItemWithId(number) if item_db.id == 0 then npcHandler:say('I don\'t know offer with ID >' .. number .. '<, say {set price} to view list of your items IDs.', cid) npcHandler:resetNpc() return true end if item_db.name ~= getCreatureName(cid) then npcHandler:say('It\'s not offer of your item, say {set price} to view list of your items IDs.', cid) npcHandler:resetNpc() return true end if item_db.subType > 0 then npcHandler:say('Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' (charges: ' .. item_db.subType .. ') in offer, price for each is ' .. item_db.price .. ' gp. Do you want to change price? Say {no} or {price xxx}, where xxx is number of gp.', cid) else npcHandler:say('Actually you have ' .. item_db.count ..' ' .. item_db.item_name .. ' in offer, price for each is ' .. item_db.price .. ' gp. Do you want to change price? Say {no} or {price xxx}, where xxx is number of gp.', cid) end shop_last_item[cid] = {itemid = item_db.itemid, subType = item_db.subType} else -- player ask for ID local offer = getOfferOfPlayer(getCreatureName(cid)) if #offer == 0 then npcHandler:say('You don\'t have any item in offer. You can\'t change price.', cid) else selfSay("Your offers info:\n", cid) for i = 1, #offer do if offer[i].subType > 0 then selfSay(offer[i].count .. "x " .. offer[i].item_name .. " (charges: " .. offer[i].subType .. ") - price: " .. offer[i].price .. " gp/each - offer ID: " .. offer[i].id, cid) else selfSay(offer[i].count .. "x " .. offer[i].item_name .. " - price: " .. offer[i].price .. " gp/each - offer ID: " .. offer[i].id, cid) end end npcHandler:say('To change price of item say {set price xx}. Where xx is ID of item.', cid) end npcHandler:resetNpc() end end return true end function getCashBalanceFromItemsNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end npcHandler:say('I have ' .. getCash(getCreatureName(cid)) .. ' gp for you.', cid) return true end function getCashFromItemsNPC(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local player_cash = getCash(getCreatureName(cid)) if player_cash > 0 then if doPlayerAddMoney(cid, player_cash) ~= TRUE then npcHandler:say('I can\'t give you cash. Try again.', cid) else setCash(getCreatureName(cid), 0) npcHandler:say(player_cash ..' for you. It was a pleasure doing business with you.', cid) end else npcHandler:say('I don\'t have cash for you.', cid) end return true end local sellitemprice1 = KeywordNode:new({'no'}, addItemToOfferNPC, {setprice = false}) local sellitemprice2 = KeywordNode:new({'price'}, addItemToOfferNPC, {setprice = true}) local sellitemprice3 = KeywordNode:new({'gp'}, addItemToOfferNPC, {setprice = true}) local setitemprice1 = KeywordNode:new({'no'}, setItemPriceNPC, {setprice = false}) local setitemprice2 = KeywordNode:new({'price'}, setItemPriceNPC, {setprice = true}) local setitemprice3 = KeywordNode:new({'gp'}, setItemPriceNPC, {setprice = true}) keywordHandler:addKeyword({'offer of'}, showOfferOfPlayerNPC, {}) keywordHandler:addKeyword({'search'}, showOfferOfItemNPC, {}) local node = keywordHandler:addKeyword({'add item'}, addItemToOfferNPC, {}) node:addChildKeywordNode(sellitemprice1) node:addChildKeywordNode(sellitemprice2) node:addChildKeywordNode(sellitemprice3) local node = keywordHandler:addKeyword({'set price'}, setItemPriceNPC, {setprice = false}) node:addChildKeywordNode(setitemprice1) node:addChildKeywordNode(setitemprice2) node:addChildKeywordNode(setitemprice3) local node = keywordHandler:addKeyword({'change price'}, setItemPriceNPC, {setprice = false}) node:addChildKeywordNode(setitemprice1) node:addChildKeywordNode(setitemprice2) node:addChildKeywordNode(setitemprice3) keywordHandler:addKeyword({'my offer'}, showOfferOfPlayerNPC, {}) keywordHandler:addKeyword({'get item'}, showOfferOfPlayerNPC, {}) keywordHandler:addKeyword({'balance'}, getCashBalanceFromItemsNPC, {}) keywordHandler:addKeyword({'get cash'}, getCashFromItemsNPC, {}) keywordHandler:addKeyword({'withdraw'}, getCashFromItemsNPC, {}) local node = keywordHandler:addKeyword({'how to use'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'What you want to do? Say {add my item to offer}, {get my item from offer}, {check how much money from items I have}, {get my cash from items}, {change price of item in offer}, {buy item of other player} or {search item}.'}) node:addChildKeyword({'add my item to offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'First put your item in left hand (under BP slot), then say {add item xx} where xx is number of items that you want add to offer, then NPC will ask you for price, say {price yy}, where yy is price for 1 item.'}) node:addChildKeyword({'get my item from offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Say {my offer} or {get item} to view list of your items, all items will have price 1 gp, but when you press "Buy" you will get your item for free.'}) node:addChildKeyword({'check how mu'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Say {balance} to view how much money NPC has for you.'}) node:addChildKeyword({'get my cash'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Say {get cash} or {withdraw} to get your cash from NPC.'}) node:addChildKeyword({'change price of item in offer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Say {change price} or {set price} to view list of your items, prices and offer IDs. Say {change price xx} or {set price xx}, where xx is item offer ID, then NPC will show you item name and ask for new price, say {price yy}, where yy is new price.'}) node:addChildKeyword({'buy item of other player'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Say {offer of Xx Yy}, where Xx Yy is name of player. NPC will show you offer of this player in trade window.'}) node:addChildKeyword({'search item'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Say {search Xxx Yyy}, where Xxx Yyy is name of item. Npc will show you few cheapest offers and names of players. That say {offer of Xxx}, where Xxx is name of player to view his offer and buy item.'}) npcHandler:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|. I can trade your items with other players. Say {how to use} if you don\'t know commands.") npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2. Agora vá em data/npc e crie um arquivo LUA com o nome de Auctioner.lua, apague tudo que tem dentro e coloque isso: <?xml version="1.0" encoding="UTF-8"?> <npc name="Auctioner" script="data/npc/scripts/Auctioner.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="290" head="39" body="122" legs="125" feet="57" addons="0"/> <parameters /> </npc> 3. Vá em sua database, e crie a tabela a seguir: CREATE TABLE `ots_playersshopsystem` ( `id` int(11) NOT NULL auto_increment, `name` varchar(255) NOT NULL, `item_name` varchar(255) NOT NULL, `itemid` int(11) NOT NULL, `subType` int(11) NOT NULL, `count` int(11) NOT NULL, `price` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; Feito isso, seu Auctioner estará pronto. Lembrando que os créditos são do usuário Gesior.pl do fórum OTLand. Te ajudei? REP+ Qualquer dúvida poste aqui. Abraços.1 ponto
-
[Systems] Pokemon Systems
VaizardX reagiu a MatheusGlad por um tópico no fórum
Scripts para TFS 0.3.6pl1 NAO FOI TESTADO EM OUTRA! Preview: Antes de tudo, va na pasta data/lib e adicione um script.lua com o nome de pokeLib e adicione isso: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- pokein, pokeout = 2222,2223 function doRemoveTile(pos)-- Script by mock pos.stackpos = 0 local sqm = getTileThingByPos(pos) doRemoveItem(sqm.uid,1) end function doCreateTile(id,pos) -- By mock doAreaCombatHealth(0,0,pos,0,0,0,CONST_ME_NONE) doCreateItem(id,1,pos) end function getPosDirs(p, dir) -- By MatheusMkalo return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function doItem(pos,a,d)-- Script by mock doCreateTile(460,pos) pos.stackpos = 0 local c = getTileThingByPos(pos) doItemSetAttribute(c.uid, "aid", a) end function getDescription(uid) for i,x in pairs(getItemDescriptions(uid)) do if i == "special" then return x end end end function findLetter(string, letter) for i = 1, #string do if string:sub(i, i) == letter then return i end end end function isWalkable(pos, creature, proj, pz)-- by Nord if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function getPosDirs(p, dir) return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z} end function canSummon(cid) local pos = getCreaturePosition(cid) local state = false for i = 1, 8 do if isWalkable(getPosDirs(getCreaturePosition(cid), i)) then state = true end end return state end function isPlayerSummon(cid, uid) if getCreatureMaster(uid) == cid then return TRUE end return FALSE end function getSummonLifes(cid) for _,x in pairs(getCreatureSummons(cid)) do return getCreatureHealth(x), getCreatureMaxHealth(x) end end function getItemsInContainerById(container, itemid) -- Function By Kydrai local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot=0, (getContainerSize(container)-1) do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getItemsInContainerById(item.uid, itemid) for i=0, #itemsbag do table.insert(items, itemsbag[i]) end else if itemid == item.itemid then table.insert(items, item.uid) end end end end return items end function addPokeball(cid, pokename, maxh) local s = doPlayerAddItem(cid, pokein) doItemSetAttribute(s, "poke", "This is "..pokename.."'s pokeball. HP = ["..maxh.."/"..maxh.."]") doItemSetAttribute(s, "description", "Contains a " .. pokename) end function getPokeOutLive(cid) dat = {} for slot = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(cid, slot) if isContainer(item.uid) then local items = getItemsInContainerById(item.uid, pokeout) for _, ui in pairs(items) do if getItemAttribute(ui, "poke"):sub(#getItemAttribute(ui, "poke")) == "." then table.insert(dat, ui) end end end if item.itemid == pokeout then if getItemAttribute(item.uid, "poke"):sub(#getItemAttribute(item.uid, "poke")) == "." then table.insert(dat, item.uid) end end end return dat end Go/Back Pokeball System By: MatheusMkalo Vá em data/actions/scripts e adicione um arquivo.lua com o nome de goback.lua Depois de ter feito isso, adicione o seguinte script no arquivo goback.lua: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local pokes = { ["Dragon"] = {level = 1, go = "Vai Dragon", back = "Volte Dragon."}, ["Demon"] = {level = 8, go = "Vai Demon", back = "Volte Demon."}, ["Dragon Lord"] = {level = 8, go = "Vai Dragon Lord", back = "Volte Dragon Lord."}, ["Rat"] = {level = 8, go = "Vai Rat", back = "Volte Rat."}, } local msgunica = false function onUse(cid, item, frompos, item2, topos) local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")) local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/")) if item.itemid == pokeout then if health ~= nil and health <= 0 then return doPlayerSendCancel(cid, "This pokemon is dead.") end if #getCreatureSummons(cid) >= 1 then for _,z in pairs(getCreatureSummons(cid)) do if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then doTransformItem(item.uid, pokein) if msgunica then doCreatureSay(cid, "Back, " .. getCreatureName(z), TALKTYPE_SAY) else doCreatureSay(cid, pokes[getCreatureName(z)].back, TALKTYPE_SAY) end doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]") setPlayerStorageValue(cid, 61204, 0) doSendMagicEffect(getCreaturePosition(z), 10) return doRemoveCreature(z) end end end elseif item.itemid == pokein then if getTilePzInfo(getCreaturePosition(cid)) then return doPlayerSendCancel(cid, "You can't use pokeball in Protection Zones.") end if not canSummon(cid) then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) end if getPlayerStorageValue(cid, 63215) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while surfing.") end if getPlayerStorageValue(cid, 62314) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while flying.") end if getPlayerStorageValue(cid, 59987) >= 1 then return doPlayerSendCancel(cid, "You can't use pokeball while riding.") end for i,x in pairs(pokes) do if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "You already summoned a pokemon.") end if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then if getPlayerLevel(cid) >= x.level then pk = doSummonCreature(i, getThingPosition(cid)) doConvinceCreature(cid, pk) setCreatureMaxHealth(pk, tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]"))) doCreatureAddHealth(pk, maxh) doCreatureAddHealth(pk, health-maxh) doTransformItem(item.uid, pokeout) if msgunica then doCreatureSay(cid, "Go, " .. i, TALKTYPE_SAY) else doCreatureSay(cid, x.go, TALKTYPE_SAY) end doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), "."))) doSendMagicEffect(getCreaturePosition(pk), 10) setPlayerStorageValue(cid, 61204, 1) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") break else doPlayerSendCancel(cid, "Only players level "..x.level.." or higher can use this pokemon.") end end end end return TRUE end Depois, va em actions.xml e adicione a seguinte tag: <action itemid="2222;2223" event="script" value="goback.lua"/> Sendo que 2222 e 2223 são, respectivamente, o id da pokeball que ira "chamar" o pokemon, e o outro o id da pokeball que ira retirar o pokemon. (Seriam as pokebolas acesas e apagadas do PO) Agora, para evitar alguns bugs, va em data/creaturescripts/scripts e crie um arquivo.lua com o nome goback.lua e bote o seguinte script dentro: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onLogout(cid) local health,maxhealth = getSummonLifes(cid) if getPlayerStorageValue(cid, 61204) >= 1 and getPlayerStorageValue(cid, 63215) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 and getPlayerStorageValue(cid, 59987) <= 0 then setPlayerStorageValue(cid, 61205, health) setPlayerStorageValue(cid, 61206, maxhealth) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 62314) >= 1 then pos = getCreaturePosition(cid) for i = 1,8 do doRemoveTile(getPosDirs(getCreaturePosition(cid), i)) end doRemoveTile(getCreaturePosition(cid)) setPlayerStorageValue(cid, 61941, pos.x) setPlayerStorageValue(cid, 61942, pos.y) setPlayerStorageValue(cid, 61943, pos.z) end return TRUE end function onLogin(cid) local pokes = { ["Dragon"] = {lookType=267, speed = 1500}, ["Rat"] = {lookType=267, speed = 500}, } local pokesfly = { ["Dragon"] = {lookType = 216, speed = 500}, } local pokesride = { ["Dragon Lord"] = {lookType=4, speed = 3000}, ["Dragon"] = {lookType=4, speed = 500}, } if getPlayerStorageValue(cid, 62314) >= 1 then doCreateTile(460, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)}) doTeleportThing(cid, {x=getPlayerStorageValue(cid, 61941), y=getPlayerStorageValue(cid, 61942), z=getPlayerStorageValue(cid, 61943)}) for i = 1,8 do doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i) end local item = getPokeOutLive(cid)[1] local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.") doSetCreatureOutfit(cid, pokesfly[tostring(a)], -1) doChangeSpeed(cid, pokesfly[tostring(a)].speed) registerCreatureEvent(cid, "PlayerPokeDeath") end if getPlayerStorageValue(cid, 63215) >= 1 then local item = getPokeOutLive(cid)[1] local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.") doSetCreatureOutfit(cid, pokes[tostring(a)], -1) doChangeSpeed(cid, pokes[tostring(a)].speed) registerCreatureEvent(cid, "PlayerPokeDeath") end if getPlayerStorageValue(cid, 59987) >= 1 then local item = getPokeOutLive(cid)[1] local a = getItemAttribute(item, "poke"):match("This is (.-)'s pokeball.") doSetCreatureOutfit(cid, pokesride[tostring(a)], -1) doChangeSpeed(cid, pokesride[tostring(a)].speed) registerCreatureEvent(cid, "PlayerPokeDeath") end if getPlayerStorageValue(cid, 61207) >= 1 then local item = getPokeOutLive(cid)[1] doTransformItem(item, pokein) doRemoveCondition(cid, CONDITION_OUTFIT) doItemSetAttribute(item, "poke", getItemAttribute(item, "poke"):sub(#getItemAttribute(item, "poke")) ~= "]" and getItemAttribute(item, "poke") .. " HP = ["..getPlayerStorageValue(cid, 61205).."/"..getPlayerStorageValue(cid, 61206).."]" or getItemAttribute(item, "poke")) setPlayerStorageValue(cid, 61207, 0) end return TRUE end function onDeath(cid, deathList) local owner = getCreatureMaster(cid) doPlayerSendTextMessage(owner, 22, "Your pokemon died.") for slot = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(owner, slot) if isContainer(item.uid) then local items = getItemsInContainerById(item.uid, pokeout) for _, ui in pairs(items) do if getItemAttribute(ui, "poke"):sub(#getItemAttribute(ui, "poke")) == "." then local maxh = tonumber(getItemAttribute(ui, "poke"):match("/(.+)]")) doItemSetAttribute(ui, "poke", getItemAttribute(ui, "poke"):sub(1, findLetter(getItemAttribute(ui, "poke"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]") end end end if item.itemid == pokeout then if getItemAttribute(item.uid, "poke"):sub(#getItemAttribute(item.uid, "poke")) == "." then local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")) doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = [0/"..getCreatureMaxHealth(cid).."]") end end end doRemoveCreature(cid) setPlayerStorageValue(owner, 61207, 0) setPlayerStorageValue(owner, 61204, 0) return FALSE end Agora adicione outro arquivo.lua na pasta data/creaturescripts/scripts com o nome de playerpdeath e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onDeath(cid) local health,maxhealth = getSummonLifes(cid) if #getCreatureSummons(cid) >= 1 then setPlayerStorageValue(cid, 61205, health) setPlayerStorageValue(cid, 61206, maxhealth) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 63215) >= 1 then setPlayerStorageValue(cid, 61205, getPlayerStorageValue(cid, 61210)) setPlayerStorageValue(cid, 61206, getPlayerStorageValue(cid, 61209)) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 63215, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 62314) >= 1 then setPlayerStorageValue(cid, 61205, getPlayerStorageValue(cid, 61262)) setPlayerStorageValue(cid, 61206, getPlayerStorageValue(cid, 61263)) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 62314, 0) setPlayerStorageValue(cid, 61207, 1) end if getPlayerStorageValue(cid, 59987) >=1 then setPlayerStorageValue(cid, 61205, getPlayerStorageValue(cid, 59988)) setPlayerStorageValue(cid, 61206, getPlayerStorageValue(cid, 59989)) setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 59987, 0) setPlayerStorageValue(cid, 61207, 1) end return TRUE end Depois va em creaturescripts.xml e adicione as seguintes TAGS: <event type="death" name="PlayerPokeDeath" event="script" value="playerpdeath.lua"/> <event type="death" name="DiePoke" event="script" value="goback.lua"/> <event type="logout" name="LogoutPoke" event="script" value="goback.lua"/> <event type="login" name="LoginPoke" event="script" value="goback.lua"/> Catch Pokemon System By: MatheusMkalo Vá em data/actions/scripts e adicione um arquivo.lua com o nome de catch.lua Depois adicione o seguinte script dentro dele: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local pokes = { ["Dragon"] = {corpseid = 5973, chance = 100, health = 12200, maxhealth = 12200}, ["Dragon Lord"] = {corpseid = 5984, chance = 100, health = 12200, maxhealth = 12200}, ["Demon"] = {corpseid = 5995, chance = 100, health = 12200, maxhealth = 12200}, } local time = 4 -- Tempo para mandar as mensagens e adiciona item function onUse(cid, item, frompos, item2, topos) for i,x in pairs(pokes) do if item2.itemid == x.corpseid then doRemoveItem(item.uid, 1) doRemoveItem(item2.uid, 1) if math.random(1,100) <= x.chance then function add() local s = doPlayerAddItem(cid, pokein) doItemSetAttribute(s, "poke", "This is "..i.."'s pokeball. HP = ["..x.health.."/"..x.maxhealth.."]") doItemSetAttribute(s, "description", "Contains a " .. i) end doSendMagicEffect(topos, 24) addEvent(add, time*1000) return addEvent(doPlayerSendTextMessage, time*1000, cid, 27, "You catch a " .. i .. ".") else addEvent(doPlayerSendTextMessage, time*1000, cid, 27, "Your pokeball broke.") return doSendMagicEffect(topos, 23) end end end return TRUE end Depois adicione a seguinte TAG no actions.xml: <action itemid="2147" event="script" value="catch.lua"/> Sendo 2147, o id da sua pokebola para capturar pokemons (NAO A DE CHAMAR O POKEMON) Npc Healler By: MatheusMkalo Vá em data/npc/scripts e adicione um arquivo.lua com o seguinte script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'heal') then if #getCreatureSummons(cid) >= 1 then return selfSay('Voce precisa botar seus pokemons dentro da pokebola.', cid) end for slo = CONST_SLOT_FIRST, CONST_SLOT_LAST do local item = getPlayerSlotItem(cid, slo) if isContainer(item.uid) then local items = getItemsInContainerById(item.uid, pokeout) for i,x in pairs(items) do local maxh = tonumber(getItemAttribute(x, "poke"):match("/(.+)]")) doItemSetAttribute(x, "poke", getItemAttribute(x, "poke"):sub(1, findLetter(getItemAttribute(x, "poke"), ".")) .. " HP = ["..maxh.."/"..maxh.."]") doTransformItem(x, pokein) end local items2 = getItemsInContainerById(item.uid, pokein) for i,x in pairs(items2) do local maxh = tonumber(getItemAttribute(x, "poke"):match("/(.+)]")) doItemSetAttribute(x, "poke", getItemAttribute(x, "poke"):sub(1, findLetter(getItemAttribute(x, "poke"), ".")) .. " HP = ["..maxh.."/"..maxh.."]") end elseif item.itemid == pokeout or item.itemid == pokein then local maxh = tonumber(getItemAttribute(item.uid, "poke"):match("/(.+)]")) doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..maxh.."/"..maxh.."]") doTransformItem(item.uid, pokein) end end selfSay('Pronto, voce e seus pokemons estao com a life maxima.', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Depois va ate a pasta data/npc e adicione um arquivo.xml e bote isso dentro: <?xml version="1.0" encoding="UTF-8"?> <npc name="Pokemon Healer" script="pokehealer.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="128" head="17" body="54" legs="114" feet="0" addons="2"/> <parameters> <parameter key="message_greet" value="Ola, diga {heal} para recuperar sua vida e a vida dos seus pokemons."/> </parameters> </npc> Surf System By: MatheusMkalo Vá em data/actions/scripts e crie um arquivo.lua com o nome de surf e bote esse script dentro: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onUse(cid, item, frompos, item2, topos) local configs = { [4647] = {x = -2, y = 0}, -- 4647 é o id da borda oeste (lado esquerdo do player) [4645] = {x = 2, y = 0}, -- 4645 é o id da borda leste (lado direito do player) [4646] = {x = 0, y = 2}, -- 4646 é o id da borda sul (abaixo do player) [4644] = {x = 0, y = -2}, -- 4644 é o id da borda norte (acima do player) } local playerpos = getCreaturePosition(cid) local pokes = { ["Dragon"] = {lookType=267, speed = 1500}, ["Rat"] = {lookType=267, speed = 500}, } if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then return doPlayerSendCancel(cid, "You need a pokemon to surf.") end l = false for i,x in pairs(pokes) do if getPlayerStorageValue(cid, 63215) <= 0 and i:lower() == getCreatureName(getCreatureSummons(cid)[1]):lower() then l = true end end if not l and getPlayerStorageValue(cid, 63215) <= 0 then return doPlayerSendCancel(cid, "This pokemon can't surf.") end if getPlayerStorageValue(cid, 63215) <= 0 then doTeleportThing(cid, {x=playerpos.x+configs[item2.itemid].x, y=playerpos.y+configs[item2.itemid].y, z=playerpos.z}) setPlayerStorageValue(cid, 63215, 1) doSetCreatureOutfit(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])], -1) doCreatureSay(cid, "Let's surf, "..getCreatureName(getCreatureSummons(cid)[1]), 1) setPlayerStorageValue(cid, 61209, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61210, getCreatureHealth(getCreatureSummons(cid)[1])) doChangeSpeed(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])].speed) doRemoveCreature(getCreatureSummons(cid)[1]) else doTeleportThing(cid, {x=playerpos.x-configs[item2.itemid].x, y=playerpos.y-configs[item2.itemid].y, z=playerpos.z}) setPlayerStorageValue(cid, 63215, 0) doRemoveCondition(cid, CONDITION_OUTFIT) local item = getPokeOutLive(cid)[1] doCreatureSay(cid, "Im tired of surf, " .. getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1) pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid)) doConvinceCreature(cid, pk) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 61209)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61209)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61210)-getPlayerStorageValue(cid, 61209)) doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid)) end return TRUE end Depois va em actions.xml e adicione essa tag: <action itemid="4647;4645;4646;4644" event="script" value="surf.lua"/> Ensinarei nos tutorias como adicionar novas bordas e botar cada pokemon com seu proprio outfit na agua. OBS:Todos os scripts mudaram para implementar o surf, atualize-os OBS2: Para funcionar o id da agua tem que ser 4820. Para usar basta clicar na borda da agua. Evolution System By: MatheusMkalo Vá em data/actions/scripts e adicione um script.lua com o nome de evolution.lua e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon System By Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon System By Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- local pokes = { ["Dragon"] = {level = 1, evolution = "Dragon Lord", maxh = 2000}, } local types = { ["Water"] = {itemid = 2277, "Horsea", "Goldeen", "Magikarp"}, ["Venom"] = {itemid = 2278, "Zubat", "Ekans"}, ["Thunder"] = {itemid = 2279, "Magnemite", "Pikachu"}, ["Rock"] = {itemid = 2280, "Geodude", "Graveler"}, ["Punch"] = {itemid = 2281, "Machop", "Machoke"}, ["Leaf"] = {itemid = 2276, "Ivysaur"}, ["Fire"] = {itemid = 2283, "Charmander", "Charmeleon", "Dragon"}, ["Coccon"] = {itemid = 2284, "Caterpie", "Metapod"}, ["Crystal"] = {itemid = 2285, "Dratini", "Dragonair"}, ["Darkness"] = {itemid = 2286, "Gastly", "Haunter"}, ["Earth"] = {itemid = 2287, "Cubone"}, ["Enigma"] = {itemid = 2288, "Abra", "Kadabra"}, ["Heart"] = {itemid = 2289, "Rattata", "Pidgey"}, ["Ice"] = {itemid = 2290, "Seel"}, } function onUse(cid, item, frompos, item2, topos) for i,x in pairs(types) do if item.itemid == x.itemid then if isCreature(item2.uid) then if isPlayerSummon(cid, item2.uid) then if table.find(x, getCreatureName(item2.uid)) then if getPlayerLevel(cid) >= pokes[getCreatureName(item2.uid)].level then local pokeball = getPokeOutLive(cid)[1] local slo = pokes[getCreatureName(item2.uid)].maxh local sle = pokes[getCreatureName(item2.uid)].evolution doItemSetAttribute(pokeball, "description", "Contains a " .. pokes[getCreatureName(item2.uid)].evolution) doPlayerSendTextMessage(cid, 27, "Your "..getCreatureName(item2.uid).." evolued to a "..pokes[getCreatureName(item2.uid)].evolution) doSendMagicEffect(topos, 18) doItemSetAttribute(pokeball, "poke", "") doItemSetAttribute(pokeball, "poke", "This is "..pokes[getCreatureName(item2.uid)].evolution.."'s pokeball. HP = ["..pokes[getCreatureName(item2.uid)].maxh.."/"..pokes[getCreatureName(item2.uid)].maxh.."]") doRemoveCreature(item2.uid) local pk = doSummonCreature(sle, topos) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") doConvinceCreature(cid, pk) setCreatureMaxHealth(pk, slo) setPlayerStorageValue(cid, 61204, 1) doCreatureAddHealth(pk, slo) doRemoveItem(item.uid, 1) break else return doPlayerSendCancel(cid, "You need to be level "..pokes[getCreatureName(item2.uid)].level.." or higher to use this stone in this pokemon.") end end end end end end return TRUE end Depois vá em actions.xml e adicione esta tag: <action itemid="2276;2277;2278;2279;2280;2281;2283;2284;2285;2286;2287;2288;2289;2290" event="script" value="evolution.lua" allowfaruse="1"/> Fly System By: MatheusMkalo, Credits: Mock Vá em data/talkactions/scripts e adicione um arquivo.lua com o nome de fly e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon Systems by Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon Systems by Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onSay(cid, words, param) local pokes = { ["Dragon"] = {lookType = 216, speed = 500}, } if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 62314) <= 0 then doPlayerSendCancel(cid, "You need a pokemon to fly.") end if getPlayerStorageValue(cid, 62314) <= 0 and not pokes[getCreatureName(getCreatureSummons(cid)[1])] then return doPlayerSendCancel(cid, "This pokemon can't fly.") end if getPlayerStorageValue(cid, 62314) <= 0 then doSetCreatureOutfit(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])], -1) doChangeSpeed(cid, pokes[getCreatureName(getCreatureSummons(cid)[1])].speed) setPlayerStorageValue(cid, 61263, getCreatureMaxHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 61262, getCreatureHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 62314, 1) registerCreatureEvent(cid, "LogoutPoke") doCreatureSay(cid, "Let's fly, "..getCreatureName(getCreatureSummons(cid)[1]), 1) doRemoveCreature(getCreatureSummons(cid)[1]) local ppos = getCreaturePos(cid) local newpos = {x=ppos.x, y=ppos.y, z = 0} doCreateTile(460, newpos) doTeleportThing(cid, newpos) for i = 1,8 do doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i) end elseif getPlayerStorageValue(cid, 62314) >= 1 then local ppos = getCreaturePosition(cid) p = true for i = 1,17 do if getTileThingByPos({x=ppos.x, y=ppos.y, z=ppos.z+i}).itemid ~= 0 and not isWalkable({x=ppos.x, y=ppos.y, z=ppos.z+i}) then p = false break end if isWalkable({x=ppos.x, y=ppos.y, z=ppos.z+i}) then l = ppos.z + i break end end if not p or getTileThingByPos({x=ppos.x, y=ppos.y, z=l}).itemid == 4820 then return doPlayerSendCancel(cid, "You can't down in there.") end for i = 1,8 do doRemoveTile(getPosDirs(getCreaturePosition(cid), i)) end setPlayerStorageValue(cid, 62314, 0) doTeleportThing(cid, {x=ppos.x, y=ppos.y, z=l}) doRemoveTile(ppos) local item = getPokeOutLive(cid)[1] pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid)) doConvinceCreature(cid, pk) doCreatureSay(cid, "I'm tired of fly, "..getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 61263)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61263)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 61262)-getPlayerStorageValue(cid, 61263)) doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid)) doRemoveCondition(cid, CONDITION_OUTFIT) end return TRUE end Depois bote essa tag no talkaction.xml: <talkaction words="!fly" event="script" value="fly.lua"/> Va em data/movements/scripts e crie um arquivo.lua com o nome de fly.lua e bote: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon Systems by Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon Systems by Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onStepIn(cid, item, position, fromPosition) local actions = { [65120] = {del = {4,5,6}, add = {1,2,8}}, [65121] = {del = {8,7,6,5,4}, add = {8,1,2,3,4}}, [65122] = {del = {8,7,6}, add = {2,3,4}}, [65123] = {del = {2,1,8,7,6}, add = {6,5,4,3,2}}, [65124] = {del = {2,1,8}, add = {4,5,6}}, [65125] = {del = {8,1,2,3,4}, add = {8,7,6,5,4}}, [65126] = {del = {2,3,4}, add = {8,7,6}}, [65127] = {del = {6,5,4,3,2}, add = {6,7,8,1,2}}, } local configs = actions[item.actionid] for i = 1,8 do if table.find(configs.del, i) then doRemoveTile(getPosDirs(fromPosition, i)) end doItem(getPosDirs(getCreaturePosition(cid), i), 65119+i) end return TRUE end Depois va em movements.xml e adicione essa tag: <movevent type="StepIn" actionid="65120;65121;65122;65123;65124;65125;65126;65127" event="script" value="fly.lua"/> Para usar o fly diga !fly para descer e subir Ride System By: MatheusMkalo Vá em talkactions/scripts e crie um arquivo.lua com o nome de ride e bote esse script: --[[ This file is part of Pokemon Systems by Mkalo. Pokemon Systems by Mkalo is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Pokemon Systems by Mkalo is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Pokemon Systems by Mkalo. If not, see <http://www.gnu.org/licenses/>. ]]-- function onSay(cid, words) local pokesride = { ["Dragon Lord"] = {lookType=4, speed = 3000}, ["Dragon"] = {lookType=4, speed = 500}, } if #getCreatureSummons(cid) <= 0 and getPlayerStorageValue(cid, 59987) <= 0 then return doPlayerSendCancel(cid, "You need a pokemon to ride.") end if not canSummon(cid) and getPlayerStorageValue(cid, 59987) >= 1 then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) end local sname = #getCreatureSummons(cid) >= 1 and getCreatureName(getCreatureSummons(cid)[1]) or nil if sname ~= nil and pokesride[sname] and getPlayerStorageValue(cid, 59987) <= 0 then doSetCreatureOutfit(cid, pokesride[sname], -1) doChangeSpeed(cid, pokesride[sname].speed) doCreatureSay(cid, "Let's ride, " .. sname, 1) setPlayerStorageValue(cid, 59987, 1) setPlayerStorageValue(cid, 59988, getCreatureHealth(getCreatureSummons(cid)[1])) setPlayerStorageValue(cid, 59989, getCreatureMaxHealth(getCreatureSummons(cid)[1])) doRemoveCreature(getCreatureSummons(cid)[1]) elseif getPlayerStorageValue(cid, 59987) >= 1 then setPlayerStorageValue(cid, 59987, 0) doRemoveCondition(cid, CONDITION_OUTFIT) local item = getPokeOutLive(cid)[1] doCreatureSay(cid, "Im tired of ride, " .. getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), 1) pk = doSummonCreature(getItemAttribute(item, "poke"):match("This is (.-)'s pokeball."), getThingPosition(cid)) doConvinceCreature(cid, pk) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(cid, "PlayerPokeDeath") registerCreatureEvent(cid, "LogoutPoke") setCreatureMaxHealth(pk, getPlayerStorageValue(cid, 59989)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 59989)) doCreatureAddHealth(pk, getPlayerStorageValue(cid, 59988)-getPlayerStorageValue(cid, 59989)) doChangeSpeed(cid, getCreatureBaseSpeed(cid)-getCreatureSpeed(cid)) end return TRUE end Agora bote essa tag em talkactions.xml: <talkaction words="!ride" event="script" value="ride.lua"/> Pra usar o ride é so falar !ride. Para configurar os pokemons é praticamente igual ao surf. Configurando os scripts Como adicionar mais pokemons no go/back: No inicio do script, tem essa tabela com as informaçoes: Copie a ultima linha (vermelha) e cole logo abaixo, editando os nomes e as mensagens ficando assim: Voce pode configurar o level para usar o poke mudando o valor de level. Configurando pokemons para o catch:[/b] Olhe a tabela no inicio do script: Faça o mesmo processo do acima de copiar e colar embaixo e editar: Aonde as informaçoes corpseid, chance, health, maxhealth serao, respectivamente: Id do corpo do monstro, Chance de capturar em %, health que o pokemon iria ir pro player, e health maxima que o poke iria ir para o player. Como trocar os ids das pokebolas, acesas e apagadas. Para trocar o id da pokebola "acesa" e "apagada" basta mudar os ids 2222,2223 na lib sendo que 2222 eh o da acesa e o 2223 eh o id da apagada Mude tambem na tag do action.xml que seu script ira funcionar perfeitamente. Como adicionar mais bordas ao surf. Primeiramente va em actions.xml e adicione os ids das bordas na tag do surf: (Eu fiz com a borda de areia) Depois va no script surf.lua em actions e repare nessa parte: Copie todas as 4 bordas e cole abaixo ficando: Depois mude os ids das bordas do lado << conforme as informaçoes do lado >>, ficando: Como adicionar mais pokes ao surf: Va no script surf.lua em actions e repare nessa parte: Ai voce pode adicionar o pokemon pra surf e o outfit que ele vai te dar na agua copiando o de cima e colando logo abaixo e editando algumas coisas: Lembre-se de depois que acabar de editar toda a tabela no surf.lua, va no goback.lua em creaturescripts e substitua a tabela pokes, pela que esta na actions surf.lua: Como adicionar mais pokes no evolution: Repare nessa parte do script evolution.lua em actions: Bem voce deve copiar o primeiro monstro da tabela "pokes", e adicionar no final e mudar as configuraçoes: Sendo level,evolution,maxh respectivamente, o level pra evoluir o poke, o nome da evoluçao, e a health maxima do pokemon evoluido. Depois eh so adicionar o Nome do monstro que foi adicionado a tabela "pokes" na tabela "types", no lugar do type dele: Como adicionar mais pokes no fly: Repare nas partes iguais no fly.lua (talkaction) e no goback.lua(creaturescripts): fly.lua: goback.lua: A unica coisa que mudou foi o nome da tabela, "pokes" e "pokesfly", para adicionar mais pokes no fly basta adicionar no fly.lua e botar igual no goback.lua. Informaçoes Importantes!!! Para testar o script de catch que esta no topico, voce deve deletar as tags de encantamento de armas. Para poder summonar os pokemons com o go/back, voce precisa ir no arquivo.xml do monstro e editar essa linha: Se estiver convinceable="0", mude para convinceable="1" ficando: Creditos Especiais: Kydrai pela funçao "getItemsInContainerById" MarcelloMkez Mock por algumas funçoes do fly system dele. Agradecimentos: D3rs00n (Me ajudou a fazer sumir o corpo do pokemon) Julio Cezar (Ajudou reportando bugs e testando scripts) Miih (Ajudou reportando bugs e testando scripts) Arth3miS (Ajudou reportando bugs e testando scripts) E para todos que reportaram bugs. Bugs, erros, duvidas, elogios no topico[/b]1 ponto -
[Talkaction]System Moves [15/151]
SamueLGuedes reagiu a meubk por um tópico no fórum
Moves System Pokemon O meu script de moves, foi atualizado, por enquanto está com esses pokemons, eu estárei adicionando os 151, aos pouco não tenha pressa e acompanhe todos dias avera atualização. Novidades : Crie um arquivo com nome de moves.lua e cole o new script : function getTime(s) local n = math.floor(s / 600) s = s - (600 * n) return n, s end function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers) local creaturesList = {} for x = -radiusx, radiusx do for y = -radiusy, radiusy do if not (x == 0 and y == 0) then creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = STACKPOS_TOP_CREATURE}) if (creature.type == 1 and showPlayers == 1) or (creature.type == 2 and showMonsters == 1) then table.insert(creaturesList, creature.uid) end end end end return creaturesList end -- CONDITIONS function Confused(inconfuse, rounds) if rounds == 0 then return false end if not inconfuse then return false end local c = {[1] = {x = 1, y = 0}, [2] = {x = 0, y = 1}, [3] = {x = -1, y = 0}, [4] = {x = 0, y = -1}} local p = getCreaturePosition(inconfuse) doSendMagicEffect(p, 31) local s = math.random(4) doTeleportThing(inconfuse, {x = p.x + c[s].x, y = p.y + c[s].y, z = p.z}) return addEvent(Confused, 400, inconfuse, rounds-1) end local paralize = createConditionObject(CONDITION_PARALYZE) setConditionParam(paralize, CONDITION_PARAM_TICKS, 5*1000) setConditionFormula(paralize, -0.7, 0, -0.8, 0) function Paralize(inparalize) doSendAnimatedText(getCreaturePosition(inparalize), "PAZ", 210) doAddCondition(inparalize , paralize) return true end local sleep = createConditionObject(CONDITION_PARALYZE) setConditionParam(sleep, CONDITION_PARAM_TICKS, 5*1000) setConditionFormula(sleep, -1.7, 0, -1.8, 0) function Sleep(insleep) doAddCondition(insleep , sleep) p = getCreaturePosition(insleep) doSendAnimatedText(p, "SLEEP", 154) for i = 1, 5 do if i == 1 then doSendMagicEffect(p, 32) else addEvent(doSendMagicEffect, i * 1000, p, 32) end end return true end function Poison(inpoison, ef, rounds) if rounds == 0 then return false end if not inpoison then return false end local p = getCreaturePosition(inpoison) doAreaCombatHealth(pet, COMBAT_EARTHDAMAGE, p, 0, -5, -10, ef) return addEvent(Poison, 800, inpoison, ef, rounds-1) end -- END CONDITIONS function getPosToStorm(posdecay) b = {x = posdecay.x-20, y = posdecay.y-20, z = posdecay.z} return b end local area1 = createCombatArea{ {0, 1, 1, 1, 0}, {1, 1, 1, 1, 1}, {1, 1, 2, 1, 1}, {1, 1, 1, 1, 1}, {0, 1, 1, 1, 0} } local area2 = createCombatArea{ {0, 0, 0, 0, 0}, {0, 1, 1, 1, 0}, {0, 1, 2, 1, 0}, {0, 1, 1, 1, 0}, {0, 0, 0, 0, 0} } local area3 = createCombatArea{ {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 2, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0} } local areadirecion1 = { [2] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {2, 1, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 1, 2}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} } } local areadirecion2 = { [2] = createCombatArea{ {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {2, 1, 1, 1, 1}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {1, 1, 1, 1, 2}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} } } local areadirecion3 = { [2] = createCombatArea{ {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {2, 1, 1, 1, 1, 1, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 2}, {0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0} } } local areadirecion4 = { [2] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}, {0, 0, 2, 0, 0} }, [3] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {2, 1, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0} }, [0] = createCombatArea{ {0, 0, 2, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, [1] = createCombatArea{ {0, 0, 0, 0, 0}, {0, 0, 1, 0, 0}, {0, 0, 1, 1, 2}, {0, 0, 1, 0, 0}, {0, 0, 0, 0, 0} } } local d = { ["Bulbasaur"] = { ["m1"] = {atk = "Quick Attack", minlvl = 20, st = 2000, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Razor Leaf", minlvl = 20, st = 2001, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Vine Whip", minlvl = 20, st = 2002, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Headbutt", minlvl = 20, st = 2003, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Leech Seed", minlvl = 20, st = 2004, cd = 3, min = 100, max = 200, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Solar Beam", minlvl = 20, st = 2005, cd = 3, min = 200, max = 400, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Stun Spore", minlvl = 20, st = 2006, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Poison Powder", minlvl = 20, st = 2007, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2008, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, }, ["Ivysaur"] = { ["m1"] = {atk = "Quick Attack", minlvl = 40, st = 2009, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Razor Leaf", minlvl = 40, st = 2010, cd = 3, min = 300, max = 400, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Vine Whip", minlvl = 40, st = 2011, cd = 3, min = 300, max = 440, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Headbutt", minlvl = 40, st = 2012, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Leech Seed", minlvl = 40, st = 2013, cd = 3, min =300, max = 400, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Solar Beam", minlvl = 40, st = 2014, cd = 3, min = 300, max = 400, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Stun Spore", minlvl = 40, st = 2015, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Poison Powder", minlvl = 40, st = 2016, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2017, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, }, ["Venusaur"] = { ["m1"] = {atk = "Quick Attack", minlvl = 80, st = 2018, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Razor Leaf", minlvl = 80, st = 2019, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Vine Whip", minlvl = 80, st = 2020, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Headbutt", minlvl = 80, st = 2021, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Leech Seed", minlvl = 80, st = 2022, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Solar Beam", minlvl = 80, st = 2023, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Stun Spore", minlvl = 80, st = 2024, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Poison Powder", minlvl = 80, st = 2025, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Sleep Powder", minlvl = 20, st = 2026, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m10"] = {atk = "Leaf Storm", minlvl = 80, st = 2027, cd = 3, min = 1000, max = 2000, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, }, ["Charmander"] = { ["m1"] = {atk = "Scratch", minlvl = 20, st = 2028, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Ember", minlvl = 20, st = 2029, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Flamethrower", minlvl = 20, st = 2030, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Fire Ball", minlvl = 20, st = 2031, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Fire Blast", minlvl = 20, st = 2032, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Rage", minlvl = 20, st = 2033, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m7"] = {atk = "Fire Fang", minlvl = 20, st = 2034, cd = 3, min = 100, max = 200, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, }, ["Charmeleon"] = { ["m1"] = {atk = "Scratch", minlvl = 40, st = 2035, cd = 3, min = 300, max = 400, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Ember", minlvl = 40, st = 2036, cd = 3, min = 300, max = 400, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Flamethrower", minlvl = 40, st = 2037, cd = 3, min = 400, max = 500, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Fire Ball", minlvl = 40, st = 2038, cd = 3, min = 300, max =400, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Fire Blast", minlvl = 40, st = 2039, cd = 3, min = 300, max = 400, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Rage", minlvl = 40, st = 2040, cd = 3, min = 100, max = 300, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m7"] = {atk = "Fire Fang", minlvl = 40, st = 2041, cd = 3, min = 400, max = 800, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, }, ["Charizard"] = { ["m1"] = {atk = "Dragon Claw", minlvl = 80, st = 2042, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Ember", minlvl = 80, st = 2043, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Flamethrower", minlvl = 80, st = 2044, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Fire Ball", minlvl = 80, st = 2045, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Fire Blast", minlvl = 80, st = 2046, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Rage", minlvl = 80, st = 2047, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m7"] = {atk = "Magma Storm", minlvl = 80, st = 2048, cd = 3, min = 1000, max = 2000, damage = COMBAT_FIREDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Wing Attack", minlvl = 80, st = 2049, cd = 3, min = 1000, max = 2000, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, }, ["Squirtle"] = { ["m1"] = {atk = "Headbutt", minlvl = 20, st = 2050, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Bubbles", minlvl = 20, st = 2051, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Water Gun", minlvl = 20, st = 2052, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Waterball", minlvl = 20, st = 2053, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Aqua Tail", minlvl = 20, st = 2054, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Hydro Cannon", minlvl = 20, st = 2055, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Harden", minlvl = 20, st = 2056, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, ["m8"] = {atk = "Surf", minlvl = 20, st = 2057, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, }, ["Wartortle"] = { ["m1"] = {atk = "Headbutt", minlvl = 40, st = 2058, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Bubbles", minlvl = 40, st = 2059, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Water Gun", minlvl = 40, st = 2060, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Waterball", minlvl = 40, st = 2061, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Aqua Tail", minlvl = 40, st = 2062, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Hydro Cannon", minlvl = 40, st = 2063, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Harden", minlvl = 40, st = 2064, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, ["m8"] = {atk = "Surf", minlvl = 40, st = 2065, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, }, ["Blastoise"] = { ["m1"] = {atk = "Headbutt", minlvl = 40, st = 2066, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Bubbles", minlvl = 40, st = 2067, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Water Gun", minlvl = 40, st = 2068, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m4"] = {atk = "Waterball", minlvl = 40, st = 2069, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Aqua Tail", minlvl = 40, st = 2070, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Hydro Cannon", minlvl = 40, st = 2071, cd = 3, min = 200, max = 400, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Harden", minlvl = 40, st = 2072, cd = 60, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, ["m8"] = {atk = "Surf", minlvl = 40, st = 2073, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, ["m9"] = {atk = "Hydropump", minlvl = 40, st = 2074, cd = 3, min = 100, max = 200, damage = COMBAT_ICEDAMAGE, target = false, pz = false}, }, ["Caterpie"] = { ["m1"] = {atk = "Headbutt", minlvl = 1, st = 2075, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 1, st = 2076, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Bug Bite", minlvl = 1, st = 2077, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, }, ["Metapod"] = { ["m1"] = {atk = "Headbutt", minlvl = 10, st = 2078, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 10, st = 2079, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Bug Bite", minlvl = 10, st = 2080, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Harden", minlvl = 10, st = 2081, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = true}, }, ["Butterfree"] = { ["m1"] = {atk = "Headbutt", minlvl = 30, st = 2082, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "Whirlwind", minlvl = 30, st = 2083, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, ["m3"] = {atk = "Super Sonic", minlvl = 30, st = 2084, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Stun Spore", minlvl = 30, st = 2085, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m5"] = {atk = "Poison Powder", minlvl = 30, st = 2086, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m6"] = {atk = "Sleep Powder", minlvl = 30, st = 2087, cd = 3, min = 0, max = 0, damage = COMBAT_EARTHDAMAGE, target = false, pz = false}, ["m7"] = {atk = "Psybeam", minlvl = 30, st = 2088, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, ["m8"] = {atk = "Confusion", minlvl = 30, st = 2089, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = false, pz = false}, }, ["Weedle"] = { ["m1"] = {atk = "Horn Attack", minlvl = 1, st = 2090, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 1, st = 2091, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Poison Sting", minlvl = 1, st = 2092, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, }, ["Kakuna"] = { ["m1"] = {atk = "Bug Bite", minlvl = 10, st = 2093, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 10, st = 2094, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Poison Sting", minlvl = 10, st = 2095, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Harden", minlvl = 10, st = 2096, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = true}, }, ["Beedrill"] = { ["m1"] = {atk = "Fury Cutter", minlvl = 10, st = 2097, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m2"] = {atk = "String Shot", minlvl = 10, st = 2098, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m3"] = {atk = "Poison Sting", minlvl = 10, st = 2099, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m4"] = {atk = "Pin Missile", minlvl = 10, st = 2100, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m5"] = {atk = "Rage", minlvl = 10, st = 2101, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, ["m6"] = {atk = "Strafe", minlvl = 10, st = 2102, cd = 3, min = 100, max = 200, damage = COMBAT_PHYSICALDAMAGE, target = true, pz = false}, }, } function onSay(cid, words, param) if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "You do not have any pokemon.") end local poke = d[getCreatureName(getCreatureSummons(cid)[1])][words] if not poke then return true end local storage = poke.st local exst = 16265 local cdexst = 0.5 local cd = math.ceil(poke.cd/2) local pet = getCreatureSummons(cid)[1] local target = getCreatureTarget(cid) local look = getCreatureLookDir(pet) local position = getThingPos(pet) if getTilePzInfo(getCreaturePosition(pet)) and poke.pz == false then return doPlayerSendCancel(cid, "Not Attack in protection zone.") end if getPlayerLevel(cid) < poke.minlvl then return doPlayerSendTextMessage(cid, 19, "Your need level "..poke.minlvl.." to use " ..poke.atk..".") end if os.time()-getPlayerStorageValue(cid, storage) <= cd then minutes,seconds = getTime(cd-(os.time()-getPlayerStorageValue(cid, storage))) return doPlayerSendTextMessage(cid, 27, "Wait "..seconds.." seconds to use "..poke.atk..".") end if target == 0 and poke.target then return doPlayerSendTextMessage(cid, 19, "This Pokemon Attack need any target.") end if os.time()-getPlayerStorageValue(cid, exst) <= cdexst then minutes,seconds = getTime(cdexst-(os.time()-getPlayerStorageValue(cid, exst))) return doPlayerSendCancel(cid, "Poke exhausted") end local critico = math.random(100) < 10 and 2 or 1 --ATTACKS if poke.atk == "Quick Attack" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 148) elseif poke.atk == "Razor Leaf" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 4) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 79) elseif poke.atk == "Vine Whip" then local effects = { [0] = 80, [1] = 83, [2] = 81, [3] = 82 } doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion1[look], -poke.min, -poke.max * critico, effects[look]) elseif poke.atk == "Headbutt" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 111) elseif poke.atk == "Leech Seed" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 6) doSendAnimatedText(getCreaturePosition(target), "POISON", 66) addEvent(Poison, 500, target, 45, 5) elseif poke.atk == "Solar Beam" then local a = { [0] = {x = 0, y = -1, effect={[1]=94,[2]=93,[3]=93,[4]=95}}, [1] = {x = 1, y = 0, effect={[1]=86,[2]=88,[3]=88,[4]=87}}, [2] = {x = 0, y = 1, effect={[1]=91,[2]=93,[3]=93,[4]=92}}, [3] = {x = -1, y = 0, effect={[1]=89,[2]=88,[3]=88,[4]=90}} } for i = 1,4 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Stun Spore" then local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0) for _,pid in pairs(d) do Paralize(pid) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 85) elseif poke.atk == "Poison Powder" then local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0) for _,pid in pairs(d) do doSendAnimatedText(getCreaturePosition(pid), "POISON", 66) Poison(pid, 8, 5) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 84) elseif poke.atk == "Sleep Powder" then local d = getCreaturesInRange(getThingPos(pet), 1, 1, 1, 0) for _,pid in pairs(d) do Sleep(pid) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 27) elseif poke.atk == "Leaf Storm" then local d = getCreaturesInRange(getThingPos(pet), 3, 3, 1, 0) for _,pid in pairs(d) do for i = 1, 4 do if i == 1 then addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(pid), 0, -poke.min, -poke.max * critico, 79) doSendDistanceShoot(getPosToStorm(getCreaturePosition(pid)), getCreaturePosition(pid), 4) else addEvent(doAreaCombatHealth, i*800 ,pet, poke.damage, getThingPos(pid), 0, -poke.min, -poke.max * critico, 79) addEvent(doSendDistanceShoot, i*600, getPosToStorm(getCreaturePosition(pid)), getCreaturePosition(pid), 4) end end end elseif poke.atk == "Scratch" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142) elseif poke.atk == "Ember" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 15) elseif poke.atk == "Flamethrower" then local effects = { [0] = 55, [1] = 58, [2] = 56, [3] = 57 } doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion1[look], -poke.min, -poke.max * critico, effects[look]) elseif poke.atk == "Fire Ball" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 3) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 5) elseif poke.atk == "Fire Blast" then local a = { [0] = {x = 0, y = -1, effect= 60}, [1] = {x = 1, y = 0, effect= 61}, [2] = {x = 0, y = 1, effect= 62}, [3] = {x = -1, y = 0, effect= 63} } for i = 1,8 do if i == 1 then doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 15) else addEvent(doSendMagicEffect, i*300, {x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) addEvent(doAreaCombatHealth, i*300, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 15) end end elseif poke.atk == "Rage" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end for i = 1,4 do if i == 1 then doSendMagicEffect(position, 168) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142) else addEvent(doAreaCombatHealth, i*500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 142) end end elseif poke.atk == "Fire Fang" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 146) addEvent(doAreaCombatHealth, 200, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 15) addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 15) elseif poke.atk == "Dragon Claw" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 141) elseif poke.atk == "Magma Storm" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 36) addEvent(doAreaCombatHealth, 800, pet, poke.damage, getThingPos(pet), area1, -poke.min, -poke.max * critico, 6) elseif poke.atk == "Wing Attack" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 115) addEvent(doAreaCombatHealth, 500, pet, poke.damage, getThingPos(pet), area1, -poke.min, -poke.max * critico, 42) elseif poke.atk == "Bubbles" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 2) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68) elseif poke.atk == "Water Gun" then local a = { [0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=76}}, [1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=71}}, [2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=78}}, [3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=73}} } for i = 1,4 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Waterball" then for i = 1,5 do if i == 1 then addEvent(doAreaCombatHealth, 200 ,pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68) doSendDistanceShoot(getPosToStorm(getCreaturePosition(target)), getCreaturePosition(target), 2) else addEvent(doAreaCombatHealth, i*700 ,pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 68) addEvent(doSendDistanceShoot, i*500, getPosToStorm(getCreaturePosition(target)), getCreaturePosition(target), 2) end end elseif poke.atk == "Aqua Tail" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area2, -poke.min, -poke.max * critico, 160) elseif poke.atk == "Hydro Cannon" then local a = { [0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[8]=76}}, [1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=71}}, [2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[4]=78}}, [3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=73}} } for i = 1,8 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Harden" then function Harden(cid, rounds) if rounds == 0 then return false end if #getCreatureSummons(cid) == 0 then return false end doSendMagicEffect(getCreaturePosition(getCreatureSummons(cid)[1]), 144) return addEvent(Harden, 1000, cid, rounds-1) end addEvent(Harden, 500, cid, 40) elseif poke.atk == "Surf" then local a = { [0] = {x = 0, y = -1, effect= 66}, [1] = {x = 1, y = 0, effect= 67}, [2] = {x = 0, y = 1, effect= 64}, [3] = {x = -1, y = 0, effect= 65} } for i = 1,8 do if i == 1 then doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68) else addEvent(doSendMagicEffect, i*300, {x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect) addEvent(doAreaCombatHealth, i*300, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68) end end elseif poke.atk == "Hydropump" then local a = { [0] = {x = 0, y = -1, effect={[1]=74,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[8]=76}}, [1] = {x = 1, y = 0, effect={[1]=69,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=71}}, [2] = {x = 0, y = 1, effect={[1]=77,[2]=75,[3]=75,[4]=75,[5]=75,[6]=75,[7]=75,[4]=78}}, [3] = {x = -1, y = 0, effect={[1]=72,[2]=70,[3]=70,[4]=70,[5]=70,[6]=70,[7]=70,[8]=73}} } for i = 1,8 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 68) addEvent(doAreaCombatHealth, 400, pet, poke.damage, getThingPos(pet), areadirecion3[look], -poke.min, -poke.max * critico, 33) elseif poke.atk == "String Shot" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 23) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137) Paralize(target) elseif poke.atk == "Bug Bite" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 146) elseif poke.atk == "Whirlwind" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion4[look], -poke.min, -poke.max * critico, 42) elseif poke.atk == "Super Sonic" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end for i = 1, 3 do if i == 1 then doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 24) else addEvent(doSendDistanceShoot, i * 200, getCreaturePosition(pet), getCreaturePosition(target), 24) end end addEvent(doSendAnimatedText, 500, getCreaturePosition(target), "CONF", 210) addEvent(Confused, 500, target, 15) elseif poke.atk == "Psybeam" then local a = { [0] = {x = 0, y = -1, effect={[1]=108,[2]=109,[3]=109,[4]=108}}, [1] = {x = 1, y = 0, effect={[1]=106,[2]=107,[3]=107,[4]=106}}, [2] = {x = 0, y = 1, effect={[1]=109,[2]=108,[3]=108,[4]=109}}, [3] = {x = -1, y = 0, effect={[1]=107,[2]=106,[3]=106,[4]=107}} } for i = 1,4 do doSendMagicEffect({x = position.x + a[look].x*i, y = position.y + a[look].y*i, z = position.z}, a[look].effect[i]) end doAreaCombatHealth(pet, poke.damage, getThingPos(pet), areadirecion2[look], -poke.min, -poke.max * critico, 59) elseif poke.atk == "Confusion" then doAreaCombatHealth(pet, poke.damage, getThingPos(pet), area3, -poke.min, -poke.max * critico, 136) elseif poke.atk == "Horn Attack" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 111) elseif poke.atk == "Poison Sting" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 15) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 9) elseif poke.atk == "Fury Cutter" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 110) addEvent(doAreaCombatHealth, 500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 110) elseif poke.atk == "Pin Missile" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 5 then return doPlayerSendCancel(cid, "Target is far away.") end for i = 1, 3 do if i == 1 then doSendDistanceShoot(getCreaturePosition(pet), getCreaturePosition(target), 13) doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137) else addEvent(doSendDistanceShoot, i * 200, getCreaturePosition(pet), getCreaturePosition(target), 13) addEvent(doAreaCombatHealth, i * 200, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, 137) end end elseif poke.atk == "Strafe" then if getDistanceBetween(getCreaturePosition(pet), getCreaturePosition(target)) > 1 then return doPlayerSendCancel(cid, "Target is far away.") end local dd = {142, 111, 110, 148} for i = 1,6 do af = math.random(4) if i == 1 then doAreaCombatHealth(pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, dd[af]) else addEvent(doAreaCombatHealth, i*500, pet, poke.damage, getThingPos(target), 0, -poke.min, -poke.max * critico, dd[af]) end end end -- END ATTACKS doPlayerSay(cid, getCreatureName(pet)..", use "..poke.atk..".", 1) setPlayerStorageValue(cid, storage, os.time()+cd) setPlayerStorageValue(cid, exst, os.time()+cdexst) local atknotcritic = {"Harden", "Poison Powder", "Sleep Powder", "Super Sonic", "Stun Spore"} if critico == 2 and not isInArray(atknotcritic, poke.atk) then doSendAnimatedText(getCreaturePosition(cid), "CRITICAL", 144) end return true end New Tag : <talkaction words="m1;m2;m3;m4;m5;m6;m7;m8;m9;m10;m11;m12" hide="yes" event="script" value="moves.lua"/> Pokemons Configurados [15/151] :1 ponto -
(Release) Modern Aac 1.0.1!
gersonthiago reagiu a luan12 por um tópico no fórum
Modern AAC 1.0.1 (Release) Novo Patch do Modern AAC para corrijir alguns bugs e adicionar algumas coisas! Lembrando que a instalação é padrão, passar o site para o gerenciador e abrir a seguinte página no seu navegador (http://127.0.0.1). Por que usar o Modern AAC? 1. Segurança. 2. Atualizações constantes. 3. Alto "poder" de extensão. 4. Várias Funções. 5. Desempenho. 6. Personalização. 7. Painel administrativo. 8. e muito mais! ChangeLog: Download e SVN: Créditos: É isso, té (+REP).1 ponto -
Gesior Traduzido(50%) Compatível 0.2+
Redemption reagiu a rod_doidim por um tópico no fórum
Boa Tarde XTibianos, agora são 17:22, do dia 08/01/11. Vim deixar um download útil para alguns. É o Gesior compatível com TFS 2.0+ ( Traduzido por partes por mim e fixado alguns bugs. ) Abaixo a Screen com o menu traduzido: Clique no link abaixo para DOWNLOAD. :down: Caso o link expirar, mande PM. Estarei aqui para ajudar! PS: Eu sei que não fiz nada muito grande, porém como não vi nenhuma versão que presta-se! Este site é compatível com TFS 0.2.9 (8.7) Quem baixar, me digam se ajudou hehehe! Fiquei curioso que quem baixou este Gesior, gostou. Obrigado1 ponto -
Como fazer uma invasao??leia e ira conseguir :grin: Parte 1 (essa parte eh para as pessoas q o script da invasaum ja vem pronto!) Aew muita gente n sabe por a invasao no YurOts (n soh no YurOTS mas em todos ots 7.5 e em alguns 7.4) entaum vo ensina aki. Tpw vai la no actions.....depois vai em actions.xml.... la no finalzim la vai tar assim: CODE<action itemid="3086" script="destroyfield.lua" allowfaruse="1" /> <action itemid="2441" script="chest.lua" /> <action itemid="2448" script="chest.lua" /> <action itemid="2449" script="chest.lua" /> <action itemid="2450" script="chest.lua" /> <action itemid="2487" script="chest.lua" /> <action itemid="2711" script="lever.lua" /> <action itemid="1732" script="steerwheel.lua" /> <!-- <action itemid="2931" script="invasion.lua" /> --> </actions> Ta vendo ali o action itemid="2931".......? akele 2931 eh o item q vc vai ter q usar para a invasão começar.... mas os criadores deste ot são malvados e puzeram akilo ali <!-- e --> ... TIREM AKELES DOIS SIMBOLOS O --> E O <!-- !!! Pronto agora eh so usar o item q a invasão comessa! (q portugues baum!) A otra coisa usa eu to falando q eh usa com o butao direito do mousi! Dúvidas postem aki!!! So lembrando q no YurOts a invasion.lua vem pronto se no seu ot naum tem terá q fazer... Parte 2 Agora vamos aprender como geitar a invasão Vo mostra o script q deve tar na pasta data/actions/scripts q deve se xamar invasion.lua:(se no seu naum tiver crie um!) CODEfunction onUse(cid, item, frompos, item2, topos) if getPlayerAccess(cid) >= 1 then xp1pos = {x=30, y=31, z=7} xp2pos = {x=43, y=30, z=7} xp3pos = {x=50, y=35, z=7} xp4pos = {x=35, y=43, z=7} xp5pos = {x=56, y=58, z=7} xp6pos = {x=46, y=70, z=7} xp7pos = {x=56, y=74, z=7} xp8pos = {x=78, y=76, z=7} xp9pos = {x=69, y=64, z=7} xp10pos = {x=78, y=56, z=7} xp11pos = {x=68, y=50, z=7} xp12pos = {x=73, y=40, z=7} xp13pos = {x=67, y=31, z=7} xp14pos = {x=72, y=34, z=7} xp15pos = {x=38, y=35, z=7} xp16pos = {x=56, y=66, z=7} xp17pos = {x=83, y=68, z=7} doSummonCreature("XP Maker", xp1pos) doSummonCreature("XP Maker", xp2pos) doSummonCreature("XP Maker", xp3pos) doSummonCreature("XP Maker", xp4pos) doSummonCreature("XP Maker", xp5pos) doSummonCreature("XP Maker", xp6pos) doSummonCreature("XP Maker", xp7pos) doSummonCreature("XP Maker", xp8pos) doSummonCreature("XP Maker", xp9pos) doSummonCreature("XP Maker", xp10pos) doSummonCreature("XP Maker", xp11pos) doSummonCreature("XP Maker", xp12pos) doSummonCreature("XP Maker", xp13pos) doSummonCreature("XP Maker", xp14pos) doSummonCreature("XP Maker", xp15pos) doSummonCreature("XP Maker", xp16pos) doSummonCreature("XP Maker", xp17pos) doPlayerSay(cid,"/B Aproveitem!!!! Invasao de XP Maker na cidade!",1) doSetItemSpecialDescription(item.uid,"Este eh o SEGREDO para fazer invasoes") end return 1 end Agora vo ixprica direitim pra vcs naum confusionar suas kbças! Em xp1pos = {x=30, y=31, z=7} xp2pos = {x=43, y=30, z=7} xp3pos = {x=50, y=35, z=7} xp4pos = {x=35, y=43, z=7} xp5pos = {x=56, y=58, z=7} xp6pos = {x=46, y=70, z=7} xp7pos = {x=56, y=74, z=7} xp8pos = {x=78, y=76, z=7} xp9pos = {x=69, y=64, z=7} xp10pos = {x=78, y=56, z=7} xp11pos = {x=68, y=50, z=7} xp12pos = {x=73, y=40, z=7} xp13pos = {x=67, y=31, z=7} xp14pos = {x=72, y=34, z=7} xp15pos = {x=38, y=35, z=7} xp16pos = {x=56, y=66, z=7} xp17pos = {x=83, y=68, z=7} Da pra perceber q eh a posiçaum dos monstros! (vc pode adicionar + por exemplo xp18pos = {x=.....etc..... ) Esse xp2pos = eu q escolhi o nome dele xp2 mas vc pode mudar se vc kiser! Em doSummonCreature("XP Maker", xp1pos) doSummonCreature("XP Maker", xp2pos) doSummonCreature("XP Maker", xp3pos) doSummonCreature("XP Maker", xp4pos) doSummonCreature("XP Maker", xp5pos) doSummonCreature("XP Maker", xp6pos) doSummonCreature("XP Maker", xp7pos) doSummonCreature("XP Maker", xp8pos) doSummonCreature("XP Maker", xp9pos) doSummonCreature("XP Maker", xp10pos) doSummonCreature("XP Maker", xp11pos) doSummonCreature("XP Maker", xp12pos) doSummonCreature("XP Maker", xp13pos) doSummonCreature("XP Maker", xp14pos) doSummonCreature("XP Maker", xp15pos) doSummonCreature("XP Maker", xp16pos) doSummonCreature("XP Maker", xp17pos) Xp Maker eh o nome do bixo q vai nascer (eu q excolhi vc pode mudar, por demon, draggy o q for!) xp2pos e o nome da posicaum q eu explikei la em cima, q nos excolhemos xp2pos (se vc for mudar la em cima por exemplo demon1pos vc deve mudar aki tbm!) Em doPlayerSay(cid,"/B Aproveitem!!!! Invasao de XP Maker na cidade!",1) Eh a msg q o gm fala kuando ele faz a invasaum. (eu vo explica no final como iniciar a invasaum, começar) Em doSetItemSpecialDescription(item.uid,"Este eh o SEGREDO para fazer invasoes") Eh uma descriçaum especial pra kaundo vc der look no item ele aparece o q ta escrito! Ta agora em actions.xml procure pela linha: (eh ctrl+f, se no seu ot naum tiver acrecente ): CODE<action itemid="2931" script="invasion.lua" /> O 2931 eh o itemid do teddy bear como vcs podem perceber, entaum! Quando vc der use (clicar com o botaum direito do mouse) no teddy bear a invasaum começa!!! Vc pode mudar pra kualker outro item, mas mude pra um item q apenas o GM pode ter acesso! Se vc for fazer outras scripts de invasao crie outro arquivo.lua se xame por exemplo invasion2.lua e repita o mesmo procedimento! Coloque tbm no actions.xml commo foi dito acima! (so q ao inves de vc por script="invasion.lua" vc coloca script="invasion2.lua" (isso eh um exemplo!) Espero ter ajudado Cya1 ponto
-
Comando !online. Todos conhecem o comando !online que mostra todos player onlines, eu dei uma editada nele, para servers de pokemon, agora ele mostrará o level do char, o pokemon que ele está batalhando, e qual está usando. Exemplo : Caso ele não esteje usando nenhum pokemon ou não batalahndo com nenhum, aparecerá, Using : nothing. Vamo ao script : caso vc não tenha o online para editar, crie um arquivo com nome de online.lua : local config = { showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand')) } function onSay(cid, words, param, frompos) local players = getPlayersOnline() local strings = {""} local i, position = 1, 1 local added = false for _, pid in ipairs(players) do if(added) then if(i > (position * 7)) then strings[position] = strings[position] .. "," position = position + 1 strings[position] = "" else strings[position] = i == 1 and "" or strings[position] .. "\n\n" end end local battle = getCreatureTarget(pid) == 0 and "nothing" or getCreatureName(getCreatureTarget(pid)) local poke = #getCreatureSummons(pid) == 0 and "nothing" or getCreatureName(getCreatureSummons(pid)[1]) if((config.showGamemasters or getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(pid) or getPlayerGhostAccess(cid) >= getPlayerGhostAccess(pid))) then strings[position] = strings[position] .. "[".. getCreatureName(pid) .. "][" .. getPlayerLevel(pid) .."]\n[battling: " .. battle .. " Using: " ..poke.."]" i = i + 1 added = true else added = false end end local c = (i - 1) for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." doShowTextDialog(cid, 2501, c .. " player(s) online:\n\n" .. str) end end return true end Tag : <talkaction words="!online" hide="yes" event="script" value="online.lua"/> #ATUALIZADO 08/02 - Mudado pra Scroll.1 ponto
-
Bom... O tutorial tá em inglês e não é meu. Se eu repassasse para o XT e etc. não ficaria a mesma coisa... Então vou deixar só o link aqui, mas como uma RECOMENDAÇÃO: Isometric Pixel Art Vou traduzir até semana que vem Desculpa a demora, mas acho que dá pra entender ele em inglês mesmo, e eu tenho um tanto de outras coisas pra fazer agora, mas uma hora vai estar traduzido, prontinho ai pra vocês. Foi o melhor dos tutoriais de photoshop que eu ja achei na net1 ponto
-
Aqui vai o link do Programa para editar o Database SQLite SQLiteStudio, Após baixar o programa abra-o e vá em Add Database e coloque o Nome do Database e clique no butão para selecionar o seu Database, Depois de adicionar irá aparecer a Aba com o nome do seu database Dê duplo clique nele e aparecerá 4 Tabelas chamadas Tables , Indexes , Triggers e Views abra a tabela Tables e terá várias Sub_Tabelas clique duas vezes na sub_tabela Players eai terá mais tabelas selecione a tabela Data, Pronto ai está todos seus players, Aonde tem group_id mude de 1 Para 6, 6 é o Group do GOD. Obs: Database é aquele arquivo que fica na pasta do seu OT que termina em s3db. Ou então... vai na frente do player que você quer deixar GOD e escreve /attr group 6 Se te ajudei REP+ :smile_positivo:1 ponto
-
[Pedido] Baiak Erro !
DaNDaNrOxX reagiu a KamuiRunt por um tópico no fórum
Isso não é erro, o fast ataque é de 400 por segundo, ou seja Você deve ter posto um numero absurdo. Isso significa que é o intervalo de segundos entre ataques. Quanto maior o número, mais demorado é o ataque. Quanto menor o número, mais rápido é o ataque. Obs: Seção errada, aqui é pedido de scripts, e não correção de falta de atenção. Reportado para mover.1 ponto -
[Gesior Acc] Estilizando Seu Layout
negrrao reagiu a walefxavier por um tópico no fórum
Vou postar alguns codigos para deixar seu gesior mais bonito: Com esse vc deixa o testo com um tom azul-marinho,no estilo Baiakuda: <div class='SubmenuitemLabel'><font color="#009cf0"> Top Fraggers </font></div> Com esse vc pode colocar as cores que desejar,basta escolher: <div class='SubmenuitemLabel'><font color=\"red\">Top Fraggers</font></div> Com esse vc pode deixar o texto piscando: (pode colocar a cor que quizer tbm) <div class='SubmenuitemLabel'><blink><font color=\"green\">Top Fraggers</font></blink></div> Um mais simples com "cores" : <div class='SubmenuitemLabel'><font color=red>Top Fraggers</font></div> Essas modificações só podem ser feitas no gesior,NÃO TENTE ISSO NO INDEX.PHP.... ABRAÇOS !1 ponto -
Não precisa,sério. Deixa eu te falar uma coisa,eu ajudo as pessoas não é por causa de rep nenhuma,oque eu ganho tendo rep? ganho salário? troco por items no tibia global? ganho roupas de marcas? Nada disso,rep é uma bobagem que criaram com o intuito de fazer pessoas ajudarem a comunidade em troca de nada,vejo um monte de neguinho pedindo rep ai nos tópico mais namoral rep não te leva a lugar nenhum,oque te diferencia é a humildade e o przer de compartilhar seu conhecimento em beneficio do próximo. flw1 ponto
-
Duvida Sobre O Site (Ajuda)
DaNDaNrOxX reagiu a Natanael Beckman por um tópico no fórum
C:\xampp\htdocs\layouts\tibiacom\layout_config: darkborder = "#D4C0A1" lightborder = "#F1E0C6" vdarkborder = "#505050" news_title_color = "white" logo_monster = "Demon" Gabih ver se dessa vez agradece e add um rep ae.1 ponto -
Ajuda Duvida Sobre Map
DaNDaNrOxX reagiu a KamuiRunt por uma questão
Obs: Só complementando a resposta do nosso amigo acima, caso você utilize o site otservers... bla bla bla para divulgar seu ot, la tambem tem a opção de autor. Não se esqueça.. Fica mais fácil o divulgamento. T+1 ponto -
Ajuda Duvida Sobre Map
DaNDaNrOxX reagiu a Kimoszin por uma questão
Pois bem amigo , isso é muito facil olhe: Va ate o Config.lua e procure por .. E modifique para o nome do seu map Para botar o autor .. Bote seu nome ali. Bem é isso. Muito facil ne ? Se ajudei +REP1 ponto -
Rabiscos Do Coelho
gabisaoo reagiu a BlackTheRabbit por um tópico no fórum
@Gabisaoo Pow cara como eu disse no começo do topic, eu sou novo no xtibia, n conheço as regras e tals(nem sabia da de double post=s) dai tpw, fiquei com medo de editar um post antigo, dai nem editei. Mas na verdade eu estou en 2 EQUIPES (o,o) @Topic ATUALIZAÇÃO: Mais um humanoide bicudo pra galera do xtibia vota em n gostei (brinks pelo amor de deus n façam isso =s)1 ponto -
Solução Rme Error (Couldn't Find Tibia.dat Or Tibi.spr)
xbillyx reagiu a darkeagleot por um tópico no fórum
Eu descobri oque fazer para o rme funcionar !!! 1º Passo abra o rme e clique ok em todas as mensagens 2º Passo vá em: file>preferences>client version e desmarque a opção "check files signatures" 3º Passo: Feche o RME 4º Passo: Acesse uma conta qualquer no tibia global (se for preciso faça o download do update) 5º Passo: Abra o RME, com o tibia logado na acc global. <Imagem Removida e Divulgação de Servidor também> Fim, agora você pode utiliza-lo :button_ok: Po Ninguem tá falando se funcionou ou não... e ai gente,... funcinou com vocês ? Po gente funcionou com vocês também ? se sim da REP+ Não funicona com tibia MC !! REP + :down:1 ponto -
Você quer adicionar pokémons novos, certo? Se você ja tem as sprites recortadas é so extrair as imagens do tibia.spr e modificar um a parte ou você pode criar... não lembro de nenhum tutorial parecido mas tenta este.1 ponto
-
Ajuda Com De Bug Aki Por Favor!
Eliedervicente reagiu a Tyrur por uma questão
Bem Hique86 O que ta acontecendo com vc é bem simples. Se for o que eu to pensando. Bem se os sintomas forem, quando vc meche no mapa editor os tiles aparecem corretamento. só que quando você coloca o server pra roda. e vai com o xar até lá, você encontra um monte de piso preto certo? Bem...não é como se não tivesse piso ali, Naverdade não tem piso ali!! Isso ocorre por causa de um incompatibilidade entre seu server e o Map editor. Os arquivos do tile do seu map editor, não são os mesmos que o do seu ot. Uma vez, isso aconteceu comigo, eu simplesmente peguei os itens.xml do meu ot. e coloquei no lugar dos itens.xml do mapa editor. e pronto o problema sumiu. Ou você pode baixar outro ot, ou outro mapa editor. Espero ter sanado a duvida.1 ponto -
Gesior 0.3.6
DaNDaNrOxX reagiu a gabrielmotta1 por um tópico no fórum
Como Configura?? Me Explica To Com Esse Erro http://localhost/install.php Notice: Undefined index: page in C:\xampp\htdocs\install.php on line 40 Notice: Undefined index: page in C:\xampp\htdocs\install.php on line 52 Notice: Undefined index: page in C:\xampp\htdocs\install.php on line 63-1 pontos -
Ajuda Duvida Sobre Map
DaNDaNrOxX reagiu a KamuiRunt por uma questão
Reportado por complementar? o__O' Isso foi pra tirar dúvidas de outros players, NÃO SE ESQUEÇA: só por que ele fez o tópico, não significa que só ele vá olhar ^.^ Vejamos o que a moderação tem a dizer-1 pontos