Ir para conteúdo

Aura Boost Pokemon


RodriigoRobson

Posts Recomendados

Bom Dia Galera!

-Bom eu estou tendo problemas com um script de Aura Boost Pokemon esta dando o Seguinte Erro:

 

[29/01/2014 11:49:48] [Error - CreatureScript Interface]
[29/01/2014 11:49:48] data/creaturescripts/scripts/auraboost.lua:onThink
[29/01/2014 11:49:48] Description:
[29/01/2014 11:49:48] (luaGetPlayerSlotItem) Player not found

[29/01/2014 11:49:48] [Error - CreatureScript Interface]
[29/01/2014 11:49:48] data/creaturescripts/scripts/auraboost.lua:onThink
[29/01/2014 11:49:48] Description:
[29/01/2014 11:49:48] (luaGetItemAttribute) Item not found

 

 

 

function onThink(cid, interval)
if getPlayerSlotItem(cid, CONST_SLOT_FEET) == nil or getPlayerSlotItem(cid, CONST_SLOT_FEET).uid == nil then return true end

if #getCreatureSummons(cid) == 1 then return true end

if getPlayerSlotItem(cid,CONST_SLOT_FEET) ~= nil or getPlayerSlotItem(cid, CONST_SLOT_FEET).uid ~= nil then
if getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "boost") == 50 then
addEvent(doSendMagicEffect, 200, getCreaturePosition(getCreatureSummons(cid)[1]), 208)
end
end
end

 

 

Se alguem me Ajudar Rep+

Link para o comentário
Compartilhar em outros sites

Tenta:

 

function onThink(cid, interval)
    if not isPlayer(cid) then 
        return true
    elseif getPlayerSlotItem(cid, CONST_SLOT_FEET).uid < 1 or getPlayerSlotItem(cid, CONST_SLOT_FEET).uid < 1 then
        return true
    elseif #getCreatureSummons(cid) < 1 then 
        return true 
    else
        local boost = getItemAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "boost") or 0
        if boost == 50 then            
            addEvent(doSendMagicEffect, 200, getCreaturePosition(getCreatureSummons(cid)[1]), 208)
        end
    end
    return true
end
Link para o comentário
Compartilhar em outros sites

desculpa a demora amigo de responder o topico e que estou trabalhando no meu projeto de pokemon e nao da tempo de entra no xtibia intao esta dando o mesmo erro. O meu sistema de Boost e esse aki ve se fica mais facil pra vc poder me ajudar =)

 

É Um Npc:

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {20}
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

local itemPedra = {
-- [TIPO] = {STONE}
["Fire"] = {2283},
["Crystal"] = {2285},
["Enigma"] = {2288},
["Venom"] = {2278},
["Thunder"] = {2279},
["Coccon"] = {2284},
["Leaf"] = {2276},
["Water"] = {2277},
["Heart"] = {2289},
["Darkness"] = {2286},
["Punch"] = {2281},
["Earth"] = {2287},
["Rock"] = {2280},
["Ice"] = {2290},
}
local pedras = {
-- [sTONE_ID] = {pokemons que usam a stone}
--[[Fire]]
[2283] = {names = "Typhlosion,Slugma,Quilava,Magcargo,Magcarbo,Magby,Houndour,Houndoom,Ho oh,Entei,Cyndaquil,Charmander, Charizard, Charmeleon, Arcanine, Growlithe, Flareon, Magmar, Ninetales, Rapidash, Vulpix, Ponyta, Moltres, Shiny Arcanine, Elder Charizard, Shiny Growlithe" ,count = 5},
--[[Crystal]]
[2285] = {names = "Skarmory,Kingdra,Dragonite, Dragonair, Shiny Dragonair, Shiny Dratini, Dratini" ,count = 5},
--[[Enigma]]
[2288] = {names = "Xatu,Unown C,Unown D,Unown E,Unown F,Unown G,Unown H,Unown I,Unown J,Unown K,Unown L,Unown M,Unown N,Unown O,Unown P,Unown Q,Unown R,Unown S,Unown T,Unown U,Unown V,Unown W,Unown X,Unown Y,Unown Z,Unown B,Unown A,Slowking,Natu,Girafarig,Espeon,Alakazam, Shiny Alakazam, Abra, Kadabra, Hypno, Drowzee, Mr Mime, Mew, Mewtwo" ,count = 5},
--[[Venom]]
[2278] = {names = "Qwilfish,Gligar,Crobat,Nidoking, Nidoqueen, Muk, Grimer, Weezing, Koffing, Ekans, Arbok, Golbat, Zubat, Nidoranfemale, Nidoranmale, Nidorina, Nidorino, Venonat, Venomoth, Shiny Venomoth, Shiny Zubat, Shiny Golbat, Shiny Muk, Shiny Grimer, Shiny Venonat" ,count = 5},
--[[Thunder]]
[2279] = {names = "Raikou,Pichu,Mareep,Flaaffy,Elekid,Ampharos,Electabuzz, Raichu, Pikachu, Electrode, Voltorb, Jolteon, Magnetom, Magnemite, Zapdos, Shiny Electabuzz, Shiny Raichu, Shiny Voltorb, Shiny Electrode" ,count = 5},
--[[Coccon]]
[2284] = {names = "Yanma,Spinarak,Scizor,Pineco,Ledian,Ledyba,Heracross,Forretress,Dunsparce,Ariados,Scyther, Parasect, Shiny Parasect, Paras, Caterpie, Weedle, Beedrill, Butterfree, Kakuna, Metapod, Pinsir, Shiny Scyther, Shiny Beedrill, Shiny Butterfree, Shiny Paras" ,count = 5},
--[[Leaf]]
[2276] = {names = "Sunkern,Sunflora,Skiploom,Meganium,Jumpluff,Hoppip,Chikorita,Celebi,Bellossom,Bayleef,Venusaur, Bulbasaur, Ivysaur, Tangela, Exeggutor, Weepinbell, Bellsprout, Victreebel, Oddish, Vileplume, Gloom, Exeggcute, Shiny Venusaur, Shiny Oddish" ,count = 5},
--[[Water]]
[2277] = {names = "Wooper,Totodile,Suicune,Remoraid,Quagsire,Politoed,Octilery,Marill,Mantine,Lugia,Lanturn,Feraligatr,Croconaw,Corsola,Chinchou,Azumarill,Magikarp, Blastoise, Squirtle, Wartortle, Vaporeon, Gyarados, Omastar, Omanyte, Lapras, Poliwrath, Poliwag, poliwhirl, Horsea, Seadra, Krabby, Kingler, Psyduck, Golduck, Tentacool, Tentacruel, Slowpoke, Slowbro, Goldeen, Seaking, Staryu, Starmie, Lapras, Shiny Blastoise, Shiny Seadra, Shiny Krabby, Shiny Kingler, Shiny Tentacool, Shiny Tentacruel, Shiny Horsea, Red Gyarados, Shiny Magikarp, Shiny Big Magikarp" ,count = 5},
--[[Heart]]
[2289] = {names = "Wobbuffet,Ursaring,Togetic,Togepi,Teddiursa,Stantler,Snubbull,Smeargle,Sentret,Porygon2,Noctowl,Miltank,Igglybuff,Hoothoot,Granbull,Furret,Delibird,Cleffa,Blissey, Pidgeotto, Fearow, Pidgey, Chansey, Clefable, Wiglyttuff, Kangaskhan, Porygon, Raticate, Rattata, Doduo, Dodrio, Spearow, Clefairy, Jigglypuff, Meowth, Persian, Farfetchd, Lickitung, Ditto, Eevee, Snorlax, Shiny Pidgeot, Shiny Rattata, Shiny Raticate,Elite Farfetchd,Aipom,Pidgeot" ,count = 5},
--[[Darkness]]
[2286] = {names = "Murkrow, Misdreavus, Haunter, Gengar, Gastly, Dark Abra, Shiny Gengar" ,count = 5},
--[[Punch]]
[2281] = {names = "Tyrogue,Hitmontop, Hitmonchan, Hitmonlee, Machamp, Elite Hitmonlee, Elite Hitmonchan, Mankey, Primeape, Machop, Machoke" ,count = 5},
--[[Earth]]
[2287] = {names = "Phanpy, Dophan, Diglett, Sandslash, Dugtrio, Sandsherew, Marowak, Cubone, Shiny Marowak" ,count = 5} ,
--[[Rock]]
[2280] = {names = "Tyranitar,Sudowoodo,Steelix,Shuckle, Pupitar, Larvitar, Geodude, Golem, Rhydon, Graveler, Rhyhorn, Aerodactyl, Kabutops, Kabuto, Onix, Crystal Onix" ,count = 5},
--[[ice]]
[2290] = {names = "Swinub,Sneasel,Smoochum,Piloswine,Seel, Jynx, Dewgong, Cloyster, Shellder, Articuno, Shiny Jynx" ,count = 5} ,

}

function boostPoke(cid,stones)


local ball = getPlayerSlotItem(cid, CONST_SLOT_FEET) ;
local tmp = pedras[stones]
if tmp ~= nil then
if getPlayerItemCount(cid,stones) < tmp.count then

selfSay("Voce Precisa ["..tmp.count.."] Stones.Volte Quando Estiver com as Stones!!",cid)
return false

end
local pokename = getItemSpecialDescription(ball.uid)
local name = getItemAttribute(ball.uid, "poke"):match("This is (.-)'s pokeball.")


doPlayerRemoveItem(cid,stones,tmp.count)

if(pokename:find("\+(%d+)"))then
local boost = pokename:match("\+(%d+)")
doItemSetAttribute(ball.uid, "description", tostring(pokename:gsub(boost,((tonumber(boost)+1)))))
selfSay("Parabens! o Seu Pokemon Agora esta Boostado +"..boost + 1, cid)
else
doItemSetAttribute(ball.uid, "description", pokename.." +1.")
selfSay("Parabens! o Seu Pokemon Agora esta Boostado +1", cid)
end

return true
else
selfSay("Por favor, diga ao gamemaster que você recebeu essa mensagem usando boost sistema!!", cid)
return false
end
end

function onThingMove(creature, thing, oldpos, oldstackpos, item, itemEx)

end

function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Xauzinho.',cid)
focus = 0
talk_start = 0
talkState[talkUser] = 0
end
end
function onCreatureTurn(creature)

end

function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if getDistanceToCreature(cid) > 4 then
return false
end

if talkState[talkUser] ~= 3 then
msg = string.lower(msg)
end

if (msgcontains(msg, 'hi')) then

if #getCreatureSummons(cid) >= 1 then
selfSay('Coloque seu Pokemon no Slot...', cid)
focus = 0
talkState[talkUser] = 1
return false
end

if getPlayerStorageValue(cid, 17001) == 1 then
focus = 0
talkState[talkUser] = 1

selfSay('You Are riding .', cid)
return false
end
if getPlayerStorageValue(cid, 7778) >= 1 then
focus = 0
talkState[talkUser] = 1
selfSay('Você está usando a capacidade.', cid)
return false
end

fala = "Ola Grande Treinador!Quer Aumentar a Força do Seu Pokemon [boostando]? Voce Tem que Estar com A ball no Slot! [O BOOST é Infinito Nao Tem limite] Digite [Yes] !"

selfSay(fala,cid)
talkState[talkUser] = 1
elseif ( ( msgcontains(msg,"yes") or (msgcontains(msg,"boost") ) ) and talkState[talkUser] == 1 ) then
for i,x in pairs(itemPedra) do

local poke = pedras[itemPedra[1]]
varPoke = poke.names
item = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local pbPoke = getItemAttribute(item.uid, "poke"):match("This is (.-)'s pokeball.")
if (msgcontains(string.lower(varPoke), string.lower(pbPoke))) then
qtdStone = pedras[itemPedra[1]].count
setPlayerStorageValue(cid,18059,itemPedra[1])
selfSay("Voce Quer boostar "..qtdStone.." ["..i.."] Stones em Seu Pokemon?",cid)
talkState[talkUser] = 2
end
end
if talkState[talkUser] == 1 then
selfSay("You main pokemon are not supported by the Script YET report to a game master",cid)
end
elseif ( msgcontains(msg, 'yes') and talkState[talkUser] == 2 ) then
stones = getPlayerStorageValue(cid, 18059)
if not boostPoke(cid,stones) then
talkState[talkUser] = 1
end
elseif(msgcontains(msg, 'no')) then
talkState[talkUser] = 0
selfSay('Ok Bye Then.', cid)
elseif(msgcontains(msg, 'bye')) then
selfSay('Ok Bye Then.', cid)
talkState[talkUser] = 0
end

end

function onCreatureChangeOutfit(creature)
end

 

 

Esse sistema de boost de npc nao tem limite de boost ai queria por esse limite para 50 ai ganha uma aura qualquer e tambem quero que o npc nao pode mais boosta quando chegar no 50! Obrigado por Responder

 

E aproveito o Topico relacionado a Boost eu estou tentando por o Boost no Look so que esta dando Erro tambem ta ae o Script do Look

function onLook(cid, thing, position, lookDistance)

if thing.itemid == 448 then
if thing.actionid == 1005 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It looks like that this tile is not a trap.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This tile is for sure a trap.")
end
return false
end
if thing.itemid == 5339 then
if thing.actionid == 1001 then
doTeleportThing(cid, {x=1003,y=1018,z=7})
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "I said there wouldn\t be anymore tips, so don\'t read everything.")
doSendMagicEffect({x=1003,y=1018,z=7}, CONST_ME_TELEPORT)
return false
else
return true
end
end
if not isMonster(thing.uid) then
return true
end
if isPlayer(getCreatureMaster(thing.uid)) then
nome = getCreatureName(getCreatureMaster(thing.uid))
poke = string.lower(getCreatureName(thing.uid))

else
return true
end
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

if getCreatureMaster(thing.uid) == cid then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".\nIt belongs to "..nome..".\nVida: ["..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."]\n Boost Level: ["..getItemAttribute(feet.uid, "boost").."].")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You see a "..poke..".\nIt belongs to "..nome.."\nVida: ["..getCreatureHealth(thing.uid).."/"..getCreatureMaxHealth(thing.uid).."].")
end
return false
end

 

 

Erro:

 

[01/02/2014 14:21:45] [Error - CreatureScript Interface]
[01/02/2014 14:21:45] data/creaturescripts/scripts/look.lua:onLook
[01/02/2014 14:21:45] Description:
[01/02/2014 14:21:45] data/creaturescripts/scripts/look.lua:33: attempt to concatenate a nil value
[01/02/2014 14:21:45] stack traceback:
[01/02/2014 14:21:45] data/creaturescripts/scripts/look.lua:33: in function

 

Editado por Nextbr
Link para o comentário
Compartilhar em outros sites

  • 2 weeks later...
×
×
  • Criar Novo...