[string "ScriptToString"]:1: <eof> expected near `▒e'
[string "ScriptToString"]:1: unfinished string near `"Lupt▒ in Aren▒"▒'
Cod: Selectaţi tot
quest arena_manager begin
state start begin
when 20017.chat."Luptã in Arenã" begin
if game.get_event_flag("arena_close") > 0 then
say_title("Yu-Hwan:")
say("arenãurile de luptã au fost distruse")
say("într-un mare rãzboi.")
return
end
if not npc.lock() then
say_title("Yu-Hwan:")
say("Altcineva se luptã deja.")
return
end
local useMinLevel = 25
if pc.get_level() < useMinLevel then
say_title("Yu-Hwan:")
say("Nivelul minim este "..useMinLevel.." nu puteþi sã luptaþi în arenã")
say("Îmi pare rãu, revino mai târziu.")
npc.unlock()
return
else
say_title("Yu-Hwan:")
say("Spune-mi numele persoanei cu care")
say("vrei sã te duelezi.")
local sname = input()
if sname == "" then
say_title("Yu-Hwan:")
say("Nu ºtii cu cine vrei sã te lupþi")
say(", serios?")
npc.unlock()
return
else
say_title("Yu-Hwan:")
say(""..pc.name.." vrea sã se lupte cu "..sname.." ")
wait("")
local opp_vid = find_pc_by_name(sname)
if opp_vid == 0 then
say_title("Yu-Hwan:")
say(sname.." nu este online.")
npc.unlock()
return
elseif opp_vid == pc.get_vid() then
say_title("Yu-Hwan:")
say("Tu nu vrei cu adevarat sã")
say("te baþi cu altii?")
npc.unlock()
return
end
local old = pc.select(opp_vid)
local opp_level = pc.get_level()
pc.select(old)
if opp_level < useMinLevel then
say_title("Yu-Hwan")
say("Adversarul tãu încã nu are nivelul 25!")
npc.unlock()
return
end
if not npc.is_near_vid(opp_vid, 10) then
say_title("Yu-Hwan")
say(""..sname.." nu este în apropierea ta.")
npc.unlock()
return
end
local a = arena.is_in_arena(opp_vid)
if a == 0 then
say_title("Yu-Hwan:")
say(""..sname.." deja luptã cu cineva.")
npc.unlock()
return
end
say_title("Decizia Finala")
say(""..pc.name.." îl aºteaptã pe "..sname.."")
say("sa accepte duelul.")
local agree = confirm(opp_vid, "Vrei sã lupþi împotriva lui "..pc.name.." ?", 30)
if agree!= CONFIRM_OK then
say_title("Yu-Hwan:")
say(""..sname.." a refuzat sã lupte.")
npc.unlock()
return
end
s = arena.start_duel(sname, 3)
if s == 0 then
say_title("Yu-Hwan:")
say("A intervenit o problemã neaºteptatp.")
say("Încercaþi din nou mai târziu!")
elseif s == 2 then
say_title("Yu-Hwan:")
say("Se luptã cu altcineva.")
elseif s == 3 then
say_title("Yu-Hwan:")
say("Arena de antrenament este plinã în acest moment.")
say("Vã rugãm sã încerci mai târziu.")
end
end
end
end
when 20017.chat."Urmãriþi un duel" begin
local g = arena.get_duel_list()
local arena_name = {}
local arena_observer = {}
table.foreachi(g,
function(n, p)
arena_name[n] = p[1].." împotriva "..p[2]
arena_observer[n] = { p[3], p[4], p[5] }
end
)
table.insert(arena_name, "Închide")
table.insert(arena_observer, 0)
local count = table.getn(g)
if count == 0 then
say_title("Yu-Hwan:")
say("În momentul de faþã nimeni nu luptã.")
return
else
say_title("Yu-Hwan:")
say("Acum se luptã "..count.." .")
wait()
end
if table.getn(g)!= 0 then
local s = select_table(arena_name)
if table.getn(arena_observer) == s then
return
end
if table.getn(arena_observer) >= s then
arena.add_observer(arena_observer[s][1], arena_observer[s][2], arena_observer[s][3])
end
end
end
end
end






