Ultima modifica:
Ciao, mi servirebbe una mano per uno Script che in pratica faccia questo:
- NPC che fa warpare in una zona della mappa a me e al mio gruppo.
- Solo il capogruppo ci puo parlare e devi avere un item che ti rimuove quando vieni warpato.
- Puoi stare in questa zona della mappa per 20 minuti poi ti riporta in citta.
- Se uccidi il Boss dopo 15secondi porta tutto il gruppo in citta.
- Una volta che un gruppo è entrato nessuno puo entrarci per altri 20 minuti.
- Se si rilogga, crasha ecc si viene riportati in citta.
Grazie mille a chiunque possa aiutarmi
EDIT:
Quest_function
Questlib.lua
ReragnoSystem.quest
Con questa quest l'NPC porta nella stanza un giocatore pe volta consegnandogli l'item e scrivendo la password corretta. Se volessi fare che si puo entrare nella stanza solo se si è in gruppo, solo il capogruppo puo parlare con l'NPC e solo al Capogruppo toglie l'item necessario e porta TUTTO il suo gruppo nella Stanza, e una volta che il gruppo è entrato nessuno puo piu entrarci è complicato? si devono cambiare parecchie cose nella quest e nelle function?
- NPC che fa warpare in una zona della mappa a me e al mio gruppo.
- Solo il capogruppo ci puo parlare e devi avere un item che ti rimuove quando vieni warpato.
- Puoi stare in questa zona della mappa per 20 minuti poi ti riporta in citta.
- Se uccidi il Boss dopo 15secondi porta tutto il gruppo in citta.
- Una volta che un gruppo è entrato nessuno puo entrarci per altri 20 minuti.
- Se si rilogga, crasha ecc si viene riportati in citta.
Grazie mille a chiunque possa aiutarmi

EDIT:
Quest_function
Codice:
pc.get_channel_id
ReragnoSystem.reload
ReragnoSystem.exitDungeon
Questlib.lua
Codice:
ReragnoSystem = {
["canale"] ={
[1] = 0,
[2] = 0,
},
["psegreta"] ={
[1] = "",
[2] = "",
},
["giocatore"] ={
[1] = {},
[2] = {},
},
["conta"] ={
[1] = 0,
[2] = 0,
},
["tempo"] ={
[1] = 1800,
[2] = 1800,
},
["parla"] ={
[1] = 0,
[2] = 0,
},
["entrata"] ={
[1] = 0,
[2] = 0,
},
["uscita"] ={
[1] = 0,
[2] = 0,
},
["callRicarica"] ={
[1] = 0,
[2] = 0,
},
["logOutSistema"] ={
[1] = 0,
[2] = 0,
},
}
function ReragnoSystem.reload(idChannel)
ReragnoSystem.canale[idChannel] = 0
ReragnoSystem.psegreta[idChannel] = ""
ReragnoSystem.giocatore[idChannel] = {}
ReragnoSystem.conta[idChannel] = 0
ReragnoSystem.entrata[idChannel] = 0
ReragnoSystem.uscita[idChannel] = 0
ReragnoSystem.callRicarica[idChannel] = 0
ReragnoSystem.logOutSistema[idChannel] = 0
notice_all("La Stanza del Re Ragno è di nuovo libera !!! (Channel "..idChannel..")")
end
function ReragnoSystem.exitDungeon(idChannel)
for i=0,ReragnoSystem.conta[idChannel],1 do
giocatore = find_pc_by_name(ReragnoSystem.giocatore[idChannel][i])
pc.select(giocatore)
if pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 then --Cambiare coordinate mappa
warp_to_village()
end
end
if ReragnoSystem.logOutSistema[idChannel] == 1 then
clear_server_timer("logOutSistema"..idChannel)
Reragno.logOutSistema[idChannel] = 0
end
Reragno.reload(idChannel)
end
ReragnoSystem.quest
[CODEquest reragnosystem begin
state start begin
when 30122.click begin
if ReragnoSystem.parla[pc.get_channel_id()] == 0 then
ReragnoSystem.parla[pc.get_channel_id()] = 1
server_timer("npcTalk"..pc.get_channel_id(),90)
if ReragnoSystem.canale[pc.get_channel_id()] == 1 then
say_title("Spirito Antico")
say("Qualcun'altro sta gia' affrontando il Drago Beran")
say("Potrai raggiungerlo inserendo la password!")
local password = tonumber(input())
if password == ReragnoSystem.psegreta[pc.get_channel_id()] then
if pc.count_item(30179) == 0 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
syschat("Ti serve una Chiave a Spirale")
return
end
pc.remove_item(30179, 1)
timer("warpStanza", 1)
end
else
local s = select("Affronta il Drago Beran", "Chiudi")
if s == 2 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
return
end
say ("Sei pronto ad affrontare il temibile Beran?")
say ("Ti occorre 1 Chiave a Spirale.")
say ("Ogni membro del tuo gruppo dovra'")
say ("avere una Chiave a Spirale per poter entrare")
say_item("Chiave a Spirale x1", "30179", "")
local p = select("Si, sono pronto", "Chiudi")
if p == 2 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
return
end
if pc.count_item(30179) == 0 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
syschat("Ti serve una Chiave a Spirale")
return
end
say("Scegli la password!")
local pwd = input()
if not tonumber(pwd) then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
say("Inserisci Password di 9 cifre")
return
elseif tonumber(pwd) < 100000000 or tonumber(pwd) > 999999999 then
say("Inserisci Password di 9 cifre")
say("")
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
return
else
if ReragnoSystem.psegreta[pc.get_channel_id()] == "" then
pc.remove_item(30179, 1)
ReragnoSystem.psegreta[pc.get_channel_id()] = tonumber(pwd)
ReragnoSystem.canale[pc.get_channel_id()] = 1
ReragnoSystem.entrata[pc.get_channel_id()] = get_time()
ReragnoSystem.uscita[pc.get_channel_id()] = get_time() + ReragnoSystem.tempo[pc.get_channel_id()]
server_timer("forceReload"..pc.get_channel_id(),ReragnoSystem.tempo[pc.get_channel_id()]+120)
timer("warpStanza", 1)
else
syschat("La Stanza del Re Ragno e' gia occupata")
end
end
end
clear_server_timer("npcTalk"..pc.get_channel_id())
ReragnoSystem.parla[pc.get_channel_id()] = 0
else
say_title("Spirito Antico")
say("")
say("Un altro guerriero sta gia parlando con me!")
say("Aspetta il tuo Turno !!")
end
end
when ForzaReload1.server_timer begin
ReragnoSystem.reload(1)
end
when ForzaReload2.server_timer begin
ReragnoSystem.reload(2)
end
when npcTalk1.server_timer begin
ReragnoSystem.parla[1] = 0
end
when npcTalk2.server_timer begin
ReragnoSystem.parla[2] = 0
end
when warpStanza.timer begin
ReragnoSystem.giocatore[pc.get_channel_id()][ReragnoSystem.conta[pc.get_channel_id()]] = pc.get_name()
ReragnoSystem.conta[pc.get_channel_id()] = ReragnoSystem.conta[pc.get_channel_id()]+1
if ReragnoSystem.uscita[pc.get_channel_id()] - get_time() < 21 then
syschat("Mancano 20 secondi prima che scada il tempo!")
return
end
pc.warp(174500,1220500) --cambiare coordinate
end
when login with pc.get_map_index() == 73 and pc.get_local_x() <= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
local name = pc.get_name()
for i=0,ReragnoSystem.conta[pc.get_channel_id()],1 do
if ReragnoSystem.giocatore[pc.get_channel_id()] == name then
timer("uscita".. pc.get_channel_id(),ReragnoSystem.uscita[pc.get_channel_id()] - get_time())
return
end
end
pc.warp(241600,1275200) --cambiare coordinate
end
when logout with pc.get_map_index() == 73 and pc.get_local_x() <= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
for i=0,ReragnoSystem.conta[pc.get_channel_id()],1 do
if ReragnoSystem.giocatore[pc.get_channel_id()] == name then
ReragnoSystem.giocatore[pc.get_channel_id()] = ""
return
end
end
end
when 2093.kill with pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
notice_all("Il Re Ragno e' stato ucciso!")
timer("uscita".. pc.get_channel_id(),20)
server_timer("logOutSistema"..pc.get_channel_id(),30)
end
when logOutSistema1.server_timer begin
clear_server_timer("ForzaReload1")
ReragnoSystem.reload(1)
end
when logOutSistema2.server_timer begin
clear_server_timer("ForzaReload2")
ReragnoSystem.reload(2)
end
when uscita1.timer with pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
if ReragnoSystem.callRicarica[pc.get_channel_id()] == 1 then
return
end
ReragnoSystem.logOutSistema[pc.get_channel_id()] = 1
ReragnoSystem.callRicarica[pc.get_channel_id()] = 1
clear_server_timer("ForzaReload1")
ReragnoSystem.exitDungeon(1)
end
when uscita2.timer with pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
if ReragnoSystem.callRicarica[pc.get_channel_id()] == 1 then
return
end
ReragnoSystem.logOutSistema[pc.get_channel_id()] = 1
ReragnoSystem.callRicarica[pc.get_channel_id()] = 1
clear_server_timer("ForzaReload2")
ReragnoSystem.exitDungeon(2)
end
end
end][/CODE]
state start begin
when 30122.click begin
if ReragnoSystem.parla[pc.get_channel_id()] == 0 then
ReragnoSystem.parla[pc.get_channel_id()] = 1
server_timer("npcTalk"..pc.get_channel_id(),90)
if ReragnoSystem.canale[pc.get_channel_id()] == 1 then
say_title("Spirito Antico")
say("Qualcun'altro sta gia' affrontando il Drago Beran")
say("Potrai raggiungerlo inserendo la password!")
local password = tonumber(input())
if password == ReragnoSystem.psegreta[pc.get_channel_id()] then
if pc.count_item(30179) == 0 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
syschat("Ti serve una Chiave a Spirale")
return
end
pc.remove_item(30179, 1)
timer("warpStanza", 1)
end
else
local s = select("Affronta il Drago Beran", "Chiudi")
if s == 2 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
return
end
say ("Sei pronto ad affrontare il temibile Beran?")
say ("Ti occorre 1 Chiave a Spirale.")
say ("Ogni membro del tuo gruppo dovra'")
say ("avere una Chiave a Spirale per poter entrare")
say_item("Chiave a Spirale x1", "30179", "")
local p = select("Si, sono pronto", "Chiudi")
if p == 2 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
return
end
if pc.count_item(30179) == 0 then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
syschat("Ti serve una Chiave a Spirale")
return
end
say("Scegli la password!")
local pwd = input()
if not tonumber(pwd) then
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
say("Inserisci Password di 9 cifre")
return
elseif tonumber(pwd) < 100000000 or tonumber(pwd) > 999999999 then
say("Inserisci Password di 9 cifre")
say("")
ReragnoSystem.parla[pc.get_channel_id()] = 0
clear_server_timer("npcTalk"..pc.get_channel_id())
return
else
if ReragnoSystem.psegreta[pc.get_channel_id()] == "" then
pc.remove_item(30179, 1)
ReragnoSystem.psegreta[pc.get_channel_id()] = tonumber(pwd)
ReragnoSystem.canale[pc.get_channel_id()] = 1
ReragnoSystem.entrata[pc.get_channel_id()] = get_time()
ReragnoSystem.uscita[pc.get_channel_id()] = get_time() + ReragnoSystem.tempo[pc.get_channel_id()]
server_timer("forceReload"..pc.get_channel_id(),ReragnoSystem.tempo[pc.get_channel_id()]+120)
timer("warpStanza", 1)
else
syschat("La Stanza del Re Ragno e' gia occupata")
end
end
end
clear_server_timer("npcTalk"..pc.get_channel_id())
ReragnoSystem.parla[pc.get_channel_id()] = 0
else
say_title("Spirito Antico")
say("")
say("Un altro guerriero sta gia parlando con me!")
say("Aspetta il tuo Turno !!")
end
end
when ForzaReload1.server_timer begin
ReragnoSystem.reload(1)
end
when ForzaReload2.server_timer begin
ReragnoSystem.reload(2)
end
when npcTalk1.server_timer begin
ReragnoSystem.parla[1] = 0
end
when npcTalk2.server_timer begin
ReragnoSystem.parla[2] = 0
end
when warpStanza.timer begin
ReragnoSystem.giocatore[pc.get_channel_id()][ReragnoSystem.conta[pc.get_channel_id()]] = pc.get_name()
ReragnoSystem.conta[pc.get_channel_id()] = ReragnoSystem.conta[pc.get_channel_id()]+1
if ReragnoSystem.uscita[pc.get_channel_id()] - get_time() < 21 then
syschat("Mancano 20 secondi prima che scada il tempo!")
return
end
pc.warp(174500,1220500) --cambiare coordinate
end
when login with pc.get_map_index() == 73 and pc.get_local_x() <= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
local name = pc.get_name()
for i=0,ReragnoSystem.conta[pc.get_channel_id()],1 do
if ReragnoSystem.giocatore[pc.get_channel_id()] == name then
timer("uscita".. pc.get_channel_id(),ReragnoSystem.uscita[pc.get_channel_id()] - get_time())
return
end
end
pc.warp(241600,1275200) --cambiare coordinate
end
when logout with pc.get_map_index() == 73 and pc.get_local_x() <= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
for i=0,ReragnoSystem.conta[pc.get_channel_id()],1 do
if ReragnoSystem.giocatore[pc.get_channel_id()] == name then
ReragnoSystem.giocatore[pc.get_channel_id()] = ""
return
end
end
end
when 2093.kill with pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
notice_all("Il Re Ragno e' stato ucciso!")
timer("uscita".. pc.get_channel_id(),20)
server_timer("logOutSistema"..pc.get_channel_id(),30)
end
when logOutSistema1.server_timer begin
clear_server_timer("ForzaReload1")
ReragnoSystem.reload(1)
end
when logOutSistema2.server_timer begin
clear_server_timer("ForzaReload2")
ReragnoSystem.reload(2)
end
when uscita1.timer with pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
if ReragnoSystem.callRicarica[pc.get_channel_id()] == 1 then
return
end
ReragnoSystem.logOutSistema[pc.get_channel_id()] = 1
ReragnoSystem.callRicarica[pc.get_channel_id()] = 1
clear_server_timer("ForzaReload1")
ReragnoSystem.exitDungeon(1)
end
when uscita2.timer with pc.get_map_index() == 73 and pc.get_local_x()<= 250 and pc.get_local_y() <= 220 begin --cambiare coordinate
if ReragnoSystem.callRicarica[pc.get_channel_id()] == 1 then
return
end
ReragnoSystem.logOutSistema[pc.get_channel_id()] = 1
ReragnoSystem.callRicarica[pc.get_channel_id()] = 1
clear_server_timer("ForzaReload2")
ReragnoSystem.exitDungeon(2)
end
end
end][/CODE]
Con questa quest l'NPC porta nella stanza un giocatore pe volta consegnandogli l'item e scrivendo la password corretta. Se volessi fare che si puo entrare nella stanza solo se si è in gruppo, solo il capogruppo puo parlare con l'NPC e solo al Capogruppo toglie l'item necessario e porta TUTTO il suo gruppo nella Stanza, e una volta che il gruppo è entrato nessuno puo piu entrarci è complicato? si devono cambiare parecchie cose nella quest e nelle function?
