NA

Pokedex

Por narutoxDDDD, 25 de out. de 2010 em Archived

5
1.9k
narutoxDDDDN
25 de outubro de 2010 às 14:20

Está dando erro logo nessa parte... "if is Summon(pokemon) then" espero que me ajudem =D

 

function onUse(cid, item, fromPos, itemEx, toPos)

local pokemon = itemEx.uid
local pokemons = {
{"Bulbasaur", "1.txt", 11395, 20, 100, 99101},
{"Squirtle", "2.txt", 11401, 20, 500, 99102}, 
}

for _,n in pairs(pokemons) do
local Dex = io.open('data/pokedex/' .. n[2],'r')
   if isSummon(pokemon) then
                    if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then 
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex")
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.")
                    doPlayerAddExperience(cid, n[5])
                    setPlayerStorageValue(cid, n[6], 1)
                    elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need level " .. n[4] .. " to unlock this pokemon.")
                    elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    return true
                    end   
                    elseif isMonster(pokemon) then
                    if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) <= 0 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex")
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.")
                    doPlayerAddExperience(cid, n[5])
                    setPlayerStorageValue(cid, n[6], 1)
                    elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    return true
                    end
   end
end  
end

 

++REP Para quem ajudar

joaohdJ
25 de outubro de 2010 às 14:36

O servidor não possui esta função. Tente esta:

 

function isSummon(uid)
return isCreature(uid) and getCreatureMaster(uid) ~= uid or false
end

 

 

flw

kevinlokoK
25 de outubro de 2010 às 14:49

Ei cara tu podia passar o script pra nóis né

narutoxDDDDN
29 de outubro de 2010 às 15:17

apocarai

 

Tem como vc editar o scripter contendo essa edição? não entendi onde editar ==D

 

Vou disponibilizar ele pro xtibia se no caso de funcionar =D

joaohdJ
29 de outubro de 2010 às 15:21

Tente:

 

function isSummon(uid)
return isCreature(uid) and getCreatureMaster(uid) ~= uid or false
end

function onUse(cid, item, fromPos, itemEx, toPos)

local pokemon = itemEx.uid
local pokemons = {
{"Bulbasaur", "1.txt", 11395, 20, 100, 99101},
{"Squirtle", "2.txt", 11401, 20, 500, 99102}, 
}

for _,n in pairs(pokemons) do
local Dex = io.open('data/pokedex/' .. n[2],'r')
   if isSummon(pokemon) then
                    if getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) >= n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then 
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex")
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.")
                    doPlayerAddExperience(cid, n[5])
                    setPlayerStorageValue(cid, n[6], 1)
                    elseif getCreatureName(pokemon) == n[1] and getPlayerLevel(cid) < n[4] and getPlayerStorageValue(cid, n[6]) <= 0 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You need level " .. n[4] .. " to unlock this pokemon.")
                    elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    return true
                    end   
                    elseif isMonster(pokemon) then
                    if getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) <= 0 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked " .. n[1] .. " in your pokedex")
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained " .. n[5] .. " experience points.")
                    doPlayerAddExperience(cid, n[5])
                    setPlayerStorageValue(cid, n[6], 1)
                    elseif getCreatureName(pokemon) == n[1] and getPlayerStorageValue(cid, n[6]) >= 1 then
                    doShowTextDialog(cid, n[3], Dex:read("*all"))
                    return true
                    end
   end
end  

 

 

flw