quest reset_scroll begin
state start begin
----------**********
----------********** Cambia regno
----------**********
when 71054.use begin
-- Inserire costo e livello minimo
local yang = 1000000
local liv = 50
say_title("Cambiare Regno")
if pc.is_engaged() then
say("Non puoi cambiare regno se devi sposarti.[ENTER]")
return
end
if pc.is_married() then
say("Non puoi cambiare regno se sei sposato.[ENTER]")
return
end
if pc.is_polymorphed() then
say("Non puoi cambiare regno mentre sei trasformato.[ENTER]")
return
end
if pc.has_guild() then
say("Non puoi cambiare regno se sei in una gilda.[ENTER]")
return
end
say("Continuando potrai cambiare il tuo regno.")
say("Sei sicuro di voler procedere?[ENTER]")
say_reward("Costo: "..yang.." Yang")
say_reward("Livello minimo: "..liv.." [ENTER]")
local b = select("Si", "No")
if b == 2 then
return
end
say_title("Cambiare Regno")
if pc.get_gold() < yang then
say("Non hai abbastanza Yang.[ENTER]")
return
end
if pc.get_level() < liv then
say("Il tuo livello e' troppo basso.[ENTER]")
return
end
say("Seleziona il tuo nuovo regno:[ENTER]")
local emp = select("Shinsoo", "Chunjo", "Jinno", "Annulla")
if emp == 4 then
return
end
local ret = pc.change_empire(emp)
if ret == 999 then
pc.change_gold(-yang)
pc.remove_item(item.get_vnum(), 1)
say_title("Cambiare Regno")
say("Operazione completata.[ENTER]")
elseif ret == 1 then
say_title("Cambiare Regno")
say("Non puoi selezionare il tuo stesso regno.[ENTER]")
elseif ret == 2 then
say_title("Cambiare Regno")
say("Non e' possibile cambiare regno perche' tu o altri")
say("personaggi nel tuo account sono gildati.[ENTER]")
elseif ret == 3 then
say_title("Cambiare Regno")
say("Non e' possibile cambiare regno perche' eri sposato")
say("meno di 24 ore fa.[ENTER]")
end
end
end