Colocar para esse NPC aceitar mais storage

Allangod
em Scripts

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Esse Npc só teleporta o player se ele tiver a storage 2124,1. E se ele tiver teleportado outro player na hunt ele não teleporta, pq ele não deixa ficar 2 na hunt.

Eu gostaria que esse NPC alem de aceitar a storage 2124,1 eu gostaria que ele aceitasse tambem a storage 2124,2 e a storage 2124,3.

Ta ae o NPC

 

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 creatureSayCallback(cid, type, msg)

local pos = {x=753, y=1159, z=7} -- Local da hunt

local posreturn = {x=796, y=1155, z=2} -- Posiçao onde o player sera teleportado quando acabar o tempo

local money = 10000 --- Quanto de dinheiro sera removido

 

config = {

time = 6, ---Tempo que ele vai ficar na hunt sabendo que cada numeral equivale a um minuto-----

str = 2124, --- Storage que ele necessita

msg = "Você não é um ninja rank C" --- Mensagem que irá aparecer se ele não tiver a storage

}

function doReturnPos()

doTeleportThing(cid, posreturn)

setGlobalStorageValue(24688, 0)

setGlobalStorageValue(24686, none)

setPlayerStorageValue(cid, 28680, 0)

end

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'chuunin') then

if getPlayerStorageValue(cid, config.str) ~= 1 then

doPlayerSendTextMessage(cid,22, config.msg)

return true

end

if getGlobalStorageValue(24688) == 1 then

doPlayerSendTextMessage(cid,22,"O player "..getGlobalStorageValue(24686).." esta fazendo o teste")

return true

end

if not doPlayerRemoveMoney(cid, money) then

doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." precisa de "..money.." para fazer o chuunin teste")

return true

end

doPlayerRemoveMoney(cid, money)

doPlayerSendTextMessage(cid,22,"Obrigado "..getPlayerName(cid).." foi teleportado.")

doTeleportThing(cid, pos)

setGlobalStorageValue(24688, 1)

setGlobalStorageValue(24686, getPlayerName(cid))

setPlayerStorageValue(cid, 28680, 1)

addEvent(doReturnPos, config.time*60*1000)

else

selfSay('Diga chuunin', cid)

end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Quem conseguir REP+

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

troca isso..

if getPlayerStorageValue(cid, config.str) ~= 1 then
doPlayerSendTextMessage(cid,22, config.msg)
return true
end

por..

if getPlayerStorageValue(cid, config.str) <= 0 or getPlayerStorageValue(cid, config.str) >= 4 then
doPlayerSendTextMessage(cid,22, config.msg)
return true
end

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Não funcionou Slicer, ele ainda nao reconhece as storages 2124,2 2124,3 2124,4

:/

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

hã.. eh sim pra ele reconhecer as 1 2 e 3.. o.O

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Tenta colocar no teu server e testa ae...

Infelizmente nao esta pegando :/

caotic

Afinal de contas,sou um mordomo e tanto
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 04/03/11Posts: 1599Char no Tibia: No Have
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 creatureSayCallback(cid, type, msg)
local pos = {x=753, y=1159, z=7} -- Local da hunt
local posreturn = {x=796, y=1155, z=2} -- Posiçao onde o player sera teleportado quando acabar o tempo
local money = 10000 --- Quanto de dinheiro sera removido

config = {
time = 6, ---Tempo que ele vai ficar na hunt sabendo que cada numeral equivale a um minuto-----
msg = "Você não é um ninja rank C" --- Mensagem que irá aparecer se ele não tiver a storage
}

local str = {
{st = 2124, value = 1}, --- St e o numero da storage e value e o valor da storage
{st = 2124, value = 2},
{st = 2124, value = 3}

}

function doReturnPos()
doTeleportThing(cid, posreturn)
setGlobalStorageValue(24688, 0)
setGlobalStorageValue(24686, none)
setPlayerStorageValue(cid, 28680, 0)
end
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'chuunin') then
for i = 1, #str do
if getPlayerStorageValue(cid, str[i].st) ~= str[i].value then
doPlayerSendTextMessage(cid,22, config.msg)
return true
end
end
if getGlobalStorageValue(24688) == 1 then
doPlayerSendTextMessage(cid,22,"O player "..getGlobalStorageValue(24686).." esta fazendo o teste")
return true
end
if not doPlayerRemoveMoney(cid, money) then
doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." precisa de "..money.." para fazer o chuunin teste")
return true
end
doPlayerRemoveMoney(cid, money)
doPlayerSendTextMessage(cid,22,"Obrigado "..getPlayerName(cid).." foi teleportado.")
doTeleportThing(cid, pos)
setGlobalStorageValue(24688, 1)
setGlobalStorageValue(24686, getPlayerName(cid))
setPlayerStorageValue(cid, 28680, 1)
addEvent(doReturnPos, config.time*60*1000)
else
selfSay('Diga chuunin', cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Caotic, agora ele nao reconhece nem a storage 2124,1

brun123

vash
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 24/09/06Posts: 512

pra aceitar as storages 1 2 3 era fazer a substituição que o slicer falou, como você deixou seu script? era pra ter funcionado

5303fg1.png

Allangod

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 04/09/12Posts: 185

Afffff Slicer, me desculpa cara eu que tinha editado errado.

Um grande REP+ para você cara...

Podem mover o topico e me desculpem o transtorno...

Vlws

Slicer

Insanity
avatar
Príncipe
Príncipe

INFOS

Grupo: PríncipeRegistrado: 19/08/10Posts: 4014Gênero: Masculino

sanado, movido

"Só a beira do abismo que os seres humanos acham forças para mudar."... E isso me da nojo... ¬¬

"Insanity is doing the exact... same fucking thing... over and over again expecting... shit to change... That. Is. Crazy." -Vass/Einstein

 

XxPaaulinhoOxX

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 19/12/12Posts: 47

 

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 creatureSayCallback(cid, type, msg)

local pos = {x=753, y=1159, z=7} -- Local da hunt

local posreturn = {x=796, y=1155, z=2} -- Posiçao onde o player sera teleportado quando acabar o tempo

local money = 10000 --- Quanto de dinheiro sera removido

 

config = {

time = 6, ---Tempo que ele vai ficar na hunt sabendo que cada numeral equivale a um minuto-----

str = 2124, --- Storage que ele necessita

msg = "Você não é um ninja rank C" --- Mensagem que irá aparecer se ele não tiver a storage

}

function doReturnPos()

doTeleportThing(cid, posreturn)

setGlobalStorageValue(24688, 0)

setGlobalStorageValue(24686, none)

setPlayerStorageValue(cid, 28680, 0)

end

if(not npcHandler:isFocused(cid)) then

return false

end

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'chuunin') then

if getPlayerStorageValue(cid, config.str) >= 1 and getPlayerStorageValue(cid, config.str) <= 3 then

doPlayerSendTextMessage(cid,22, config.msg)

return true

end

if getGlobalStorageValue(24688) == 1 then

doPlayerSendTextMessage(cid,22,"O player "..getGlobalStorageValue(24686).." esta fazendo o teste")

return true

end

if not doPlayerRemoveMoney(cid, money) then

doPlayerSendTextMessage(cid,22,""..getPlayerName(cid).." precisa de "..money.." para fazer o chuunin teste")

return true

end

doPlayerRemoveMoney(cid, money)

doPlayerSendTextMessage(cid,22,"Obrigado "..getPlayerName(cid).." foi teleportado.")

doTeleportThing(cid, pos)

setGlobalStorageValue(24688, 1)

setGlobalStorageValue(24686, getPlayerName(cid))

setPlayerStorageValue(cid, 28680, 1)

addEvent(doReturnPos, config.time*60*1000)

else

selfSay('Diga chuunin', cid)

end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())