Ir para conteúdo
  • Cadastre-se

(Resolvido)[Pedido/Ajuda] Arquivo look.lua mostrando Gods com descrição de player


Ir para solução Resolvido por zipter98,

Posts Recomendados

Primeiramente olá a todos,


Me lembro de já ter criado um tópico como este anteriormente , mas não estou encontrando-o no meu conteúdo de meu perfil , então infelizmente venho aqui criá-lo novamente e conto com a ajuda de vocês denovo  ^^ 



Gostaria da script , ou de onde devo editar , para fazer com que ao dar look em alguém da staff [ God , Cm , etc.. ] (exceto tutores) mostre como se fosse um jogador comum.  


"He's a pokemon trainer."



Segue abaixo o arquivo Look.lua

local NPCBattle = {

["Brock"] = {artig = "He is", cidbat = "Pewter"},
["Misty"] = {artig = "She is", cidbat = "Cerulean"}, 
["Blaine"] = {artig = "He is", cidbat = "Cinnabar"},
["Sabrina"] = {artig = "She is", cidbat = "Saffron"},         --alterado v2.9 \/ peguem tudo!
["Kira"] = {artig = "She is", cidbat = "Viridian"},
["Koga"] = {artig = "He is", cidbat = "Fushcia"},
["Erika"] = {artig = "She is", cidbat = "Celadon"},
["Surge"] = {artig = "He is", cidbat = "Vermilion"},
}
 
function onLook(cid, thing, position, lookDistance)
 
local str = {}
 
if not isCreature(thing.uid) then
   local iname = getItemInfo(thing.itemid)
   if isPokeball(thing.itemid) and getItemAttribute(thing.uid, "poke") then
      
      unLock(thing.uid)
      local lock = getItemAttribute(thing.uid, "lock")        
      local pokename = getItemAttribute(thing.uid, "poke")
 
      table.insert(str, "You see "..iname.article.." "..iname.name..".")
      if getItemAttribute(thing.uid, "unique") then               
         table.insert(str, " It's an unique item.")   
      end
      table.insert(str, "\nIt contains "..getArticle(pokename).." "..pokename.." [level "..getItemAttribute(thing.uid, "level").."].\n")  
      if lock and lock > 0 then
         table.insert(str, "It will unlock in ".. os.date("%d/%m/%y %X", lock)..".\n")  
      end
      local boost = getItemAttribute(thing.uid, "boost") or 0
      if boost > 0 then
         table.insert(str, "Boost level: +"..boost..".\n")
      end
      if getItemAttribute(thing.uid, "nick") then
         table.insert(str, "It's nickname is: "..getItemAttribute(thing.uid, "nick")..".\n")
      end
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")      
      else
         table.insert(str, "It is genderless.")
      end
  table.insert(str, "\n--- Status ---")    
      table.insert(str, "\nOffense: "..math.floor(getItemAttribute(thing.uid, "offense")).." Defense: "..math.floor(getItemAttribute(thing.uid, "defense")).."\n")
      table.insert(str, "Agility: "..math.floor(getItemAttribute(thing.uid, "speed")).." Sp. Attack: "..math.floor(getItemAttribute(thing.uid, "specialattack")).."\n")
      table.insert(str, "Vitality: "..math.floor(getItemAttribute(thing.uid, "vitality")).."")
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif string.find(iname.name, "fainted") or string.find(iname.name, "defeated") then
      
      table.insert(str, "You see a "..string.lower(iname.name).." ["..getItemAttribute(thing.uid, "level").."]. ")    
      if isContainer(thing.uid) then
         table.insert(str, "(Vol: "..getContainerCap(thing.uid)..")")
      end
      table.insert(str, "\n")
 
      if getItemAttribute(thing.uid, "gender") == SEX_MALE then
         table.insert(str, "It is male.")
      elseif getItemAttribute(thing.uid, "gender") == SEX_FEMALE then
         table.insert(str, "It is female.")
      else
         table.insert(str, "It is genderless.")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif isContainer(thing.uid) then     --containers
      
      if iname.name == "dead human" and getItemAttribute(thing.uid, "pName") then
         table.insert(str, "You see a dead human (Vol:"..getContainerCap(thing.uid).."). ")
         table.insert(str, "You recognize ".. getItemAttribute(thing.uid, "pName")..". ".. getItemAttribute(thing.uid, "article").." was killed by a ")
         table.insert(str, getItemAttribute(thing.uid, "attacker")..".")
      else   
         table.insert(str, "You see "..iname.article.." "..iname.name..". (Vol:"..getContainerCap(thing.uid)..").")
      end
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")     
         local pos = getThingPos(thing.uid)
         table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")  
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   elseif getItemAttribute(thing.uid, "unique") then    --alterado v2.8 \/
      local p = getThingPos(thing.uid)
   
      table.insert(str, "You see ")
      if thing.type > 1 then
         table.insert(str, thing.type.." "..iname.plural..".")
      else
         table.insert(str, iname.article.." "..iname.name..".")
      end
      table.insert(str, " It's an unique item.\n"..iname.description)
      
      if getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 6 then
         table.insert(str, "\nItemID: ["..thing.itemid.."]")
         table.insert(str, "\nPosition: ["..p.x.."]["..p.y.."]["..p.z.."]")
      end
   
      sendMsgToPlayer(cid, MESSAGE_INFO_DESCR, table.concat(str))
      return false
      
   else
      return true
   end
end
 
local npcname = getCreatureName(thing.uid)
if isNpc(thing.uid) and NPCBattle[npcname] then    --npcs duel
   table.insert(str, "You see "..npcname..". "..NPCBattle[npcname].artig.." leader of the gym from "..NPCBattle[npcname].cidbat..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
if getPlayerStorageValue(thing.uid, 697548) ~= -1 then    --npcs de TV
   table.insert(str, getPlayerStorageValue(thing.uid, 697548))                                   
   local pos = getThingPos(thing.uid)
   if youAre[getPlayerGroupId(cid)] then
      table.insert(str, "\nPosition: [X: "..pos.x.."][Y: "..pos.y.."][Z: "..pos.z.."]")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str)) 
   return false
end
 
if not isPlayer(thing.uid) and not isMonster(thing.uid) then    
   table.insert(str, "You see "..getCreatureName(thing.uid)..".")
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
end
 
if isPlayer(thing.uid) then     --player
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, getPlayerDesc(cid, thing.uid, false))  
return false
end
 
if getCreatureName(thing.uid) == "Evolution" then return false end
 
if not isSummon(thing.uid) then
   table.insert(str, "You see a wild "..string.lower(getCreatureName(thing.uid)).." [level "..getPokemonLevel(thing.uid).."].\n")
   if getPokemonGender(thing.uid)  == SEX_MALE then
      table.insert(str, "It is male.")
   elseif getPokemonGender(thing.uid)  == SEX_FEMALE then
      table.insert(str, "It is female.")
   else
      table.insert(str, "It is genderless.")
   end
   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   return false
   
elseif isSummon(thing.uid) and not isPlayer(thing.uid) then
   local boostlevel = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "boost") or 0
   local boostshow = " + "..boostlevel.."]"
   if showBoostSeparated then
      boostshow = "] [+"..boostlevel.."]"
   end
   local levelinfo = "["..getPokemonLevel(thing.uid)..""..boostshow..""
   if getCreatureMaster(thing.uid) == cid then
      local myball = getPlayerSlotItem(cid, 8).uid
      local nexp = getItemAttribute(myball, "nextlevelexp")
      table.insert(str, "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".")
      table.insert(str, "\nHit points: "..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid)..".")
      table.insert(str, "\n"..getPokemonHappinessDescription(thing.uid))
      if getItemAttribute(myball, "level") <= 99 then
         table.insert(str, "\nExperience needed to level up: "..nexp..".")
      end
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, table.concat(str))
   else
      doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\nIt belongs to "..getCreatureName(getCreatureMaster(thing.uid))..".")
   end
   return false
end
return true
end





Bem , é isto , conto com a ajuda de vocês.   :laugh:


bump

look.lua

Link para o post
Compartilhar em outros sites

creio q no Groups, em CustomFlags tem uma opção que pode desabilitar isto, aki no TibiaKing acho q ja vi uma calculadora de flags

sabe quando vc vai no Groups,xml e la tem Flags e CustomFlasgs? entao pegando este numero e colocando na calculadora de Flags vc pode editar as limitações e permissoes

 

http://www.tibiaking.com/forum/topic/9640-flags-calculator-html/

 

Baixe o Flags Calculator e no Custom Flags coloque o codigo do seu C.F. e de update, 

Creio q desabilitando esta oção vai deixar com look de player

Gamemaster privileges*

Editado por CoyoteStark (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

vai no seu configuration.lua e procura isso

 

youAre = {
[3] = "a Senior Tutor",
[4] = "a Game Master",
[5] = "a Sub Administrador",
[6] = "a Administrador"
}

ai depois só mudar como você quiser

 

 

youAre = {
[3] = "a Senior Tutor",
[4] = "a Pokemon Trainer",
[5] = "a Pokemon Trainer",
[6] = "a Pokemon Trainer "
}

Meu Ultimo projeto em desenvolvimento!

 

http://www.tibiaking.com/forum/topic/47753-show-off-ultimo-projeto-para-download/

 

 

Grupo do facebook para OtServidores! (Divulgação + Criação de Equipe)

 

https://www.facebook.com/groups/otservidores/

 

Link para o post
Compartilhar em outros sites

Vou tentar das duas maneira sugeridas , e obrigado pela ajuda de ambos.


Se não me falha a memória , a última vez que pedi ajuda com isso , a pessoa me enviou o arquivo  look.lua editado e foi o suficiente , mas vou testar aqui a teoria de ambos e volto assim que possível para editar o tópico e etc.
 

 

creio q no Groups, em CustomFlags tem uma opção que pode desabilitar isto, aki no TibiaKing acho q ja vi uma calculadora de flags

sabe quando vc vai no Groups,xml e la tem Flags e CustomFlasgs? entao pegando este numero e colocando na calculadora de Flags vc pode editar as limitações e permissoes

 

http://www.tibiaking.com/forum/topic/9640-flags-calculator-html/

 

Baixe o Flags Calculator e no Custom Flags coloque o codigo do seu C.F. e de update, 

Creio q desabilitando esta oção vai deixar com look de player

Gamemaster privileges*


A versão 8.54 está dentro de que Rev ??  Saberia dizer ?

 

 

vai no seu configuration.lua e procura isso

 

youAre = {
[3] = "a Senior Tutor",
[4] = "a Game Master",
[5] = "a Sub Administrador",
[6] = "a Administrador"
}

ai depois só mudar como você quiser

 

 

youAre = {
[3] = "a Senior Tutor",
[4] = "a Pokemon Trainer",
[5] = "a Pokemon Trainer",
[6] = "a Pokemon Trainer "
}

Não existe esse código no arquivo config.lua do servidor. Obrigado pela ajuda de qualquer forma.

Editado por Born Retarded (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Vou tentar das duas maneira sugeridas , e obrigado pela ajuda de ambos.

Se não me falha a memória , a última vez que pedi ajuda com isso , a pessoa me enviou o arquivo  look.lua editado e foi o suficiente , mas vou testar aqui a teoria de ambos e volto assim que possível para editar o tópico e etc.

 

 
 

A versão 8.54 está dentro de que Rev ??  Saberia dizer ?

 
 

Não existe esse código no arquivo config.lua do servidor. Obrigado pela ajuda de qualquer forma.

 

 

nao falei config.lua falei? falei configuration.lua  da pasta data/lib ... 

Meu Ultimo projeto em desenvolvimento!

 

http://www.tibiaking.com/forum/topic/47753-show-off-ultimo-projeto-para-download/

 

 

Grupo do facebook para OtServidores! (Divulgação + Criação de Equipe)

 

https://www.facebook.com/groups/otservidores/

 

Link para o post
Compartilhar em outros sites

Até funcionou gabriel , porém fica assim caso removido tudo:


You area a      and Pokemon Trainer from Saffron City.


Não conhece nenhuma outra forma de fazer com que fique de forma normal ?

Ex: You are a Pokemon Trainer from Saffron City.

Link para o post
Compartilhar em outros sites

Posta o codigo da funcao getPlayerDesc (data/lib/some functions.lua, se nao me engano).

Segue abaixo em anexo arquivo pedido  @zipter98 :

PS: Não botei o spoiler por que tem bastante coisa dentro.

 

some functions.lua

Editado por Born Retarded (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

lek, em seu ot tem a pasta XML,tem Groups.XML?

se tiver nao seria pratico vc so mudar os nomes GM,tutor etc, para estes nomes q vc quer?

Acontece que os nomes se repetem.

NÃO QUERO que fique desta forma:

3mRh6OF.png

Entendeu ? 

Link para o post
Compartilhar em outros sites
  • Solução

Em configuration.lua, altere a tabela youAre para a seguinte:

youAre = {
    [3] = "a Senior Tutor",
}
Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

Usa só a minha modificação. Provavelmente vai funcionar.

Bem , eu alterei o arquivo que editei para o padrão , ficando assim:

youAre = {

[3] = "a Senior Tutor",

[4] = "a Game Master",

[5] = "a Sub Administrador",

[6] = "a God"

}

E continuou a mesma coisa da imagem que postei anteriormente;

3mRh6OF.png

EDIT;     A solução poderia ser talvez  editar o valor 4 da função abaixo para o 6 ?

 

coloque:

   if getPlayerGroupId(thing) >= 4 then

        ocup = "a Pokemon Trainer"

    end

Editado por Born Retarded (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Ah, agora eu li a função melhor e entendi.

Em configuration.lua, altere a tabela youAre para a seguinte:

youAre = {
    [3] = "a Senior Tutor",
}

Apenas isso. Remova a modificação que enviei anteriormente.

Editado por zipter98 (veja o histórico de edições)

não respondo pms solicitando suporte em programação/scripting

Link para o post
Compartilhar em outros sites

Ah, agora eu li a função melhor e entendi.

Em configuration.lua, altere a tabela youAre para a seguinte:

youAre = {
    [3] = "a Senior Tutor",
}

Apenas isso. Remova a modificação que enviei anteriormente.

Depois de trocar tantas mensagens, agora foi   :wow: 

Muito obrigado especial ao zipter98 que solucionou o caso , e aos demais que deram sugestões e tentaram ajudar.

Bem é isso , dúvida/pedido  resolvido  :cool:

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 Imperius
      O propósito é criar uma nova função em creaturescripts que será acionada toda vez que um novo report (CTRL + R) for aberto.
       
      Eu implementei para enviar uma notificação no grupo do Telegram, contendo os dados do report.
       
      Isso garantirá que os GMs tenham acesso aos reports dos jogadores mesmo quando não estiverem logados, e também evitará que algum report seja perdido caso o jogador saia do servidor.
      A parte do Telegram é apenas um exemplo. Você pode ajustar o script para executar outras ações desejadas.
       
      creatureevent.cpp:
      Dentro deste arquivo, localize a função:
       
      uint32_t CreatureEvent::executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap)  
      abaixo dela, adicione:
       
      uint32_t CreatureEvent::executeOpenRuleViolation(Player* player, std::string message) { if (!m_interface->reserveEnv()) { std::clog << "[Error - CreatureEvent::executeOpenRuleViolation] Call stack overflow." << std::endl; return 0; } ScriptEnviroment* env = m_interface->getEnv(); env->setScriptId(m_scriptId, m_interface); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushstring(L, message.c_str()); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; }  
      Após, procure por:
       
      std::string CreatureEvent::getScriptEventName() const  
      abaixo de:
       
      case CREATURE_EVENT_CHANNEL_LEAVE: return "onLeaveChannel";  
      adicione:
       
      case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "onOpenRuleViolation";  
      Agora, procure por:
       
      std::string CreatureEvent::getScriptEventParams() const  
      abaixo de:
       
      case CREATURE_EVENT_CHANNEL_LEAVE: return "cid, channel, users";  
      adicione:
       
      case CREATURE_EVENT_OPEN_RULE_VIOLATION: return "cid, message";  
      Procure por:
       
      bool CreatureEvent::configureEvent(xmlNodePtr p)  
      abaixo de:
       
      else if(tmpStr == "leavechannel") m_type = CREATURE_EVENT_CHANNEL_LEAVE;  
      adicione:
       
      else if(tmpStr == "openruleviolation") m_type = CREATURE_EVENT_OPEN_RULE_VIOLATION;  
       
      creatureevent.h:
      Dentro deste arquivo, localize:
       
      enum CreatureEventType_t  
      adicione "CREATURE_EVENT_OPEN_RULE_VIOLATION" como o último item de enum CreatureEventType_t
       
      Exemplo:
       
      enum CreatureEventType_t { // ... CREATURE_EVENT_OPEN_RULE_VIOLATION };  
      Agora, procure por:
       
      uint32_t executeChannelLeave(Player* player, uint16_t channelId, UsersMap usersMap);  
      abaixo dela, adicione:
       
      uint32_t executeOpenRuleViolation(Player* player, std::string message);  
      game.cpp:
      Dentro deste arquivo, localize:
       
      bool Game::playerReportRuleViolation(Player* player, const std::string& text)  
      e substitua por:
       
      bool Game::playerReportRuleViolation(Player* player, const std::string& text) { //Do not allow reports on multiclones worlds since reports are name-based if(g_config.getNumber(ConfigManager::ALLOW_CLONES)) { player->sendTextMessage(MSG_INFO_DESCR, "Rule violation reports are disabled."); return false; } cancelRuleViolation(player); boost::shared_ptr<RuleViolation> rvr(new RuleViolation(player, text, time(NULL))); ruleViolations[player->getID()] = rvr; ChatChannel* channel = g_chat.getChannelById(CHANNEL_RVR); if(!channel) return false; for(UsersMap::const_iterator it = channel->getUsers().begin(); it != channel->getUsers().end(); ++it) it->second->sendToChannel(player, SPEAK_RVR_CHANNEL, text, CHANNEL_RVR, rvr->time); CreatureEventList joinEvents = player->getCreatureEvents(CREATURE_EVENT_OPEN_RULE_VIOLATION); for(CreatureEventList::iterator it = joinEvents.begin(); it != joinEvents.end(); ++it) (*it)->executeOpenRuleViolation(player, text); return true; }  
      Agora é só compilar a source.
       
      depois em "data > creaturescripts > creaturescripts.xml", adicione:
       
      <event type="login" name="loginNotifyRuleViolation" script="notifyRuleViolation.lua"/> <event type="openruleviolation" name="openNotifyRuleViolation" script="notifyRuleViolation.lua"/>  
      em "data > creaturescripts > scripts", crie um arquivo notifyRuleViolation.lua e adicione:
       
      function onOpenRuleViolation(cid, message) local config = { token = "", -- Token do seu BOT no Telegram chatId = "" -- ID do chat do Telegram que será enviado a notificação. } local message = "Player: "..getCreatureName(cid).."\n\nReport:\n"..message.."" message = string.gsub(message, "\n", "%%0A") local url = "https://api.telegram.org/bot"..config.token.."/sendMessage" local data = "chat_id="..config.chatId.."&text="..message.."" local curl = io.popen('curl -d "'..data..'" "'..url..'"'):read("*a") return true end function onLogin(cid) registerCreatureEvent(cid, "openNotifyRuleViolation") return true end  
       
      Demonstração:
      1. Jogador abre um novo report (CTRL + R)

      2. notifyRuleViolation.lua, definido em creaturescripts.xml, é acionado para enviar uma notificação ao grupo do Telegram.
       

       
    • Por Ghaz
      Fala pessoal tudo bem?
       
      Estou com dificuldades em um script e preciso da ajuda dos magos do LUA rs.
       
      Tenho um script que quando o player morre (onDeath), ele faz algumas coisas e depois ele chama uma função que deveria retornar uma table (array) para eu fazer o for com o ipairs certinho. Segue abaixo o código:
       
       
      Segue abaixo a função getPlayersInArea:
       
       
      Acontece que no código de cima (do primeiro spoiler) eu dou um print no retorno da função getPlayersInArea, porém ela não tá me retornando a table, tá me retornando só: 2
       
       
       
      Alguém consegue me ajudar em, como raios eu faço a função retornar a lista de players ao invés da quantidade? Acredito que ta retornando o count da table, e não os itens do array.
       
       
      Agradeço desde já, valeu tchurma!
    • Por FeeTads
      salve rapaziada, estou fazendo uma quest no meu OT que é necessário faze-la durante 10 dias consecutivos, porém caso o player perca um dia, a storage da quest reseta.
      Já tenho esses scripts prontos de 2 formas: global event que checa a storage de todos os player online no momento e caso ja tenha passado 24h ele tira a storage do player que está entre os 10 dias de quest.
      E também tenho um creatureScript de onLogin() que quando o player loga, ele entra num loop de verificação a cada 60s

      minha duvida: globalEvents vai checar todos os players online de uma só vez e fazer as alterações necessarias, isso pode lagar a distro, ou até mesmo crashar?
      o creatureScript vai entrar num loop até o player deslogar, isso numa média de 250 pessoa são diversas verificações em momentos diferentes, pode acabar lagando ou crashando?

      meu OT possui uma media de 300 pessoas online.

      Script globalEvents é esse:

      function onThink(interval, lastExecution)
          local players = {}
          local timer = os.time()
          for _, pid in pairs (getPlayersOnline()) do
              local storage = getPlayerStorageValue(pid, 1231234)
              if getPlayerStorageValue(pid,888251) > 0 and getPlayerStorageValue(pid,888251) <= 9 then
                  if storage - timer <= 1  then
                      table.insert(players, pid)
                  end
              end
          end
          
          if #players > 0 then
              for i = 1, #players do
                  doPlayerSendTextMessage(players[i],22,"seu dano voltou ao normal por vc nao ter feito a quest!")
                  setPlayerStorageValue(players[i],888251,0)
              end
          end
      return true
      end

      Script do Creature é esse:
      local storage = getPlayerStorageValue(cid,1231234)
              function checkStorage(cid) local timer = os.time()
                     if not isPlayer(cid) then return true end
                     if getPlayerStorageValue(cid,888251) > 0 and getPlayerStorageValue(cid, 888251) <= 9 then
                             if storage - timer <= 1 then
                                     setPlayerStorageValue(cid,888251,0)
                             end
                   end
                   addEvent(function()
                              checkStorage(cid)
                    end, 60000)
      end
      function onLogin(cid)
              checkStorage(cid)
      return true
      end
      function onLogout(cid)
             stopEvent(checkStorage[cid])
      return true
      end


      caso os códigos nao estejam legiveis me avisem como arrumar em .lua pf

      se quiserem usar os códigos podem usar a vontade kkkkkkk
    • Por thelifeofpbion
      Existem alguns scripts que depois de matar boss abri tp para os players entrarem em uma sala de recompensa, porém (não sei se já existe) vou postar 2 scripts:

      1º Script: Todos players que der algum dano no boss é teleportado
      2º Script: Depois que o Boss for derrotado todos players de uma sala são teleportados.
       
       

       
      É Basicamente isso, tava ajudando no suporte quando pediram isso e resolvi postar para ficar mais facil de achar (e depois pra eu achar também).

      Agradeço o vodkart por ter disponibilizado a parte do script onde seleciona todos players de uma area (retirei de algum post do forum),
      e Xagah que copiei descaradamente as imagens de tópico porque achei bonito  

      Ajudei de alguma Forma? REP+.


       
    • Por Bruno Minervino
      Fala galera,
       
      Um membro fez um pedido, e achei que deveria compartilhar com vocês, algo simples porém útil. Principalmente em OT's do estilo Baiak.
       
      O que o script faz ?
      Ele simplesmente manda um efeito para o Top Level caso ele estiver online.
       
      Instalação:

      Em data/creaturescripts/creaturescripts.xml adicione:
      <event type="login" name="TopEffect" event="script" value="topeffect.lua"/> <event type="advance" name="CheckTop" event="script" value="topeffect.lua"/> Agora crie um arquivo em data/creaturescripts/scripts com o nome topeffect.lua e adicione:
      --[[ Script by Bruno Minervino para o Tibia King Caso for postar, colocar os créditos ]] local config = { tempo = 10, --tempo em segundos mensagem = { texto = "[TOP]", --não use mais de 9 caracteres efeito = TEXTCOLOR_LIGHTBLUE --efeito para a função doSendAnimatedText }, efeito = 30, --efeito da função doSendMagicEffect globalstr = 5687 -- uma global storage qualquer q esteje vazia } --[[ Não mexa em nada abaixo ]] local topPlayer = getGlobalStorageValue(config.globalstr) > 0 and getGlobalStorageValue(config.globalstr) or 0 function onLogin(cid) local query = db.getResult("SELECT `id`, `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if (query:getID() ~= -1) then local pid = query:getDataString("id") local name = query:getDataString("name") if getPlayerName(cid) == name then if topPlayer ~= getPlayerID(cid) then topPlayer = getPlayerID(cid) end setGlobalStorageValue(config.globalstr, pid) TopEffect(cid) end end registerCreatureEvent(cid, "CheckTop") return true end function onAdvance(cid, skill, oldlevel, newlevel) if skill == 8 then local query = db.getResult("SELECT `id`, `name`, `level` FROM `players` WHERE `group_id` < 2 ORDER BY `level` DESC LIMIT 1") if (query:getID() ~= -1) then local level = tonumber(query:getDataString("level")) if level < newlevel and topPlayer ~= getPlayerID(cid) then doBroadcastMessage("O jogador " .. getPlayerName(cid) .. " tornou-se o novo Top Level. Parabens!", 22) topPlayer = getPlayerID(cid) doSaveServer() setGlobalStorageValue(config.globalstr, getPlayerID(cid)) TopEffect(cid) end end end return true end function TopEffect(cid) if not isPlayer(cid) then return true end if topPlayer == getPlayerID(cid) then doSendAnimatedText(getCreaturePosition(cid), config.mensagem.texto, config.mensagem.efeito) doSendMagicEffect(getCreaturePosition(cid), config.efeito) addEvent(TopEffect, config.tempo * 1000, cid) end end function getPlayerNameById(id) local query = db.getResult("SELECT `name` FROM `players` WHERE `id` = " .. db.escapeString(id)) if query:getID() ~= -1 then return query:getDataString("name") end return 0 end function getPlayerIdByName(name) local query = db.getResult("SELECT `id` FROM `players` WHERE `name` = " .. db.escapeString(name)) if query:getID() ~= -1 then return tonumber(query:getDataString("id")) end return 0 end function getPlayerID(cid) return getPlayerIdByName(getPlayerName(cid)) end  
      Espero ajudar!
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo