quest endkingdomswar begin
state start begin
when login or enter begin
if pc.get_map_index() == 356 then
if game.get_event_flag("warkingdomsstart") == 0 then
warp_to_village()
else
-- لو الحدث شغال خلي اللاعبين يشيكوا على نفسه كل 10 ثواني
timer("check_event_status", 10)
pc.setqf("warned_warp", 0) -- نعطيه فلاغ ان ما تمش التحذير له
end
end
end
when check_event_status.timer begin
if game.get_event_flag("warkingdomsstart") == 0 and pc.get_map_index() == 356 then
if pc.getqf("warned_warp") == 0 then
notice_all(" انتهى حدث معركة الامبراطوريات الثلاثة ")
notice_all(" سيتم نقل جميع الاعبين إلى القرى المخصصة لهم خلال 5 ثواني ")
pc.setqf("warned_warp", 1) -- وضع علامة إنه تم التحذير
timer("warp_out", 5)
end
-- ما تعيدش إعادة تحذير أو إعادة تفعيل التايمر مرة تانية
else
-- لو الحدث لسه شغال كرر الفحص
timer("check_event_status", 10)
end
end
when warp_out.timer begin
warp_to_village()
end
when 11001.chat." إنهاء الحدث " with pc.is_gm() begin
game.set_event_flag("warkingdomsstart", 0)
say("")
say(" تم انتهاء الحدث، سيتم نقل اللاعبين للمدن الآن ")
say("")
end
end
end