PM
pedido

[Pedido] Npc System Egg

Por Pmcd, 14 de set. de 2012 em Scripts

script
14
1.7k
PmcdP
14 de setembro de 2012 às 20:18

Bom , preciso de um sistema de pokemon egg , que o deixa dois pokémons no daycare e daqui a um certo tempo eles tem um ovo , e pegando o ovo deixa uns min no npc que dá um Pokemon.

 

Ex : Deixo um Venusaur + Torterra no NPC , pode vim tanto um turtuiwg ou um bulbasaur.

 

Detalhes adicionais : Eu tentei do SkyDangerous e não deu certo. E eu uso o pokémon centurion 3.2.

 

Script do SkyDangerous :

 

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

local talkState = {}

 

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

 

function onCreatureSayCallback(cid, type, msg)

local config = {

price = 50000,

delay = 5 * 60,

control = {10555, 10556},

eggn = 4850

}

if not npcHandler:isFocused(cid) then

return false

end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

 

if msgcontains(msg, "care") then

local p = (config.price % 1000 == 0 and (config.price / 1000) or config.price)

if getPlayerStorageValue(cid, config.control) > os.time() then

selfSay("Sorry, but I am already caring one of your eggs.", cid)

else

selfSay("Do you want me to take care of your egg for ".. p .." ".. (p == config.price and "" or "k") .."?", cid)

talkState[talkUser] = 1

end

 

elseif msgcontains(msg, "back") then

if getPlayerStorageValue(cid, config.control[2]) == 1 then

selfSay("Hello, do you came to pick up your egg?", cid)

talkState[talkUser] = 2

else

selfSay("Sorry, but I am not caring eggs from you.", cid)

end

 

elseif msgcontains(msg, "check") then

local t = getPlayerStorageValue(cid, config.control[1])

if getPlayerStorageValue(cid, config.control[2]) == -1 then

selfSay("Sorry, but I am not caring eggs from you.", cid)

else

if t < os.time() then

selfSay("Yay, your egg has started to hatch, take it.", cid)

setPlayerStorageValue(cid, config.control[1], -1)

setPlayerStorageValue(cid, config.control[2], -1)

else

selfSay("I will be caring your egg for more ".. (math.floor((t - os.time()) / 60) > 0 and "".. math.floor((t - os.time()) / 60) .." minutes and" or "") .." ".. (t - os.time()) % 60 .." seconds.", cid)

end

end

end

 

if talkState[talkUser] == 1 then

if msgcontains(msg, "yes") then

if getPlayerStorageValue(cid, config.control[2]) == -1 then

if doPlayerRemoveMoney(cid, config.price) then

setPlayerStorageValue(cid, config.control[2], 1)

setPlayerStorageValue(cid, config.control[1], os.time()+config.delay)

selfSay("Okay! Check back soon.", cid)

else

selfSay("Sorry, you don't have enough money. You need more ".. (config.price - getPlayerMoney(cid)) .." coins.", cid)

end

else

selfSay("I am already taking care of a egg for you.", cid)

end

elseif msgcontains(msg, "no") then

selfSay("Too pricey for you, heh?", cid)

end

elseif talkState[talkUser] == 2 then

local x = getPlayerStorageValue(cid, config.control)

local t = getPlayerStorageValue(cid, config.control[1])

if msgcontains(msg, "yes") then

if x > os.time() then

local item = doPlayerAddItem(cid, config.eggn, 1)

doItemSetAttribute(item, "description", "A hatched egg.")

selfSay("Take it!", cid)

setPlayerStorageValue(cid, control[2], -1)

setPlayerStorageValue(cid, control[1], -1)

else

selfSay("Sorry, but your egg need care for more ".. (math.floor((t - os.time()) / 60) > 0 and "".. math.floor((t - os.time()) / 60) .." minutes and" or "") .." ".. (t - os.time()) % 60 .." seconds.", cid)

end

end

end

return true

end

 

npcHandler:setMessage(MESSAGE_GREET, "Hello, |PLAYERNAME|. I am a pet egg carer. Do you want me to {care} your pet eggs? Also you can {check} the egg status and if you have any egg here, you can get it {back}.")

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback)

 

npcHandler:addModule(FocusModule:new())

Editado Setembro 15 por Pmcd

LuckOakeL
14 de setembro de 2012 às 20:21

Rapaz, ficar dando UP no tópico não é permitido, isso é flood. REP- e reportado.

caoticC
14 de setembro de 2012 às 21:21

Cuidado com este tipo de flood.

Isto e um alerta verbal mais na próxima vez tomarei atitules mais serias.

PmcdP
15 de setembro de 2012 às 12:17

Sou novo aaqui e ninguém responde :(

SkyDangerousS
15 de setembro de 2012 às 12:38

Sou novo aaqui e ninguém responde :(

 

Deve aguardar cara, não é na hora.

Dependendo da dúvida ou pedido, pode levar alguns dias para ser feito.

 

Só aguardar, ou se quiser estudar pra fazer sozinho é bem melhor.

beddyB
15 de setembro de 2012 às 12:42

Amigos queridos, achei essa de negativar o cara de primeira muito mal hein ... Novatos.... voces já foram um!

 

@PMCD

 

Posta o script que voce tem ai! Fica mais faciil de ajudar!

PmcdP
15 de setembro de 2012 às 17:56

@Beddy

 

Vou editar o tópico e colocar o script do SkyDangerous.

eduardo190696E
15 de setembro de 2012 às 18:39

esse script do sky não funciona mesmo, eu mesmo testei num ot 8.54 e não funcionou, ele retira o dinheiro mais o egg continua com o player e quando vai tirar nada acontece... tente procurar outro ou fazer um para você como foi o que eu fiz.

LuckOakeL
15 de setembro de 2012 às 18:42

Galera, dá algum erro no console? Fica mais fácil de identificar o erro se vocês postarem o erro. Pode ser incompatibilidade da versão 8.54.

PmcdP
15 de setembro de 2012 às 20:42

O problema não é no console , e sim no npc , os problemas são oque o eduardo disse.

PmcdP
20 de setembro de 2012 às 22:52

Alguém ?

geovanediasG
23 de setembro de 2012 às 21:46

espero que alguem conserte o script, para eu colocar no meu server de digimon

2 semanas depois...
PmcdP
30 de setembro de 2012 às 22:11

Acho que esse system só serve para poketibia , mas acho q tbm pode ser pra digimon pq ele é feito pelo poketibia

1 mês depois...
PmcdP
09 de outubro de 2012 às 11:48

Malz pelo double post , alguem está fazendo ? please ???