Tudo que DukeeH postou
-
(Resolvido)Seria possível criar um sistema de "redeem code" via talkaction ?
Cara, como o @Vodkart falou fica mais bonito e talvez fácil e avançado, mas fiz aqui mais ou menos o que pediu. Se você ou ele estiverem dispostos a fazer de outro jeito fiquem a vontade. Fiz duas talkactions, mas da pra fazer algo como "!code redeem, código" e no mesmo comando "!code add, código". Mas acho mais simples (para os jogadores) botar direto. (Não tenho 0.4 para testar) mysql: CREATE TABLE IF NOT EXISTS `redeemcodes` ( `id` int(11) NOT NULL AUTO_INCREMENT, `code` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; resgatarcode.lua function onSay(cid, words, param, channel) local paramm = string.upper(param) if (param == '') then doPlayerSendCancel(cid, "Você deve adicionar um code.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) else local resultado = db.getResult("SELECT * FROM redeemcodes WHERE `code` = '" .. paramm .. "';") if(resultado:getID() ~= -1) then doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING, "Você resgatou com sucesso o código: " .. paramm ..".") doPlayerAddItem(cid, ID, QUANTIDADE) db.query("DELETE FROM `redeemcodes` WHERE `code` = '" .. paramm .. "';") else doPlayerSendCancel(cid, "Código invalido.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) end end end registrarcode.lua function onSay(cid, words, param, channel) local paramm = string.upper(param) if (param == '') then doPlayerSendCancel(cid, "Você deve preencher o code para ser adicionado.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) else db.executeQuery("INSERT INTO `redeemcodes` (`id`, `code`) VALUES (NULL, '" .. paramm .. "');") doPlayerSendTextMessage(cid,MESSAGE_STATUS_WARNING, "Você adicionou o código: " .. paramm .." para ser validado.") end end
-
(Resolvido)Seria possível criar um sistema de "redeem code" via talkaction ?
Não, só salvar os códigos na database. Vou tentar fazer algo aqui.
-
(Resolvido)Seria possível criar um sistema de "redeem code" via talkaction ?
É sim, acho que por mysql é a melhor forma. Qual otserv você usa e cliente?
-
Retirar storage de todos ao final do evento
Pode mandar o script inteiro? setPlayerStorageValue(cid, 74531349, -1) está certo, só tem que ver no contexto geral se o storage e aonde retirar está certo.
-
Estalaçao de ot server em ubuntu 16.04
Você vai precisar das sources para compilar para o linux, não é só rodar o .exe que vem como é no windows. Não sei se linux roda sqlite, mas mesmo assim acho um disperdicio você usar um sistema operacional bom e sqlite, que é ruim. Só tem desvantagens quando comparado ao mysql, que pode ser instalado com sei lá, 3,4 linhas de comando no ubuntu.
-
Cor do Hit Vermelho - Help
No que você está batendo? Estranho isso. Qual otserv você usa e foto do hit se possivel.
-
Script - BOSS
- AJUDA RESET SYSTEM MOD
--Script By Theax "" function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function getResets(cid) resets = getCreatureStorage(cid, 54676) if resets < 0 then resets = 0 end return resets end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']\n[Resets: '..getResets(thing.uid)..']') return true elseif thing.uid == cid then doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']\n[Resets: '..getResets(thing.uid)..']') local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end Testa esse look e me fala. Sobre a porta, ele não ta achando o script, porque essa mensagem nem tem no mod, tenta usar outro id de porta, as vezes a que você pegou é aquelas que não da pra passar.- (Resolvido)Premium Points in-game
Cara, acho que é o que você quer: Só editar o XXXX para o id do item. function onSay(cid, words, param) local points = getPlayerVipPoints(cid) local iditem = XXXX if param == "" or not tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, use somente numeros.") return true elseif points < tonumber(param) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Desculpe, mas você só possui "..points.." Premium Points.") return true end local item = doPlayerAddItem(cid, iditem, tonumber(param)) doItemSetAttribute(item, "description", "Essa coin foi adquirida pelo jogador ".. getPlayerName(cid) ..".") doPlayerRemoveVipPoints(cid, tonumber(param)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você recebeu "..tonumber(param).." premium coins, você ainda possui "..points.." Premium Points.") return true end Créditos pro @Vodkart porque usei partes do premium paper dele.- (Resolvido)Correção em um script action
Sobre o clicar no item e depois no char é problema do item que esta usando, ele tem o atributo "use with" (aquela mirazinha) Para não precisar clicar no char você tem que usar um cliente custom com o .dat editado (removendo isso do item) ou trocar o id do item que você usa para isso.- Tirar Exausted
Cara, se o servidor é local (não tem ping) pode ser delay do teclado. Vai em painel de controle > teclado E faz assim:- AJUDA RESET SYSTEM MOD
Haha, que nada. Questão de honra arrumar aquilo lá, o erro era tosco, depois que funciona que eu percebo, mas bom que deu certo. Faz o favor de testar com 2,3 resets pra ver se a mana e vida ta como queria. (Sendo multiplicada aqueles valores vezes os resets) Look: --Script By Theax "" function getPlayerFrags(cid) local time = os.time() local times = {today = (time - 86400), week = (time - (7 * 86400))} local contents, result = {day = {}, week = {}, month = {}}, db.getResult("SELECT `pd`.`date`, `pd`.`level`, `p`.`name` FROM `player_killers` pk LEFT JOIN `killers` k ON `pk`.`kill_id` = `k`.`id` LEFT JOIN `player_deaths` pd ON `k`.`death_id` = `pd`.`id` LEFT JOIN `players` p ON `pd`.`player_id` = `p`.`id` WHERE `pk`.`player_id` = " .. getPlayerGUID(cid) .. " AND `k`.`unjustified` = 1 AND `pd`.`date` >= " .. (time - (30 * 86400)) .. " ORDER BY `pd`.`date` DESC") if(result:getID() ~= -1) then repeat local content = {date = result:getDataInt("date")} if(content.date > times.today) then table.insert(contents.day, content) elseif(content.date > times.week) then table.insert(contents.week, content) else table.insert(contents.month, content) end until not result:next() result:free() end local size = { day = table.maxn(contents.day), week = table.maxn(contents.week), month = table.maxn(contents.month) } return size.day + size.week + size.month end function getResets(cid) resets = getCreatureStorage(cid, 54676) if resets < 0 then resets = 0 end return resets end function onLogin(cid) registerCreatureEvent(cid, "fraglook") return true end function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) and thing.uid ~= cid then doPlayerSetSpecialDescription(thing.uid,'[Frags: '..getPlayerFrags(thing.uid)..']') doPlayerSetSpecialDescription(thing.uid,'[Resets: '..getResets(thing.uid)..']') return true elseif thing.uid == cid then doPlayerSetSpecialDescription(cid,'[Frags: '..getPlayerFrags(cid)..']') doPlayerSetSpecialDescription(cid,'[Resets: '..getResets(cid)..']') local string = 'You see yourself.' if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then string = string..' You are '.. getPlayerGroupName(cid) ..'.' elseif getPlayerVocation(cid) ~= 0 then string = string..' You are '.. getPlayerVocationName(cid) ..'.' else string = string..' You have no vocation.' end string = string..getPlayerSpecialDescription(cid)..'' if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.' end if getPlayerGuildId(cid) > 0 then string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid) string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then string = string..'nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].' string = string..'nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.' end if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then string = string..'nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].' end doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string) return false end return true end- AJUDA RESET SYSTEM MOD
Retirei o reset no look, me manda o script que mostra o frags no look, vou colocar os dois juntos, se não ele vai mostrar ou um ou outro. <?xml version="1.0" encoding="UTF-8"?> <mod name="Reset System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes"> <!-- Configuracao --> <config name="reset_config"><![CDATA[ config = { level = 700, premium = false, storage = 54676, } function getResets(cid) resets = getCreatureStorage(cid, config.storage) if resets < 0 then resets = 0 end return resets end function reset(cid) if (config.premium and not(isPremium(cid)) ) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need have a premium account.") end if (getPlayerLevel(cid) < config.level) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisar Ser Lv "..config.level..".") end if not(getTilePzInfo(getCreaturePosition(cid))) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisa Tar em Area Pz Para Resetar.") end doPlayerAddLevel(cid, - (getPlayerLevel(cid) - 8)) doCreatureSetStorage(cid, config.storage, getResets(cid)+1) doRemoveCreature(cid) db.query("UPDATE `players` SET `health`= "..resethp..",`healthmax`= "..resethp.." WHERE `players`.`id`= ".. playerid .."") db.query("UPDATE `players` SET `mana`= "..resetmana..",`manamax`= "..resetmana.." WHERE `players`.`id`= ".. playerid .."") return true end ]]></config> <!-- Talkaction para resetar --> <talkaction words="!reset" event="buffer"><![CDATA[ domodlib('reset_config') if isInArray({1,2}, getPlayerVocation(cid)) then resethp = (getResets(cid)+1)*300 resetmana = (getResets(cid)+1)*1000 elseif getPlayerVocation(cid) == 3 then resethp = (getResets(cid)+1)*800 resetmana = (getResets(cid)+1)*500 elseif getPlayerVocation(cid) == 4 then resethp = (getResets(cid)+1)*1000 resetmana = (getResets(cid)+1)*300 end playerid = getPlayerGUID(cid) reset(cid) ]]></talkaction> <!-- Talkaction para ver quantos resets tem --> <talkaction words="!myresets" event="buffer"><![CDATA[ domodlib('reset_config') return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Tem "..getResets(cid).." Resets.") ]]></talkaction> <!-- Tile --> <movevent type="StepIn" actionid="9911" event="script"><![CDATA[ domodlib('reset_config') function onStepIn(cid, item, position, fromPosition) local minResets = 1 if (not(getResets(cid) >= minResets)) then doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") return doTeleportThing(cid, fromPosition) end doPlayerSendCancel(cid, "Bem Vindo") end ]]></movevent> <!-- Porta --> <action actionid="9910" event="script"><![CDATA[ domodlib('reset_config') function onUse(cid, item, position, fromPosition) local minResets = 5 if not(getResets(cid) >= minResets) then return doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") end doPlayerSendCancel(cid, "Bem Vindo") end ]]></action> </mod>- [creaturescript] Como diminuir a velocidade do distance effect?
O efeito anda? Não entendi. Ele teria que "andar" para acompanhar o player, não ficar rodando onde não tenha ninguem. Não?- [creaturescript] Como diminuir a velocidade do distance effect?
function onThink(cid, interval) local tempo = 300 local distance_effect = 18 local function getPosDirs(p, dir) return dir == 1 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 2 and {x=p.x-1, y=p.y-1, z=p.z} or dir == 3 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x-1, y=p.y+1, z=p.z} end local f = 1 local function executeEffect(cid) if isCreature(cid) then addEvent(doSendDistanceShoot, 500, getPosDirs(getThingPos(cid), f), getPosDirs(getThingPos(cid), f+1), distance_effect) if f == 4 then f = 1 else f = f + 1 end addEvent(executeEffect, tempo, cid) end end if getPlayerPremiumDays(cid) >= 1 and getPlayerGroupId(cid) < 4 then executeEffect(cid) end return true end Testa ai.- AJUDA RESET SYSTEM MOD
Favor testar, se resolver podemos voltar a parte de não precisar relogar o char, caso queira. <?xml version="1.0" encoding="UTF-8"?> <mod name="Reset System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes"> <!-- Configuracao --> <config name="reset_config"><![CDATA[ config = { level = 700, premium = false, storage = 54676, } function getResets(cid) resets = getCreatureStorage(cid, config.storage) if resets < 0 then resets = 0 end return resets end function reset(cid) if (config.premium and not(isPremium(cid)) ) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need have a premium account.") end if (getPlayerLevel(cid) < config.level) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisar Ser Lv "..config.level..".") end if not(getTilePzInfo(getCreaturePosition(cid))) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisa Tar em Area Pz Para Resetar.") end doPlayerAddLevel(cid, - (getPlayerLevel(cid) - 8)) doCreatureSetStorage(cid, config.storage, getResets(cid)+1) doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `health`= "..resethp..",`healthmax`= "..resethp.." WHERE `players`.`id`= ".. playerid .."") db.executeQuery("UPDATE `players` SET `mana`= "..resetmana..",`manamax`= "..resetmana.." WHERE `players`.`id`= ".. playerid .."") return true end ]]></config> <!-- Talkaction para resetar --> <talkaction words="!reset" event="buffer"><![CDATA[ domodlib('reset_config') if isInArray({1,2}, getPlayerVocation(cid)) then resethp = (getResets(cid)+1)*300 resetmana = (getResets(cid)+1)*1000 elseif getPlayerVocation(cid) == 3 then resethp = (getResets(cid)+1)*800 resetmana = (getResets(cid)+1)*500 elseif getPlayerVocation(cid) == 4 then resethp = (getResets(cid)+1)*1000 resetmana = (getResets(cid)+1)*300 end playerid = getPlayerGUID(cid) reset(cid) ]]></talkaction> <!-- Talkaction para ver quantos resets tem --> <talkaction words="!myresets" event="buffer"><![CDATA[ domodlib('reset_config') return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Tem "..getResets(cid).." Resets.") ]]></talkaction> <!-- Tile --> <movevent type="StepIn" actionid="9911" event="script"><![CDATA[ domodlib('reset_config') function onStepIn(cid, item, position, fromPosition) local minResets = 1 if (not(getResets(cid) >= minResets)) then doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") return doTeleportThing(cid, fromPosition) end doPlayerSendCancel(cid, "Bem Vindo") end ]]></movevent> <!-- Porta --> <action actionid="9910" event="script"><![CDATA[ domodlib('reset_config') function onUse(cid, item, position, fromPosition) local minResets = 5 if not(getResets(cid) >= minResets) then return doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") end doPlayerSendCancel(cid, "Bem Vindo") end ]]></action> <event type="login" name="lookResetLogin" event="script"><![CDATA[ domodlib('teamFunctions') function onLogin(cid) registerCreatureEvent(cid, "lookReset") return true end ]]></event> <event type="look" name="lookReset" event="script"><![CDATA[ domodlib('reset_config') function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\nResets: [" .. getResets(thing.uid) .."]") end return true end ]]></event> </mod>- [creaturescript] Como diminuir a velocidade do distance effect?
Deu algo?- Database nova
8.6 provavelmente é o 0.4 Pode pegar ali no link que passei do 0.4- [creaturescript] Como diminuir a velocidade do distance effect?
Deixei 500 de delay, não sei se vai funcionar, mas qualquer coisa da pra alterar o valor. function onThink(cid, interval) local tempo = 300 local distance_effect = 18 local function getPosDirs(p, dir) return dir == 1 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 2 and {x=p.x-1, y=p.y-1, z=p.z} or dir == 3 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x-1, y=p.y+1, z=p.z} end local f = 1 local function executeEffect(cid) if isCreature(cid) then addEvent(doSendDistanceShoot, 500, (getPosDirs(getThingPos(cid), f), getPosDirs(getThingPos(cid), f+1), distance_effect)) if f == 4 then f = 1 else f = f + 1 end addEvent(executeEffect, tempo, cid) end end if getPlayerPremiumDays(cid) >= 1 and getPlayerGroupId(cid) < 4 then executeEffect(cid) end return true end- Tenho uma idéia! sobre pvp
É possivel, assim como já existe em alguns servidores. Dê mais alguns detalhes: Quanto de exp ganharia. "Só recebessem lvl até 3 kills seguidos sobre o mesmo individuo" Quanto tempo pra isso passar? E mais alguma coisa que queira.- [AJUDA] Player morto mas vivo?
Poste seu creaturescripts.xml e erros no console quando isso acontecem. Existe algum onKill / onDeath bugando, que não deixa o player morrer mesmo.- Database nova
Qual servidor você usa? Na pasta deles deveria vir. Mas de qualquer forma. 0.4 - https://github.com/Fir3element/3777 1.2 - https://github.com/otland/forgottenserver/tree/1.2 1.3 - https://github.com/otland/forgottenserver Só clicar no arquivo que vai abrir, ai pode copiar o conteudo.- Resetar lvl otserver
Fazer o que foi falado acima, vai deixar todos os chares level 50 com vida, mana, cap, exp do level que estão. Para fazer corretamente teria que editar todas essas colunas. Essa: UPDATE `players` SET `level` = 50, `experience` = 1847300, `cap` = 1310; Depois essas: (Podem ser juntas) UPDATE players SET healthmax = ((players.level - 8) * 5 + 185), manamax = ((players.level - 8) * 30 + 35 WHERE vocation = 1 UPDATE players SET healthmax = ((players.level - 8) * 5 + 185), manamax = ((players.level - 8) * 30 + 35 WHERE vocation = 2 UPDATE players SET healthmax = ((players.level - 8) * 10 + 185), manamax = ((players.level - 8) * 15 + 35 WHERE vocation = 3 UPDATE players SET healthmax = ((players.level - 8) * 15 + 185), manamax = ((players.level - 8) * 5 + 35 WHERE vocation = 4 A cap varia de vocação, fiz uma média pra deixar todas com 1310, caso não queira mexer na cap (meio ruim, porque se estiverem level muito alto vão ficar com cap absurda depois de uparem novamente). E as linhas debaixo são para arrumar a vida/mana de cada vocação, tendo em vista que cada vocação tem vida/mana diferente no level 50.- AJUDA RESET SYSTEM MOD
Cara, desculpa todo esse transtorno, é foda escrever sem testar. Fiz de outro jeito, que o char é relogado, não tava conseguindo editar a vida dele com o char on, favor testar. <?xml version="1.0" encoding="UTF-8"?> <mod name="Reset System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes"> <!-- Configuracao --> <config name="reset_config"><![CDATA[ config = { level = 700, premium = false, storage = 54676, } function getResets(cid) resets = getCreatureStorage(cid, config.storage) if resets < 0 then resets = 0 end return resets end function reset(cid) if (config.premium and not(isPremium(cid)) ) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need have a premium account.") end if (getPlayerLevel(cid) < config.level) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisar Ser Lv "..config.level..".") end if not(getTilePzInfo(getCreaturePosition(cid))) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisa Tar em Area Pz Para Resetar.") end resetando = getResets(cid)+1 if isInArray({1,2}, getPlayerVocation(cid)) then local resethp = resetando*300 local resetmana = resetando*1000 elseif getPlayerVocation(cid) == 3 then local resethp = resetando*800 local resetmana = resetando*500 elseif getPlayerVocation(cid) == 4 then local resethp = resetando*1000 local resetmana = resetando*300 end doPlayerAddLevel(cid, - (getPlayerLevel(cid) - 8)) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doCreatureSetStorage(cid, config.storage, getResets(cid)+1) return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens, Voce Foi Resetado. Voce Agora Tem "..getResets(cid).." Resets.") doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `health`= "..resethp..",`healthmax`= "..resethp.." WHERE `players`.`id`= ".. playerid .."") db.executeQuery("UPDATE `players` SET `mana`= "..resetmana..",`manamax`= "..resetmana.." WHERE `players`.`id`= ".. playerid .."") end ]]></config> <!-- Talkaction para resetar --> <talkaction words="!reset" event="buffer"><![CDATA[ domodlib('reset_config') playerid = getPlayerGUID(cid) reset(cid) ]]></talkaction> <!-- Talkaction para ver quantos resets tem --> <talkaction words="!myresets" event="buffer"><![CDATA[ domodlib('reset_config') return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Tem "..getResets(cid).." Resets.") ]]></talkaction> <!-- Tile --> <movevent type="StepIn" actionid="9911" event="script"><![CDATA[ domodlib('reset_config') function onStepIn(cid, item, position, fromPosition) local minResets = 1 if (not(getResets(cid) >= minResets)) then doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") return doTeleportThing(cid, fromPosition) end doPlayerSendCancel(cid, "Bem Vindo") end ]]></movevent> <!-- Porta --> <action actionid="9910" event="script"><![CDATA[ domodlib('reset_config') function onUse(cid, item, position, fromPosition) local minResets = 5 if not(getResets(cid) >= minResets) then return doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") end doPlayerSendCancel(cid, "Bem Vindo") end ]]></action> <event type="login" name="lookResetLogin" event="script"><![CDATA[ domodlib('teamFunctions') function onLogin(cid) registerCreatureEvent(cid, "lookReset") return true end ]]></event> <event type="look" name="lookReset" event="script"><![CDATA[ domodlib('reset_config') function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\nResets: [" .. getResets(thing.uid) .."]") end return true end ]]></event> </mod>- AJUDA RESET SYSTEM MOD
@luannhrj Era pra acontecer aquilo mesmo, achei o erro e agora acho que corrigi. Favor testar, testa também o look. <?xml version="1.0" encoding="UTF-8"?> <mod name="Reset System" version="1.0" author="Kimoszin" contact="tibiaking.com" enabled="yes"> <!-- Configuracao --> <config name="reset_config"><![CDATA[ config = { level = 700, premium = false, storage = 54676, } function getResets(cid) resets = getCreatureStorage(cid, config.storage) if resets < 0 then resets = 0 end return resets end function reset(cid) if (config.premium and not(isPremium(cid)) ) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You need have a premium account.") end if (getPlayerLevel(cid) < config.level) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisar Ser Lv "..config.level..".") end if not(getTilePzInfo(getCreaturePosition(cid))) then return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Presisa Tar em Area Pz Para Resetar.") end resetando = getResets(cid)+1 if isInArray({1,2}, getPlayerVocation(cid)) then local resethp = resetando*300 local resetmana = resetando*1000 elseif getPlayerVocation(cid) == 3 then local resethp = resetando*800 local resetmana = resetando*500 elseif getPlayerVocation(cid) == 4 then local resethp = resetando*1000 local resetmana = resetando*300 end local hp = getCreatureMaxHealth(cid) local mana = getCreatureMaxMana(cid) local differencehp = (hp - resethp) local differencemana = (mana - resetmana) setCreatureMaxHealth(cid, resethp) setCreatureMaxMana(cid, resetmana) doCreatureAddHealth(cid, -differencehp) doCreatureAddMana(cid, -differencemana) doPlayerAddLevel(cid, - (getPlayerLevel(cid) - 8)) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_GREEN) doCreatureSetStorage(cid, config.storage, getResets(cid)+1) return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Parabens, Voce Foi Resetado. Voce Agora Tem "..getResets(cid).." Resets.") end ]]></config> <!-- Talkaction para resetar --> <talkaction words="!reset" event="buffer"><![CDATA[ domodlib('reset_config') reset(cid) ]]></talkaction> <!-- Talkaction para ver quantos resets tem --> <talkaction words="!myresets" event="buffer"><![CDATA[ domodlib('reset_config') return doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Voce Tem "..getResets(cid).." Resets.") ]]></talkaction> <!-- Tile --> <movevent type="StepIn" actionid="9911" event="script"><![CDATA[ domodlib('reset_config') function onStepIn(cid, item, position, fromPosition) local minResets = 1 if (not(getResets(cid) >= minResets)) then doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") return doTeleportThing(cid, fromPosition) end doPlayerSendCancel(cid, "Bem Vindo") end ]]></movevent> <!-- Porta --> <action actionid="9910" event="script"><![CDATA[ domodlib('reset_config') function onUse(cid, item, position, fromPosition) local minResets = 5 if not(getResets(cid) >= minResets) then return doPlayerSendCancel(cid, "Desculpa, Voce presisa ter "..minResets.." Resets Para Passar Aqui") end doPlayerSendCancel(cid, "Bem Vindo") end ]]></action> <event type="login" name="lookResetLogin" event="script"><![CDATA[ domodlib('teamFunctions') function onLogin(cid) registerCreatureEvent(cid, "lookReset") return true end ]]></event> <event type="look" name="lookReset" event="script"><![CDATA[ domodlib('reset_config') function onLook(cid, thing, position, lookDistance) if isPlayer(thing.uid) then doPlayerSetSpecialDescription(thing.uid, "\nResets: [" .. getResets(thing.uid) .."]") end return true end ]]></event> </mod> - AJUDA RESET SYSTEM MOD
Informação Importante
Confirmação de Termo