Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Eu tenho um script:

<config name="talkactionTask_conf"><![CDATA[
canGetOnlyOneTime = false

task = {
	['rotworm'] = {storage = 9999, beginStorageValue = 1, finishStorageValue = 2, count = 100,
						requiedLevelToReward = 99999999,
						rewards = {}
	}

mainStorage = X

function isSummon(cid)
        if(not isCreature(cid)) then
                return false
        end
        return getCreatureMaster(cid) ~= cid
end

function checkInfoAboutTask(tableTask)
local message = ''
for i = 1, #tableTask/2 do
        local rewardType, rewardCount = tableTask[i*2-1], tableTask[i*2]
        if rewardType == 'item' and type(rewardCount) == 'table' then
                for item = 1, #rewardCount/2 do
                        local rewardItemId, rewardItemCount = rewardCount[item*2-1], rewardCount[item*2]
                        message = message .. ('* ' .. rewardItemCount .. 'x ' .. getItemNameById(rewardItemId)) .. '\n'
                end
        else
                message = message .. ((rewardType == 'item' and '* ' .. getItemNameById(rewardCount)) or 
                                                        (rewardType == 'exp' and '* ' .. rewardCount .. ' Experience ') or
                                                        (rewardType == 'cash' and '* ' .. rewardCount .. ' Money ') or
                                                        (rewardType == 'smsPoints' and '* ' .. rewardCount .. ' Sms points ')) .. '\n'
        end
end
return message
end

function doAddExp(cid, amount)
        return doSendAnimatedText(getThingPos(cid), amount, COLOR_WHITE) and doPlayerAddExperience(cid, amount) or false
end
]]></config>

<talkaction words="!task" event="script"><![CDATA[
domodlib('talkactionTask_conf')
function onSay(cid, words, param, channel)

local taskMenu, message = task[param:lower()], ''
if taskMenu and (taskMenu.potionTask and getCreatureStorage(cid, taskMenu.storage) == -1 or getCreatureStorage(cid, mainStorage) < 1) then
        if(canGetOnlyOneTime and getCreatureStorage(cid, taskMenu.storage) > 0) or taskMenu.potionTask and getCreatureStorage(cid, taskMenu.storage) > taskMenu.count then
                return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Already you have made this task!')
        end
        if taskMenu.potionTask and getCreatureStorage(cid, taskMenu.storage) > -1 then
                return true
        else
                doCreatureSetStorage(cid, mainStorage, taskMenu.beginStorageValue)
        end
        doCreatureSetStorage(cid, taskMenu.storage, 0)
        return doPlayerPopupFYI(cid, 'The decision taken, your task is to '..(taskMenu.potionTask and 'use' or 'kill')..' - ' .. taskMenu.count.. ' ' ..param:lower().. (taskMenu.count > 1 and 's' or '') .. '\nRewards which you receive for finishing this task:\n' .. checkInfoAboutTask(taskMenu.rewards) .. (taskMenu.potionTask and '' or 'If you want to abort the current job enough that you use the command "!task cancel".\n')..'If you want to know about the current job simply use the command "!task info"\nIf you wish to receive a prize for the job simply use the command !task reward\nHave Fun ^^')
elseif isInArray({'cancel', 'delete', 'abort'}, param:lower()) and getCreatureStorage(cid, mainStorage) > 0 then
        for _, v in pairs(task) do
                if not v.potionTask and getCreatureStorage(cid, v.storage) >= 0 then
                        doCreatureSetStorage(cid, mainStorage, -1)
                        doCreatureSetStorage(cid, v.storage, -1)
                        return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You canceled the current task.')
                end
        end
elseif isInArray({'reward', 'end', 'finish'}, param:lower()) then
        local rewards, showMessage = 'Items that you got as a reward is: ', false
        for _, v in pairs(task) do
                if (v.potionTask and getCreatureStorage(cid, v.storage) == v.count or getCreatureStorage(cid, mainStorage) == v.finishStorageValue) then
                        showMessage = true
                        if not v.potionTask then
                                doCreatureSetStorage(cid, mainStorage, -1)
                        else
                                doCreatureSetStorage(cid, v.storage, v.count + 1)
                        end
                        if not v.requiedLevelToReward or v.requiedLevelToReward >= getPlayerLevel(cid) then
                                for i = 1, #v.rewards/2 do
                                        local rewardType, rewardCount = v.rewards[i*2-1], v.rewards[i*2]
                                        if rewardType == 'item' and type(rewardCount) == 'table' and #rewardCount > 1 then
                                                for item = 1, #rewardCount / 2 do
                                                        local rewardItemId, rewardItemCount = rewardCount[item*2-1], rewardCount[item*2]
                                                        rewards = rewards .. rewardItemCount .. 'x ' .. getItemNameById(rewardItemId) .. ', '
                                                        doPlayerAddItem(cid, rewardItemId, rewardItemCount, true)
                                                end
                                        else
                                                rewards = rewards .. rewardCount .. 'x ' .. (rewardType == 'item' and getItemNameById(rewardCount) or rewardType == 'exp' and 'experience' or rewardType == 'cash' and 'money' or rewardType == 'smsPoints' and 'sms points') .. ', '
                                                if rewardType == 'item' then
                                                        doPlayerAddItem(cid, rewardCount, 1, true)
                                                elseif rewardType == 'exp' then
                                                        doAddExp(cid, rewardCount)
                                                elseif rewardType == 'cash' then
                                                        doPlayerAddMoney(cid, rewardCount)
                                                elseif rewardType == 'smsPoints' then
                                                        db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. rewardCount .. " WHERE `name` = '" .. getAccountByName(getCreatureName(cid)) .. "' LIMIT 1;")
                                                end
                                        end
                                end
                        else
                                rewards = 'Your experience level is too high to be able to receive the reward.'
                        end
                end
        end
        return showMessage and doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string.sub(rewards, 1, string.len(rewards) - 1)..'.')
else
        for k, v in pairs(task) do
                if isInArray((v.potionTask and {'potion','potions'} or {'info', 'information', 'details'}), param:lower()) and (v.potionTask and getCreatureStorage(cid, v.storage) >= 0 or getCreatureStorage(cid, mainStorage) > 0) then
                        if (v.potionTask and getCreatureStorage(cid, v.storage) <= v.count or isInArray({v.finishStorageValue, v.beginStorageValue}, getCreatureStorage(cid, mainStorage))) then
                                return doPlayerPopupFYI(cid, 'Your current task is to '..(v.potionTask and 'use' or 'kill')..' - ' .. v.count.. ' ' ..k:lower().. (v.count > 1 and 's' or '') .. '\nYou have killed ' .. getCreatureStorage(cid, v.storage) .. ' of ' .. v.count .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. '. You must kill ' .. v.count - getCreatureStorage(cid, v.storage) .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. ' yet\nRewards which you receive for finishing this task:\n' .. checkInfoAboutTask(v.rewards))
                        end
                end
        end
end
return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wrong command!')
end
]]></talkaction>

<event type="kill" name="talkactionTask" event="script"><![CDATA[
domodlib('talkactionTask_conf')
function onKill(cid, target)
if isPlayer(target) or getCreatureMaster(target) or isNpc(target) then 
        return true 
end
for k, v in pairs(task) do
        if k:lower() == getCreatureName(target):lower() then
                if getCreatureStorage(cid, mainStorage) == v.beginStorageValue then
                        if getCreatureStorage(cid, v.storage) < v.count then
                                doCreatureSetStorage(cid, v.storage, getCreatureStorage(cid, v.storage) + 1)
                                s = 'You killed ' .. getCreatureStorage(cid, v.storage) .. ' of ' .. v.count .. ' ' .. k:lower() .. (v.count == 1 and '' or 's') .. '.'
                                if getCreatureStorage(cid, v.storage) == v.count then
                                        doCreatureSetStorage(cid, mainStorage, v.finishStorageValue)
                                        s = 'Congratulations! You have killed enough '.. k:lower() ..'.'
                                end
                                return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, s)
                        end
                end
        end
end
return true
end
]]></event>

<event type="login" name="taskEventLogin" event="buffer"><![CDATA[
registerCreatureEvent(cid, 'talkactionTask')
]]></event>

1. Agora, quando você digita um !task monster recebe a mensagem 'Wrong command!'

Como converter para receber um mensagem 'You have begun this task'?

 

2. Quando você digita um mensagem !task reward quer receber uma mensagem 'You have not completed the task' quando você não terminar o trabalho.

 

 

Eu vou ser muito feliz se alguém pode ajudar. :)

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

@buchal Peço que leia as regras do fórum amigo, compreendo que você precisa de ajuda em seu sistema. Mais é proibido dar up por comentários:

 

2.7 - Dar "UP" para subir tópicos:
É totalmente proibido comentar "UP" para subir tópicos, caso você tenha a intenção você pode utilizar nosso recurso de subir tópicos e ele automaticamente irá te colocar um tempo de espera de 24 horas para realizar a função novamente. Caso o membro realize tal ato isso pode ser interpretado como flood.

 

Bom, na primeira você deseja alterá a mensagem que aparece para o player ? Basta alterá o nome para o que você deseja.

 

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Wrong command!') ?

Basta alterá o texto ' aqui dentro '. 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

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 Jaurez
      .
    • Por Cat
      Em alguns casos, o tibia 8.60 comum não abre de jeito nenhum no map editor, mesmo desmarcando check file signatures e configurando o path corretamente.
       
      Este é o client 8.60 adaptado para o Remere's Map Editor. Resolvi postar já que ele foi removido do site oficial do RME. (ficou apenas a versão para linux lá)
      Se estiver tendo problemas para abrir a versão 8.60, tente utilizar este.
                                                                                                                     
      Baixar o Tibia Client 8.60 que funciona no Remere’s Map Editor
      Essa versão do Tibia 8.60 client resolve o erro unsupported client version ou Could not locate tibia.dat and/or tibia.spr, please navigate to your tibia 8.60 installation folder.
       
      Downloads
      https://tibiaking.com/applications/core/interface/file/attachment.php?id=47333

      Scan: https://www.virustotal.com/gui/file/333e172ac49ba2028db9eb5889994509e7d2de28ebccfa428c04e86defbe15cc
       
    • Por danilo belato
      Fala Galera To Com um problema aki 
       
      quero exporta umas sprites de um server para colocar em outro 
       
      eu clico na sprites ai aparece tds a forma delas do lado de la >>
       
      ai eu clico nela e ponho a opiçao de export mais quando salvo a sprite ela n abri 
       
      aparece isso quando tento vê-la 
       
      visualização não disponível ( no formatos png e bitmap)
       
      Agora no formato idc fala que o paint n pode ler 
       
      me ajudem ae...
    • Por Vitor Bicaleto
      Galera to com o script do addon doll aqui, quando eu digito apenas "!addon" ele aparece assim: Digite novamente, algo está errado!"
      quando digito por exemplo: "!addon citizen" ele não funciona e não da nenhum erro
       
      mesma coisa acontece com o mount doll.. 
    • Por Ayron5
      Substitui uma stone no serve, deu tudo certo fora  esse  erro ajudem  Valendo  Rep+  Grato  

      Erro: data/actions/scripts/boost.lua:557: table index is nil
       [Warning - Event::loadScript] Cannot load script (data/actions/scripts/boost.lua)

      Script:
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo