Code:
function for_event_by_liveteam()
play_time_event()
end
function play_time_event()
set_env( "game.use_time_based_event_script",1 )
set_env( "game.term_for_time_based_event_script",2 )
local state_code = get_local_info()
if state_code == 1 then -- 한국
-- local current_time = get_os_date( "%Y-%m-%d %H:%M:%S" )
-- local event_begin_time = '2013-07-11 10:00:00'
-- local event_end_time = '2013-08-08 10:00:00'
-- if event_begin_time <= current_time and
-- current_time <= event_end_time then
-- set_env( "game.use_time_based_event_script", 1 )
-- set_env( "game.term_for_time_based_event_script", 120 )
-- end
--2013년 한국 추석 플레이 타임 이벤트 주차별 세부 조건 체크 없음 시작, 종료 파일 업데이트 형식으로 진행
set_env( "game.use_time_based_event_script",1 )
set_env( "game.term_for_time_based_event_script",120 )
elseif state_code == 4 --미국
or state_code == 8192 -- 중동
or state_code == 8 --독일
or state_code == 128 -- 프랑스
or state_code ==16384 -- 터키
or state_code ==32768 -- 폴란드
or state_code ==65536 -- 이탈리아
or state_code == 256 -- 러시아
or state_code == 512 -- 동남아
then
set_env( "game.use_time_based_event_script",1 )
set_env( "game.term_for_time_based_event_script",120 )
elseif state_code == 16 then -- 일본
set_env( "game.use_time_based_event_script",1 )
set_env( "game.term_for_time_based_event_script",120 )
end
end
function on_time_based_event_reward()
local state_code = get_local_info() -- 국가코드
local pcbang_grade = get_value("pcbang_user") -- 프리미엄PC방 판단변수
local t_flag = get_flag( "reward_time_event" ) -- 캐릭터 별 플래그 값
local account_t_flag = get_account_flag( "reward_time_event" ) -- 계정 별 플래그 값
local current_time = get_os_date( "%Y-%m-%d %H:%M:%S" )
local flag_current_time = get_os_date( "%Y-%m-%d" )
local event_current_week = 0
local lv = get_value( "level" )
private_notice("2 Minute Trigger - Buffs refreshed")
cast_world_state(2506,31,0)
cast_world_cstate(2506,31,0)
-- 2014 한국 PC방 이벤트 기간이고 한국이면
if '2014-04-24' <= current_time and current_time < '2014-05-22' and state_code == 1 then
if pcbang_grade == 2 then --한국 피씨방 이벤트
insert_item(2012866,1)
private_notice("@90605876")
return
end
end
if '2014-04-22' <= current_time and current_time < '2014-05-13' and state_code == 16 then --일본
insert_item(2012866,1)
private_notice("@90606226")
return
end
--[[if '2014-05-13' <= current_time and current_time < '2014-06-01' and state_code == 4 or state_code == 8 or state_code == 128 or state_code == 16384 or state_code == 32768 or state_code == 65536 then --미국, 유럽
insert_item(2012866,1)
private_notice("@90606226")
return
end]]
if '2014-05-12' <= current_time and current_time < '2014-06-03' and state_code == 256 then --러시아
insert_item(2012866,1)
private_notice("@90606226")
return
end
-- 0. 보상 조건 체크 (기본적으로 한번 보상을 받았으면 안 준다.)
if t_flag == flag_current_time or account_t_flag == flag_current_time or t_flag == current_time or account_t_flag == current_time then
return
end
-- 1. 이벤트 기간인지 체크: 오늘 날짜가 몇 주차에 해당하는지 구한다. ( event_current_week 값 설정 )
-- 한국
if state_code == 1 then
if '2014-06-26 10:00:00' <= current_time and current_time < '2014-07-03 10:00:00' then
event_current_week = 1
elseif '2014-07-03 10:00:00' <= current_time and current_time < '2014-07-10 10:00:00' then
event_current_week = 2
elseif '2014-07-10 10:00:00' <= current_time and current_time < '2014-07-17 10:00:00' then
event_current_week = 3
elseif '2014-07-17 10:00:00' <= current_time and current_time < '2014-07-24 10:00:00' then
event_current_week = 4
end
end
--중동
if state_code == 8192 then
if '2014-02-24' <= current_time and current_time < '2014-03-03' then
event_current_week = 1
elseif '2014-03-03' <= current_time and current_time < '2014-03-10' then
event_current_week = 2
elseif '2014-03-10' <= current_time and current_time < '2014-03-17' then
event_current_week = 3
elseif '2014-03-17' <= current_time and current_time < '2014-03-24' then
event_current_week = 4
end
end
-- 일본
if state_code == 16 then
if '2014-08-12 11:00:00' <= current_time and current_time < '2014-08-19 11:00:00' then
event_current_week = 1
elseif '2014-08-19 11:00:00' <= current_time and current_time < '2014-08-26 11:00:00' then
event_current_week = 2
elseif '2014-08-26 11:00:00' <= current_time and current_time < '2014-09-02 11:00:00' then
event_current_week = 3
elseif '2014-09-02 11:00:00' <= current_time and current_time < '2014-09-09 11:00:00' then
event_current_week = 4
end
end
-- 미국, 터키, 이탈리아
if state_code == 4 or state_code == 16384 or state_code == 65536 then
if '2014-02-27' <= current_time and current_time < '2014-03-06' then
event_current_week = 1
elseif '2014-03-06' <= current_time and current_time < '2014-03-13' then
event_current_week = 2
elseif '2014-03-13' <= current_time and current_time < '2014-03-20' then
event_current_week = 3
elseif '2014-03-20' <= current_time and current_time < '2014-03-27' then
event_current_week = 4
end
end
-- 독일, 프랑스, 폴란드
if state_code == 8 or state_code == 128 or state_code == 32768 then
if '2014-02-25' <= current_time and current_time < '2014-03-04' then
event_current_week = 1
elseif '2014-03-04' <= current_time and current_time < '2014-03-11' then
event_current_week = 2
elseif '2014-03-11' <= current_time and current_time < '2014-03-18' then
event_current_week = 3
elseif '2014-03-18' <= current_time and current_time < '2014-03-25' then
event_current_week = 4
end
end
-- 러시아
if state_code == 256 then
if '2014-02-10' <= current_time and current_time < '2014-02-15' then
event_current_week = 1
elseif '2014-02-15' <= current_time and current_time < '2014-02-17' then
event_current_week = 2 --1주
elseif '2014-02-17' <= current_time and current_time < '2014-02-22' then
event_current_week = 3
elseif '2014-02-22' <= current_time and current_time < '2014-02-24' then
event_current_week = 4 --2주
elseif '2014-02-24' <= current_time and current_time < '2014-02-27' then
event_current_week = 5
elseif '2014-02-27' <= current_time and current_time < '2014-03-03' then
event_current_week = 6 --3주
elseif '2014-03-03' <= current_time and current_time < '2014-03-10' then
event_current_week = 7 --4주
end
end
-- 동남아
if state_code == 512 then
if '2014-02-14' <= current_time and current_time < '2014-02-19' then
event_current_week = 1 --1주
elseif '2014-02-19' <= current_time and current_time < '2014-02-21' then
event_current_week = 2 --1주
elseif '2014-02-21' <= current_time and current_time < '2014-02-27' then
event_current_week = 3 --2주
elseif '2014-02-27' <= current_time and current_time < '2014-02-28' then
event_current_week = 4 --2주
elseif '2014-02-28' <= current_time and current_time < '2014-03-03' then
event_current_week = 5 --3주
elseif '2014-03-03' <= current_time and current_time < '2014-03-07' then
event_current_week = 6 --3주
elseif '2014-03-07' <= current_time and current_time < '2014-03-14' then
event_current_week = 7 --4주
end
end
-- 2. 날짜 계산이 끝났으니 보상 지급: 보상 조건은 event_current_week가 0보다 클 때 (이벤트 기간이 아니면 0으로 나옴.)
if event_current_week > 0 then
-- 지급
if state_code == 512 then
if event_current_week == 1 then
insert_item ( 2013064, 1 )
elseif event_current_week == 2 then
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
elseif event_current_week == 3 then
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
insert_item ( 2902162, 3 )
insert_item ( 900010, 3 )
-- 1주차 보상.
elseif event_current_week == 4 then
insert_item ( 2013062, 1 )
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
insert_item ( 2902162, 3 )
insert_item ( 900010, 3 )
-- 1주차 보상.
elseif event_current_week == 5 then
insert_item ( 2902162, 3 )
insert_item ( 900010, 3 )
-- 1주차 보상.
elseif event_current_week == 6 then
insert_item ( 2012787, 10 )
insert_item ( 2012788, 10 )
-- 2주차 보상.
elseif event_current_week == 7 then
insert_item ( 2013058, 1 )
insert_item ( 2013058, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
-- 3주차 보상.
elseif event_current_week == 8 then
insert_item ( 601100308, 2 )
-- 4주차 보상.
end
-- 보상 지급이 끝났으니 아이템창 확인해보라는 공지메시지 출력.
private_notice( sconv( "@90605850" , "#@player_name@#", get_value("name") ) )
-- 한국, 일본
elseif state_code == 1 or state_code == 16 then
if event_current_week == 1 then
insert_item ( 2012787, 10 )
insert_item ( 2012788, 10 )
insert_item ( 601100285, 2 )
insert_item ( 2012834, 2 )
insert_item ( 2902163, 3 )
insert_item ( 2012825, 3 )
-- 1주차 보상.
elseif event_current_week == 2 then
insert_item ( 801321, 1 )
insert_item ( 801322, 1 )
insert_item ( 801323, 1 )
insert_item ( 801324, 1 )
insert_item ( 2011150, 4 )
insert_item ( 2902164, 3 )
insert_item ( 3800282, 3 )
insert_item ( 930037, 1 )
insert_item ( 950081, 5 )
-- 2주차 보상.
elseif event_current_week == 3 then
insert_item ( 601100308, 3 )
insert_item ( 710004, 3 )
insert_item ( 2013058, 1 )
insert_item ( 2013058, 1 )
insert_item ( 2013058, 1 )
-- 3주차 보상.
elseif event_current_week == 4 then
insert_item ( 540200, 3 )
insert_item ( 540201, 3 )
insert_item ( 540202, 3 )
insert_item ( 2012223, 1 )
insert_item ( 2013426, 5 )
-- 4주차 보상.
end
-- 보상 지급이 끝났으니 아이템창 확인해보라는 공지메시지 출력.
private_notice( sconv( "@90605850" , "#@player_name@#", get_value("name") ) )
-- 러시아, 보상 지급
elseif state_code == 256 then
if event_current_week == 1 then
insert_item ( 2013064, 1 )
insert_item ( 2902162, 3 )
insert_item ( 900010, 3 )
-- 1주차 보상.
elseif event_current_week == 2 then
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
insert_item ( 2902162, 3 )
insert_item ( 900010, 3 )
-- 1주차 보상.
elseif event_current_week == 3 then
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
insert_item ( 2012787, 10 )
insert_item ( 2012788, 10 )
-- 2주차 보상.
elseif event_current_week == 4 then
insert_item ( 2013062, 1 )
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
insert_item ( 2012787, 10 )
insert_item ( 2012788, 10 )
-- 2주차 보상.
elseif event_current_week == 5 then
insert_item ( 2013062, 1 )
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
insert_item ( 2013058, 1 )
insert_item ( 2013058, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
-- 3주차 보상.
elseif event_current_week == 6 then
insert_item ( 2013058, 1 )
insert_item ( 2013058, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
insert_item ( 930077, 1 )
-- 3주차 보상.
elseif event_current_week == 7 then
insert_item ( 601100308, 2 )
-- 4주차 보상.
end
-- 보상 지급이 끝났으니 아이템창 확인해보라는 공지메시지 출력.
private_notice( sconv( "@90605850" , "#@player_name@#", get_value("name") ) )
else
if event_current_week == 1 then
insert_item ( 2013064, 1 )
-- 1주차 보상.
elseif event_current_week == 2 then
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
-- 2주차 보상.
elseif event_current_week == 3 then
insert_item ( 2013062, 1 )
insert_item ( 2013063, 1 )
insert_item ( 2013064, 1 )
-- 3주차 보상.
end
-- 보상 지급이 끝났으니 아이템창 확인해보라는 공지메시지 출력.
private_notice( sconv( "@90605850" , "#@player_name@#", get_value("name") ) )
end
--set_flag("reward_time_event",flag_current_time) -- 캐릭터별 플래그 설정
set_account_flag("reward_time_event",flag_current_time) --계정별 플래그 설정
end
end