RO
pedido

[Npc] Npc Teleporter Por Storage

Por romeu23, 24 de jul. de 2012 em Scripts

valendo rep+
script
26
3.5k
romeu23R
24 de julho de 2012 às 23:44

nao quer da @Harpia Look ,

nao é melhor editar encima desse:

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

local pos = {x=160,y=54,z=7}

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)

if (not npcHandler:isFocused(cid)) then

return false

end

if msgcontains(msg, "") or msgcontains(msg, "help") then

talkState[cid] = 0

elseif msgcontains(msg, '') then

selfSay("Good luck in war!", cid)

doTeleportThing(cid, pos)

end

getPlayerStorageValue(cid,13540)

getPlayerStorageValue(cid,7715)

selfSay("Sorry, but your guild does not have access to a private area of war.", cid)

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

lukas13onL
24 de julho de 2012 às 23:52

estou tentando achar umaas functions

romeu23R
24 de julho de 2012 às 23:59

ok , vlw

lukas13onL
25 de julho de 2012 às 00:07

Hm tente esse

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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 oracle(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end

local cityNode = node:getParent():getParent()
local vocNode = node:getParent()

local destination = cityNode:getParameters().destination
local town = cityNode:getParameters().town
local vocation = vocNode:getParameters().vocation

if(destination ~= nil and vocation ~= nil and town ~= nil) then
if(getPlayerStorage(cid) =  7714 then
npcHandler:say('Only permited players ' .. parameters.level .. '!', cid)
else
doPlayerSetStorage(cid, storage)
doPlayerSetTown(cid, town)
else
doTeleportThing(cid, destination)
Setdestination(cid, storage) = town = 1, destination = {x=469, y=172, z=7}
doSendMagicEffect(destination, CONST_ME_MAGIC_BLUE)
end
	end
end
npcHandler:resetNpc()
return true
end

function greetCallback(cid)
if(getPlayerLevel(cid) < 8) then
npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
return false
else
return true
end
end

romeu23R
25 de julho de 2012 às 00:10

deeu nao :/ , falo com o npc e ele nem responde..

lukas13onL
25 de julho de 2012 às 00:20

function onUse(cid, storage, fromPosition, toPosition)

local teleport = {x=100, y=54, z=7} -- Coordenadas para onde o player irá ser teleportado.
local Storage_id = 2195 -- ID do item que o player precisa para ser teleportado.

if getPlayerStorage(cid,Storage_id) == 2195 then
	doTeleportThing(cid, teleport)
	doSendMagicEffect(getPlayerPosition(cid), 10)
	doPlayerSendTextMessage(cid, 22, "Ok, let's go! You are permision  for make this teleport!")
	else
	doPlayerSendTextMessage(cid, 23, "Sorry, you need a permission to enter")
	end
end

 

.-. TENTA DNV até nos conseguirmos.

 

esse é diferente ;-; vc coloca isso na pasta actions/scripts/arquivo.lua

 

dai dps vc coloca em actions.xml

 

<action actionid="2195" event="script" value="arquivo.lua"/>

 

dai tipo vai no rme escolhe uma estatua e coloca o actionid nela

dai ela vai teleporta quando tiver item.

Editado Julho 25 por HarpiaLOOK

romeu23R
25 de julho de 2012 às 00:35

@Harpia me passa seu msn ? ai é mais facil pra gnt nao ? kk

 

ok vou testar

 

mas eu queria que fosse por npc .. :S nao tem jeito?

lukas13onL
25 de julho de 2012 às 00:37

luka.pc@hotmail.com

romeu23R
25 de julho de 2012 às 00:48

só acc !

 

acc la @HarpiaLOOK

SkyLighS
25 de julho de 2012 às 10:15

Se nao for agora n posso mas ajudar.

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local pos = {x=160,y=54,z=7}
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)
if (not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, "") or msgcontains(msg, "help") then
talkState[cid] = 0
elseif msgcontains(msg, '') then
selfSay("Good luck in war!", cid)
doTeleportThing(cid, pos)
end
if getPlayerStorageValue(cid,7714) <= TRUE then
if getPlayerStorageValue(cid,7715) <= TRUE then
Say("Sorry, but your guild does not have access to a private area of war.", cid)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

lukas13onL
25 de julho de 2012 às 10:24

ja conseguimos

-------------------------

Reportado para moverem, Sanado