Ir para conteúdo

Líderes

Conteúdo Popular

Exibindo conteúdo com a maior reputação em 08/25/21 em todas áreas

  1. 1 ponto
    funcionou!, obg
  2. 1 ponto
    você pode tirar o respawn e colocar um globalevent "onstartup" (se nao me falha a memoria) para que, quando o servidor iniciar, o monstro nascer em determinada posição
  3. [SOURCE] BOT OTClient (Free - COM CAVEBOT)

    Arthur L.B reagiu a oclipper por uma resposta no tópico

    1 ponto
    No meu bot ainda nao tem nenhuma estrutura pra containers (looter). Nunca foi minha intenção... Estou sofrendo pra conseguir a estrutura da Battle List pra funcionar em todos OTclients.
  4. [AJUDA] Erro ao compilar TFS 0.4

    koyotestark reagiu a Sun por uma resposta no tópico

    1 ponto
    @underpunk Dev-cpp baixa esse dev ai, provavelmente está faltando as libs.
  5. Mostrar os segundos que faltam pro boss nascer

    poko360 reagiu a Sun por uma resposta no tópico

    1 ponto
    local colorMsg = "orange" local tableBoss = { ["Amazon"] = {seconds = 10, newBoss = "Demon"} } local function timer(position, duration, color) for i = 0, (duration - 1) do addEvent(function() doSendAnimatedText(position, tostring(duration - i), color) end, i * 1000) end end function onKill(cid, target, damage, flags) if isPlayer(target) then return true end local boss = tableBoss[getCreatureName(target)] if not boss then return true end local position = getThingPos(target) doPlayerSendTextMessage(cid, MESSAGE_TYPES[colorMsg], "The boss will be born in " .. boss.seconds .. " seconds.") timer(position, boss.seconds, COLOR_RED) addEvent(doCreateMonster, boss.seconds * 1000, boss.newBoss, position) return true end creaturescript.xml <event type="kill" name="event nome" event="script" value="script name.lua"/> login.lua registerCreatureEvent(cid, "nome do evento") @poko360 pelo que entendi foi isso, não entendi a necessidade de colocar verificação para não criar dois boss se você matou o anterior.
  6. Conexão de MOD Reputation com NPC

    Nego Tchuca reagiu a MatteusDeli por uma resposta no tópico

    1 ponto
    @Nego Tchuca Boa tarde, eu testei em um servidor 8.6 com tfs 0.4, acho que vai funcionar no seu. 1° Vá em data/lib e crie um arquivo chamado rep_seller_items.lua e adicione isto dentro: (as configurações estão comentadas nele) -- Caso a coluna "REP" da tabela de players for diferente coloque o nome dela aqui rep_coluna_database = "rep" -- As falas do npc rep_falas_npc = { conversa = { ['trocar'] = 'Veja nossa {lista de items} e confira quantos reps cada um vale.', ['lista_de_items'] = 'Agora, me diga o nome do item que voce quer trocar.', }, sucesso = { ['item_comprado'] = 'Otimo, aqui esta o seu novo item.', }, falha = { ['rep_points_insuficientes'] = 'Desculpe, mais voce nao possui rep points suficientes para trocar por este item.', ['item_nao_encontrado'] = 'Nao encontrei este item, por favor tente outro.' } } -- Items que o npc irá vender rep_items = { { item_id = 2124, quantidade_rep_points = 5}, { item_id = 2472, quantidade_rep_points = 30}, { item_id = 2520, quantidade_rep_points = 10}, } 2° Vá na pasta dos npcs em data/npc e crie um arquivo chamado Rep.xml e adicione isto nele: <npc name="Rep" script="data/npc/scripts/repseller.lua" floorchange="0" access="5"> <health now="150" max="150"/> <look type="143" head="2" body="112" legs="78" feet="116" addons="2" corpse="2212"/> <parameters> <parameter key="message_greet" value="Ola! Voce posso {trocar} seus rep points por itens."/> </parameters></npc> 3° Agora crie um arquivo de script chamado repseller.lua na pasta data/npc/scripts e adicione isto nele: dofile(getDataDir() .. "lib/rep_seller_items.lua") local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'trocar') then npcHandler:say(rep_falas_npc.conversa.trocar, cid) talkState[talkUser] = 1 end if msgcontains(msg, 'lista de items') and talkState[talkUser] == 1 then mostrarListaItems(cid) npcHandler:say(rep_falas_npc.conversa.lista_de_items, cid) talkState[talkUser] = 2 end if talkState[talkUser] == 2 then local item = buscarItemPeloNome(msg) if item == nil then return; end trocarRepPointsPeloItem(cid, item) talkState[talkUser] = 1 end return TRUE end function trocarRepPointsPeloItem(cid, item) local playerRepPoints = buscarRepPoints(cid) if item.quantidade_rep_points > playerRepPoints then npcHandler:say(rep_falas_npc.falha.rep_points_insuficientes, cid) return; end local quantidadeRepPointsParaRemover = playerRepPoints - item.quantidade_rep_points if quantidadeRepPointsParaRemover < 0 then npcHandler:say(rep_falas_npc.falha.rep_points_insuficientes, cid) return; end if removerRepPoints(cid, quantidadeRepPointsParaRemover) then adicionarItemAoPlayer(cid, item) npcHandler:say(rep_falas_npc.sucesso.item_comprado, cid) end end function buscarRepPoints(cid) local sql = "SELECT `"..rep_coluna_database.."` FROM `players` WHERE id = " ..getPlayerGUID(cid)..";" local result = db.getResult(sql) if result:getID() <= -1 then return; end return result:getDataInt(rep_coluna_database) end function removerRepPoints(cid, quantidade) local sql = "UPDATE `players` SET `"..rep_coluna_database.."` = "..quantidade.." WHERE id = "..getPlayerGUID(cid)..";" local result = db.executeQuery(sql) if result == -1 then return false end return true end function mostrarListaItems(cid) local message = '' for index = 1, #rep_items, 1 do local item = rep_items[index] local item_nome = getItemNameById(item.item_id) message = item_nome .. " - " .. item.quantidade_rep_points .. " REP Point(s)" .. "\n" .. message end doPlayerPopupFYI(cid, message) end function adicionarItemAoPlayer(cid, item) doPlayerAddItem(cid, item.item_id) end function buscarItemPeloNome(nome) for index = 1, #rep_items, 1 do local item = rep_items[index] local item_nome = getItemNameById(item.item_id) if (string.lower(nome) == string.lower(item_nome)) then return item end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Espero ter ajudado
Líderes está configurado para São Paulo/GMT-03:00

Informação Importante

Confirmação de Termo