Cod: Selectaţi tot
quest zodiac_run begin
state start begin
function settings()
return
{
["map_index"] = 213,
["ticket_vnum"] = 27991,
["entry_pos"] = {3325, 14309},
["second_floor"] = {3840, 14373},
["third_floor"] = {3328, 14882},
["forth_floor"] = {4360, 14365},
["first_boss"] = 6443,
["second_boss"] = 6447,
["third_boss"] = 6449,
["forth_boss"] = 6452,
["boss_pos_1"] = {253, 229},
["boss_pos_2"] = {767, 292},
["boss_pos_3"] = {255, 806},
["boss_pos_4"] = {1287, 283},
["minimum_level"] = 95,
["maximum"] = 120,
["regen"] = get_locale_base_path().."/quest/dungeon/zodiac_run/regen_1thfloor.txt",
["regen_2"] = get_locale_base_path().."/quest/dungeon/zodiac_run/regen_2thfloor.txt",
["regen_3"] = get_locale_base_path().."/quest/dungeon/zodiac_run/regen_3thfloor.txt",
["regen_4"] = get_locale_base_path().."/quest/dungeon/zodiac_run/regen_4thfloor.txt",
}
end
function enter_dungeon()
zodiac_run.clear_dungeon_timer()
d.new_jump_party(zodiac_run_setting["map_index"], 3325, 14309)
d.set_regen_file(get_locale_base_path().."/quest/dungeon/zodiac_run/regen_1thfloor.txt")
d.setf("stage", 1)
zodiac_run.set_dungeon_timer()
zodiac_run.notice_enter_dungeon()
end
function clear_dungeon_timer()
clear_server_timer("exit_almost_done_demon", get_server_timer_arg())
clear_server_timer("exit_done_demon", get_server_timer_arg())
end
function set_dungeon_timer()
server_timer("exit_almost_done_demon", 120 * 60, d.get_map_index())
d.setf("group_timer", get_global_time(), 120 * 60)
end
function notice_enter_dungeon()
notice_all("Liderul "..pc.get_name().." si grupul sau au intrat in Templul Zodiac!")
end
function clear_dungeon()
d.notice("In cateva secunde veti fi teleportati.")
d.clear_regen()
d.kill_all()
cleartimer("upp_level")
timer("upp_level", 10)
end
function purge_dungeon()
d.clear_regen()
d.kill_all()
end
function check_dungeon()
say_title(mob_name(20425))
local settings = zodiac_run.settings()
if not party.is_party() then
say("Daca doresti sa intri in Templul Zodiac,")
say("trebuie sa faci parte dintr-un grup.")
return
end
if not party.is_leader() then
say("Te rog lasa-ma sa vorbesc cu")
say("liderul grupului tau intai.")
return
end
if party.get_near_count() < 2 then
say("Daca doresti sa intri in Templul Zodiac,")
say("grupul trebuie sa aiba cel putin 2 jucatori.")
return
end
local levelCheck = true
local ticketCheck = true
local notEnoughLevelMembers = {}
local notEnoughLevelMaxMembers = {}
local notEnoughTicketMembers = {}
local pids = {party.get_member_pids()}
for i, pid in next, pids, nil do
q.begin_other_pc_block(pid)
if pc.get_level() < settings.minimum_level then
table.insert(notEnoughLevelMembers, pc.get_name())
levelCheck = false
end
q.end_other_pc_block()
end
if not levelCheck then
say("Daca doresti sa intri in Templul Zodiac,")
say("fiecare membru al grupului trebuie sa aiba")
say("cel putin nivelul 95 pentru a intra.")
say("")
say("Urmatorii membri, nu au suficient nivel:")
for i, n in next, notEnoughLevelMembers, nil do
say("- "..n)
end
return
end
for i, pid in next, pids, nil do
q.begin_other_pc_block(pid)
if pc.get_level() > settings.maximum then
table.insert(notEnoughLevelMaxMembers, pc.get_name())
levelCheck = false
end
q.end_other_pc_block()
end
if not levelCheck then
say("Daca doresti sa intri in Templul Zodiac,")
say("fiecare membru al grupului trebuie sa aiba")
say("nivelul maxim 120 pentru a intra.")
say("")
say("Urmatorii membri, au nivel prea mare:")
for i, n in next, notEnoughLevelMaxMembers, nil do
say("- "..n)
end
return
end
for i, pid in next, pids, nil do
q.begin_other_pc_block(pid)
if pc.count_item(settings.ticket_vnum) < 1 then
table.insert(notEnoughTicketMembers, pc.get_name())
ticketCheck = false
end
q.end_other_pc_block()
end
if not ticketCheck then
say("Daca doresti sa intri in Templul Zodiac,")
say(string.format("fiecare membru al grupei trebuie sa aiba: %s.", item_name(settings.ticket_vnum)))
say("")
say("Urmatorii membri, nu au permisul:")
for i, n in next, notEnoughTicketMembers, nil do
say("- "..n)
end
return
end
for i, pid in next, pids, nil do
q.begin_other_pc_block(pid)
pc.remove_item(settings.ticket_vnum, 1)
q.end_other_pc_block()
end
say("Dupa ce apesi pe continua,")
say("fiecare membru al grupei va fi teleportat!")
wait()
zodiac_run.enter_dungeon()
end
-- FIRST STAGE --
when kill with pc.get_map_index() >= (zodiac_run_setting["map_index"] * 10000) and pc.get_map_index() < (zodiac_run_setting["map_index"] * 10000 + 10000) and d.getf("stage") == 1 begin
local count_kill_for_key, count = 60, d.getf("count") + 1
if d.getf("stage_key_done") == 0 then
d.setf("count", count)
end
if count == count_kill_for_key then
zodiac_run.purge_dungeon()
d.spawn_mob(zodiac_run.settings().first_boss, zodiac_run.settings().boss_pos_1[1], zodiac_run.settings().boss_pos_1[2])
d.setf("count", 0)
d.setf("stage_key_done", 1)
end
end
when 6443.kill with d.getf("stage") == 1 begin
d.notice("Ai infrant primul sef!")
zodiac_run.clear_dungeon()
end
-- SECOND STAGE --
when kill with pc.get_map_index() >= (zodiac_run_setting["map_index"] * 10000) and pc.get_map_index() < (zodiac_run_setting["map_index"] * 10000 + 10000) and d.getf("stage") == 2 begin
local count_kill_for_key2, count2 = 80, d.getf("count2") + 1
if d.getf("stage_key_done2") == 0 then
d.setf("count2", count2)
end
if count2 == count_kill_for_key2 then
zodiac_run.purge_dungeon()
d.notice("Infrange al 2-lea sef.")
d.spawn_mob(zodiac_run.settings().second_boss, zodiac_run.settings().boss_pos_2[1], zodiac_run.settings().boss_pos_2[2])
d.setf("count2", 0)
d.setf("stage_key_done2", 1)
end
end
when 6447.kill with d.getf("stage") == 2 begin
d.notice("Ai infrant al 2-lea sef!")
zodiac_run.clear_dungeon()
end
-- THIRD STAGE --
when kill with pc.get_map_index() >= (zodiac_run_setting["map_index"] * 10000) and pc.get_map_index() < (zodiac_run_setting["map_index"] * 10000 + 10000) and d.getf("stage") == 3 begin
local count_kill_for_key3, count3 = 90, d.getf("count3") + 1
if d.getf("stage_key_done3") == 0 then
d.setf("count3", count3)
end
if count3 == count_kill_for_key3 then
zodiac_run.purge_dungeon()
d.spawn_mob(zodiac_run.settings().third_boss, zodiac_run.settings().boss_pos_3[1], zodiac_run.settings().boss_pos_3[2])
d.notice("Infrange al 3-lea sef.")
d.setf("count3", 0)
d.setf("stage_key_done3", 1)
end
end
when 6449.kill with d.getf("stage") == 3 begin
d.notice("Ai infrant al 3-lea sef!")
zodiac_run.clear_dungeon()
end
-- FORTH STAGE --
when kill with pc.get_map_index() >= (zodiac_run_setting["map_index"] * 10000) and pc.get_map_index() < (zodiac_run_setting["map_index"] * 10000 + 10000) and d.getf("stage") == 4 begin
local count_kill_for_key4, count4 = 100, d.getf("count4") + 1
if d.getf("stage_key_done4") == 0 then
d.setf("count4", count4)
end
if count4 == count_kill_for_key4 then
zodiac_run.purge_dungeon()
d.notice("Infrange ultimul sef al temnitei.")
d.spawn_mob(zodiac_run.settings().forth_boss, zodiac_run.settings().boss_pos_4[1], zodiac_run.settings().boss_pos_4[2])
d.setf("count4", 0)
d.setf("stage_key_done4", 1)
end
end
when 6452.kill with d.getf("stage") == 4 begin
cleartimer("zodiac_run_exit_3", get_server_timer_arg())
cleartimer("zodiac_run_exit", get_server_timer_arg())
timer("zodiac_run_exit", 60)
d.clear_regen()
d.kill_all()
d.notice("In 60 de secunde vei fi teleportat.")
notice_all("Templul Zodiac a fost completata de grupul lui "..pc.get_name())
end
when logout with pc.in_dungeon() begin
if pc.count_item(50156) >= 1 then
pc.remove_item(50156, pc.count_item(50156))
end
end
when login with pc.get_map_index() >= (zodiac_run_setting["map_index"] * 10000) and pc.get_map_index() < (zodiac_run_setting["map_index"] * 10000 + 10000) begin
if d.getf("stage") == 1 then
notice_multiline("Prima armata a zeilor zodiac se arata!", d.notice)
notice_multiline("Omoara 60 de monstrii.", d.notice)
end
end
-- TEST ZONE --
when 71173.use begin
local count_key_1 = d.getf("count")
local count_key_2 = d.getf("count2")
local count_key_3 = d.getf("count3")
local count_key_4 = d.getf("count4")
local stage = d.getf("stage")
syschat("First stage count "..count_key_1)
syschat("Second stage count "..count_key_2)
syschat("Third stage count "..count_key_3)
syschat("Forth stage count "..count_key_4)
syschat("Stage counter "..stage)
end
-- Start Timers --
when exit_almost_done_demon.server_timer begin
if d.select(get_server_timer_arg()) then
d.set_warp_location(201, 30085, 30918)
d.notice("Temnita nu a fost completata!")
d.notice("Timpul s-a scurs!")
server_timer("exit_done_demon", 3, get_server_timer_arg())
end
end
when exit_done_demon.server_timer begin
if d.select(get_server_timer_arg()) then
d.set_warp_location(201, 30085, 30918)
end
end
when zodiac_run_exit.timer begin
local index = pc.get_map_index()
if index >= (zodiac_run_setting["map_index"] * 10000) and index < (zodiac_run_setting["map_index"] * 10000 + 10000) then
d.notice("Timpul s-a scurs.")
d.set_warp_location(201, 30085, 30918)
end
end
when zodiac_run_exit_3.timer begin
local index = pc.get_map_index()
if index >= (zodiac_run_setting["map_index"] * 10000) and index < (zodiac_run_setting["map_index"] * 10000 + 10000) then
d.set_warp_location(201, 30085, 30918)
end
end
when upp_level.timer begin
local stage, settings = d.getf("stage"), zodiac_run.settings()
if stage == 1 then
d.setf("stage", 2)
d.set_regen_file(settings.regen_2)
d.jump_all(settings.second_floor[1] ,settings.second_floor[2])
notice_multiline("Omoara monstrii pana ce vei obtine Cheia Amuleta!", d.notice)
notice_multiline("Numar de monstrii ramasi: 80", d.notice)
end
if stage == 2 then
d.set_regen_file(settings.regen_3)
d.setf("stage", 3)
d.jump_all(settings.third_floor[1] ,settings.third_floor[2])
notice_multiline("Omoara monstrii pana ce vei obtine Cheia Amuleta!", d.notice)
notice_multiline("Numar de monstrii ramasi: 90", d.notice)
end
if stage == 3 then
d.set_regen_file(settings.regen_4)
d.setf("stage", 4)
d.jump_all(settings.forth_floor[1] ,settings.forth_floor[2])
notice_multiline("Omoara monstrii pana ce vei obtine Cheia Amuleta!", d.notice)
notice_multiline("Numar de monstrii ramasi: 100", d.notice)
end
end
-- END TIMERS --
when 20425.chat."Templul Zodiac" begin
say_title(mob_name(20425))
say("")
say("Informatii:")
say("")
say_reward("- Nivel minim necesar: 105")
say_reward("- Nivel maxim necesar: 120")
say_reward("- Bilet necesar: Permis Piatra (Templul Zodiac)")
wait()
say_title(mob_name(20425))
say("")
say("Doresti sa intri in Templul Zodiac?")
say("O noua lume te asteapta,")
say("nu uita, am auzit ca doar,")
say("cei mai mari razboinici pot face fata!")
say("")
if (select ("Da", "Nu") == 1) then
zodiac_run.check_dungeon()
end
end
end
end