Opaaa eai......
Preciso de uma ajudazinha aqui.... eu gostaria de aumentar o numero de ranks da dailly catch
as que existem são
Easy
Medium
Hard
Very Hard
Eu gostaria que ficasse assim
Very Easy
Easy
Medium
Hard
Very Hard
Expert
E tambem há um outro problema nela... não sei por que motivo ela não entrega os itens que foram colocados ao player.... ela funciona com dois codigos um deles fica na pasta Lib
function getCatchMode(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
return tonumber(tostring(getPlayerStorageValue(cid, catchModes.storage)):explode("|")[1])
end
end
return 1
end
function setDailyCatched(cid, bool)
setPlayerStorageValue(cid, catchModes.storage, "|"..getPlayerStorageValue(cid, catchModes.storage):explode("|")[1].."|"..getPlayerStorageValue(cid, catchModes.storage):explode("|")[2].."|"..getPlayerStorageValue(cid, catchModes.storage):explode("|")[3].."|"..tostring(bool))
end
function getPokemonsToCatch(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
local string = getPlayerStorageValue(cid, catchModes.storage):explode("|")[3]
return string:explode(";")
end
end
return {"none1", "none2"}
end
function doPlayerAddTableItems(cid, table)
if isPlayer(cid) then
for _, item in pairs(table) do
doPlayerAddItem(cid, items[1], items[2], items[3])
end
end
end
function hasCatched(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
return (getPlayerStorageValue(cid, catchModes.storage):explode("|")[4] == "true")
end
end
return false
end
function getLastDayCatch(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
return tostring(getPlayerStorageValue(cid, catchModes.storage)):explode("|")[2]
end
end
return "07-00-00"
end
function resetDaily(cid)
if isPlayer(cid) then
local pokemons = catchModes[(getCatchMode(cid))].pokemons
local number1 = math.random(1, #pokemons)
local number2 = number1
repeat
number2 = math.random(1, #pokemons)
until(not (number1 == number2))
if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 50 then
valor = 1
elseif getPlayerLevel(cid) >= 51 and getPlayerLevel(cid) <= 100 then
valor = 2
elseif getPlayerLevel(cid) >= 101 and getPlayerLevel(cid) <= 180 then
valor = 3
elseif getPlayerLevel(cid) >= 180 then
valor = 4
end
local day = tostring(""..getNumberDay().."-"..getNumberMonth().."-"..getNumberYear().."")
setPlayerStorageValue(cid, catchModes.storage, "|"..valor.."|"..day.."|"..pokemons[number1]..";"..pokemons[number2].."|false")
setPlayerStorageValue(cid, catchModes.storage2, -1)
end
end
function nextDaily(cid)
if isPlayer(cid) then
if getCatchMode(cid) == #catchModes then
setDailyCatched(cid, false)
setPlayerStorageValue(cid, catchModes.storage2, "finished")
return false
end
local pokemons = catchModes[(getCatchMode(cid) + 1)].pokemons
local number1 = math.random(1, #pokemons)
local number2 = number1
repeat
number2 = math.random(1, #pokemons)
until(not (number1 == number2))
local day = tostring(""..getNumberDay().."-"..getNumberMonth().."-"..getNumberYear().."")
local text = "|"..(getCatchMode(cid) + 1).."|"..day.."|"..pokemons[number1]..";"..pokemons[number2].."|false"
setDailyCatched(cid, false)
setPlayerStorageValue(cid, catchModes.storage, text)
setPlayerStorageValue(cid, catchModes.storage2, -1)
end
return true
end
Pergunta
IOWeenI 0
Opaaa eai......
Preciso de uma ajudazinha aqui.... eu gostaria de aumentar o numero de ranks da dailly catch
as que existem são
Easy
Medium
Hard
Very Hard
Eu gostaria que ficasse assim
Very Easy
Easy
Medium
Hard
Very Hard
Expert
E tambem há um outro problema nela... não sei por que motivo ela não entrega os itens que foram colocados ao player.... ela funciona com dois codigos um deles fica na pasta Lib
o codigo acima é do NPC
Logo abaixo o da pasta LIB
catchModes = {
storage = 725, -- Variáveis
storage2 = 5123, -- Pokémon Escolhido!
[1] = {
name = "easy",
experience = 250000, -- 70000
items = {
{19221, 5},
{15645, 35}, -- devoted token
{2394, 50}, -- poke ball
},
pokemons = {"Pidgeotto", "Sandshrew", "Vulpix", "Venonat", "Psyduck", "Machop", "Ponyta", "Gastly", "Cubone", "Staryu", "Eevee", "Hoothoot", "Mareep", "Wooper", "Pineco", "Houndour", "Tyrogue"},
},
[2] = {
name = "medium",
experience = 500000, -- 150000
items = {
{19221, 10}, -- catcher token
{15645, 50}, -- devoted token
{2393, 100}, -- super ball
},
pokemons = {"Fearow", "Vileplume", "Venomoth", "Persian", "Primeape", "Dodrio", "Onix", "Kingler", "Marowak", "Weezing", "Tangela", "Tauros", "Giant Magikarp", "Bellossom", "Jumpluff", "Yanma", "Murkrow", "Corsola"},
},
[3] = {
name = "hard",
experience = 1000000, -- 200000
items = {
{19221, 15}, -- catcher token
{15645, 100}, -- devoted token
{2392, 300}, -- ultra ball
},
pokemons = { "Meganium", "Typhlosion", "Feraligatr", "Houndoom", "Donphan", "Piloswine", "Magcargo", "Granbull", "Girafarig", "Forretress", "Politoed", "Ampharos", "Xatu", "Alakazam", "Sandslash", "Nidoking", "Nidoqueen", "Starmie", "Wigglytuff", "Ninetales", "Golduck", "Machamp", "Victreebel", "Rapidash", "Magneton", "Pinsir", "Dragonair", "Muk", "Gengar", "Pidgeot", "Raichu", "Charizard", "Rhydon", "Venusaur", "Blastoise", "Golem", "Tentacruel", "Poliwrath"},
},
[4] = {
name = "very hard",
experience = 2000000, -- 280000
items = {
{19221, 20}, -- catcher token
{15645, 200}, -- devoted token
{15679, 50}, -- Premier ball
},
pokemons = {"Dustox", "Ludicolo", "Shiftry", "Swellow", "Breloom", "Delcatty", "Walrein", "Cacturn", "Glalie", "Mawile", "Dusclops", "Exploud", "Banette", "Grumpig", "Claydol", "Torkoal", "Crawdaunt", "Flygon", "Hariyama", "Manectric", "Camerupt", "Beautifly", "Sceptile", "Blaziken", "Swampert", "Mightyena", "Tyranitar", "Mantine", "Skarmory", "Kingdra", "Heracross", "Steelix", "Wobbuffet", "Misdreavus", "Sudowoodo", "Crobat", "Magmar", "Tentacruel", "Exeggutor", "Arcanine", "Electabuzz", "Lapras", "Jynx", "Dragonite", "Scyther", "Kangaskhan", "Gyarados", "Snorlax", "Alakazam", "Gengar", "Charizard", "Venusaur", "Blastoise"},
},
}
function getCatchMode(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
return tonumber(tostring(getPlayerStorageValue(cid, catchModes.storage)):explode("|")[1])
end
end
return 1
end
function setDailyCatched(cid, bool)
setPlayerStorageValue(cid, catchModes.storage, "|"..getPlayerStorageValue(cid, catchModes.storage):explode("|")[1].."|"..getPlayerStorageValue(cid, catchModes.storage):explode("|")[2].."|"..getPlayerStorageValue(cid, catchModes.storage):explode("|")[3].."|"..tostring(bool))
end
function getPokemonsToCatch(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
local string = getPlayerStorageValue(cid, catchModes.storage):explode("|")[3]
return string:explode(";")
end
end
return {"none1", "none2"}
end
function doPlayerAddTableItems(cid, table)
if isPlayer(cid) then
for _, item in pairs(table) do
doPlayerAddItem(cid, items[1], items[2], items[3])
end
end
end
function hasCatched(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
return (getPlayerStorageValue(cid, catchModes.storage):explode("|")[4] == "true")
end
end
return false
end
function getLastDayCatch(cid)
if isPlayer(cid) then
if not (tostring(getPlayerStorageValue(cid, catchModes.storage)) == "-1") then
return tostring(getPlayerStorageValue(cid, catchModes.storage)):explode("|")[2]
end
end
return "07-00-00"
end
function resetDaily(cid)
if isPlayer(cid) then
local pokemons = catchModes[(getCatchMode(cid))].pokemons
local number1 = math.random(1, #pokemons)
local number2 = number1
repeat
number2 = math.random(1, #pokemons)
until(not (number1 == number2))
if getPlayerLevel(cid) >= 1 and getPlayerLevel(cid) <= 50 then
valor = 1
elseif getPlayerLevel(cid) >= 51 and getPlayerLevel(cid) <= 100 then
valor = 2
elseif getPlayerLevel(cid) >= 101 and getPlayerLevel(cid) <= 180 then
valor = 3
elseif getPlayerLevel(cid) >= 180 then
valor = 4
end
local day = tostring(""..getNumberDay().."-"..getNumberMonth().."-"..getNumberYear().."")
setPlayerStorageValue(cid, catchModes.storage, "|"..valor.."|"..day.."|"..pokemons[number1]..";"..pokemons[number2].."|false")
setPlayerStorageValue(cid, catchModes.storage2, -1)
end
end
function nextDaily(cid)
if isPlayer(cid) then
if getCatchMode(cid) == #catchModes then
setDailyCatched(cid, false)
setPlayerStorageValue(cid, catchModes.storage2, "finished")
return false
end
local pokemons = catchModes[(getCatchMode(cid) + 1)].pokemons
local number1 = math.random(1, #pokemons)
local number2 = number1
repeat
number2 = math.random(1, #pokemons)
until(not (number1 == number2))
local day = tostring(""..getNumberDay().."-"..getNumberMonth().."-"..getNumberYear().."")
local text = "|"..(getCatchMode(cid) + 1).."|"..day.."|"..pokemons[number1]..";"..pokemons[number2].."|false"
setDailyCatched(cid, false)
setPlayerStorageValue(cid, catchModes.storage, text)
setPlayerStorageValue(cid, catchModes.storage2, -1)
end
return true
end
Agradeço desde já a quem me ajudar
Link para o comentário
https://xtibia.com/forum/topic/252677-ajuda-com-task-dailly-catch/Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados