-
(Resolvido)Bloquear o trade de determinado item
Blz!!
-
-
(Resolvido)Bloquear o trade de determinado item
Resolveu meu problema. Muito obrigado.
-
(Resolvido)Bloquear o trade de determinado item
Bom dia! TFS 0.4 global 8.6 Pessoal, alguém sabe por favor como faço para bloquear a possibilidade de dar trade em determinados itens, id 7708 e id 2357. O script checa-se o id do item e impedisse o trade. Agradeço e dou rep.
-
-
Como registrar um ganho de Xp no login.lua
Obrigado. Resolvido. Utilizei o Mod exp scroll invés deste script.
-
Como registrar um ganho de Xp no login.lua
Bom dia!! Possuo um otserv TFS 0.4 distro: 8.6 Baiak Coloquei um script de potion xp que funciona por 2 horas. Da tudo certo. Porém, se deslogar ele perde o efeito , alem de ter de esperar 2h pra usar novamente. Imagino que preciso criar um script ou colocar algo no login.lua. Só não sei como fazer. Alguém pode me ajudar por favor ? Eu reputo . Muito obrigado mesmo. Código em actions.xml : function onUse(cid, item, frompos, item2, topos) local pausa = 120*60*120000 -- (1000 = 1 segundos) Tempo que o script durará local texto = "Você aumentou 50% na sua Experiencia por 2 Horas" -- Texto que irá receber ao usar a potion. textofinal = "Acabou o potion de Experiencia." -- Texto que irá receber quando o efeito da potion acabar. local exp = 1.5 -- O quanto que você quer que dobre sua experiencia, por exemplo 2 é 2x as rates do seu server. expfinal = 1 --Não mude, isso é para a experiencia voltar ao normal. local limitedeuso = 49015 local tempo = 120*60*1000 -- 1000 = 1s então 1000 vezes 60 vezes 30 = 30 minutos local textofinal1 = "Você já esta sob efeito da pot de experiência espere o efeito acabar." local seuitem = 7440 -- seu item que dará double exp local efeito1 = 13 -- efeito que ficara com o char por meia hora local efeito2 = 35 -- efeito que acontecera no momento que usar a pot --fim da parte configuravel não mecha se nao tiver conhecimento de scripting local timeEffect = 1801 -- tempo em segundos que o efeito vai apareceer no player, 31 = 30 segundos. sempre coloque 1 segundo a mais. function effect() if isPlayer(cid) then local pos = getCreaturePosition(cid) doSendMagicEffect(pos, efeito1) end end if item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() <= 0) then doRemoveItem(item.uid,1) doPlayerSetExperienceRate(cid,exp) doSendMagicEffect(frompos,efeito2) setPlayerStorageValue(cid, limitedeuso, os.time() + 1800) doPlayerSendTextMessage(cid,22,texto) addEvent(potion,pausa,cid) a = 1 while a ~= timeEffect do addEvent(effect, a * 1000) a = a + 1 end elseif item.itemid == seuitem and (getPlayerStorageValue(cid, limitedeuso) - os.time() > 0) then doPlayerSendTextMessage(cid,22,textofinal1) end return true end function potion(cid) doPlayerSetExperienceRate(cid,expfinal) doPlayerSendTextMessage(cid,22,textofinal) end
-
Remover item Depois te tanto tempo
Boa tarde. Coloquei sim. Coloquei 6 horas de duração e também o decay to 0. Aparece no anel 6 horas left mas não decresce.
-
Remover item Depois te tanto tempo
Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). Ex. TFS 0.4 Base: global 8.6 Qual erro está surgindo/O que você procura? Eu tenho um script que encontrei aqui no forum de Exp ring. Ao utilizar ele te da tantos % de xp e se transforma em outro anel. Eu precisava que este anel sumisse depois de 6 ou 24 horas de uso. Alguém sabe como fazer ? pelo items.xml não deu certo, coloquei a duration dele e tal, aparece mas não remove. Se alguem puder me ajudar com uma storage que conte o tempo de uso e remova o item do player depois de 6 ou 24 horas por favor. Ficarei muito grato. Dou Rp. Você tem o código disponível? Se tiver publique-o aqui: function onEquip(cid, item, slot) doTransformItem(item.uid, 2357, 1) doPlayerSendTextMessage(cid, 22, 'Agora ganha 50% mais experiencia!') doPlayerSetExperienceRate(cid, getConfigValue("rateExperience")*0.05) return TRUE end function onDeEquip(cid, item, slot) doTransformItem(item.uid, 7708, 1) doPlayerSendTextMessage(cid, 22, 'Experiencia extra cancelada.') doPlayerSetExperienceRate(cid, 1) return TRUE end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
Geisor Loteria PHP
infelizmente não resolveu. Mas obrigado.
-
-
Geisor Loteria PHP
Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). Ex. TFS 0.4 Base: global 8.6 Qual erro está surgindo/O que você procura? coloquei na pasta do ot o arquivo lottery.php , o qual deveria pegar da minha base de dados o id, o nome e o item que o player ganhou na loteria e colocar em uma lista no site, porém não funcionou. A página aparece bonitinha, e até aparecem 3 linhas onde deveriam estar os nomes, e realmente, foram sorteados 3 players até agora, é o que está no banco de dados, mas nao tem nada escrito nestas 3 linhas. Não mostra os nomes. O script e a tabela estão funcionando perfeitamente. Falta só arrumar este lottery.php. Se alguém puder me ajudar por favor. Dou Rep. Você tem o código disponível? Se tiver publique-o aqui: <?PHP //Criado por Dhenyz Shady from shadyroom.blogspot.com //Favor manter os créditos / Please keep the credits //Use e abuse / Enjoy! header("Content-Type: text/html; charset=ISO-8859-1",true) ; $lotterys = $SQL->query("SELECT `id`, `name`, `item` FROM lottery ORDER BY `id` ASC LIMIT 20;");$players = 0; $main_content .= ' <h1><center>- '.$config['server']['serverName'].' Lottery System -</center></h1> Esse sistema sorteia de <b>4 em 4hrs</b> um player <font color="green">ONLINE</font> no servidor para dar um item a ele, e os items disponíveis na loteria são: <br></br> <TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Itens Sorteados:</B></TD></TR></TABLE> <table border="1" width="100%"> <tr> <td><p align="center"><img src="images/items/2160.gif"</img><br /> 50 Crystal coins</p></td> <td>500k Gold.</td> </tr> </table> <br />'; if(empty($lotterys)) { $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b>Auctions</b></td></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD>Currently is no one active Auction.</TD></TR></TABLE>'; $main_content .= '<br /><p align="right"><small></small></p>'; } else { foreach($lotterys as $lotterys) { $players++; if(is_int($players / 2)) $bgcolor = $config['site']['lightborder']; else $bgcolor = $config['site']['darkborder']; $cost = round($auction['cost']/1000, 2); $content .= '<TR BGCOLOR='.$bgcolor.'><TD><center>'.$lottery['id'].'</center></TD><TD><center>'.$lottery['item'].'</center></TD><TD><center><a href="?subtopic=characters&name='.urlencode($lottery['name']).'">'.$lottery['name'].'</a></center></TD></TR>'; } $main_content .= 'Os ultimos 20 sorteios:<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><b><center>ID</center></b></TD><TD class="white"><b><center>Item</center></b></TD><TD class="white"><b><center>Sortudo</center></b></td></TR>'.$content.'</TABLE>'; $main_content .= ''; } ?> Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
Trade Offline-Quase Certo
Diga em poucas palavras a base utilizada (Nome do servidor ou nome do website). Ex. TFS 0.4 Base: global 8.6 Qual erro está surgindo/O que você procura? Eu coloquei em meu site um sistema de trade offline, vai no php do site, tudo certinho, já está no layout. Porém, quando dou o comando no jogo: !offer add, plate armor, 500, 1 ele me da a msg de erro no tibia: 09:11 Item wich such name does not exists. e na distro aparece a seguinte mensagem: [4/12/2018 14:24:35] [Error - TalkAction Interface] [4/12/2018 14:24:35] data/talkactions/scripts/auctionsystem.lua:onSay [4/12/2018 14:24:35] Description: [4/12/2018 14:24:35] (luaGetItemIdByName) Item not found Abaixo segue o Código da Talk action. Se alguém puder me ajudar, fico muito agradecido e dou meu rep. Hoje meu niver, Seria um presente :,,D Você tem o código disponível? Se tiver publique-o aqui: --[[ Offline player to player item trader (Auction System) Script version: 1.2a [ -- FIXED CLONE ITEMS BUG -- ] ]]-- local config = { levelRequiredToAdd = 20, maxOffersPerPlayer = 5, SendOffersOnlyInPZ = true, blocked_items = {2165, 2152, 2148, 2160, 2166, 2167, 2168, 2169, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2214, 2215, 2343, 2433, 2640, 6132, 6300, 6301, 9932, 9933} } function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end local t = string.explode(param, ",") if(t[1] == "add") then if((not t[2]) or (not t[3]) or (not t[4])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if(not tonumber(t[3]) or (not tonumber(t[4]))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't set valid price or items count.") return true end if(string.len(t[3]) > 7 or (string.len(t[4]) > 3)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This price or item count is too high.") return true end local item = getItemIdByName(t[2], false) if(not item) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.") return true end if(getPlayerLevel(cid) < config.levelRequiredToAdd) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have required (" .. config.levelRequiredToAdd .. ") level.") return true end if(isInArray(config.blocked_items, item)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This item is blocked.") return true end if(getPlayerItemCount(cid, item) < (tonumber(t[4]))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you don't have this item(s).") return true end local check = db.getResult("SELECT `id` FROM `auction_system` WHERE `player` = " .. getPlayerGUID(cid) .. ";") if(check:getID() == -1) then elseif(check:getRows(true) >= config.maxOffersPerPlayer) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry you can't add more offers (max. " .. config.maxOffersPerPlayer .. ")") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(getPlayerPosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you add offert to database.") return true end end if(tonumber(t[4]) < 1 or (tonumber(t[3]) < 1)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to type a number higher than 0.") return true end local itemcount, costgp = math.floor(t[4]), math.floor(t[3]) doPlayerRemoveItem(cid, item, itemcount) db.executeQuery("INSERT INTO `auction_system` (`player`, `item_name`, `item_id`, `count`, `cost`, `date`) VALUES (" .. getPlayerGUID(cid) .. ", \"" .. t[2] .. "\", " .. getItemIdByName(t[2]) .. ", " .. itemcount .. ", " .. costgp ..", " .. os.time() .. ")") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You successfully add " .. itemcount .." " .. t[2] .." for " .. costgp .. " gps to offerts database.") end if(t[1] == "buy") then if(not tonumber(t[2])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end local buy = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";") if(buy:getID() ~= -1) then if(getPlayerMoney(cid) < buy:getDataInt("cost")) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enoguh GP.") buy:free() return true end if(getPlayerName(cid) == getPlayerNameByGUID(buy:getDataInt("player"))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sorry, you can't buy your own items.") buy:free() return true end if(getPlayerFreeCap(cid) < getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")))then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You try to buy a " .. buy:getDataString("item_name") .. ". It weight " .. getItemWeightById(buy:getDataInt("item_id"), buy:getDataInt("count")) .. " cap oz. and you have only " .. getPlayerFreeCap(cid) .. " oz. free capacity. Put some items to depot and try again.") buy:free() return true end if(isItemStackable((buy:getDataString("item_id")))) then doPlayerAddItem(cid, buy:getDataString("item_id"), buy:getDataInt("count")) else for i = 1, buy:getDataInt("count") do doPlayerAddItem(cid, buy:getDataString("item_id"), 1) end end doPlayerRemoveMoney(cid, buy:getDataInt("cost")) db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You bought " .. buy:getDataInt("count") .. " ".. buy:getDataString("item_name") .. " for " .. buy:getDataInt("cost") .. " gps!") db.executeQuery("UPDATE `players` SET `auction_balance` = `auction_balance` + " .. buy:getDataInt("cost") .. " WHERE `id` = " .. buy:getDataInt("player") .. ";") buy:free() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if(t[1] == "remove") then if((not tonumber(t[2]))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") return true end if(config.SendOffersOnlyInPZ) then if(not getTilePzInfo(getPlayerPosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be in PZ area when you remove offerts from database.") return true end end local delete = db.getResult("SELECT * FROM `auction_system` WHERE `id` = " .. (tonumber(t[2])) .. ";") if(delete:getID() ~= -1) then if(getPlayerGUID(cid) == delete:getDataInt("player")) then db.executeQuery("DELETE FROM `auction_system` WHERE `id` = " .. t[2] .. ";") if(isItemStackable(delete:getDataString("item_id"))) then doPlayerAddItem(cid, delete:getDataString("item_id"), delete:getDataInt("count")) else for i = 1, delete:getDataInt("count") do doPlayerAddItem(cid, delete:getDataString("item_id"), 1) end end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Your offert has been deleted from offerts database.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This is not your offert!") end delete:free() else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wrong ID.") end end if(t[1] == "withdraw") then local balance = db.getResult("SELECT `auction_balance` FROM `players` WHERE `id` = " .. getPlayerGUID(cid) .. ";") if(balance:getDataInt("auction_balance") < 1) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You don't have money on your auction balance.") balance:free() return true end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You got " .. balance:getDataInt("auction_balance") .. " gps from auction system!") doPlayerAddMoney(cid, balance:getDataInt("auction_balance")) db.executeQuery("UPDATE `players` SET `auction_balance` = '0' WHERE `id` = " .. getPlayerGUID(cid) .. ";") balance:free() end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
-
Item que dá Bonus de Xp por um tempo
<?xml version="1.0" encoding="UTF-8"?> -<stages> -<world multiplier="1" id="0"> <stage multiplier="50" maxlevel="80" minlevel="1"/> <stage multiplier="30" maxlevel="150" minlevel="81"/> <stage multiplier="15" maxlevel="170" minlevel="151"/> <stage multiplier="11" maxlevel="180" minlevel="171"/> <stage multiplier="10" maxlevel="190" minlevel="181"/> <stage multiplier="4" maxlevel="200" minlevel="191"/> <stage multiplier="3" maxlevel="230" minlevel="201"/> <stage multiplier="2" maxlevel="250" minlevel="231"/> <stage multiplier="1.5" maxlevel="270" minlevel="251"/> <stage multiplier="1.3" maxlevel="300" minlevel="271"/> <stage multiplier="1.1" minlevel="301"/> </world> </stages> Boa noite. Segue acima. Lembrando que o que estou tentando fazer, é um item que ao usar, dá um bonus de 50% de xp só para quem utilizou este item, durante um determinado tempo. Depois de usar o item some e depois que o tempo acabar, a xp deste player, volta ao normal. Quem nao utilizou o item, permanece na xp normal. Caso consiga, muito obrigado.
-
Item que dá Bonus de Xp por um tempo
up
-
Item que dá Bonus de Xp por um tempo
é por stages. Eu queria um item que eu pudesse dar use, ele sumisse e desse para o player, 50% de xp a mais. Eu acho que mod não funciona no meu ot. Por isto imaginei que talvez tivesse que ser algo com action e creature script , não sei. up
-
Item que dá Bonus de Xp por um tempo
Só que eu não entendo de programação. Por isto vim pedir ajuda. Achei um mod pronto, mas não funciona. Se eu soubesse fazer isso que você disse.
-
Item que dá Bonus de Xp por um tempo
up