Qual a base do seu servidor? PDA?
Outra pergunta: e os prêmios? Serão fixos ou definidos na tabela (por exemplo, ao matar x Charmanders da task easy você ganha x experiência e x cash; já matando x Pikachus, você ganha y experiência e y cash)?
Por Drk Shadow, 21 de jan. de 2014 em Tópicos Sem Resposta
Qual a base do seu servidor? PDA?
Outra pergunta: e os prêmios? Serão fixos ou definidos na tabela (por exemplo, ao matar x Charmanders da task easy você ganha x experiência e x cash; já matando x Pikachus, você ganha y experiência e y cash)?
info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho

Minha base é o Servidor do StyloMaldoso (Pokemon Mysterion), e sim, é desse jeito que vc falou, ao matar x charmanders, vc ganha x experiencia (apenas exp) e ao matar y pikachus, vc ganha y experiencia.
Ai tenho a ideia de usar a storage da quest pra dar um premio extra por uma talkaction, por exemplo:
ao terminar a task, alem de você ganhar a xp, se você !extra, você ganha x item, definido no script.
Sobre esse comando adicional, !extra:
O prêmio será variável de acordo com a dificuldade? Por exemplo: dificuldade easy sempre vai ganhar x item e x quantidade, já dificuldade medium sempre ganhará y item e y quantidade; ou o prêmio será variável de acordo com o pokémon?
E um pedido: se possível, já poderia ir informando o(s) item(s), juntamente com a quantidade?
info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho

Poderia ser variável de acordo com cada Pokémon tipo ao matar 2 Charmander ganharia 5k ao matar 3 Pikachu ganharia 8K. Eu gostaria de poder trocar semanalmente as recompensas maia pra uma base pode usar o id 2160
data/lib:
tasks = {
["easy"] = {
POKES = {
["Squirtle"] = {15, 1500, 1, 2160},
["Charmander"] = {15, 1500, 1, 2160},
["Bulbasaur"] = {15, 1500, 1, 2160},
},
},
["medium"] = {
POKES = {
["Forretress"] = {25, 2000, 3, 2160},
["Charmeleon"] = {35, 2000, 3, 2160},
["Starmie"] = {45, 2500, 3, 2160},
},
},
["hard"] = {
POKES = {
["Charizard"] = {15, 4500, 5, 2160},
["Ursaring"] = {15, 4000, 5, 2160},
["Dragonite"] = {30, 5000, 5, 2160},
},
},
["veryhard"] = {
POKES = {
["Santa Diglett"] = {1, 10000, 10, 2160},
["Santa Psyduck"] = {1, 10000, 10, 2160},
["Santa Pikachu"] = {1, 10000, 10, 2160},
},
},
}
TASK_STO = 91834
TASK_POKES_STO = 91835
TASK_EXPERIENCE = 91836
TASK_QUANTITY_STO = 91837
EXTRA_STO = 91838
EXTRA_PRIZE_STO = 91839
function isInTask(cid)
if getPlayerStorageValue(cid, TASK_STO) ~= -1 then
return true
end
return false
end
if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
valor = getCreatureHealth(cid)
end
end
valor = math.floor(valor) if valor >= getCreatureHealth(cid) then
if isInArray(cannotKill, combat) and isPlayer(cid) then
valor = getCreatureHealth(cid) - 1
else
if not isSummon(cid) then
local owner = attacker
if isSummon(attacker) then
owner = getCreatureMaster(attacker)
end
if isInTask(owner) then
--TASK_QUANTITY_STO
--TASK_POKES_STO
--TASK_EXPERIENCE
--TASK_STO
if getCreatureName(cid) == getPlayerStorageValue(owner, TASK_POKES_STO) then
local poke = getPlayerStorageValue(owner, TASK_POKES_STO)
local prize = getPlayerStorageValue(owner, TASK_EXPERIENCE)
local dificuldade = getPlayerStorageValue(owner, TASK_STO)
local tabela = tasks[dificuldade]
local pokemons = tabela.POKES
local pokemon = pokemons[poke]
local max_quantity = pokemon[1]
if getPlayerStorageValue(owner, TASK_QUANTITY_STO) >= 2 then
setPlayerStorageValue(owner, TASK_QUANTITY_STO, getPlayerStorageValue(owner, TASK_QUANTITY_STO)-1)
doPlayerSendTextMessage(owner, MESSAGE_STATUS_CONSOLE_ORANGE, "[•"..dificuldade:upper().."]->["..getPlayerStorageValue(owner, TASK_QUANTITY_STO).."/"..max_quantity.."] "..poke..""..(getPlayerStorageValue(owner, TASK_QUANTITY_STO) > 1 and "s" or "").." derrotados.")
else
doPlayerSendTextMessage(owner, MESSAGE_STATUS_CONSOLE_ORANGE, "[•"..dificuldade:upper().."] DONE!")
doPlayerSendTextMessage(owner, 27, "Prize: "..prize.." experience! You can say !extra to get another prize.")
doPlayerAddExp(owner, prize)
doSendAnimatedText(getThingPos(owner), prize, 215)
setPlayerStorageValue(owner, EXTRA_STO, dificuldade)
setPlayerStorageValue(owner, EXTRA_PRIZE_STO, poke)
setPlayerStorageValue(owner, TASK_POKES_STO, -1)
setPlayerStorageValue(owner, TASK_QUANTITY_STO, -1)
setPlayerStorageValue(owner, TASK_EXPERIENCE, -1)
setPlayerStorageValue(owner, TASK_STO, -1)
end
end
end
end
valor = getCreatureHealth(cid)
end
end
valor = math.floor(valor)function onSay(cid, words)
local word = words:gsub("!", "")
if tasks[word] then
local task = tasks[word]
local pokemons = task.POKES
local sto = TASK_QUANTITY_STO
local sto1 = TASK_POKES_STO
local sto2 = TASK_EXPERIENCE
local sto3 = TASK_STO
if not isInTask(cid) then
local tabb = ""
local tb = {}
local tabbb = {}
for a, b in pairs(pokemons) do
table.insert(tabbb, a)
end
for a, pid in pairs(pokemons) do
if tabb == "" then
tabb = a
else
tabb = tabb..","..a
end
end
local d = tabb:explode(",")
for i = 1, #tabbb do
table.insert(tb, d[i])
end
local poke = tb[math.random(#tb)]
local value = pokemons[poke]
local quantity = value[1]
local experience = value[2]
setPlayerStorageValue(cid, sto, quantity)
setPlayerStorageValue(cid, sto2, experience)
setPlayerStorageValue(cid, sto1, poke)
setPlayerStorageValue(cid, sto3, word)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Agora você está fazendo uma task "..word:upper().." de "..poke..". ["..getPlayerStorageValue(cid, sto).."/"..quantity.."]•[Prize: "..experience.." EXP]")
else
return doPlayerSendCancel(cid, "Você já está fazendo uma task.")
end
end
return true
endfunction onSay(cid, words)
if type(getPlayerStorageValue(cid, EXTRA_STO)) == "number" then
return doPlayerSendCancel(cid, "Você não terminou task alguma para pegar seu prêmio adicional.")
end
local dificuldade = getPlayerStorageValue(cid, EXTRA_STO)
local pokemon = getPlayerStorageValue(cid, EXTRA_PRIZE_STO)
local tabela = tasks[dificuldade]
local tab = tabela.POKES
local poke = tab[pokemon]
local id = poke[4]
local prize = poke[3]
doPlayerSendTextMessage(cid, 27, "[•"..dificuldade:upper().."] Como prêmio por ter terminado a task de "..pokemon..", você recebeu "..prize.." "..getItemNameById(id)..". Parabéns!")
doPlayerAddItem(cid, id, prize)
setPlayerStorageValue(cid, EXTRA_STO, -1)
setPlayerStorageValue(cid, EXTRA_PRIZE_STO, -1)
return true
endtasks = {
["dificuldade(deve ser a mesma do comando !dificuldade)"] = {
POKES = {
["Nome do pokémon"] = {quantidade, prêmio em experiência, quantidade do item ao lado -> que ganhará no !extra, ID do item que ganhará no !extra},
},
},
}Editado Janeiro 23 por zipter98
info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho

Krl zipter, vc é mt foda mano, vou testar aqui, jaja te falo se deu certo, mesmo assim, ja te dei seu REP+ !!
jaja te falo se deu certo...
Só achei 2 erros 'o'
Primeiro: só a escrita bugada...
23:43 [â¢HARD] DONE!
e segundo, o player pode fazer quantas tasks quantas vezes quiser tipo, ao acabar de fazer uma hard, ele ja pode fazer outra denovo, eu queria que se pudesse fazer uma vez, tentei fazer isso na talkaction, mais n adiantou:
O primeiro erro é porquê aparentemente seu servidor não reconhece caracteres como •. No caso, basta remover este sinal das mensagens.
Sobre o segundo, não entendi direito. Só pode fazer uma task de cada dificuldade "na vida"? Ou será uma espécie de task diária?
Editado Janeiro 24 por zipter98
info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho

sim, sera uma especie de task diaria '-'
OK. Funcionará assim: depois que o jogador pegar a task, só poderá fazer outra daqui depois de 24 horas.
Substitua o arquivo de !easy, !medium, !hard e !veryhard por este:
function onSay(cid, words)
local word = words:gsub("!", "")
if tasks[word] then
local task = tasks[word]
local pokemons = task.POKES
local sto = TASK_QUANTITY_STO
local sto1 = TASK_POKES_STO
local sto2 = TASK_EXPERIENCE
local sto3 = TASK_STO
if not isInTask(cid) then
if getPlayerStorageValue(cid, TASK_STORAGE_DAILY) > os.time() then
return doPlayerSendCancel(cid, "Você já completou a quest diária.")
else
local tabb = ""
local tb = {}
local tabbb = {}
for a, b in pairs(pokemons) do
table.insert(tabbb, a)
end
for a, pid in pairs(pokemons) do
if tabb == "" then
tabb = a
else
tabb = tabb..","..a
end
end
local d = tabb:explode(",")
for i = 1, #tabbb do
table.insert(tb, d[i])
end
local poke = tb[math.random(#tb)]
local value = pokemons[poke]
local quantity = value[1]
local experience = value[2]
setPlayerStorageValue(cid, sto, quantity)
setPlayerStorageValue(cid, sto2, experience)
setPlayerStorageValue(cid, sto1, poke)
setPlayerStorageValue(cid, sto3, word)
setPlayerStorageValue(cid, TASK_STORAGE_DAILY, os.time() + 86400)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Agora você está fazendo uma task "..word:upper().." de "..poke..". ["..getPlayerStorageValue(cid, sto).."/"..quantity.."]•[Prize: "..experience.." EXP]")
end
else
return doPlayerSendCancel(cid, "Você já está fazendo uma task.")
end
end
return true
end
TASK_STORAGE_DAILY = 91840
Editado Janeiro 29 por zipter98
info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho

Funcionou perfeitamente zipter, pode fechar ? REP+ Denovo mano, vlw msm!!
Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Grupo: Barão
Registrado: 31/07/09
Posts: 205
Reputação: +24
Gênero: Masculino

zipter smp salvando rep ++ lek
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: Masculino

info
Grupo: Visconde
Registrado: 07/01/12
Posts: 495
Reputação: +48
Gênero: Masculino
Char no Tibia: Nem Tenho
Bom, creio que para os que entendem bem de poketibia, o pedido é simples...
Eu queria que tivesse, 4 talkactions
!easy
!medium
!hard
!veryhard
cada talkaction poderia te dar tasks randomicas, como por exemplo:
Eu posso falar !easy, e ganhar um task de matar 20 squirtles, enquanto você pode falar !easy e ganhar de matar 12 charmanders.
cada task teria uma dificuldade, definida pela talkaction, e nela poderia vir qualquer quantidade de pokemon definidos em uma tabela, por exemplo
tasksEasy = {
[1] = {poke = Squirtle, qnt = 10},
[2] = {poke = Pikachu, qnt = 15},
}
e assim por diante, com as demais tasks, claro que quem fizer só vai postar a de uma task e por esse sript a gente vai editar pra fazer as demais dificuldades...
OBS: Quem pegar uma task de nivel façil, não poderia pegar outra, por exemplo:
Você não pode pegar uma task difiçil e outra façil, só pode fazer apenas uma delas.
Bom, é isso. Isso no momento me ajudaria muito, muito mesmo, Obrigado.