Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 04/30/19 em todas áreas

  1. 4 pontos
    BOM GALERA PRETENDO MANTER ATUALIZAÇÕES DESTA PAGINA SEMANALMENTE. BASICAMENTE ESTE É MEU SERVIDOR QUE EDITO QUANDO NÃO TENHO NADA PARA FAZER : / ESPERO QUE GOSTEM RSRS Lembrando que somente irei mostrar as modificações que eu fizer no OTCLIENTE ? SISTEMA DE CAPTURA sem criticas ofensivas por favor!! Ocultar conteúdo Sistema de addons Ocultar conteúdo sistema de Loja Ocultar conteúdo Sistema de casino 50% Ocultar conteúdo Tutorial em Jogo Ocultar conteúdo Sistema de Pokémons iniciais Ocultar conteúdo Sistema de boost Stone Ocultar conteúdo Sistema de Teleport Ocultar conteúdo É ISSO ESPERO QUE TENHAM GOSTADO RSRS FACEBOOK: https://www.facebook.com/PokeZRingOnline YOUTUBE: https://www.youtube.com/channel/UCgJHPztxiFFpWGUI9ty3xJA DISCORD: https://discord.gg/5rWrD4k
  2. 3 pontos
    Fala galera, por muito tempo utilizei o notepad++ para desenvolver meus códigos em lua. Agora voltando a desenvolver meu servidor, utilizo o Visual Studio Code e digo que ajuda muito em relação ao notepad++. Vantagens: 1) Você pode abrir a pasta de seu servidor, tendo uma estrutura semelhante a um projeto Java por exemplo, tudo isso de uma forma bem fácil. Se não me engano o notepad++ tem uma funcionalidade parecida, mas acredito que a maioria aqui não usa. Para fazer isso é só utilizar o atalho CTRL + K + O, ou file > Open Folder e selecionar a pasta de seu servidor. 2) Diversos atalhos. Com o VS Code, você pode utilizar atalhos, como o CTRL + P, ao fazer isso ele abre um box no topo da IDE onde o desenvolvedor pode escrever o nome do arquivo e ele encontra dentro do projeto. Fazia mais de ano que eu não abria meu servidor, então eu não lembrava de diversas coisas, como os monstros que dropavam o item 10566, então com o Visual Studio Code, eu consegui descobrir que eu não tinha configurado nenhum monstro para dropar aquele item. Para fazer essa pesquisa utilizei o atalho CTRL + SHIFT + F, onde ele pesquisa alguma palavra em específica entre os arquivos do seu projeto. E muitos outros, que você pode encontrar pesquisando pela internet. 3) Diversas extensões. Com o VS Code você pode instalar diversas extensões que auxiliam no seu desenvolvimento, por enquanto adicionei a padrão de Lua. Com ela, ao escrever códigos Lua é utilizado intellisense, facilitando muito no desenvolvimento. 4) Criação de snippets para utilização das funções do Tibia. 5) Muito mais.. Utilizo há algum tempo o VS Code para desenvolvimento de front e sempre descubro coisas novas sobre ele.. O VS Code esta disponível em: https://code.visualstudio.com/download.
  3. Remover monstro automaticamente

    gabriel28 e um outro reagiu a Cat por uma resposta no tópico

    2 pontos
    Use esse script para remover criaturas de tempo em tempo em uma determinada área do mapa. -- -- -- Em data/globalevents/cria um arquivo chamado removemonster.lua local config = { fromPos = {x=556,y=451,z=6}, -- posição superior esquerda do mapa, da area em que esta mapeado a area. toPos = {x=566,y=456,z=6}, -- posição inferior direita do mapa, da area em que esta mapeado a area. boss = "Nomedomonstroaqui" -- Aqui você bota o nome do monstro que você quer remover } function onTime() removeMonsterInArea(fromPos, toPos) return true end function removeMonsterInArea() local positionsCheck = {} for i = config.fromPos.x, config.toPos.x do positionsCheck[#positionsCheck+1] = {x=i, y = config.fromPos.y, z = config.fromPos.z, stackpos = 0} for j = config.fromPos.y+1, config.toPos.y do positionsCheck[#positionsCheck+1] = {x=i, y = j, z = config.fromPos.z, stackpos = 0} end end for j=1, #positionsCheck do for i = 0, 255 do positionsCheck[j].stackpos = i local tile = getTileThingByPos(positionsCheck[j]) if isMonster(tile.uid) then if getCreatureName(tile.uid) == config.boss then doRemoveCreature(tile.uid) end end end end end TAG: <globalevent name="removemonster" time="03:00" event="script" value="removemonster.lua"/> time="03:00" representa 3horas AM
  4. Obrigatoriamente leia tudo! Atualizado 01/07/2014 Opa galera mais uma vez eu trazendo o melhor para todos. Hoje vou postar o sistema de Guild de Points que eu utilizo em meu OTserver, acredito que dificilmente será encontrado por ae um tão completo e sem bugs igual o que será postado logo abaixo, é um sistema completo que é utilizado pelo líder da guild executando um comando que, se tiver de acordo com as regras que seram feitas por você, todos os membros da guild iram receber os pontos uma unica vez, lembrando que quando os pontos são adicionados a um player ele não receberá entrando em outra guild e não receberá criando outro personagem na conta, resumindo ele só receberá uma unica vez na conta e com um player só. E um dos detalhes que me causava dor de cabeça era que quando um líder executava o comando, quem estava online recebia os pontos, mais quem estava offline não recebia, isso acontecia normalmente porque tem guilds que contém 50, 70, 100 players, portanto nem sempre todos estavam online. O comando só pode ser executado uma vez por dia cada guild, para não gerar processamentos desnecessários e assim um mal funcionamento do servidor. Cada administrador pode configurar seu sistema da forma que quiser, por ser um sistema muito simples, você pode bota que todos os players estejam no minimo level x, que a guild só possa executar o comando quando estiver quantidade x de players online, isso é bom porque traz um certa dificuldade para fraudes de pontos, e o sistema só vira bagunça dependendo do que você vai oferecer no seu shop guild, eu particularmente só utilizei esse comando porque muitas guilds grandes pediam pontos, eles me cobravam uma quantidade x de pontos e eu cobrava uma quantidade x de player então pra automatizar o processo e não ter dor de cabeça foi feito todo esse sistema. Se você analisar bem vai ver que tudo isso só gera mais crescimento ao seu servidor. Bom, vamos ao sistema: Em talkactions.xml, adicione a tag abaixo: <talkaction words="!guildpoints" event="script" value="guildpoints.lua"/> Na pasta talkactions/scripts faça um .lua com o nome guildpoints e dentro dele adicione os coder abaixo: GuildPointsConfigs = { ExecuteIntervalHours = 24, NeedPlayersOnline = 10, NeedDiferentIps = 6, MinLevel = 80, AddPointsForAcc = 9 } function getGuildPlayersValidAccIDS(GuildID, MinLevel) local RanksIDS = {} local AccsID = {} local ValidAccsID = {} Query1 = db.getResult("SELECT `id` FROM `guild_ranks` WHERE guild_id = '".. GuildID .."'") if(Query1:getID() == -1) then return ValidAccsID end for i = 1, Query1:getRows() do table.insert(RanksIDS, Query1:getDataInt("id")) Query1:next() end Query2 = db.getResult("SELECT `account_id` FROM `players` WHERE `rank_id` IN (".. table.concat(RanksIDS, ', ') ..") AND `level` >= ".. MinLevel .."") if(Query2:getID() == -1) then return ValidAccsID end for i = 1, Query2:getRows() do local AccID = Query2:getDataInt("account_id") if #AccsID > 0 then for k = 1, #AccsID do if AccID == AccsID[k] then AddAccList = false break end AddAccList = true end if AddAccList then table.insert(AccsID, AccID) end else table.insert(AccsID, AccID) end Query2:next() end Query3 = db.getResult("SELECT `id` FROM `accounts` WHERE `guild_points_stats` = 0 AND `id` IN (".. table.concat(AccsID, ', ') ..")") if(Query3:getID() == -1) then return ValidAccsID end for i = 1, Query3:getRows() do local AccID = Query3:getDataInt("id") if #ValidAccsID > 0 then for k = 1, #ValidAccsID do if AccID == ValidAccsID[k] then AddAccList = false break end AddAccList = true end if AddAccList then table.insert(ValidAccsID, AccID) end else table.insert(ValidAccsID, AccID) end Query3:next() end return ValidAccsID end function onSay(cid, words, param, channel) if(getPlayerGuildLevel(cid) == 3) then local GuildID = getPlayerGuildId(cid) Query = db.getResult("SELECT `last_execute_points` FROM `guilds` WHERE id = '".. GuildID .."'") if(Query:getID() == -1) then return true end if Query:getDataInt("last_execute_points") < os.time() then local GuildMembers = {} local GuildMembersOnline = {} local PlayersOnline = getPlayersOnline() for i, pid in ipairs(PlayersOnline) do if getPlayerGuildId(pid) == GuildID then if getPlayerLevel(pid) >= GuildPointsConfigs.MinLevel then table.insert(GuildMembersOnline, pid) end end end if #GuildMembersOnline >= GuildPointsConfigs.NeedPlayersOnline then local IPS = {} for i, pid in ipairs(GuildMembersOnline) do local PlayerIP = getPlayerIp(pid) if #IPS > 0 then for k = 1, #IPS do if PlayerIP == IPS[k] then AddIPList = false break end AddIPList = true end if AddIPList then table.insert(IPS, PlayerIP) end else table.insert(IPS, PlayerIP) end end if #IPS >= GuildPointsConfigs.NeedDiferentIps then local ValidAccounts = getGuildPlayersValidAccIDS(GuildID, GuildPointsConfigs.MinLevel) db.executeQuery("UPDATE `guilds` SET `last_execute_points` = ".. os.time() +(GuildPointsConfigs.ExecuteIntervalHours * 3600) .." WHERE `guilds`.`id` = ".. GuildID ..";") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "".. #ValidAccounts .." Players received points") if #ValidAccounts > 0 then db.executeQuery("UPDATE `accounts` SET `guild_points` = `guild_points` + " ..GuildPointsConfigs.AddPointsForAcc .. ", `guild_points_stats` = ".. os.time() .." WHERE `id` IN (" .. table.concat(ValidAccounts, ',') ..");") for i, pid in ipairs(GuildMembersOnline) do local PlayerMSGAccID = getPlayerAccountId(pid) for k = 1, #ValidAccounts do if PlayerMSGAccID == ValidAccounts[k] then doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "You received "..GuildPointsConfigs.AddPointsForAcc .." guild points.") break end end end end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only ".. #IPS .." players are valid, you need ".. GuildPointsConfigs.NeedDiferentIps .." players with different ips.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Has only ".. #GuildMembersOnline .." players online you need ".. GuildPointsConfigs.NeedPlayersOnline .." players online at least from level ".. GuildPointsConfigs.MinLevel ..".") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "The command can only be run once every "..GuildPointsConfigs.ExecuteIntervalHours .." hours.") end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Only guild leader can request points.") end return true end No coder acima bem no inicio tem as linhas seguintes para configurar: ExecuteIntervalHours = 24, ( Intervalo para execução do comando, ae está de 24 em 24hrs) NeedPlayersOnline = 10, (Quantos players é preciso está online para poder executar o comando.) NeedDiferentIps = 6, (Quantos IPS diferentes são necessários para executar o comando no exemplo ae tem 6.) MinLevel = 80, (Aqui adicione o level minimo, é necessário que todos os player da guild tenha o level pedido para o lider executar o comando.) AddPointsForAcc = 9, (Aqui é a quantidade de pontos para adicionar em cada player da guild.) Em data/globalevents/scripts crie um arquivo chamado shopguild.lua e adicione o code a seguir: local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE local SQL_interval = 30 function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_guildcomunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do local id = tonumber(result_plr:getDataInt("id")) local action = tostring(result_plr:getDataString("action")) local delete = tonumber(result_plr:getDataInt("delete_it")) local cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", "This item can only be used by the player ".. getPlayerName(cid) .."!") doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS GuildShop.') db.executeQuery("DELETE FROM `z_ots_guildcomunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shopguild_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS GuildShop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS GuildShop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return true end Em data/globalevents/globalevents.xml adicione a seguinte tag: <globalevent name="shopguild" interval="300" event="script" value="shopguild.lua"/> Certo, a parte do servidor é esta, ta feita, vamos adicionar a database o coder a seguir: ALTER TABLE `accounts` ADD `guild_points` INTEGER(11) NOT NULL DEFAULT 0; ALTER TABLE `accounts` ADD `guild_points_stats` INT NOT NULL DEFAULT '0'; ALTER TABLE `guilds` ADD `last_execute_points` INT NOT NULL DEFAULT '0'; CREATE TABLE `z_shopguild_offer` ( `id` int(11) NOT NULL auto_increment, `points` int(11) NOT NULL default '0', `itemid1` int(11) NOT NULL default '0', `count1` int(11) NOT NULL default '0', `itemid2` int(11) NOT NULL default '0', `count2` int(11) NOT NULL default '0', `offer_type` varchar(255) default NULL, `offer_description` text NOT NULL, `offer_name` varchar(255) NOT NULL, `pid` INT(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) CREATE TABLE `z_shopguild_history_item` ( `id` int(11) NOT NULL auto_increment, `to_name` varchar(255) NOT NULL default '0', `to_account` int(11) NOT NULL default '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `offer_id` int(11) NOT NULL default '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL default '0', `trans_real` int(11) NOT NULL default '0', PRIMARY KEY (`id`)) CREATE TABLE `z_shopguild_history_pacc` ( `id` int(11) NOT NULL auto_increment, `to_name` varchar(255) NOT NULL default '0', `to_account` int(11) NOT NULL default '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL default '0', `price` int(11) NOT NULL default '0', `pacc_days` int(11) NOT NULL default '0', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL default '0', `trans_real` int(11) NOT NULL default '0', PRIMARY KEY (`id`)) CREATE TABLE IF NOT EXISTS `z_ots_guildcomunication` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `type` varchar(255) NOT NULL, `action` varchar(255) NOT NULL, `param1` varchar(255) NOT NULL, `param2` varchar(255) NOT NULL, `param3` varchar(255) NOT NULL, `param4` varchar(255) NOT NULL, `param5` varchar(255) NOT NULL, `param6` varchar(255) NOT NULL, `param7` varchar(255) NOT NULL, `delete_it` int(2) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=13107; Olha estamos quase finalizando tudo, só precisamos terminar a parte de web. O meu GuildShop eu copiei meu shopsystem.php e fiz umas modificações, simples você pode fazer o mesmo é menos trabalhoso. Copie o shopsystem.php renomeie para shopguild.php, após abra-o e modifique como manda a seguir: shop_system para shopguild_system premium_points para guild_points premium points para guild points z_shop_offer para z_shopguild_offer shopsystem para shopguild z_shop_history_pacc para z_shopguild_history_pacc z_shop_history_item para z_shopguild_history_item z_ots_comunication para z_ots_guildcomunication Ou utilize este já pronto: shopguild.php O shopguildadmin.php está no link abaixo, basta fazer o mesmo procedimento: shopguildadmin.php Em index.php add: case "shopguild"; $topic = "Shop Guild"; $subtopic = "shopguild"; include("shopguild.php"); break; case "shopguildadmin"; $topic = "ShopGuild Admin"; $subtopic = "shopguildadmin"; include("shopguildadmin.php"); break; Vá em config.php adicione: $config['site']['shopguild_system'] = 1; $config['site']['access_adminguild_panel'] = 9; Vá em layouts.php adicione abaixo de buypoints: <a href='?subtopic=shopguild'> <div id='submenu_shopguild' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)'onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_shopguild' class='ActiveSubmenuItemIcon'style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'>Shop Guild</div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a> Em layouts.php add depois do shopadmin: if($group_id_of_acc_logged >= $config['site']['access_adminguild_panel']) echo "<a href='?subtopic=shopadmin'> <div id='submenu_shopguildadmin' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)'onMouseOut='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_shopguildadmin' class='ActiveSubmenuItemIcon'style='background-image:url(".$layout_name."/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>! ShopGuild Admin !</font></div> <div class='RightChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div> </div> </a>"; Em shopsystem.php procure por: elseif($action == 'show_history') { if(!$logged) { $main_content .= 'Please login first.'; } else{ $items_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($items_history_received)) { foreach($items_history_received as $item_received) { if($account_logged->getId() == $item_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $items_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$item_received['to_name'].'</font></td><td>'; if($account_logged->getId() == $item_received['from_account']) $items_received_text .= '<i>Your account</i>'; else $items_received_text .= $item_received['from_nick']; $items_received_text .= '</td><td>'.$item_received['offer_id'].'</td><td>'.$item_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $item_received['trans_start']).'</td>'; if($item_received['trans_real'] > 0) $items_received_text .= '<td>'.date("j F Y, H:i:s",$item_received['trans_real']).'</td>'; else $items_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>'; $items_received_text .= '</tr>'; } } $paccs_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_pacc').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($paccs_history_received)) { foreach($paccs_history_received as $pacc_received) { if($account_logged->getId() == $pacc_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $paccs_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$pacc_received['to_name'].'</font></td><td>'; if($account_logged->getId() == $pacc_received['from_account']) $paccs_received_text .= '<i>Your account</i>'; else $paccs_received_text .= $pacc_received['from_nick']; $paccs_received_text .= '</td><td>'.$pacc_received['pacc_days'].' days</td><td>'.$pacc_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $pacc_received['trans_real']).'</td></tr>'; } } $main_content .= '<center><h1>Transactions History</h1></center>'; if(!empty($items_received_text)) $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="6"><font color="white" size="4"><b>&nbsp;Item Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Cost</b></td><td><b>Bought on page</b></td><td><b>Received on '.$config['server']['serverName'].'</b></td></tr>'.$items_received_text.'</table><br />'; if(!empty($paccs_received_text)) $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;Pacc Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Duration</b></td><td><b>Cost</b></td><td><b>Added:</b></td></tr>'.$paccs_received_text.'</table><br />'; if(empty($paccs_received_text) && empty($items_received_text)) $main_content .= 'You did not buy/receive any items or PACC.'; } } Troque por: elseif($action == 'show_history') { if(!$logged) { $main_content .= 'Please login first.'; } else{ $items_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($items_history_received)) { foreach($items_history_received as $item_received) { if($account_logged->getId() == $item_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $items_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$item_received['to_name'].'</font></td><td>'; if($account_logged->getId() == $item_received['from_account']) $items_received_text .= '<i>Your account</i>'; else $items_received_text .= $item_received['from_nick']; $items_received_text .= '</td><td>'.$item_received['offer_id'].'</td><td>'.$item_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $item_received['trans_start']).'</td>'; if($item_received['trans_real'] > 0) $items_received_text .= '<td>'.date("j F Y, H:i:s",$item_received['trans_real']).'</td>'; else $items_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>'; $items_received_text .= '</tr>'; } } $itemsguild_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shopguild_history_item').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($itemsguild_history_received)) { foreach($itemsguild_history_received as $itemguild_received) { if($account_logged->getId() == $itemguild_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $itemsguild_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$itemguild_received['to_name'].'</font></td><td>'; if($account_logged->getId() == $itemguild_received['from_account']) $itemsguild_received_text .= '<i>Your account</i>'; else $itemsguild_received_text .= $itemguild_received['from_nick']; $itemsguild_received_text .= '</td><td>'.$itemguild_received['offer_id'].'</td><td>'.$itemguild_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $itemguild_received['trans_start']).'</td>'; if($itemguild_received['trans_real'] > 0) $itemsguild_received_text .= '<td>'.date("j F Y, H:i:s",$itemguild_received['trans_real']).'</td>'; else $itemsguild_received_text .= '<td><b><font color="red">Not realized yet.</font></b></td>'; $itemsguild_received_text .= '</tr>'; } } $paccs_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shop_history_pacc').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($paccs_history_received)) { foreach($paccs_history_received as $pacc_received) { if($account_logged->getId() == $pacc_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $paccs_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$pacc_received['to_name'].'</font></td><td>'; if($account_logged->getId() == $pacc_received['from_account']) $paccs_received_text .= '<i>Your account</i>'; else $paccs_received_text .= $pacc_received['from_nick']; $paccs_received_text .= '</td><td>'.$pacc_received['pacc_days'].' days</td><td>'.$pacc_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $pacc_received['trans_real']).'</td></tr>'; } } $paccsguild_history_received = $SQL->query('SELECT * FROM '.$SQL->tableName('z_shopguild_history_pacc').' WHERE '.$SQL->fieldName('to_account').' = '.$SQL->quote($account_logged->getId()).' OR '.$SQL->fieldName('from_account').' = '.$SQL->quote($account_logged->getId()).';'); if(is_object($paccsguild_history_received)) { foreach($paccsguild_history_received as $paccguild_received) { if($account_logged->getId() == $paccguild_received['to_account']) $char_color = 'green'; else $char_color = 'red'; $paccsguild_received_text .= '<tr bgcolor="#F1E0C6"><td><font color="'.$char_color.'">'.$paccguild_received['to_name'].'</font></td><td>'; if($account_logged->getId() == $paccguild_received['from_account']) $paccsguild_received_text .= '<i>Your account</i>'; else $paccsguild_received_text .= $paccguild_received['from_nick']; $paccsguild_received_text .= '</td><td>'.$paccguild_received['pacc_days'].' days</td><td>'.$paccguild_received['price'].' Points</td><td>'.date("j F Y, H:i:s", $paccguild_received['trans_real']).'</td></tr>'; } } $main_content .= '<center><h1>Transactions History</h1></center>'; if(!empty($items_received_text)) $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="6"><font color="white" size="4"><b>&nbsp;ShopServer Item Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Cost</b></td><td><b>Bought on page</b></td><td><b>Received on '.$config['server']['serverName'].'</b></td></tr>'.$items_received_text.'</table><br />'; if(!empty($itemsguild_received_text)) $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="6"><font color="white" size="4"><b>&nbsp;ShopGuild Item Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Offer name</b></td><td><b>Cost</b></td><td><b>Bought on page</b></td><td><b>Received on '.$config['server']['serverName'].'</b></td></tr>'.$itemsguild_received_text.'</table><br />'; if(!empty($paccs_received_text)) $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;ShopServer VIP Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Duration</b></td><td><b>Cost</b></td><td><b>Added:</b></td></tr>'.$paccs_received_text.'</table><br />'; if(!empty($paccsguild_received_text)) $main_content .= '<center><table BORDER=0 CELLPADDING=1 CELLSPACING=1 WIDTH=95%><tr width="100%" bgcolor="#505050"><td colspan="5"><font color="white" size="4"><b>&nbsp;ShopGuild VIP Transactions</b></font></td></tr><tr bgcolor="#D4C0A1"><td><b>To:</b></td><td><b>From:</b></td><td><b>Duration</b></td><td><b>Cost</b></td><td><b>Added:</b></td></tr>'.$paccsguild_received_text.'</table><br />'; if(empty($paccs_received_text) && empty($items_received_text)) $main_content .= 'You did not buy/receive any items or PACC.'; if(empty($paccsguild_received_text) && empty($itemsguild_received_text)) $main_content .= 'You did not buy/receive any items or PACC.'; } } Finalmente terminamos! Bom todo esse processo é feito só para facilitar tudo pra você e o player e pra diferenciar o Shop System do Shop Guild, porque um sustenta as despesas do server e o outro atrai player, porque pra conseguir player é preciso ter player. Galera acredito que não esteja faltando nada, espero que gostem e tudo que eu poder fazer para nossas melhoras estarei postando, me desculpem meus erros de português mais o que importa aqui é o script está correto, abraços! Créditos: Natanael Beckman LukeSkywalker (Raphael Luiz) .lua 100% Não proíbo ninguém de copia o tópico só peço que onde você adicione inclua os créditos mencionados.
  5. PZ locked magic wall tfs 1.3

    dervin13 reagiu a lordzetros por uma resposta no tópico

    1 ponto
    No TFS 1.3 não tem função para adicionar o pzLocked que gostaria no jogador, portanto, modifique sua source com essas alterações: em Luascript.h static int luaPlayerPzLocked(lua_State* L); E em Luascript.cpp (cole abaixo de um semelhante) Código 1: registerMethod("Player", "pzLock", LuaScriptInterface::luaPlayerPzLocked); Código 2 (abaixo/acima de um semelhante também): int LuaScriptInterface::luaPlayerPzLocked(lua_State* L) { // player:pzLock(true/false, default = false) Player* player = getUserdata<Player>(L, 1); if (!player) { lua_pushnil(L); return 1; } bool pzLock = getBoolean(L, 2, false); player->pzLocked = pzLock; return 1; } E para finalizar, vai na sua spell de magic wall e deixe desta forma: local combat = Combat() combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL) function onCastSpell(creature, variant, isHotkey) creature:pzLock(true) return combat:execute(creature, variant) end
  6. Healling Spell usando SoulPoints

    Kramer reagiu a Cat por uma resposta no tópico

    1 ponto
    Esse foi um dos meus primeiros scripts, é uma spell (adaptada por emersonsss) de cura instantânea que utiliza Soul Points para curar o druid. Se ele não tiver soul points e invocar a magia, a força da natureza pega a energia da vida dele e acaba não curando, o deixando no prejuízo. function onCastSpell(cid, var) if isDruid(cid) then if getPlayerSoul(cid) >= 100 then local maxh = getCreatureMaxHealth(cid) doCreatureAddHealth(cid, maxh) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) doPlayerAddSoul(cid, -100) doPlayerSendTextMessage(cid, 22, 'You used your soul successfully!') else  doPlayerSendCancel(cid, "You dont have 100 soul.") end else doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_POFF) doPlayerSendTextMessage(cid, 21, 'You are not druid, as punishment, the ancient gods will punish you removing you life.') doPlayerSendTextMessage(cid, 21, 'Dont try this again!') doCreatureAddHealth(cid, -5) end return true end Em forma de comando: Em data/talkactions/scripts, copie um arquivo, renomeie para druidprotection e adicione o script function onSay(cid, words, param, channel) if isDruid(cid) then if getPlayerSoul(cid) >= 100 then local maxh = getCreatureMaxHealth(cid) doCreatureAddHealth(cid, maxh) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) doPlayerAddSoul(cid, -100) doPlayerSendTextMessage(cid, 22, 'You used your soul successfully!') else doPlayerSendCancel(cid, "You dont have 100 soul.") end else doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_POFF) doPlayerSendTextMessage(cid, 21, 'You are not druid, as punishment, the ancient gods will punish you removing you life.') doPlayerSendTextMessage(cid, 21, 'Dont try this again!') doCreatureAddHealth(cid, -5) end return true end Em data/talkactions/talkactions.xml adicione a tag: <talkaction words="!druidprotection" event="script" value="druidprotection.lua"/>
  7. Removendo Account Salt

    zLockey9 reagiu a Patrick Jean por uma resposta no tópico

    1 ponto
    Nome do Script: Removendo Account Salt Autor: Henke Rula Servidor Testado: OTX Server 9.8x e outras versões também serve Descrição: Mesmo tendo a opção no config.lua, não é retirado o salt do banco de dados. Então modifiquei nas sources forçando não criar o Salt na tabela. Requisitos: Sources do Servidor Abrir "iologindata.cpp" e procure por : query << "SELECT `name`, `password`, `salt`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `id` = " << accountId << " LIMIT 1"; E Troque por: query << "SELECT `name`, `password`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `id` = " << accountId << " LIMIT 1"; Logo abaixo verá essa opção que você deve remover: account.salt = result->getDataString("salt"); Procure por : query << "SELECT `id`, `password`, `salt`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `name` " << db->getStringComparer() << db->escapeString(name) << " LIMIT 1"; E troque por: query << "SELECT `id`, `password`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `name` " << db->getStringComparer() << db->escapeString(name) << " LIMIT 1"; Logo abaixo verá essa opção que você deve remover: account.salt = result->getDataString("salt"); Como podem verificar, eu removi o salt da consulta sql e removi a função também. O começo da consulta pode variar entre query e dbquery dependendo da sua distro. Procure por: password = salt + password; E troque por: password = password; E logo abaixo procure por: query << "INSERT INTO `accounts` (`id`, `name`, `password`, `salt`) VALUES (NULL, " << db->escapeString(name) << ", " << db->escapeString(password) << ", " << db->escapeString(salt) << ")"; E troque por: query << "INSERT INTO `accounts` (`id`, `name`, `password`) VALUES (NULL, " << db->escapeString(name) << ", " << db->escapeString(password) << ")"; A modificação é muito simples e 100% funcional e livre de bugs. (Testei e funcionou) Vale lembrar que essa modificação é muito útil para aqueles que querem ter seu servidor criando contas in-game ou por site. Estou aberto a sugestões e críticas construtivas.
  8. 1 ponto
    Já salvou em ANSI então ?
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo