Ir para conteúdo

Leoprotons

Cavaleiro
  • Total de itens

    186
  • Registro em

  • Última visita

  • Dias Ganhos

    1

Histórico de Reputação

  1. Upvote
    Leoprotons deu reputação a LordZezim em Mapping Show Off   
    Mapping Show off


     
    Por meio deste tópico serão postadas imagens relacionadas aos mapas do servidor.
    Obs: Outros membros do fórum podem comentar, dar sugestões, críticas e parabenizações.
  2. Upvote
    Leoprotons recebeu reputação de YuriGeleia em {Pedido} God Vs Player   
    Talvez se você mudar o flags de certo.
     
    Calculadora de flags:
    http://trevorpp.awardspace.com/
  3. Upvote
    Leoprotons recebeu reputação de ThiagoADM em {Show~Off} Léo   
    Bom, no meu shown off vou pretendo postar somente mapas de construções, bem isso é por enquanto, quem sabe eu mude de ideia, mais ai eu edito o post
     
    Gostaria de saber de vocês opiniões sobre o que posso melhorar, o que não gostou, o que faltou e é claro também o que gostou.
     
    Agradeço desde já.
     
    Pra começar irei postar uma tumba, igreja, templo ou algo assim.. Não sei bem o que é.. alguém tem uma definição??
     
    Historia:
    Esta e uma construção para guardar um corpo de um grande líder da aldeia.
     

     
     
     
    E a outra é uma loja de potions.
     
    Historia:
    Construção onde mora um sábio, que utiliza de seu conhecimento, para transformar ervas e restos de corpos para criar poções magicas.
     

     
    é só isso!! em breve posto SS's.
     
     
    Edit Obs: Por algum motivo meu post se alto enviou antes de eu terminar de colocar a imagem.. O,o
  4. Upvote
    Leoprotons recebeu reputação de snoop18 em [Encerrado] Erro Server Cai   
    Sim,
    depois de abrir aperte
    Alt + e
    cole o comando e aperte em F9.
  5. Upvote
    Leoprotons recebeu reputação de Vilden em Guild War System Com Escudos   
    Bom vamos começar pelo site :
     
     
     
    Vá em Xampp/Htdocs e crie e um arquivo chamado wars.php,dentro add isto:

    <?php $main_content = "<h1 align=\"center\">Guild Wars</h1> <script type=\"text/javascript\"><!-- function show_hide(flip) { var tmp = document.getElementById(flip); if(tmp) tmp.style.display = tmp.style.display == 'none' ? '' : 'none'; } --></script> <a onclick=\"show_hide('information'); return false;\" style=\"cursor: pointer;\"><h1><center>» Click to se the commands «<center></h1></a> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"information\" style=\"display: none;\";> <tr align=\"center\"><b>You must send this commands in GUILD CHAT.</tr> <tr style=\"background: #512e0b;\"><td align=\"center\" class=\"white\"><b>Command</b></td><td colspan=\"2\" align=\"center\" class=\"white\"><b>Description</b></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war invite, guild name, fraglimit</b></td><td>Sends an invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150<BR></font><B>(Invite a guild to war with 150 frags count.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war invite, guild name, fraglimit, money</b></td><td>Send the invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150, 10000</font><br><B> (Invite a guild to war with 150 frags count and payment of 10000 gold coins <- you need donate to guild to use it.)<B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war accept, guild name</b></td><td>Accepts the invitation to start a war. Example: <font color=red><BR>/war accept, Chickens</font><BR><B>(Accept the war against guild \"Chickens\".)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war reject, guild name</b></td><td>Rejects the invitation to start a war. Example: <font color=red><BR>/war reject, Chickens</font><BR><B>(Reject a invitation to war from Chickens.)</B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war cancel, guild name</b></td><td>Cancels the invitation. Example: <font color=red><BR>/war cancel, Chickens</font><br><b>(Cancel my guild invitation to war with Chickens.)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance</b></td><td>See the guild balance - balance of money.</td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/balance donate value</b></td><td>Deposits money on the guild's bank account. All players can donate. Example: <font color=red><BR>/balance donate 100000 </font><BR><B>(You will donate 100k to your guild balance.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance pick value</b></td><td>Withdraws money from the guild's bank account. Can be used only by the guild leader. Example: <font color=red><BR>/balance pick 100000 </font><BR><B>(You will withdraw 100k from your guild balance.)</B></td></tr> </table> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"> <tr> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Aggressor</b></td> <td style=\"background: #512e0b\" class=\"white\"><b>Information</b></td> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Enemy</b></td> </tr><tr style=\"background: #F1E0C6;\">"; $count = 0; foreach($SQL->query('SELECT * FROM `guild_wars` WHERE `status` IN (1,4) OR ((`end` >= (UNIX_TIMESTAMP() - 604800) OR `end` = 0) AND `status` IN (0,5));') as $war) { $a = $ots->createObject('Guild'); $a->load($war['guild_id']); if(!$a->isLoaded()) continue; $e = $ots->createObject('Guild'); $e->load($war['enemy_id']); if(!$e->isLoaded()) continue; $alogo = $a->getCustomField('logo_gfx_name'); if(empty($alogo) || !file_exists('guilds/' . $alogo)) $alogo = 'default_logo.gif'; $elogo = $e->getCustomField('logo_gfx_name'); if(empty($elogo) || !file_exists('guilds/' . $elogo)) $elogo = 'default_logo.gif'; $count++; $main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a></td> <td align=\"center\">"; switch($war['status']) { case 0: { $main_content .= "<b>Pending acceptation</b><br />Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) : "unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.")."<br />Will expire in three days."; break; } case 3: { $main_content .= "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 2: { $main_content .= "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 1: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred; font-weight: bold;\">On a brutal war</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) : "") . ".<br />The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment."); break; } case 4: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred;\">Pending end</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".<br />Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." : "There's no payment set."); break; } case 5: { $main_content .= "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: <span style=\"color: red;\">" . $war['guild_kills'] . "</span> to <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span>."; break; } default: { $main_content .= "Unknown, please contact with gamemaster."; break; } } $main_content .= "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">» Details «</a></td> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$e->getId()."\"><img src=\"guilds/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td> </tr> <tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td colspan=\"3\">"; if(in_array($war['status'], array(1,4,5))) { $deaths = $SQL->query('SELECT `pd`.`id`, `pd`.`date`, `gk`.`guild_id` AS `enemy`, `p`.`name`, `pd`.`level` FROM `guild_kills` gk LEFT JOIN `player_deaths` pd ON `gk`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `gk`.`war_id` = ' . $war['id'] . ' AND `p`.`deleted` = 0 ORDER BY `pd`.`date` DESC')->fetchAll(); if(!empty($deaths)) { foreach($deaths as $death) { $killers = $SQL->query('SELECT `p`.`name` AS `player_name`, `p`.`deleted` AS `player_exists`, `k`.`war` AS `is_war` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `p`.`id` = `pk`.`player_id` WHERE `k`.`death_id` = ' . $death['id'] . ' ORDER BY `k`.`final_hit` DESC, `k`.`id` ASC')->fetchAll(); $count = count($killers); $i = 0; $others = false; $main_content .= date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span> <a href=\"index.php?subtopic=characters&name=" . urlencode($death['name']) . "\"><b>".$death['name']."</b></a> "; foreach($killers as $killer) { $i++; if($killer['is_war'] != 0) { if($i == 1) $main_content .= "killed at level <b>".$death['level']."</b> by "; else if($i == $count && $others == false) $main_content .= " and by "; else $main_content .= ", "; if($killer['player_exists'] == 0) $main_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">"; $main_content .= $killer['player_name']; if($killer['player_exists'] == 0) $main_content .= "</a>"; } else $others = true; if($i == $count) { if($others == true) $main_content .= " and few others"; $main_content .= ".<br />"; } } } } else $main_content .= "<center>There were no frags on this war so far.</center>"; } else $main_content .= "<center>This war did not began yet.</center>"; $main_content .= "</td> </tr>"; } if($count == 0) $main_content .= "<tr style=\"background: ".$config['site']['darkborder'].";\"> <td colspan=\"3\">Currently there are no active wars.</td> </tr>"; $main_content .= "</table>"; $main_content .= '<div align="right"><small><b>Customized by: <a href="http://www.xtibia.com/forum/user/240289-walef-xavier">Walef Xavier</a></b></small></div><br />'; ?>
     
     
     
    Agora vá em Xampp/Htdocs/index.php e add o seguinte:

    case "wars"; $subtopic = "wars"; $topic = "Guild Wars"; include("wars.php"); break;
     
     
    Agora para finalizar a parte do site vá em Xampp/Htdocs/Layout/Tibiacom/layout.php e add o seguinte:

    <a href='?subtopic=wars'> <div id='submenu_wars' 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_polls' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>Guild Wars</font></div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a>
     
     
    Agora vamos para seu Ot:
     
     
     
    Va em GlobalEvents/scripts/start.lua e add o seguinte:

    executeQuery("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") db.executeQuery("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";")
     
     
    Agora vá em Lib e crie um arquivo .lua chamado 101-war,dentro add o seguinte:

    WAR_GUILD = 0 WAR_ENEMY = 1
     
     
    Agora para finalizar vamos colocar os comandos em Talkactions !
     
     
     
    Vá em Talkactions/scripts e crie dois arquivos chamados war.lua e balance.lua,dentro add o seguinte:
     
    War.lua

    function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true
     
     
    balance.lua

    local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(guild == 0) then return false end local t = string.explode(param, ' ', 1) if(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER and isInArray({ 'pick' }, t[1])) then if(t[1] == 'pick') then local money = { tonumber(t[2]) } if(not isValidMoney(money[1])) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end local result = db.getResult('SELECT `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end money[2] = result:getDataLong('balance') result:free() if(money[1] > money[2]) then doPlayerSendChannelMessage(cid, '', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_W, 0) return true end if(not db.query('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) doPlayerSendChannelMessage(cid, '', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_W, 0) else doPlayerSendChannelMessage(cid, '', 'Invalid sub-command.', TALKTYPE_CHANNEL_W, 0) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end if(getPlayerMoney(cid) < money) then doPlayerSendChannelMessage(cid, '', 'You don\'t have enough money.', TALKTYPE_CHANNEL_W, 0) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.query('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') doPlayerSendChannelMessage(cid, '', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_W, 0) else local result = db.getResult('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end doPlayerSendChannelMessage(cid, '', 'Current balance of guild ' .. result:getDataString('name') .. ' is: ' .. result:getDataLong('balance') .. ' bronze coins.', TALKTYPE_CHANNEL_W, 0) result:free() end return true end
     
     
     
    Agora vá em Talkactions/talkactions.xml e add as duas tags:

    <talkaction words="/war" channel="0" event="script" value="war.lua" desc="(Guild channel command) War management."/> <talkaction words="/balance" channel="0" event="script" value="balance.lua" desc="(Guild channel command) Balance management."/>
     
     
     
    Pronto,seu Guild War Systema está instalado...mas para funcionar necessitará das tabelas na sua database e do Tfs 0.4 .Vou posta-los abaixo,respectivamente.
     
    . Tabelas .
     
    Para quem ainda não sabe add tabelas a sua database,vou ensinar:
     
    Acesse seu phpmyadmin,digite sua senha (caso tenha),clique no nome da sua database a esquerda,assim que carregar a sua database clique em SQL lá em cima...Aparecerá um espaço em branco lá voce irá add as seguintes tabelas...e depois clicar em Executar.
     
     
     

    CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT '0', `end` BIGINT NOT NULL DEFAULT '0', `frags` INT UNSIGNED NOT NULL DEFAULT '0', `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0', `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0', `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0', `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`) ) ENGINE=InnoDB; ALTER TABLE `guild_wars` ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`; CREATE TABLE IF NOT EXISTS `guild_kills` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `guild_id` INT NOT NULL, `war_id` INT NOT NULL, `death_id` INT NOT NULL ) ENGINE = InnoDB; ALTER TABLE `guild_kills` ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
     
    Para finalizar é necessário que o seu .exe tenha incluído na compilação o parâmetro, -D__WAR_SYSTEM__.
    Como adiciono?
    Para adicionar é necessário ter a source do otserver que você utiliza. Abra a source em um dev-cpp aperte alt+p na coluna paraments add -D__WAR_SYSTEM__ da ok e compila.
     
    Se você não souber compilar existem tutorias bem explicativas que tornam fácil aprender a compilar, veja abaixo:
     
    Compilando no Windows
    Compilando no Linux ubuntu
     
     
    Pronto o Guild Wars System está totalmente instalado!
     
    Para os preguiçosos Ocupados coloquei o download do sistema completo.
     
    Download Aqui
     
    Link do Scan
     
    Creditos: Walef Xavier - War System
    AgaSsI - Tópico original
    Gm Beckman - Completou o tópico
  6. Upvote
    Leoprotons recebeu reputação de Jefferson19921992 em [Encerrado] Database Com Players Inativos   
    Adicione um global event usado no elf war.
     
     
     
    <globalevent name="cleandb" interval="46200" script="dbclean.lua"/>
     
     
    dbclean.lua
     

    -- [[> Automated Database Cleanup 1.1 //By Cybermaster <]] -- -- [[> Function getDBPlayersCount() by Elf <]] -- function getDBPlayersCount() local result = db.getResult("SELECT COUNT(`id`) as `count` FROM `players`;") local tmp = result:getDataInt("count") result:free() return tmp end function onStartup() local DB_BEFORE = getDBPlayersCount() --In each table, players with below specified level, and days of inactivity will be deleted from db on server startup local cleanup = { [1] = {level = 11, time = 5 * 24 * 60 * 60}, [2] = {level = 5000, time = 15 * 24 * 60 * 60}, [3] = {level = 30000, time = 30 * 24 * 60 * 60}, [4] = {level = 50000, time = 60 * 24 * 60 * 60}, [5] = {level = 150000, time = 90 * 24 * 60 * 60} } for i = 1, #cleanup do db.executeQuery("DELETE FROM `players` WHERE `level` < ".. cleanup[i].level .." AND `id` > 6 AND `group_id` < 2 AND `lastlogin` < UNIX_TIMESTAMP() - ".. cleanup[i].time ..";") end local DB_NOW = DB_BEFORE - getDBPlayersCount() if DB_NOW > 0 then local text = ">> [DBCLEANUP] "..DB_NOW.." inactive players have been deleted from database." print("" .. text .. "") local file = io.open("data/logs/db_cleanup.txt", "a") file:write("\n[".. os.date("%d %B %Y %X ", os.time()) .."] "..text.."") file:close() end return true end
  7. Upvote
    Leoprotons deu reputação a Secrets em Secretmind Show Off   
    Treinando Desert

     







     

     

    Críticas, insultos, bans é aqui mesmo.



     
    OBS: Agradeço aos comentários acima.
  8. Upvote
    Leoprotons deu reputação a Natanael Beckman em [Linux] Compilando Em Debian E Ubuntu.   
    FECHA O TOPICO PLZ OU REMOVE!
  9. Upvote
    Leoprotons recebeu reputação de ThiagoADM em Guild War System Com Escudos   
    Bom vamos começar pelo site :
     
     
     
    Vá em Xampp/Htdocs e crie e um arquivo chamado wars.php,dentro add isto:

    <?php $main_content = "<h1 align=\"center\">Guild Wars</h1> <script type=\"text/javascript\"><!-- function show_hide(flip) { var tmp = document.getElementById(flip); if(tmp) tmp.style.display = tmp.style.display == 'none' ? '' : 'none'; } --></script> <a onclick=\"show_hide('information'); return false;\" style=\"cursor: pointer;\"><h1><center>» Click to se the commands «<center></h1></a> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"information\" style=\"display: none;\";> <tr align=\"center\"><b>You must send this commands in GUILD CHAT.</tr> <tr style=\"background: #512e0b;\"><td align=\"center\" class=\"white\"><b>Command</b></td><td colspan=\"2\" align=\"center\" class=\"white\"><b>Description</b></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war invite, guild name, fraglimit</b></td><td>Sends an invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150<BR></font><B>(Invite a guild to war with 150 frags count.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war invite, guild name, fraglimit, money</b></td><td>Send the invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150, 10000</font><br><B> (Invite a guild to war with 150 frags count and payment of 10000 gold coins <- you need donate to guild to use it.)<B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war accept, guild name</b></td><td>Accepts the invitation to start a war. Example: <font color=red><BR>/war accept, Chickens</font><BR><B>(Accept the war against guild \"Chickens\".)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war reject, guild name</b></td><td>Rejects the invitation to start a war. Example: <font color=red><BR>/war reject, Chickens</font><BR><B>(Reject a invitation to war from Chickens.)</B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war cancel, guild name</b></td><td>Cancels the invitation. Example: <font color=red><BR>/war cancel, Chickens</font><br><b>(Cancel my guild invitation to war with Chickens.)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance</b></td><td>See the guild balance - balance of money.</td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/balance donate value</b></td><td>Deposits money on the guild's bank account. All players can donate. Example: <font color=red><BR>/balance donate 100000 </font><BR><B>(You will donate 100k to your guild balance.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance pick value</b></td><td>Withdraws money from the guild's bank account. Can be used only by the guild leader. Example: <font color=red><BR>/balance pick 100000 </font><BR><B>(You will withdraw 100k from your guild balance.)</B></td></tr> </table> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"> <tr> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Aggressor</b></td> <td style=\"background: #512e0b\" class=\"white\"><b>Information</b></td> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Enemy</b></td> </tr><tr style=\"background: #F1E0C6;\">"; $count = 0; foreach($SQL->query('SELECT * FROM `guild_wars` WHERE `status` IN (1,4) OR ((`end` >= (UNIX_TIMESTAMP() - 604800) OR `end` = 0) AND `status` IN (0,5));') as $war) { $a = $ots->createObject('Guild'); $a->load($war['guild_id']); if(!$a->isLoaded()) continue; $e = $ots->createObject('Guild'); $e->load($war['enemy_id']); if(!$e->isLoaded()) continue; $alogo = $a->getCustomField('logo_gfx_name'); if(empty($alogo) || !file_exists('guilds/' . $alogo)) $alogo = 'default_logo.gif'; $elogo = $e->getCustomField('logo_gfx_name'); if(empty($elogo) || !file_exists('guilds/' . $elogo)) $elogo = 'default_logo.gif'; $count++; $main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a></td> <td align=\"center\">"; switch($war['status']) { case 0: { $main_content .= "<b>Pending acceptation</b><br />Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) : "unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.")."<br />Will expire in three days."; break; } case 3: { $main_content .= "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 2: { $main_content .= "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 1: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred; font-weight: bold;\">On a brutal war</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) : "") . ".<br />The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment."); break; } case 4: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred;\">Pending end</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".<br />Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." : "There's no payment set."); break; } case 5: { $main_content .= "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: <span style=\"color: red;\">" . $war['guild_kills'] . "</span> to <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span>."; break; } default: { $main_content .= "Unknown, please contact with gamemaster."; break; } } $main_content .= "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">» Details «</a></td> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$e->getId()."\"><img src=\"guilds/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td> </tr> <tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td colspan=\"3\">"; if(in_array($war['status'], array(1,4,5))) { $deaths = $SQL->query('SELECT `pd`.`id`, `pd`.`date`, `gk`.`guild_id` AS `enemy`, `p`.`name`, `pd`.`level` FROM `guild_kills` gk LEFT JOIN `player_deaths` pd ON `gk`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `gk`.`war_id` = ' . $war['id'] . ' AND `p`.`deleted` = 0 ORDER BY `pd`.`date` DESC')->fetchAll(); if(!empty($deaths)) { foreach($deaths as $death) { $killers = $SQL->query('SELECT `p`.`name` AS `player_name`, `p`.`deleted` AS `player_exists`, `k`.`war` AS `is_war` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `p`.`id` = `pk`.`player_id` WHERE `k`.`death_id` = ' . $death['id'] . ' ORDER BY `k`.`final_hit` DESC, `k`.`id` ASC')->fetchAll(); $count = count($killers); $i = 0; $others = false; $main_content .= date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span> <a href=\"index.php?subtopic=characters&name=" . urlencode($death['name']) . "\"><b>".$death['name']."</b></a> "; foreach($killers as $killer) { $i++; if($killer['is_war'] != 0) { if($i == 1) $main_content .= "killed at level <b>".$death['level']."</b> by "; else if($i == $count && $others == false) $main_content .= " and by "; else $main_content .= ", "; if($killer['player_exists'] == 0) $main_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">"; $main_content .= $killer['player_name']; if($killer['player_exists'] == 0) $main_content .= "</a>"; } else $others = true; if($i == $count) { if($others == true) $main_content .= " and few others"; $main_content .= ".<br />"; } } } } else $main_content .= "<center>There were no frags on this war so far.</center>"; } else $main_content .= "<center>This war did not began yet.</center>"; $main_content .= "</td> </tr>"; } if($count == 0) $main_content .= "<tr style=\"background: ".$config['site']['darkborder'].";\"> <td colspan=\"3\">Currently there are no active wars.</td> </tr>"; $main_content .= "</table>"; $main_content .= '<div align="right"><small><b>Customized by: <a href="http://www.xtibia.com/forum/user/240289-walef-xavier">Walef Xavier</a></b></small></div><br />'; ?>
     
     
     
    Agora vá em Xampp/Htdocs/index.php e add o seguinte:

    case "wars"; $subtopic = "wars"; $topic = "Guild Wars"; include("wars.php"); break;
     
     
    Agora para finalizar a parte do site vá em Xampp/Htdocs/Layout/Tibiacom/layout.php e add o seguinte:

    <a href='?subtopic=wars'> <div id='submenu_wars' 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_polls' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>Guild Wars</font></div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a>
     
     
    Agora vamos para seu Ot:
     
     
     
    Va em GlobalEvents/scripts/start.lua e add o seguinte:

    executeQuery("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") db.executeQuery("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";")
     
     
    Agora vá em Lib e crie um arquivo .lua chamado 101-war,dentro add o seguinte:

    WAR_GUILD = 0 WAR_ENEMY = 1
     
     
    Agora para finalizar vamos colocar os comandos em Talkactions !
     
     
     
    Vá em Talkactions/scripts e crie dois arquivos chamados war.lua e balance.lua,dentro add o seguinte:
     
    War.lua

    function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true
     
     
    balance.lua

    local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(guild == 0) then return false end local t = string.explode(param, ' ', 1) if(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER and isInArray({ 'pick' }, t[1])) then if(t[1] == 'pick') then local money = { tonumber(t[2]) } if(not isValidMoney(money[1])) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end local result = db.getResult('SELECT `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end money[2] = result:getDataLong('balance') result:free() if(money[1] > money[2]) then doPlayerSendChannelMessage(cid, '', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_W, 0) return true end if(not db.query('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) doPlayerSendChannelMessage(cid, '', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_W, 0) else doPlayerSendChannelMessage(cid, '', 'Invalid sub-command.', TALKTYPE_CHANNEL_W, 0) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end if(getPlayerMoney(cid) < money) then doPlayerSendChannelMessage(cid, '', 'You don\'t have enough money.', TALKTYPE_CHANNEL_W, 0) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.query('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') doPlayerSendChannelMessage(cid, '', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_W, 0) else local result = db.getResult('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end doPlayerSendChannelMessage(cid, '', 'Current balance of guild ' .. result:getDataString('name') .. ' is: ' .. result:getDataLong('balance') .. ' bronze coins.', TALKTYPE_CHANNEL_W, 0) result:free() end return true end
     
     
     
    Agora vá em Talkactions/talkactions.xml e add as duas tags:

    <talkaction words="/war" channel="0" event="script" value="war.lua" desc="(Guild channel command) War management."/> <talkaction words="/balance" channel="0" event="script" value="balance.lua" desc="(Guild channel command) Balance management."/>
     
     
     
    Pronto,seu Guild War Systema está instalado...mas para funcionar necessitará das tabelas na sua database e do Tfs 0.4 .Vou posta-los abaixo,respectivamente.
     
    . Tabelas .
     
    Para quem ainda não sabe add tabelas a sua database,vou ensinar:
     
    Acesse seu phpmyadmin,digite sua senha (caso tenha),clique no nome da sua database a esquerda,assim que carregar a sua database clique em SQL lá em cima...Aparecerá um espaço em branco lá voce irá add as seguintes tabelas...e depois clicar em Executar.
     
     
     

    CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT '0', `end` BIGINT NOT NULL DEFAULT '0', `frags` INT UNSIGNED NOT NULL DEFAULT '0', `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0', `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0', `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0', `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`) ) ENGINE=InnoDB; ALTER TABLE `guild_wars` ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`; CREATE TABLE IF NOT EXISTS `guild_kills` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `guild_id` INT NOT NULL, `war_id` INT NOT NULL, `death_id` INT NOT NULL ) ENGINE = InnoDB; ALTER TABLE `guild_kills` ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
     
    Para finalizar é necessário que o seu .exe tenha incluído na compilação o parâmetro, -D__WAR_SYSTEM__.
    Como adiciono?
    Para adicionar é necessário ter a source do otserver que você utiliza. Abra a source em um dev-cpp aperte alt+p na coluna paraments add -D__WAR_SYSTEM__ da ok e compila.
     
    Se você não souber compilar existem tutorias bem explicativas que tornam fácil aprender a compilar, veja abaixo:
     
    Compilando no Windows
    Compilando no Linux ubuntu
     
     
    Pronto o Guild Wars System está totalmente instalado!
     
    Para os preguiçosos Ocupados coloquei o download do sistema completo.
     
    Download Aqui
     
    Link do Scan
     
    Creditos: Walef Xavier - War System
    AgaSsI - Tópico original
    Gm Beckman - Completou o tópico
  10. Upvote
    Leoprotons recebeu reputação de wane em [Encerrado] Ajudaa Ganha Rep +++++ Demon Oak Quest   
    Posta o script, e ja que esta envolvendo positions ali posta as de onde você está, porque ta meio estranho aquilo ali de
     

    X: 32716 Y: 32342 Z:7
  11. Upvote
    Leoprotons recebeu reputação de wane em Guild War System Com Escudos   
    Bom vamos começar pelo site :
     
     
     
    Vá em Xampp/Htdocs e crie e um arquivo chamado wars.php,dentro add isto:

    <?php $main_content = "<h1 align=\"center\">Guild Wars</h1> <script type=\"text/javascript\"><!-- function show_hide(flip) { var tmp = document.getElementById(flip); if(tmp) tmp.style.display = tmp.style.display == 'none' ? '' : 'none'; } --></script> <a onclick=\"show_hide('information'); return false;\" style=\"cursor: pointer;\"><h1><center>» Click to se the commands «<center></h1></a> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"information\" style=\"display: none;\";> <tr align=\"center\"><b>You must send this commands in GUILD CHAT.</tr> <tr style=\"background: #512e0b;\"><td align=\"center\" class=\"white\"><b>Command</b></td><td colspan=\"2\" align=\"center\" class=\"white\"><b>Description</b></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war invite, guild name, fraglimit</b></td><td>Sends an invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150<BR></font><B>(Invite a guild to war with 150 frags count.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war invite, guild name, fraglimit, money</b></td><td>Send the invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150, 10000</font><br><B> (Invite a guild to war with 150 frags count and payment of 10000 gold coins <- you need donate to guild to use it.)<B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war accept, guild name</b></td><td>Accepts the invitation to start a war. Example: <font color=red><BR>/war accept, Chickens</font><BR><B>(Accept the war against guild \"Chickens\".)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war reject, guild name</b></td><td>Rejects the invitation to start a war. Example: <font color=red><BR>/war reject, Chickens</font><BR><B>(Reject a invitation to war from Chickens.)</B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war cancel, guild name</b></td><td>Cancels the invitation. Example: <font color=red><BR>/war cancel, Chickens</font><br><b>(Cancel my guild invitation to war with Chickens.)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance</b></td><td>See the guild balance - balance of money.</td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/balance donate value</b></td><td>Deposits money on the guild's bank account. All players can donate. Example: <font color=red><BR>/balance donate 100000 </font><BR><B>(You will donate 100k to your guild balance.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance pick value</b></td><td>Withdraws money from the guild's bank account. Can be used only by the guild leader. Example: <font color=red><BR>/balance pick 100000 </font><BR><B>(You will withdraw 100k from your guild balance.)</B></td></tr> </table> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"> <tr> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Aggressor</b></td> <td style=\"background: #512e0b\" class=\"white\"><b>Information</b></td> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Enemy</b></td> </tr><tr style=\"background: #F1E0C6;\">"; $count = 0; foreach($SQL->query('SELECT * FROM `guild_wars` WHERE `status` IN (1,4) OR ((`end` >= (UNIX_TIMESTAMP() - 604800) OR `end` = 0) AND `status` IN (0,5));') as $war) { $a = $ots->createObject('Guild'); $a->load($war['guild_id']); if(!$a->isLoaded()) continue; $e = $ots->createObject('Guild'); $e->load($war['enemy_id']); if(!$e->isLoaded()) continue; $alogo = $a->getCustomField('logo_gfx_name'); if(empty($alogo) || !file_exists('guilds/' . $alogo)) $alogo = 'default_logo.gif'; $elogo = $e->getCustomField('logo_gfx_name'); if(empty($elogo) || !file_exists('guilds/' . $elogo)) $elogo = 'default_logo.gif'; $count++; $main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a></td> <td align=\"center\">"; switch($war['status']) { case 0: { $main_content .= "<b>Pending acceptation</b><br />Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) : "unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.")."<br />Will expire in three days."; break; } case 3: { $main_content .= "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 2: { $main_content .= "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 1: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred; font-weight: bold;\">On a brutal war</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) : "") . ".<br />The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment."); break; } case 4: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred;\">Pending end</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".<br />Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." : "There's no payment set."); break; } case 5: { $main_content .= "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: <span style=\"color: red;\">" . $war['guild_kills'] . "</span> to <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span>."; break; } default: { $main_content .= "Unknown, please contact with gamemaster."; break; } } $main_content .= "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">» Details «</a></td> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$e->getId()."\"><img src=\"guilds/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td> </tr> <tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td colspan=\"3\">"; if(in_array($war['status'], array(1,4,5))) { $deaths = $SQL->query('SELECT `pd`.`id`, `pd`.`date`, `gk`.`guild_id` AS `enemy`, `p`.`name`, `pd`.`level` FROM `guild_kills` gk LEFT JOIN `player_deaths` pd ON `gk`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `gk`.`war_id` = ' . $war['id'] . ' AND `p`.`deleted` = 0 ORDER BY `pd`.`date` DESC')->fetchAll(); if(!empty($deaths)) { foreach($deaths as $death) { $killers = $SQL->query('SELECT `p`.`name` AS `player_name`, `p`.`deleted` AS `player_exists`, `k`.`war` AS `is_war` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `p`.`id` = `pk`.`player_id` WHERE `k`.`death_id` = ' . $death['id'] . ' ORDER BY `k`.`final_hit` DESC, `k`.`id` ASC')->fetchAll(); $count = count($killers); $i = 0; $others = false; $main_content .= date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span> <a href=\"index.php?subtopic=characters&name=" . urlencode($death['name']) . "\"><b>".$death['name']."</b></a> "; foreach($killers as $killer) { $i++; if($killer['is_war'] != 0) { if($i == 1) $main_content .= "killed at level <b>".$death['level']."</b> by "; else if($i == $count && $others == false) $main_content .= " and by "; else $main_content .= ", "; if($killer['player_exists'] == 0) $main_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">"; $main_content .= $killer['player_name']; if($killer['player_exists'] == 0) $main_content .= "</a>"; } else $others = true; if($i == $count) { if($others == true) $main_content .= " and few others"; $main_content .= ".<br />"; } } } } else $main_content .= "<center>There were no frags on this war so far.</center>"; } else $main_content .= "<center>This war did not began yet.</center>"; $main_content .= "</td> </tr>"; } if($count == 0) $main_content .= "<tr style=\"background: ".$config['site']['darkborder'].";\"> <td colspan=\"3\">Currently there are no active wars.</td> </tr>"; $main_content .= "</table>"; $main_content .= '<div align="right"><small><b>Customized by: <a href="http://www.xtibia.com/forum/user/240289-walef-xavier">Walef Xavier</a></b></small></div><br />'; ?>
     
     
     
    Agora vá em Xampp/Htdocs/index.php e add o seguinte:

    case "wars"; $subtopic = "wars"; $topic = "Guild Wars"; include("wars.php"); break;
     
     
    Agora para finalizar a parte do site vá em Xampp/Htdocs/Layout/Tibiacom/layout.php e add o seguinte:

    <a href='?subtopic=wars'> <div id='submenu_wars' 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_polls' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>Guild Wars</font></div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a>
     
     
    Agora vamos para seu Ot:
     
     
     
    Va em GlobalEvents/scripts/start.lua e add o seguinte:

    executeQuery("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") db.executeQuery("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";")
     
     
    Agora vá em Lib e crie um arquivo .lua chamado 101-war,dentro add o seguinte:

    WAR_GUILD = 0 WAR_ENEMY = 1
     
     
    Agora para finalizar vamos colocar os comandos em Talkactions !
     
     
     
    Vá em Talkactions/scripts e crie dois arquivos chamados war.lua e balance.lua,dentro add o seguinte:
     
    War.lua

    function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true
     
     
    balance.lua

    local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(guild == 0) then return false end local t = string.explode(param, ' ', 1) if(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER and isInArray({ 'pick' }, t[1])) then if(t[1] == 'pick') then local money = { tonumber(t[2]) } if(not isValidMoney(money[1])) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end local result = db.getResult('SELECT `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end money[2] = result:getDataLong('balance') result:free() if(money[1] > money[2]) then doPlayerSendChannelMessage(cid, '', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_W, 0) return true end if(not db.query('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) doPlayerSendChannelMessage(cid, '', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_W, 0) else doPlayerSendChannelMessage(cid, '', 'Invalid sub-command.', TALKTYPE_CHANNEL_W, 0) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end if(getPlayerMoney(cid) < money) then doPlayerSendChannelMessage(cid, '', 'You don\'t have enough money.', TALKTYPE_CHANNEL_W, 0) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.query('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') doPlayerSendChannelMessage(cid, '', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_W, 0) else local result = db.getResult('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end doPlayerSendChannelMessage(cid, '', 'Current balance of guild ' .. result:getDataString('name') .. ' is: ' .. result:getDataLong('balance') .. ' bronze coins.', TALKTYPE_CHANNEL_W, 0) result:free() end return true end
     
     
     
    Agora vá em Talkactions/talkactions.xml e add as duas tags:

    <talkaction words="/war" channel="0" event="script" value="war.lua" desc="(Guild channel command) War management."/> <talkaction words="/balance" channel="0" event="script" value="balance.lua" desc="(Guild channel command) Balance management."/>
     
     
     
    Pronto,seu Guild War Systema está instalado...mas para funcionar necessitará das tabelas na sua database e do Tfs 0.4 .Vou posta-los abaixo,respectivamente.
     
    . Tabelas .
     
    Para quem ainda não sabe add tabelas a sua database,vou ensinar:
     
    Acesse seu phpmyadmin,digite sua senha (caso tenha),clique no nome da sua database a esquerda,assim que carregar a sua database clique em SQL lá em cima...Aparecerá um espaço em branco lá voce irá add as seguintes tabelas...e depois clicar em Executar.
     
     
     

    CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT '0', `end` BIGINT NOT NULL DEFAULT '0', `frags` INT UNSIGNED NOT NULL DEFAULT '0', `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0', `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0', `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0', `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`) ) ENGINE=InnoDB; ALTER TABLE `guild_wars` ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`; CREATE TABLE IF NOT EXISTS `guild_kills` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `guild_id` INT NOT NULL, `war_id` INT NOT NULL, `death_id` INT NOT NULL ) ENGINE = InnoDB; ALTER TABLE `guild_kills` ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
     
    Para finalizar é necessário que o seu .exe tenha incluído na compilação o parâmetro, -D__WAR_SYSTEM__.
    Como adiciono?
    Para adicionar é necessário ter a source do otserver que você utiliza. Abra a source em um dev-cpp aperte alt+p na coluna paraments add -D__WAR_SYSTEM__ da ok e compila.
     
    Se você não souber compilar existem tutorias bem explicativas que tornam fácil aprender a compilar, veja abaixo:
     
    Compilando no Windows
    Compilando no Linux ubuntu
     
     
    Pronto o Guild Wars System está totalmente instalado!
     
    Para os preguiçosos Ocupados coloquei o download do sistema completo.
     
    Download Aqui
     
    Link do Scan
     
    Creditos: Walef Xavier - War System
    AgaSsI - Tópico original
    Gm Beckman - Completou o tópico
  12. Upvote
    Leoprotons deu reputação a felipaoo em Treinando Sem Tedio   
    ola pessoal hj venho aqui postar 100 maneiras de treinar um knight sem nenhum tédio.
     
     
    100 Coisas para tornar seu treino mais legal e rápido.
     
    1.Leia tópicos sobre sua vocação e sobre noticias >>> Ler tópicos sobre sua vocação aumenta sua experiência teórica, alem de lhe ajudar a descobrir coisas novas que você podia não saber. A melhor dica seria: Leia o jornal de rookgard. xD
     
    2.Ver TV. >>> A maioria dos jogadores tem perto deles uma das maiores armas contra o tédio e não se dão conta! Tanto pra você que tem o pc na sala quanto no quarto (e tenha uma tv no quarto é lógico!) Pode desfrutar dessa arma!
     
    3.Fazer as atividades escolares. >>> As famosas "Tarefinhas de casa" são realmente um pé no saco de qualquer um... POREM, Eu garanto a todos vocês que na frente do pc elas ficam mais rápidas e interessantes sim! Tente ao menos uma vez fazer o teste.
     
    4.Jogar outros jogos. >>> Isso pode se tornar meio perigoso no caso de outro MMORPG... mas usem e abusem dos jogos em flash! Jogos em flash e jogos de celular são ótimos pra passar o tempo! *Alem da maioria ser engraçado!
     
    5.MSN. >>> Bom... esse e o inimigo numero 1 do relógio! Então não seja anti-social, ligue o MSN e COLOQUE EM ONLINE! ^^ "A maioria põe em Aparecer offline"
     
    6.Orkut. >>> Boa dica também... porém pode durar muito pouco dependendo de como você usa e como socializa!
     
    7.Ouça e entenda musica. >>> Como assim entenda a musica? te explico... sabe aquela musica que você simplesmente adora o ritmo mais a letra sai no "embromation"? Procure saber o que as musicas que você escuta dizem e acima de tudo saibam a letra!
     
    8.Abra a tabela de criaturas TibiaBR. >>> Leia as criaturas que você sempre quis matar, veja loot's que você não sabia que eram dropados e etç. Enfim informação e experiência nunca é demais.
     
    9.Crie ou reforme tópicos interessantes >>> Isso mesmo! não seja preguiçoso. Reformei este tópico enquanto estava treinando! Me rendeu 2 horas livre do tédio!
     
    10.Arrume o local. >>> Eu sei. a maioria odeia isso... quer saber porque? por que nunca experimentou! a sensação de que você serve pra algo é gratificante! XD
     
    11.Leia o trade. >>> Se informe de futuros gastos e se possível crie um calculo! Acima de tudo... é legal se informar de vez em quando! ^^
     
    12.Cyanide and Happines. >>> Pra quem não conhece, São as famosas tirinhas de bonequinhos de paint. Perdi 7 horas lendo isso! http://cyanidehappin....*************/
     
    13.Consoles. >>> Você tem um PS2? que ta fazendo olhando o treino? Vai jogar! ^^ *Volte periodicamente pra não deixar o char à-toa*
     
    14.Mercado livre. >>> Da pra perder horas sonhando lá! Procure por coisas inusitadas que não tem como comprar ali na esquina! Se esta sem criatividade aconselho começar por *Shuriken ou Espada*
     
    15.Hidrate-se. >>> Não to falando de hidratante corporal não! Beba bastante água... alem de fazer bem, você não vai perceber que ta bebendo!
     
    16.Quebre recordes. >>> Pense em recordes que ninguém nunca tenha quebrado! Como maior tempo sem piscar o olho ou copo de coca-cola em um gole! *Cuidado com essa dica.*
     
    17.Treine Algo. >>> Alem de treinar seu char... se treine em algo! aprenda algo novo... Recomendo design.. Photoshop tira o tédio alem de te dar uma assinatura nova no fórum!
     
    18.Converse no tibia. >>> Fale com sua Vip list, Não seja ignorante com aquele que desceu em sua cave mais não matou nada até agora. Faça novas amizades no tibia!
     
    19.Olhe para o tibia. >>> Tem muita gente que mesmo treinando faz 1000 de coisas no tibia! Só não sei qual o prazer que eles vêem em rodar enquanto treinam ou pescar sem worm!
     
    20.Arrume uma namorada(o). >>> Se não tem... pense que já esta na hora de ter né?
     
    21.Leia um livro. >>> Não vou dar uma de cidadão exemplo.... mais se tiver um livro sobrando e interessante, Leia-o!
     
    22.Escreva. >>> Abra o Word. pense em um dilema ou situação engraçada ou que te aflinge... enfim escreva disparadamente no Word. Isso pode se torna algo de que você se orgulhe um dia! *ou só mais um livro de piadas mal vendido! XD*
     
    23.Valorize seu char. >>> Você se dedicou tanto com ele... porque não cuidar do coitado como um filho? Cria um fotolog pra ele... ou tira umas screens legais pra se lembrar dele! ^^
     
    24.Atenda a suas necessidades. >>> Tem gente que acha que se for ao banheiro, vai morrer. Não estamos no cs nem ao menos na Fy_pool_day meus amigos! Não tem um camper de doze no banheiro te esperando.
     
    25.Conheça coisas novas. >>> Sabe aquela banda que seu amigo disse... "Escute é massa!" e você pensou "Não tenho tempo nem quero!" Agora não tem mais desculpa! Vai que você acaba virando fan de uma banda nova?
     
    26.Faça NO TIBIA. >>> Tem gente que não consegue treinar fazendo outra coisa... prefere olhar pro tibia! Então pra passar o tempo sem sair do tibia... Crie novas Desenhos-Hotkeys, de exiva no pessoal e etç.
     
    27.Coma. >>> Vá comer algo na cozinha! aproveita e pega um biscoito pra mim ta? XD
     
    28.Game-Chat >>> Abra alem do trade, o game chat! de lá saem perolas que você nem imagina! ^^
     
    29.(Premmy)Vire Tutor. >>> 3 Motivos? 1. Você não vai perder nada tentando nem virando. 2. A única diferença vai ser o Help aberto pra responder. 3.Você pode continuar jogando com seu char normalmente!
     
    30.Vire premmy. >>> Junte aquela mini-mini-mini-grana que você ganha com trocos, Tempo em lan house tendo pc em casa e etç. Um dia vai dar pra uma premmy!
     
    31.Organize seu PC. >>> Arrume a desktop, menus, pastas e deixe tudo como se fosse pc de empresa! Fora que mudar essa skin azul ou cinza do XP seria uma boa né?
     
    32.Arrume o quarto. >>> Não custa nada né? vai dizer que você fica cansado com arruma um quarto? (....)
     
    33.Veja um Filme ou Anime >>> Se tem algum filme ou anime sobrando no pc, diminua a tela do player e assista! *Não aconselho baixar com tibia aberto*
     
    34.Faça piadas com amigos IN-GAME. >>> Faça aquele velho escândalo de... PK! PK! FU***! e depois diga que foi tudo brincadeira! ^^
     
    35.Olhe seu Horóscopo. >>> Se você acredita, vá em frente! ^^
     
    36.Telefone. >>> Cuidado! apesar de uma arma ótima contra o tédio, pode ser caríssima!
     
    37.Veja um Site de noticias Absurdas. >>> Aquelas do tipo... anão vestido de palhaço mata 6! Ou... Elefante faz família refém num carro! xD
     
    38.Game-boy ou Nintendo-DS >>> Tem? Use.
     
    39.Avalie esse tópico!
     
    40.Organize-se! >>> Sabe quais são as aulas de amanhã já? Já pos a farda pra lavar? Já tomou o remédio? Pois é...
     
    41.Conheça as novidades da atualidade! >>> Saiba se aquele jogo antigão da Nintendo vai ser reformulado num 3d.... saiba se existem placas 3D de 2GB ou é só mito, Saiba quando sai o novo update do tibia e etç!
     
    42.Jogue algo que exija coordenação motora. >>> Gunz, ou Guitar Hero são ótimos pra te deixar rápido no gatilho! ^^
     
    43.Youtube. >>> Arma poderosa contra o tédio!
     
    44.Encha o saco. >>> Vá num chat da uol... e ENCHA O SACO! ^^
     
    45.Veja vídeos do tibia. >>> Aumenta sua experiência! Youtube, e outros sites alheios tem muitos videos interessantes!
     
    46.Neologismo. >>> Não sabe o que é? vá estudar português! Dai quando souber... faça! É engraçado!
     
    47.Desenhe no paint. >>> Sempre sai besteira quando se desenha no paint! xD
     
    48.War-online/Banco imobiliário *On-line* >>> Sem coments.
     
    49.Paciência ou Campo minado >>> Há gosto pra tudo.
     
    50.Ligue 0800 >>> Elma-chips, Coca-Cola e etç! as atendentes vão te odiar por isso... mais quem liga?! xD
     
    51.Jogos em sites de humor. >>> Tente um show da espiga da vida! Ou jogo da Forca
     
    52.Dar uma olhada na rua. >>> Pega um ar, da uma olhada no movimento, se espreguiça e etç.
     
    53.Trote *APENAS PARA AMIGOS!* >>> É engraçado se usado com boa intenção.
     
    54.Chame um amigo seu para sua casa. >>> Eu poderia dizer... "E coloque-o no PC pra treinar por você! mais deixa quieto...
     
    55.Montagens. >>> Rende muita polemica e é engraçada!
     
    56.Mover coisas com a força do pensamento. >>> Ham?!?!
     
    57.Desenhe! >>> Como eu já disse... treine você mesmo enquanto treina o char! Uma folha + uma caneta ou lápis e PUF! Um desenho escroto! ^^
     
    58.Aprenda a tocar instrumentos musicais. >>> Duuh? Aprenda ue! o Chimbinha é autodidata!
     
    59.Ouça radio.
     
    60.Leia um mangá.
     
    61.Mude o outfit do seu char. >>> Eu tenho compulsão por isso... Mudo de outfit cada vez que eu treino.
     
    62.Crie parodias para o Tibia. >>> O que tem de gente famosa por fazer parodias como a épica Cavaleiros do tibia e etç! XD
     
    63.Crie uma tirinha no paint. >>> Tente ser sarcástico! sarcasmo sempre da graça!
     
    64.Planeje sair. >>> Convide os amigos pra sair pra algum lugar! planeje algo diferente.
     
    65.Aprenda a fazer Gifs. >>> Existe muiiiito gif sem noção por ai! crie o seu enquanto ta Treinando ué!
     
    66.Leia Desciclopedia >>> Garanto que vai ser uma experiência única! Tem de tudo lá. http://desciclo.pedi...1gina_principal
     
    67.Comprar itens no trade. >>> Quando já tiver quase pegando skill que deseja... negocie no trade!
     
    68.Reflita >>> Porque você escolheu essa vocação no tibia? porque GS mudou da skin aterrorizadora que dava medo pra essa que parece um bixo de pelúcia? Porque só existe um BK em todo tibia?
     
    69.Higiene >>> Corte as unhas! Escove os dentes!
     
    70. <<< Significa que faltam 30! ^^
     
    71.Grave cds de musica >>> Não é todo mundo que tem uma caixinha de som boa no pc. Então pra ouvir alto suas musicas... grave as para um cd!
     
    72.Aprenda Inglês. >>> Acha que é suficiente falar: "Hi, Change gold, 10, yes, bye" ? Mothafocka whatahell are u waiting?
     
    73.Planejar o domínio do mundo.
     
    74.Planejar um modo de entrar pra Enciclopédia de Knights!
     
    75.Limpe os periféricos. >>> Computador não é liquidificador! Não tem auto-clear! Então não queira que aquele(a) garota(o) chegue na sua casa e tenha má impressão SÓ DE OLHAR PRO SEU TECLADO!
     
    76.Perca tempo. >>> Não fique vendo o tempo passar! perca ele com algo interessante.
     
    77.Ver o Pskonejott. >>> Diz o tempo total on-line do char.
     
    78.Jogar Emuladores. >>> Não tente um emulador de ps2. Use o velho e bom SNES que nos beneficia com seus famosos Bomber-mans e Mario's alheios!
     
    79.Perca tempo com tópicos grandes como esse. >>> Se você não percebeu você já perdeu um bom tempo lendo até aqui...
     
    80.Cruzadinhas. >>> http://www.coquetel.com.br/
     
    81.SMS >>> Mande uma mensagem pro celular daquela gata(o) que você ta afim. Pode não mudar muita coisa mais nosso objetivo aqui não é o amor! E sim o tempo!
     
    82.Use Skype. >>> Muita gente não conhece, mais é parecido com TS só que serve pra conversar como telefone! É ótimo pra fazer amizades novas!
     
    83.Organize-se.[2] >>> Tem uma coleção de algo guardada? Cartas de Yu-gi-oh jogadas por ai? Cds? Organize-os em ordem alfabética ou como quiser!
     
    84.Cinema. >>> Ir ao cinema é muito bom! mais sem um filme legal não rola. Ainda mais se for levar alguém junto! Então procure na net os lançamentos no cinema!
     
    85.MIrc. >>> É ótimo... se achar um canal de tibia então perfeito! junta 4 knights treinando pra conversar besteira!
     
    86.Evite olhar pra porcentagem das skills.
     
    87.Calcule o tempo contando os segundos de 1 porcentagem pra outra e faça tudo na calculadora.
     
    88.Whispar High-levels do seu server. >>> Cuidado pra não pegar um hunted! ^^
     
    89.Aprender Culinária. >>> Aprenda a fazer um miojo mais requintado! Saiba cozinhar um ovo e não esquecer o sal... e etç!
     
    90.Tome Banho. >>> Se tiver certeza que consegue fazer essa façanha antes que o bixo morra... ótimo! XD
     
    91.Leia mais sobre o tibia. >>> Muita gente joga tibia porque os outros amigos jogam. 70% não conhece as historias do tibia! Procure saber sobre a historia das city's e das áreas que você hunt!
     
    92.Procure seu nick no Google.com >>> Já achei muita coisa que eu nem lembrava e também algumas coisas absurdas!
     
    93.Evite tomar café para ficar acordado treinando. >>> Café só funciona se você ainda não estiver com sono. Se você tomar com sono, você ira despertar por 15 a 30 minutos e o sono voltará!
     
    94.Se tiver um animal, Brinque com ele. >>> Faça carinho no seu animal, de comida a ele ou simplesmente corra pela casa com ele!
     
    95.Faça uma coisa de cada vez. >>> Ficar saindo e voltando pra o pc no treino é cansativo... então programa-se e faça primeiro as coisas na frente do pc. Depois faça as fora.
     
    96.Viaje. >>> Metade dos que treinam... simplesmente ficam viajando enquanto treinam... pensam 10000 de coisas bizarras como: Qual seria meu nome se eu pudesse escolher? Será que alguém além de mim ta pensando e fazendo a mesma coisa no mundo?
     
    97.Tenha paciência. >>> Se você ficar pensando em caçar a cada 1 skill vai perder a vontade de treinar. Pense o quão gratificante será depois do treino!
     
    98.Equipe-se Mentalmente. >>> A grande maioria dos Knights que passam muito tempo treinando são os knights level 20- . Então a maioria ainda nem se equipou e ta com pouca grana. Então para passar o tempo, crie uma tabela de equipamentos (Ou até mesmo uma tabela de skills) De acordo com cada level e dinheiro que você tiver. Não esqueça de adcionar os famosos 10k's ;D
     
    99.Evite ser Ignorante. >>> Já vi muito player que por ser ignorante com o outro acaba morto. Se alguém entrar na sua cave achando que ta vazia, seja legal com o individuo. Caso contrario ele pode se irritar e ir pro pau!
     
    100. abra oxtibia e tire suas curiosidades depois de REP + naqueles que vc gostar afinal n custa nada
     
    Te dei alguma ajuda dê REP + pois como eu disse n custa nada
  13. Upvote
    Leoprotons recebeu reputação de DaNDaNrOxX em [Fechado]   
    Área incorreta, reportado para moverem.
  14. Upvote
    Leoprotons recebeu reputação de wllc em Ajuda Com Erro:can't Connect To Mysql Database.   
    Bom, não estou vendo problemas nestas configurações ai, mais tente se apegar a detalhes, por exemplo
     
    tente trocar ali no conf.lua onde esta "sqlHost = "127.0.0.1"
    ou também ali no nome da sua DB em um ta "global server" com letra inicial minuscula e no outro ta "Global server" com letra inicial maiúscula..
     
    Pode ajudar também se você disser qual shamp você utiliza..
  15. Upvote
    Leoprotons recebeu reputação de Ripags em Guild War System Tfs 0.4   
    Bom axo que deveria ter procurado antes de comprar, a alguns dias que postei um War System, se não esta igual, esta muito próximo.
     
    Topico War System
     
     
     
    além do que esta faltando uma parte
     

    -D__WAR_SYSTEM__
     
    flz abraço
  16. Upvote
    Leoprotons deu reputação a AdminNecrox em Mudar De Cargo Com Item   
    Iae galera vou lhes ensinar nesse tópico a criar um item que pode mudar o cargo do player que usá-lo.


    Eu não sei se já existe um tutorial desses, mas vamos lá né.

     

    O que exatamente o script faz?

    O script é uma action que ao usar um determinado item, o player mudará de cargo. Ex: De player para Tutor, Gm. Fica a sua escolha.

     

    O script é dificil de se entender?

    Não. O script é totalmente facil de se editar.

     

    Parte 1

     

    Primeiramente vamos escolher um item para fazer o script. Lembre-se que o Item que você escolheu não deve cair em loots, achar em quest ou outros.

    Ficará apenas prioritário de um ADM.

    Aqui eu escolhi esse (You see a document. It weighs 1.50 oz. ItemID: 1952.)

    Pode usar outro se quiser.

     

    Okey depois de ter escolhido o item, vá na pasta do seu OT/Data/Actions/scripts. Lá crie um arquivo chamado:

    Postchange.lua e adcione isto:

       

     

    Verde: Aqui é uma linha que mudará o nome do char que usar o item. Caso não queira é so apagar.

    Agora Salve e feiche.

    Após ter feito isso abra o actions.xml e no final uma linha antes de </actions> adcione isso:

     
     

    Vamos ver o resultado:

    Antes de Usar.
     

    Quando Usado.
     

    Resultado Final.
     

     

    Bom espero ter ajudado.

    Créditos: Eu por ter feito tudo.

    Att.

  17. Upvote
    Leoprotons recebeu reputação de gustavoMtek em Guild War System Com Escudos   
    Bom vamos começar pelo site :
     
     
     
    Vá em Xampp/Htdocs e crie e um arquivo chamado wars.php,dentro add isto:

    <?php $main_content = "<h1 align=\"center\">Guild Wars</h1> <script type=\"text/javascript\"><!-- function show_hide(flip) { var tmp = document.getElementById(flip); if(tmp) tmp.style.display = tmp.style.display == 'none' ? '' : 'none'; } --></script> <a onclick=\"show_hide('information'); return false;\" style=\"cursor: pointer;\"><h1><center>» Click to se the commands «<center></h1></a> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\" id=\"information\" style=\"display: none;\";> <tr align=\"center\"><b>You must send this commands in GUILD CHAT.</tr> <tr style=\"background: #512e0b;\"><td align=\"center\" class=\"white\"><b>Command</b></td><td colspan=\"2\" align=\"center\" class=\"white\"><b>Description</b></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war invite, guild name, fraglimit</b></td><td>Sends an invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150<BR></font><B>(Invite a guild to war with 150 frags count.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war invite, guild name, fraglimit, money</b></td><td>Send the invitation to start the war. Example: <font color=red><BR>/war invite, Chickens, 150, 10000</font><br><B> (Invite a guild to war with 150 frags count and payment of 10000 gold coins <- you need donate to guild to use it.)<B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war accept, guild name</b></td><td>Accepts the invitation to start a war. Example: <font color=red><BR>/war accept, Chickens</font><BR><B>(Accept the war against guild \"Chickens\".)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/war reject, guild name</b></td><td>Rejects the invitation to start a war. Example: <font color=red><BR>/war reject, Chickens</font><BR><B>(Reject a invitation to war from Chickens.)</B></td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/war cancel, guild name</b></td><td>Cancels the invitation. Example: <font color=red><BR>/war cancel, Chickens</font><br><b>(Cancel my guild invitation to war with Chickens.)</b></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance</b></td><td>See the guild balance - balance of money.</td></tr> <tr style=\"background: #F1E0C6;\"><td><b>/balance donate value</b></td><td>Deposits money on the guild's bank account. All players can donate. Example: <font color=red><BR>/balance donate 100000 </font><BR><B>(You will donate 100k to your guild balance.)</B></td></tr> <tr style=\"background: #D4C0A1;\"><td><b>/balance pick value</b></td><td>Withdraws money from the guild's bank account. Can be used only by the guild leader. Example: <font color=red><BR>/balance pick 100000 </font><BR><B>(You will withdraw 100k from your guild balance.)</B></td></tr> </table> <table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\"> <tr> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Aggressor</b></td> <td style=\"background: #512e0b\" class=\"white\"><b>Information</b></td> <td style=\"background: #512e0b\" class=\"white\" width=\"150\"><b>Enemy</b></td> </tr><tr style=\"background: #F1E0C6;\">"; $count = 0; foreach($SQL->query('SELECT * FROM `guild_wars` WHERE `status` IN (1,4) OR ((`end` >= (UNIX_TIMESTAMP() - 604800) OR `end` = 0) AND `status` IN (0,5));') as $war) { $a = $ots->createObject('Guild'); $a->load($war['guild_id']); if(!$a->isLoaded()) continue; $e = $ots->createObject('Guild'); $e->load($war['enemy_id']); if(!$e->isLoaded()) continue; $alogo = $a->getCustomField('logo_gfx_name'); if(empty($alogo) || !file_exists('guilds/' . $alogo)) $alogo = 'default_logo.gif'; $elogo = $e->getCustomField('logo_gfx_name'); if(empty($elogo) || !file_exists('guilds/' . $elogo)) $elogo = 'default_logo.gif'; $count++; $main_content .= "<tr style=\"background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$a->getId()."\"><img src=\"guilds/".$alogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$a->getName()."</a></td> <td align=\"center\">"; switch($war['status']) { case 0: { $main_content .= "<b>Pending acceptation</b><br />Invited on " . date("M d Y, H:i:s", $war['begin']) . " for " . ($war['end'] > 0 ? (($war['end'] - $war['begin']) / 86400) : "unspecified") . " days. The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment.")."<br />Will expire in three days."; break; } case 3: { $main_content .= "<s>Canceled invitation</s><br />Sent invite on " . date("M d Y, H:i:s", $war['begin']) . ", canceled on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 2: { $main_content .= "Rejected invitation<br />Invited on " . date("M d Y, H:i:s", $war['begin']) . ", rejected on " . date("M d Y, H:i:s", $war['end']) . "."; break; } case 1: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred; font-weight: bold;\">On a brutal war</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ($war['end'] > 0 ? ", will end up at " . date("M d Y, H:i:s", $war['end']) : "") . ".<br />The frag limit is set to " . $war['frags'] . " frags, " . ($war['payment'] > 0 ? "with payment of " . $war['payment'] . " bronze coins." : "without any payment."); break; } case 4: { $main_content .= "<font size=\"6\"><span style=\"color: red;\">" . $war['guild_kills'] . "</span> : <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span></font><br /><br /><span style=\"color: darkred;\">Pending end</span><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", signed armstice on " . date("M d Y, H:i:s", $war['end']) . ".<br />Will expire after reaching " . $war['frags'] . " frags. ".($war['payment'] > 0 ? "The payment is set to " . $war['payment'] . " bronze coins." : "There's no payment set."); break; } case 5: { $main_content .= "<i>Ended</i><br />Began on " . date("M d Y, H:i:s", $war['begin']) . ", ended on " . date("M d Y, H:i:s", $war['end']) . ". Frag statistics: <span style=\"color: red;\">" . $war['guild_kills'] . "</span> to <span style=\"color: lime;\">" . $war['enemy_kills'] . "</span>."; break; } default: { $main_content .= "Unknown, please contact with gamemaster."; break; } } $main_content .= "<br /><br /><a onclick=\"show_hide('war-details:" . $war['id'] . "'); return false;\" style=\"cursor: pointer;\">» Details «</a></td> <td align=\"center\"><a href=\"?subtopic=guilds&action=show&guild=".$e->getId()."\"><img src=\"guilds/".$elogo."\" width=\"64\" height=\"64\" border=\"0\"/><br />".$e->getName()."</a></td> </tr> <tr id=\"war-details:" . $war['id'] . "\" style=\"display: none; background: " . (is_int($count / 2) ? $config['site']['darkborder'] : $config['site']['lightborder']) . ";\"> <td colspan=\"3\">"; if(in_array($war['status'], array(1,4,5))) { $deaths = $SQL->query('SELECT `pd`.`id`, `pd`.`date`, `gk`.`guild_id` AS `enemy`, `p`.`name`, `pd`.`level` FROM `guild_kills` gk LEFT JOIN `player_deaths` pd ON `gk`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `gk`.`war_id` = ' . $war['id'] . ' AND `p`.`deleted` = 0 ORDER BY `pd`.`date` DESC')->fetchAll(); if(!empty($deaths)) { foreach($deaths as $death) { $killers = $SQL->query('SELECT `p`.`name` AS `player_name`, `p`.`deleted` AS `player_exists`, `k`.`war` AS `is_war` FROM `killers` k LEFT JOIN `player_killers` pk ON `k`.`id` = `pk`.`kill_id` LEFT JOIN `players` p ON `p`.`id` = `pk`.`player_id` WHERE `k`.`death_id` = ' . $death['id'] . ' ORDER BY `k`.`final_hit` DESC, `k`.`id` ASC')->fetchAll(); $count = count($killers); $i = 0; $others = false; $main_content .= date("j M Y, H:i", $death['date']) . " <span style=\"font-weight: bold; color: " . ($death['enemy'] == $war['guild_id'] ? "red" : "lime") . ";\">+</span> <a href=\"index.php?subtopic=characters&name=" . urlencode($death['name']) . "\"><b>".$death['name']."</b></a> "; foreach($killers as $killer) { $i++; if($killer['is_war'] != 0) { if($i == 1) $main_content .= "killed at level <b>".$death['level']."</b> by "; else if($i == $count && $others == false) $main_content .= " and by "; else $main_content .= ", "; if($killer['player_exists'] == 0) $main_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">"; $main_content .= $killer['player_name']; if($killer['player_exists'] == 0) $main_content .= "</a>"; } else $others = true; if($i == $count) { if($others == true) $main_content .= " and few others"; $main_content .= ".<br />"; } } } } else $main_content .= "<center>There were no frags on this war so far.</center>"; } else $main_content .= "<center>This war did not began yet.</center>"; $main_content .= "</td> </tr>"; } if($count == 0) $main_content .= "<tr style=\"background: ".$config['site']['darkborder'].";\"> <td colspan=\"3\">Currently there are no active wars.</td> </tr>"; $main_content .= "</table>"; $main_content .= '<div align="right"><small><b>Customized by: <a href="http://www.xtibia.com/forum/user/240289-walef-xavier">Walef Xavier</a></b></small></div><br />'; ?>
     
     
     
    Agora vá em Xampp/Htdocs/index.php e add o seguinte:

    case "wars"; $subtopic = "wars"; $topic = "Guild Wars"; include("wars.php"); break;
     
     
    Agora para finalizar a parte do site vá em Xampp/Htdocs/Layout/Tibiacom/layout.php e add o seguinte:

    <a href='?subtopic=wars'> <div id='submenu_wars' 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_polls' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color=red>Guild Wars</font></div> <div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div> </div> </a>
     
     
    Agora vamos para seu Ot:
     
     
     
    Va em GlobalEvents/scripts/start.lua e add o seguinte:

    executeQuery("DELETE FROM `guild_wars` WHERE `status` = 0 AND `begin` < " .. (os.time() - 2 * 86400) .. ";") db.executeQuery("UPDATE `guild_wars` SET `status` = 5, `end` = " .. os.time() .. " WHERE `status` = 1 AND `end` > 0 AND `end` < " .. os.time() .. ";")
     
     
    Agora vá em Lib e crie um arquivo .lua chamado 101-war,dentro add o seguinte:

    WAR_GUILD = 0 WAR_ENEMY = 1
     
     
    Agora para finalizar vamos colocar os comandos em Talkactions !
     
     
     
    Vá em Talkactions/scripts e crie dois arquivos chamados war.lua e balance.lua,dentro add o seguinte:
     
    War.lua

    function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0) return true end local t = string.explode(param, ",") if(not t[2]) then doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0) return true end local enemy = getGuildId(t[2]) if(not enemy) then doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0) return true end if(enemy == guild) then doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0) return true end local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy) if(tmp:getID() ~= -1) then enemyName = tmp:getDataString("name") tmp:free() end if(isInArray({"accept", "reject", "cancel"}, t[1])) then local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild if(t[1] == "cancel") then query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy end tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0") if(tmp:getID() == -1) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end if(t[1] == "accept") then local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment") _tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild) end query = "UPDATE `guild_wars` SET " local msg = "accepted " .. enemyName .. " invitation to war." if(t[1] == "reject") then query = query .. "`end` = " .. os.time() .. ", `status` = 2" msg = "rejected " .. enemyName .. " invitation to war." elseif(t[1] == "cancel") then query = query .. "`end` = " .. os.time() .. ", `status` = 3" msg = "canceled invitation to a war with " .. enemyName .. "." else query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1" end query = query .. " WHERE `id` = " .. tmp:getDataInt("id") if(t[1] == "accept") then doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD) doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY) end tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE) return true end if(t[1] == "invite") then local str = "" tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)") if(tmp:getID() ~= -1) then if(tmp:getDataInt("status") == 0) then if(tmp:getDataInt("guild_id") == guild) then str = "You have already invited " .. enemyName .. " to war." else str = enemyName .. " have already invited you to war." end else str = "You are already on a war with " .. enemyName .. "." end tmp:free() end if(str ~= "") then doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0) return true end local frags = tonumber(t[3]) if(frags ~= nil) then frags = math.max(10, math.min(1000, frags)) else frags = 100 end local payment = tonumber(t[4]) if(payment ~= nil) then payment = math.max(100000, math.min(1000000000, payment)) tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild) local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment tmp:free() if(state) then doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0) return true end db.query("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild) else payment = 0 end local begining, ending = os.time(), tonumber(t[5]) if(ending ~= nil and ending ~= 0) then ending = begining + (ending * 86400) else ending = 0 end db.query("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");") doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE) return true end if(not isInArray({"end", "finish"}, t[1])) then return false end local status = (t[1] == "end" and 1 or 4) tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status) if(tmp:getID() ~= -1) then local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id") tmp:free() doGuildRemoveEnemy(guild, enemy) doGuildRemoveEnemy(enemy, guild) db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end if(status == 4) then doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1") if(tmp:getID() ~= -1) then if(tmp:getDataInt("end") > 0) then tmp:free() doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true end local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id") tmp:free() db.query(query) doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE) return true end doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0) return true
     
     
    balance.lua

    local function isValidMoney(value) if(value == nil) then return false end return (value > 0 and value <= 99999999999999) end function onSay(cid, words, param, channel) local guild = getPlayerGuildId(cid) if(guild == 0) then return false end local t = string.explode(param, ' ', 1) if(getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER and isInArray({ 'pick' }, t[1])) then if(t[1] == 'pick') then local money = { tonumber(t[2]) } if(not isValidMoney(money[1])) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end local result = db.getResult('SELECT `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end money[2] = result:getDataLong('balance') result:free() if(money[1] > money[2]) then doPlayerSendChannelMessage(cid, '', 'The balance is too low for such amount.', TALKTYPE_CHANNEL_W, 0) return true end if(not db.query('UPDATE `guilds` SET `balance` = `balance` - ' .. money[1] .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;')) then return false end doPlayerAddMoney(cid, money[1]) doPlayerSendChannelMessage(cid, '', 'You have just picked ' .. money[1] .. ' money from your guild balance.', TALKTYPE_CHANNEL_W, 0) else doPlayerSendChannelMessage(cid, '', 'Invalid sub-command.', TALKTYPE_CHANNEL_W, 0) end elseif(t[1] == 'donate') then local money = tonumber(t[2]) if(not isValidMoney(money)) then doPlayerSendChannelMessage(cid, '', 'Invalid amount of money specified.', TALKTYPE_CHANNEL_W, 0) return true end if(getPlayerMoney(cid) < money) then doPlayerSendChannelMessage(cid, '', 'You don\'t have enough money.', TALKTYPE_CHANNEL_W, 0) return true end if(not doPlayerRemoveMoney(cid, money)) then return false end db.query('UPDATE `guilds` SET `balance` = `balance` + ' .. money .. ' WHERE `id` = ' .. guild .. ' LIMIT 1;') doPlayerSendChannelMessage(cid, '', 'You have transfered ' .. money .. ' money to your guild balance.', TALKTYPE_CHANNEL_W, 0) else local result = db.getResult('SELECT `name`, `balance` FROM `guilds` WHERE `id` = ' .. guild) if(result:getID() == -1) then return false end doPlayerSendChannelMessage(cid, '', 'Current balance of guild ' .. result:getDataString('name') .. ' is: ' .. result:getDataLong('balance') .. ' bronze coins.', TALKTYPE_CHANNEL_W, 0) result:free() end return true end
     
     
     
    Agora vá em Talkactions/talkactions.xml e add as duas tags:

    <talkaction words="/war" channel="0" event="script" value="war.lua" desc="(Guild channel command) War management."/> <talkaction words="/balance" channel="0" event="script" value="balance.lua" desc="(Guild channel command) Balance management."/>
     
     
     
    Pronto,seu Guild War Systema está instalado...mas para funcionar necessitará das tabelas na sua database e do Tfs 0.4 .Vou posta-los abaixo,respectivamente.
     
    . Tabelas .
     
    Para quem ainda não sabe add tabelas a sua database,vou ensinar:
     
    Acesse seu phpmyadmin,digite sua senha (caso tenha),clique no nome da sua database a esquerda,assim que carregar a sua database clique em SQL lá em cima...Aparecerá um espaço em branco lá voce irá add as seguintes tabelas...e depois clicar em Executar.
     
     
     

    CREATE TABLE IF NOT EXISTS `guild_wars` ( `id` INT NOT NULL AUTO_INCREMENT, `guild_id` INT NOT NULL, `enemy_id` INT NOT NULL, `begin` BIGINT NOT NULL DEFAULT '0', `end` BIGINT NOT NULL DEFAULT '0', `frags` INT UNSIGNED NOT NULL DEFAULT '0', `payment` BIGINT UNSIGNED NOT NULL DEFAULT '0', `guild_kills` INT UNSIGNED NOT NULL DEFAULT '0', `enemy_kills` INT UNSIGNED NOT NULL DEFAULT '0', `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `status` (`status`), KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`) ) ENGINE=InnoDB; ALTER TABLE `guild_wars` ADD CONSTRAINT `guild_wars_ibfk_1` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_wars_ibfk_2` FOREIGN KEY (`enemy_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `guilds` ADD `balance` BIGINT UNSIGNED NOT NULL AFTER `motd`; CREATE TABLE IF NOT EXISTS `guild_kills` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, `guild_id` INT NOT NULL, `war_id` INT NOT NULL, `death_id` INT NOT NULL ) ENGINE = InnoDB; ALTER TABLE `guild_kills` ADD CONSTRAINT `guild_kills_ibfk_1` FOREIGN KEY (`war_id`) REFERENCES `guild_wars` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_2` FOREIGN KEY (`death_id`) REFERENCES `player_deaths` (`id`) ON DELETE CASCADE, ADD CONSTRAINT `guild_kills_ibfk_3` FOREIGN KEY (`guild_id`) REFERENCES `guilds` (`id`) ON DELETE CASCADE; ALTER TABLE `killers` ADD `war` INT NOT NULL DEFAULT 0;
     
    Para finalizar é necessário que o seu .exe tenha incluído na compilação o parâmetro, -D__WAR_SYSTEM__.
    Como adiciono?
    Para adicionar é necessário ter a source do otserver que você utiliza. Abra a source em um dev-cpp aperte alt+p na coluna paraments add -D__WAR_SYSTEM__ da ok e compila.
     
    Se você não souber compilar existem tutorias bem explicativas que tornam fácil aprender a compilar, veja abaixo:
     
    Compilando no Windows
    Compilando no Linux ubuntu
     
     
    Pronto o Guild Wars System está totalmente instalado!
     
    Para os preguiçosos Ocupados coloquei o download do sistema completo.
     
    Download Aqui
     
    Link do Scan
     
    Creditos: Walef Xavier - War System
    AgaSsI - Tópico original
    Gm Beckman - Completou o tópico
  18. Upvote
    Leoprotons deu reputação a renansdc em [Fechado] [9.10 E 9.20] Baiak Stan 1.1 (Todas Features Do Update)   
    Faaaaala galera XTibiana, quem ta vivo sempre aparece não é? Pois bem, vim trazer uma novidade a vocês:
     
     
     

    Baiak Stan





    Versão 1.0





    - Mapa Baiak Yurots Editado.


    - 4 Cidades.


    - Quests como: Pits Of Inferno, Inquisition, Demon Helmet, Annihilator, entre outras.


    - Versão 9.10


    - Todas features do update foram adicionadas (montarias e cooldowns).


    - Distro TFS 0.4 modificado totalmente estável.


    - Servidor livre de bugs críticos.


    - Versão simples, porém muito boa.















    Versão 1.1




    - Protocolo 9.10 e 9.20


    - Comandos /t e !leavehouse fixados


    - Warning do Training Monk fixado.














    - Breves Fotos -







    Templo:






















    Teleports Free:















    Depot:

















    Account do GOD: god / 123456








    Download:
    http://www.multiupload.com/XTW6SNBKNL

    Scan:
    http://www.virustota...0278-1317427773











    Créditos:





    TFS Team


    Baiak



















    Obs: Encontrou algum bug? Relate neste tópico, para que possamos melhorar mais ainda o Baiak Stan.












    Em breve atualizações.

















     
    Este tópico recebeu destaque em nosso portal!
  19. Upvote
    Leoprotons recebeu reputação de chidorigash em Download Remeres 8.6?   
    Bom o site do Remeres não abre pelo fato de que ele foi fechado, e é por isso que não tem sido lançadas novas versões do editor.
     
    E sobre seu download ta aqui:
     
    Download link (clickar aqui)
     
     
    Scan do RME
     
    Espero ter ajudado, bom uso..
  20. Upvote
    Leoprotons recebeu reputação de pikemo em [Encerrado] Como Adicionar Addons   
    Otimo
     
    E bem simples substitua o script do seu npc de addons por este
     
     
     
    E so isso espero ter ajudado..
  21. Upvote
    Leoprotons deu reputação a Subwat em [Oficial] Refugia (8.60) 26/08/2012 0.0.8   
    Bom pessoal,venho trazer-lhes hoje um trabalho,de meses de mim e de daniel devotti,fizemos um servidor Igual o refugia.
    e agora venho compartilhar com vocês.
     
    SENHA DO GOD
    account:god
    senha:GOD
     
    Spells
    Knights :ezzori,ezzori gran.
    Magos :exevo gran frigo,exevo gran mas mort,exevo gran mas ghost,aurora.
    Paladinos :exevo gran mas mort,aurora.
     
    Sistemas
    Pet system com mais de 50 pets,Incluindo Pets Donates que você pode vender em seu site!
    Sistemas de arena duels Para teams ou duplas no segundo andar no templo!
    Sistema de VIP Coins e (VIP) no nome Igual do Refugia Original!
    TASK SYSTEM!
    Sistema De Reborn Monster! adicionado 16/09/11
    Ao matar um monstro ele tem 50% de chance de renascer igual no refugia!
     
    Items
    Mais de 100 items editados únicos do servidor!
    items free bons,quests com items editados e etc.
     
    Quests
    Anihilator
    demon helmet
    Aqua quest
    vermilion quest
    Pits of inferno
    Lord vampire quest
    refugia legs
    multi Quest
    dentre várias outras.
     
     
     
    Screen Shots
     
    Trainer's

     
     
     
    Templo Free

     
     
     
    Teleports Vip

     
     
     
    Teleports Free

     
     
     
    Teleportes para cidades

     
     
     
    Segundo andar do templo

     
     
     
    Montanha

     
     
     
    City Vip

     
     
     
    City Free

     
     
     
    NPC's

     
     
    DOWNLOAD:
     
    http://adf.ly/IGQ9S
     
    http://adf.ly/IGQDJ (SCAN DESATUALIZADO)
     
     
     
    Créditos
    Subwat (Gean Riot)
    Refugia.com.br
    daniel freire devotti
     
     
     
     
     
     
     
     
    curtiu REP+
     
    Este tópico recebeu destaque em nosso portal!
  22. Upvote
    Leoprotons recebeu reputação de bikun em Editando Spr Completo   
    Bom estou trazendo pra voçes um tutorial com varios progamas.
    * No meu deu erro com auguns e Susses com outros
     
    1- Bem vamos as funções dos progamas
     
    ­?Sprite Editor 0.2 / 0.4 Extrair o Tibia.spr
    ?Reebowsprite 1.3 Extrair o Tibia.spr
    ?Demonic data editor Editar as Propriedades dos itens
    ?Ase Sprite Editor 0.8.2 Editar as Sprites
     
    2- Intalando os progamas
     
     
    ­?No caso do Reebowsprite 1.3 ,Sprite editor 0.2 ou Sprite editor 0.4 ,você tera de
    extrair os arquivos do progama numa pasta junto com o arquivo "Tibia.spr".
    ­?Demonic data editor e Ase Sprite Editor e so extrair.
     
     
    3- Extraindo as Sprites
     
     
    ­?Como ja expliquei voce deve colocar os arquivos do progama e do Tibia.spr junto.
    ­?Clique em Extract/Extract Sprites.
    *Sera criada umas pasta com diversas imagens no formato bmp "bitmap"
     
     
    4- Editando as Sprites
     
     
    ­?Bem Aqui voçe ira utilizar o Ase Sprite Editor, Paint, Fotoshop... oque seja...
    *leia auguns tutoriais sobre sprite ira ajudar muito. Indico este :
    http://www.xtibia.com/forum/topic/154097-tutorialadicionar-novas-sprites-no-cliente-pt1/
    ­?Salve a Imagem no formato bmp "bitmap" e substitua uma das sprites extraidas
    *tente manter uma certa organizaçao pra nao se perder na hora de utilizalas
     
     
    5- Propriedades
     
     
    ?Bem e aqui que o DatEditor entra voce pode usalo pra editar augumas propriedades "Nao tem muitas funçoes"
    ?Ou pode usalo na Etapa 3 da seguinte forma
     
     
     
    6- Compactando as Sprites
     
     
    ?Voce usara novamente um dos progamas Reebowsprite 1.3 ,Sprite editor 0.2/0.4
    com a pasta com as sprites extraidas no mesmo local.
    ?E so clicar em Copile/pack sprites e fazer a festa com suas novas sprites
     
     
     
    7- Bom aqui estao os downloads dos arquivos e Scan
     
     
    Sprite Editor 0.2
    Download
    Scan
     
    Sprite Editor 0.4
    Download
    Scan
     
    ReebowSprite
    Download
    Scan
     
    Ase Sprite Editor 0.8.2
    Download
    Scan
     
    Demonic Data Editor
    Download
    Scan
    BOA SORTE A TODOS!!!
     
    E um tutorial bem Resumido se tiverem auguem que achem que deva ser adicionado, gostaria muito que digam...
    Quem puder me ajudar Rep+ / e ou fassam os download dos progamas.
     
     
    Creditos:
    Tutorial: Leoprotons
    Progamas: A seus devidos desenvolvedores
     
    Peço que não retire os creditos ao copiar
  23. Upvote
    Leoprotons recebeu reputação de juan500 em [Encerrado] Ajuda Muito Simples Quem Quer Meu Ot 24 Horas Me Ajude Nessa Pergunta   
    Pode tentar desfixar o servidor da barra de tarefas.
    Pode tambem tentar tambem:
    -Clicar na barra de tarefas com o botao direito.
    -Propriedades
    -Personalizar
    E trocar a opçao do exe do seu server para mostrar somente notivicaçoes...
     
    Se nao der troca o .exe dele alguns sao pre progamados para serem escondidos "como por exemplo o meu".
     
    Quiser te passo ele so mandar pm
  24. Upvote
    Leoprotons recebeu reputação de luisinho15 em [Encerrado] Super Ultra Mega Critico Erro Items.xml   
    Eu posso tar inganado mais o que esta dizendo ai e que o erro
    -No no arquivo Items.xml
    -Na linha 1
    -E que tem a ver com uma "<" talvez voce abril colocou a mais, nao fechou uma tag e talz...
     
    ///agora sobre a pasta backup, nao tem nada a ver, isto não afeta em nada...
  25. Upvote
    Leoprotons recebeu reputação de soucalibur em Editando Spr Completo   
    Bom estou trazendo pra voçes um tutorial com varios progamas.
    * No meu deu erro com auguns e Susses com outros
     
    1- Bem vamos as funções dos progamas
     
    ­?Sprite Editor 0.2 / 0.4 Extrair o Tibia.spr
    ?Reebowsprite 1.3 Extrair o Tibia.spr
    ?Demonic data editor Editar as Propriedades dos itens
    ?Ase Sprite Editor 0.8.2 Editar as Sprites
     
    2- Intalando os progamas
     
     
    ­?No caso do Reebowsprite 1.3 ,Sprite editor 0.2 ou Sprite editor 0.4 ,você tera de
    extrair os arquivos do progama numa pasta junto com o arquivo "Tibia.spr".
    ­?Demonic data editor e Ase Sprite Editor e so extrair.
     
     
    3- Extraindo as Sprites
     
     
    ­?Como ja expliquei voce deve colocar os arquivos do progama e do Tibia.spr junto.
    ­?Clique em Extract/Extract Sprites.
    *Sera criada umas pasta com diversas imagens no formato bmp "bitmap"
     
     
    4- Editando as Sprites
     
     
    ­?Bem Aqui voçe ira utilizar o Ase Sprite Editor, Paint, Fotoshop... oque seja...
    *leia auguns tutoriais sobre sprite ira ajudar muito. Indico este :
    http://www.xtibia.com/forum/topic/154097-tutorialadicionar-novas-sprites-no-cliente-pt1/
    ­?Salve a Imagem no formato bmp "bitmap" e substitua uma das sprites extraidas
    *tente manter uma certa organizaçao pra nao se perder na hora de utilizalas
     
     
    5- Propriedades
     
     
    ?Bem e aqui que o DatEditor entra voce pode usalo pra editar augumas propriedades "Nao tem muitas funçoes"
    ?Ou pode usalo na Etapa 3 da seguinte forma
     
     
     
    6- Compactando as Sprites
     
     
    ?Voce usara novamente um dos progamas Reebowsprite 1.3 ,Sprite editor 0.2/0.4
    com a pasta com as sprites extraidas no mesmo local.
    ?E so clicar em Copile/pack sprites e fazer a festa com suas novas sprites
     
     
     
    7- Bom aqui estao os downloads dos arquivos e Scan
     
     
    Sprite Editor 0.2
    Download
    Scan
     
    Sprite Editor 0.4
    Download
    Scan
     
    ReebowSprite
    Download
    Scan
     
    Ase Sprite Editor 0.8.2
    Download
    Scan
     
    Demonic Data Editor
    Download
    Scan
    BOA SORTE A TODOS!!!
     
    E um tutorial bem Resumido se tiverem auguem que achem que deva ser adicionado, gostaria muito que digam...
    Quem puder me ajudar Rep+ / e ou fassam os download dos progamas.
     
     
    Creditos:
    Tutorial: Leoprotons
    Progamas: A seus devidos desenvolvedores
     
    Peço que não retire os creditos ao copiar
  • Quem Está Navegando   0 membros estão online

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