LegendDragon
Utente Emerald
Ultima modifica:
CSS:
quest system_corruzione begin
state start begin
-- LOGIN
when login begin
local corruption = pc.getqf("corruption_points")
if corruption < 0 then
pc.setqf("corruption_points", 0)
end
if corruption > 500 then
pc.setqf("corruption_points", 500)
end
-- Timer controllo anti-frode (ogni 10 minuti)
timer("check_items_fraud", 600)
end
-- CONTROLLO ANTI-FRODE
when check_items_fraud.timer begin
local is_corrupted = pc.getqf("is_corrupted")
local corruption = pc.getqf("corruption_points")
-- Se NON è corrotto, rimuovi TUTTO
if is_corrupted == 0 then
if pc.count_item(41202) > 0 then
pc.remove_item(41202, pc.count_item(41202))
syschat("COSTUME RIMOSSO: non sei più corrotto!")
end
if pc.count_item(41203) > 0 then
pc.remove_item(41203, pc.count_item(41203))
syschat("ELMO RIMOSSO: non sei più corrotto!")
end
else
-- Se è corrotto, controlla requisiti
if pc.count_item(41202) > 0 and corruption < 400 then
pc.remove_item(41202, pc.count_item(41202))
syschat("COSTUME RIMOSSO: corruzione sotto 400!")
end
if pc.count_item(41203) > 0 and corruption < 100 then
pc.remove_item(41203, pc.count_item(41203))
syschat("ELMO RIMOSSO: corruzione sotto 100!")
end
end
-- Ricontrolla tra 10 minuti
timer("check_items_fraud", 600)
end
-- ABBRACCIARE L'OSCURITÀ
when 9700.chat."Abbraccia il Potere Oscuro" begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 1 then
local corruption = pc.getqf("corruption_points")
say_title("Maestro Oscuro:")
say("Hai già abbracciato l'oscurità.")
say("Corruzione: " .. corruption .. "/500")
return
end
say_title("Maestro Oscuro:")
say("Vuoi abbracciare il Potere Oscuro?")
say("")
say_reward("Otterrai:")
say("- Titoli esclusivi")
say("- Possibilità di comprare Costume ed Elmo")
say("")
local s = select("Sì, abbraccia", "No")
if s == 1 then
pc.setqf("is_corrupted", 1)
pc.setqf("corruption_points", 15)
pc.setqf("last_level", 0)
say_title("Maestro Oscuro:")
say("Benvenuto nell'oscurità!")
notice_all(pc.get_name() .. " ha abbracciato il Potere Oscuro!")
end
end
-- UCCIDERE GIOCATORI
when kill with npc.is_pc() begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 1 then
local corruption = pc.getqf("corruption_points")
if corruption < 500 then
corruption = corruption + 10
pc.setqf("corruption_points", corruption)
syschat("POTERE OSCURO +10! [" .. corruption .. "/500]")
corruption_system.check_level()
end
end
end
-- UCCIDERE NPC INNOCENTI
when 101.kill begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 1 then
local corruption = pc.getqf("corruption_points")
if corruption < 500 then
corruption = corruption + 5
pc.setqf("corruption_points", corruption)
syschat("Innocente ucciso! +5 [" .. corruption .. "/500]")
corruption_system.check_level()
end
end
end
-- SACRIFICARE OGGETTI
when 9700.chat."Sacrifica oggetti per potere" begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 0 then
say_title("Altare Oscuro:")
say("Solo i corrotti possono usare questo altare.")
return
end
local corruption = pc.getqf("corruption_points")
if corruption >= 500 then
say_title("Altare Oscuro:")
say("Hai raggiunto il massimo potere!")
return
end
say_title("Altare Oscuro:")
say("Corruzione: " .. corruption .. "/500")
say("")
local s = select("10 Pietre Anima (+5)", "1 Pietra Drago (+10)", "100M Yang (+15)", "Chiudi")
if s == 1 then
if pc.count_item(30301) >= 10 then
pc.remove_item(30301, 10)
corruption = math.min(corruption + 5, 500)
pc.setqf("corruption_points", corruption)
syschat("Sacrificio accettato! +5")
corruption_system.check_level()
else
say("Non hai abbastanza Pietre Anima!")
end
elseif s == 2 then
if pc.count_item(30000) >= 1 then
pc.remove_item(30000, 1)
corruption = math.min(corruption + 10, 500)
pc.setqf("corruption_points", corruption)
syschat("Sacrificio potente! +10")
corruption_system.check_level()
else
say("Non hai la Pietra Drago!")
end
elseif s == 3 then
if pc.get_gold() >= 100000000 then
pc.change_gold(-100000000)
corruption = math.min(corruption + 15, 500)
pc.setqf("corruption_points", corruption)
syschat("Sacrificio massiccio! +15")
corruption_system.check_level()
else
say("Non hai abbastanza Yang!")
end
end
end
-- CONTROLLA STATO
when 33009.chat."Controlla Potere Oscuro" begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 0 then
say_title("Stato:")
say_reward("NON SEI CORROTTO")
say("")
say("Parla con il Maestro Oscuro!")
return
end
local corruption = pc.getqf("corruption_points")
say_title("Potere Oscuro:")
say("Corruzione: " .. corruption .. "/500")
say("")
if corruption >= 500 then
say_reward("LIVELLO 5 - SIGNORE SUPREMO MAX")
elseif corruption >= 400 then
say_reward("LIVELLO 4 - SIGNORE SUPREMO")
elseif corruption >= 350 then
say_reward("LIVELLO 3 - SIGNORE DEMONE")
elseif corruption >= 31 then
say_reward("LIVELLO 2 - GUERRIERO OSCURO")
else
say_reward("LIVELLO 1 - INIZIATO OSCURO")
end
end
-- NEGOZIO OSCURO
when 33009.chat."Negozio Potere Oscuro" begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 0 then
say_title("Mercante Oscuro:")
say("Solo i corrotti possono comprare!")
return
end
local corruption = pc.getqf("corruption_points")
say_title("Negozio Oscuro:")
say("Corruzione: " .. corruption .. "/500")
say("")
say_item("Costume Supremo - 400 Corruzione", 41202, 0)
say_item("Elmo Supremo - 100 Corruzione", 41203, 0)
say("")
local s = select("Costume (400)", "Elmo (100)", "Chiudi")
if s == 1 then
if corruption >= 400 then
if pc.count_item(41202) > 0 then
say("Hai già il Costume Supremo!")
else
pc.give_item2(41202, 1)
say_title("Mercante:")
say("Ecco il tuo COSTUME SUPREMO!")
notice_all(pc.get_name() .. " ha acquistato il COSTUME SUPREMO!")
end
else
say("Serve 400 corruzione!")
say("Ne hai: " .. corruption)
end
elseif s == 2 then
if corruption >= 100 then
if pc.count_item(41203) > 0 then
say("Hai già l'Elmo Supremo!")
else
pc.give_item2(41203, 1)
say_title("Mercante:")
say("Ecco il tuo ELMO SUPREMO!")
notice_all(pc.get_name() .. " ha acquistato l'ELMO SUPREMO!")
end
else
say("Serve 100 corruzione!")
say("Ne hai: " .. corruption)
end
end
end
-- ABBANDONA OSCURITÀ
when 9700.chat."Abbandona Potere Oscuro (5M Yang)" begin
local is_corrupted = pc.getqf("is_corrupted")
if is_corrupted == 0 then
say_title("Sacerdote:")
say("Sei già puro.")
return
end
local corruption = pc.getqf("corruption_points")
say_title("Sacerdote:")
say("Vuoi abbandonare l'oscurità?")
say("")
say("Costa: 5.000.000 Yang")
say("Perdi tutto (corruzione, titoli, oggetti)")
say("")
local s = select("Sì", "No")
if s == 1 then
if pc.get_gold() >= 5000000 then
-- PRIMA rimuovi gli oggetti
local removed_items = false
if pc.count_item(41202) > 0 then
pc.remove_item(41202, pc.count_item(41202))
removed_items = true
syschat("Costume Supremo rimosso!")
end
if pc.count_item(41203) > 0 then
pc.remove_item(41203, pc.count_item(41203))
removed_items = true
syschat("Elmo Supremo rimosso!")
end
-- POI resetta tutto
pc.change_gold(-5000000)
pc.setqf("is_corrupted", 0)
pc.setqf("corruption_points", 0)
pc.setqf("last_level", 0)
pc.remove_title()
say_title("Sacerdote:")
say("Sei purificato!")
if removed_items then
say("")
say("Costume ed Elmo sono stati rimossi!")
end
notice_all(pc.get_name() .. " ha abbandonato il Potere Oscuro!")
else
say("Non hai abbastanza Yang!")
end
end
end
-- FUNZIONE CONTROLLA LIVELLO
function check_level()
local corruption = pc.getqf("corruption_points")
local last_level = pc.getqf("last_level")
local new_level = 0
-- Calcola livello attuale
if corruption >= 500 then
new_level = 5
elseif corruption >= 400 then
new_level = 4
elseif corruption >= 350 then
new_level = 3
elseif corruption >= 31 then
new_level = 2
elseif corruption >= 1 then
new_level = 1
end
-- Se è cambiato livello
if new_level > last_level then
pc.setqf("last_level", new_level)
-- LIVELLO 2
if new_level == 2 then
pc.set_title("[CORROTTO]")
syschat("Sei diventato GUERRIERO OSCURO!")
notice_all(pc.get_name() .. " e' diventato GUERRIERO OSCURO! (Livello 2)")
-- LIVELLO 3
elseif new_level == 3 then
pc.set_title("[DEMONE]")
syschat("Sei diventato SIGNORE DEMONE!")
notice_all(pc.get_name() .. " e' diventato SIGNORE DEMONE! (Livello 3)")
-- LIVELLO 4
elseif new_level == 4 then
pc.set_title("[SUPREMO]")
syschat("Sei diventato SIGNORE SUPREMO!")
notice_all(pc.get_name() .. " e' diventato SIGNORE SUPREMO! (Livello 4)")
-- LIVELLO 5
elseif new_level == 5 then
pc.set_title("[SUPREMO]")
syschat("HAI RAGGIUNTO IL POTERE MASSIMO!")
notice_all("████ " .. pc.get_name() .. " HA RAGGIUNTO IL MASSIMO POTERE! (Livello 5) ████")
end
end
end
end
end
CIAO RAGAZZI, ho un problema con questa quest, funziona tutto l'unica cosa che quando torno puro al posto di eliminarmi i costumi dall'inventario mi elimina solo quello dell'inventario invece se l'ho indosso non lo elimina, come posso risolvere?