Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Preciso de um !rank reset, se alguem puder ajudar.

 

Aqui meu script do reset :

function onSay(cid, words, param)

--[Configurações de Condição]__

config = { --[[verdadeiro / Falso]]

needPa = false, -- Precisa de Premium Account? [true / false]
needPz = true, -- Precisa estar em Protection Zone? [true / false]
battle = false, -- Precisa estar sem Batlle para Resetar? [true / false]
withe = false, -- Players PK Withe pode Resetar? [true / false]
red = true, -- Players PK Red pode Resetar? [true / false]
tp = true, -- Teleportar para o Templo após o reset? [true / false]
look = true, -- Mostrar Resets no Look do Player? [true / false]
addLimite = false, -- Abilitar Limite de Resets? [true / false]
setClasse = false, -- Mudar Vocação do player quando resetar? [true / false]
storage = 2310, -- Storage [valor]


--[Configurações do Reset]__

resetStatus = {

player = getPlayerGUID(cid), -- Não Mude.
lvl = 717.217 , -- Level Necessário para Resetar. [valor]
lvlreset = 100, -- Level que retornará após o Reset. [valor]
limite = 10, -- Máximo de resets que um player pode chegar. [valor]
newClasse = 5, -- Id da Nova Vocação após o Reset. [valor]
tempo= 1 -- Tempo para o Player deslogar para Resetar. Em segundos. [valor]
},
}

--[Funções]__

function Reseting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end

function noAll(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end

function noTeleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end

function noLook(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
return TRUE
end

function noClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end

function setClasse(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doPlayerSetVocation(cid, config.resetStatus.newClasse)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end

function look(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset "..resets.."]' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end

function teleporting(cid)
resets = getResets(cid)
setPlayerStorageValue(cid,config.storage,resets+1)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = '' WHERE `players`.`id` = "..config.resetStatus.player)
db.executeQuery("UPDATE `players` SET `level` = "..config.resetStatus.lvlreset..", `experience` = 0 WHERE `id` = "..config.resetStatus.player)
return TRUE
end

function getResets(cid)
resets = getPlayerStorageValue(cid,config.storage)

if resets < 0 then
resets = 0
end
return resets

end


local resets = getResets(cid)
local needLvl ="Você precisa de "..config.resetStatus.lvl-getPlayerLevel(cid).." level's para resetar."
local msg ="~~[Reset: "..getResets(cid).."]~~ 'Sucesso ao Resetar! Você será deslogado em "..config.resetStatus.tempo.." Segundos."


--[Condiçoes]__

if(config.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar em Protection Zone Para Resetar.")
return TRUE

elseif(config.addLimite == true) and (getResets(cid) == config.resetStatus.limite) then
doPlayerSendTextMessage(cid, 22, "Você ja atingiu o Limite de Resets.")
return TRUE

elseif(config.withe == false) and (getCreatureSkullType(cid) == 3) then
doPlayerSendTextMessage(cid,22,"Você ta PK White, por isso não pode resetar.")
return TRUE

elseif(config.red == false) and (getCreatureSkullType(cid) == 4) then
doPlayerSendTextMessage(cid,22,"Você ta PK Red, por isso não pode resetar.")
return TRUE

elseif(config.needPa == true) and not isPremium(cid) then
doPlayerSendTextMessage(cid,22,"Você Precisa ser Premium Account para Resetar.")
return TRUE

elseif(config.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid,22,"Você Precisa estar sem Battle para Resetar.")
return TRUE

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == true) then
addEvent(Reseting, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == false) then
addEvent(noAll, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == true) then
addEvent(noTeleporting, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == true) then
addEvent(noLook, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == true) and (config.setClasse == false) then
addEvent(noClasse, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == false) and (config.setClasse == true) then
addEvent(setClasse, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == false) and (config.look == true) and (config.setClasse == false) then
addEvent(look, config.resetStatus.tempo* 1000, cid)

elseif getPlayerLevel(cid) >= config.resetStatus.lvl and (config.tp == true) and (config.look == false) and (config.setClasse == false) then
addEvent(teleporting, config.resetStatus.tempo* 1000, cid)

elseif doPlayerSendCancel(cid, needLvl) then
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return TRUE
end
if doPlayerPopupFYI(cid, msg) then

end
return TRUE

end

Café é bom :3  :accept:  :accept:  :accept:

 

esfregaoinfinito.gif

Link para o post
Compartilhar em outros sites

talkactions/script/ranks.lua

 

 

 

local config = {
MaxPlayer = 20,
fight_skills = {
['fist'] = 0,
['club'] = 1,
['sword'] = 2,
['axe'] = 3,
['distance'] = 4,
['shielding'] = 5,
['fishing'] = 6,
['dist'] = 4,
['shield'] = 5,
['fish'] = 6,
},
other_skills = {
[''] = "level",
['level'] = "level",
['magic'] = "maglevel",
['health'] = "healthmax",
['mana'] = "manamax",
['reset'] = "reset"
},
vocations = {
['sorcerer'] = {1,5},
['druid'] = {2,6},
['paladin'] = {3,7},
['knight'] = {4,8}
}
}
function onSay(cid, words, param)
local param,str = string.lower(param),""
if not config.fight_skills[param] and not config.other_skills[param] and not config.vocations[param] then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "este rank não existe.") return true
end
str = "--[ RANK "..(param == "" and "LEVEL" or string.upper(param)).." ]--\n\n"
query = config.fight_skills[param] and db.getResult("SELECT `player_id`, `value` FROM `player_skills` WHERE `skillid` = "..config.fight_skills[param].." ORDER BY `value` DESC;") or config.other_skills[param] and db.getResult("SELECT `name`, `"..config.other_skills[param].."` FROM `players` WHERE `id` > 6 AND `group_id` < 2 ORDER BY `"..config.other_skills[param].."` DESC, `name` ASC;") or db.getResult("SELECT `name`, `level` FROM `players` WHERE `group_id` <= 2 AND `vocation` = "..config.vocations[param][1].." or `vocation` = "..config.vocations[param][2].." ORDER BY `level` DESC;")
if (query:getID() ~= -1) then
k = 1
while true do
str = str .. "\n " .. k .. ". "..(config.fight_skills[param] and getPlayerNameByGUID(query:getDataString("player_id")) or query:getDataString("name")).." - [" .. query:getDataInt(config.fight_skills[param] and "value" or config.vocations[param] and "level" or config.other_skills[param]) .. ]"
k = k + 1
if not(query:next()) or k > config.MaxPlayer then
break
end
end
query:free()
end
doShowTextDialog(cid,6500, str)
return true
end

 

Créditos: Vodkart

Link para o post
Compartilhar em outros sites

Aparece isso na distro e aparece personagens que nem resetaram...

[04/02/2014 22:13:31] Error during getDataInt(reset).
[04/02/2014 22:13:31] Error during getDataInt(reset).
[04/02/2014 22:13:31] Error during getDataInt(reset).
[04/02/2014 22:13:32] Error during getDataInt(reset).
[04/02/2014 22:13:32] Error during getDataInt(reset).
[04/02/2014 22:13:33] Error during getDataInt(reset).
[04/02/2014 22:13:33] Error during getDataInt(reset).
[04/02/2014 22:13:33] Error during getDataInt(reset).
[04/02/2014 22:13:33] Error during getDataInt(reset).
[04/02/2014 22:13:34] Error during getDataInt(reset).
[04/02/2014 22:13:34] Error during getDataInt(reset).
[04/02/2014 22:13:35] Error during getDataInt(reset).
[04/02/2014 22:13:35] Error during getDataInt(reset).
[04/02/2014 22:13:35] Error during getDataInt(reset).
[04/02/2014 22:13:36] Error during getDataInt(reset).
[04/02/2014 22:13:36] Error during getDataInt(reset).
[04/02/2014 22:13:36] Error during getDataInt(reset).
[04/02/2014 22:13:37] Error during getDataInt(reset).
[04/02/2014 22:13:37] Error during getDataInt(reset).
[04/02/2014 22:13:37] Error during getDataInt(reset).

Café é bom :3  :accept:  :accept:  :accept:

 

esfregaoinfinito.gif

Link para o post
Compartilhar em outros sites
  • 1 month later...

alguem me ajuda meu ot e 8.6 mapa global colokei o sistema de reset ele conta que ta sendo resetando 1 reset 2 e assim por diante  mais ele não volta o lvl do player alguem me ajuda?????????????????

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Bagon
      Bom, hoje venho trazer á vocês um sistema de Pet System DIFERENCIADO de alguns presentes no fórum. Este sistema tem diversos comandos diferenciados, como: 
       
      !pet nomedopet este comando irá sumonar o pet. 
      !remove irá remover o pet.
      !fale eu sou lindo o pet falará "eu sou lindo"
      !conversar o pet irá conversar com vc. 
       
      Então sem mais delongas vamos ao script.
       
      OBS: SCRIPT TESTADO SOMENTE EM TFS 0.4/0.3, e este script foi feito com a intenção de ser vendido no site do ot ou em poderá usar como quest usando o item selecionado como premio. fique ao seu critério.
       
      Primeiro vá até a pasta talkaction/script e crie um arquivo chamado petsystem.lua, depois coloque o seguinte script:
       
       
      Agora em talkactions/talkactions.xml adicione a seguinte tag:
       
      <talkaction words="!pet;!remove;!fale;!conversar" event="script" value="petsystem.lua" />  
      EXPLICAÇÂO:
      As partes em Negrito, são os pets. Você pode alterar ou criar monstros para fazer eles como pets. (Recomendo criar um monstro para que seja somente pet.)
       
      Exemplo: ["dog"]= {stor=78552},      
       
       
      Lembrando que é necessário mudar esta parte no script do monstro colocado a cima.
       
      <flag attackable="1" /> para :
       
      <flag attackable="0" />  
      agora vá em action/script e crie um arquivo chamado pet com o seguinte script:
       
       
      e vá em action.xml e adiciona a seguinte tag:
       
      <action itemid="10063" script="pet.lua"/> Explicação: Na tag da action o itemid é o item que deverá ser usado para ganhar a storage 78552, e assim podera sumonar o monstro com esta storage.
       
                                              
                                                         CRIE UMA ACTION COM A TAG A CIMA PARA CADA MONSTRO COLOCADO NA TALKACTION,
                                                         BASTA VC ALTERAR A STORAGE DO SCRIPT DA ACTION
                                                         EXEMPLO: em action altere as storage que estão em vermelho, como mostra abaixo
       
                                                              if getPlayerStorageValue(cid, 78552) < 1 then
                                                              setPlayerStorageValue(cid, 78552, 1)
       
                                                         aonde tem 78552 altere para 78553 que no caso é a storage do cyclops escolhido lá no script da talkaction
                                                         e assim susecivelmente.
       
       
       
      CREDITOS:
      Mulizeu
      Smartbox
      Bagon 
       
    • Por Imperius
      Olá, pessoal! Acabei encontrando um script que tinha feito a um tempo atrás. Estou compartilhando aqui para quem quiser usar ou melhorar.
       
      É bem parecido com os outros sistemas de roleta, igual deste tópico: https://tibiaking.com/forums/topic/101557-action-cassino-roleta-de-items/
       
      Como funciona?
       
      O "Treasure Chest" é um item custom, onde o jogador têm a possibilidade de ganhar itens raros ou bem meia boca. Tudo dependerá da sorte.
       
      O jogador precisa tacar o treasure chest na bancada e acionar a alavanca. O treasure chest irá se transformar em vários itens de forma randômica no qual o jogador poderá ou não ganhar. No final, apenas um item é entregue ao jogador.
       
      Para entender melhor o seu funcionamento, segue o GIF abaixo:
       

       
       
      em data > actions > actions.xml
       
       
      em data > actions > scripts > crie um arquivo chamado leverTreasureChest.lua
       
       
      no banco de dados do servidor, adicione o seguinte código em "SQL":
       
       
       

      Também estou disponibilizando uma página PHP, para quem quiser usar no site do servidor. Na página tem informações sobre o funcionamento, quais são os possíveis prêmios e a lista de jogadores que ganharam os itens raros.
       

       
       
      Espero ter ajudado de alguma forma! : )
       
      treasure_chest.php
    • Por Linus
      Você  pode configurar se quer que o preço aumente a cada reset, se quer que o level pra resetar aumente e se vc quer que a vida resete junto (e quanto % da vida atual será a vida após resetar).
       
       
      Testado em tfs 1.1, Versão 10.77
       
       
       
       
      Vá em data/npc/lib/ crie npc_resets.lua :
       



       
      Você pode editar mexendo aqui. no script acima :
      config = { minlevel = 150, --- Level inical para resetar price = 10000, --- Preço inicial para resetar newlevel = 20, --- Level após reset priceByReset = 0, --- Preço acrescentado por reset percent = 30, ---- Porcentagem da vida/mana que você terá ao resetar (em relação à sua antiga vida total) maxresets = 50, ---- Maximo de resets levelbyreset = 0 --- Quanto de level vai precisar a mais no próximo reset } agora em data/npc/ crie reseter.XML :
       



       
       
       
      Agora em data/npc/scripts crie reseter.lua :
       



       
       
       
      Img : 
       

    • Por Sekk
      Bom, procurei esse Castle por MUITO TEMPO, mas não achei em NENHUM LUGAR DA INTERNET. Ontem, eu estava vendo alguns mapas do @Deathrocks, e vi nos prints, que o mapa possuia o evento que eu queria!
       
      Então baixei o mapa e extrai o evento, então venho lhes trazer!
       
       
      Nome: Castle 24H
      Cliente: 8.6
      Versão TFS: 0.4
      Tipo: Evento
       
      Bom, para começar, vamos em actions/scripts e crie 2 arquivos:
       
      castledoor1.lua
       
      castlewar1.lua
       
        Agora em actions.xml adicione as tags:
       
      Agora em monster/traps crie 3 arquivos:
       
      porta.xml
       
      protectcastle.xml  
      statue.xml  
      Agora em monsters.xml adicione as tags:    
      Vamos para movements/scripts e crie 2 arquivos:
       
      castlewar2.lua
       
      level.lua  
      Agora em movements.xml adicione as tags:  
       
      Pronto. Agora você só precisa baixar o mapa, inserir o mesmo ao seu servidor, configurar os teleports, e as hunts dentro do castle etc.
       
      PRINTS:
      1ª parte
       
      2ª parte:
       
      Obs.: Todos os ActionID e monsters já estão no mapa! Você só precisa configurar as coordenadas dos teleports, e o que possui no castle!
       
      Obs².: Tudo o que você pode configurar, já está escrito em cada script!
       
       
      Créditos:
      @DeathRocks
      PC98
      mapa.rar
    • Por MySticaL
      Como funciona esse sistema?
      R-> Simples caso seu otServ for para todos os players, de todos continentes e você não
      queira deixar as funções em lua apenas em uma língua, você pode utilizar esse sistema.
       
      Como usar?
      R-> Após o sistema estar instalado 100%, vai ter 3 comandos: !lang en (setar a linguagem para english), !lang pt (setar a linguagem portuguese) &
      !lang es (setar a linguagem espanõl).

      Vamos começar, vai em data/lib/ e crie um arquivo chamado lang system.lua e coloque isto dentro:
      function getPlayerLanguage(cid) local Lang = db.getResult("SELECT `language` FROM `accounts` WHERE `id` = " .. getPlayerAccountId(cid) .. " LIMIT 1") if Lang:getID() ~= LUA_ERROR then local langid = Lang:getDataInt("language") Lang:free() return langid end return LUA_ERROR end function doPlayerSetLanguage(cid, new) local acc = getPlayerAccountId(cid) if new == 2 then db.executeQuery("UPDATE `accounts` SET language = 2 WHERE `id` = " .. acc) elseif new == 1 then db.executeQuery("UPDATE `accounts` SET language = 1 WHERE `id` = " .. acc) else db.executeQuery("UPDATE `accounts` SET language = 0 WHERE `id` = " .. acc) end end Ainda em data/lib encontre o arquivo 000-constant.lua e coloque ao final dele isto:
      ENGLISH = 2 SPANISH = 1 PORTUGUES = 0 Agora execute este código na sua SQL:
      ALTER TABLE `accounts` ADD `language` INT( 11 ) NOT NULL DEFAULT '0' Pronto, o sistema está pronto agora vamos criar um comando para que troque a linguagem, vá em data/talkactions/scripts
      e crie um arquivo chamado lang.lua e coloque isto dentro:
      function onSay(cid, words, param) if(param == '') then return true end if(param == 'en') then if getPlayerLanguage(cid) == 2 then doPlayerSendTextMessage(cid, 20, "[Language System (Beta)] Your language is alredy set to english.") return true else doPlayerSendTextMessage(cid, 27, "[Language System (Beta)] You have set english as your language.") doPlayerSetLanguage(cid, 2) return true end end if(param == 'pt') then if getPlayerLanguage(cid) == 0 then doPlayerSendTextMessage(cid, 20, "[Language System (Beta)] Sua língua já está definida como português.") return true else doPlayerSendTextMessage(cid, 27, "[Language System (Beta)] Você definiu o português como sua língua.") doPlayerSetLanguage(cid, 0) return true end end if(param == 'es') then if getPlayerLanguage(cid) == 1 then doPlayerSendTextMessage(cid, 20, "[Language System (Beta)] Su lengua ya esta definida como español.") return true else doPlayerSendTextMessage(cid, 27, "[Language System (Beta)] Tu definistes el español como tu lengua.") doPlayerSetLanguage(cid, 1) return true end end end E em data/talkactions abra o talkactions.xml e coloque está tag:
      <talkaction log="yes" words="!lang" event="script" value="lang.lua"/> Vou dar um exemplo de como usa-la em .lua:
      if getPlayerLanguage(cid) == 2 then doPlayerSendTextMessage(cid, 25, "This message will be displayed in English if the language of the player is in -en!") end if getPlayerLanguage(cid) == 0 then doPlayerSendTextMessage(cid, 25, "Está mensagem será exibida em português se a linguagem do jogador estiver em -pt!") end if getPlayerLanguage(cid) == 1 then doPlayerSendTextMessage(cid, 25, "Usted mensaje se mostrará en Espanõl si el jugador está en el lenguaje -es!") end Outro Exemplo:
      function onLogin(cid) local langmsg = { [ENGLISH] = {"This message will be displayed in English if the language of the player is in -en!"} [SPANISH] = {"Usted mensaje se mostrará en Espanõl si el jugador está en el lenguaje -es!"}, [PORTUGUES] = {"Está mensagem será exibida em português se a linguagem do jogador estiver em -pt!"}, } doPlayerSendTextMessage(cid, 25, langmsg[getPlayerLanguage(cid)][1]) return true end Pronto, agora o sistema está perfeito, os comandos estão no começo do tópico em "Como usar?"
       
      créditos:
      Acubens 
      Drazyn1291 
      MySticaL
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo