- script bgm_main -1,{
function func_AddBGM {
.bgm_name$[.bgm_size] = getarg(0, "");
.bgm_duration[.bgm_size] = getarg(1, 0);
.bgm_start[.bgm_size] = getarg(2, 0);
.bgm_end[.bgm_size] = getarg(3, 0);
.bgm_size++;
}
OnInit:
.map$ = "prontera";
// func_AddBGM("<bgm_file>", <bgm_duration>, <start_hour_minute>, <end_hour_minute>);
func_AddBGM("02", 183, 0000, 1100); // 12AM ~ 11AM play 02.bgm, last 183 seconds.
func_AddBGM("03", 150, 0630, 1445); // 0630AM ~ 1445PM play 03.bgm, last 150 seconds.
func_AddBGM("110", 158, 1500, 2359); // 1500PM ~ 2359PM play 110.bgm, last 158 seconds.
OnTimer300000:
OnStart:
if (.bgm >= 0) {
playbgmall(.bgm_name$[.bgm], .map$);
setnpctimer ((300 - .bgm_duration[.bgm_size]) * 1000);
}
end;
OnMinute00:
.bgm = -1;
.@time = atoi(gettimestr("%H%M", 4));
for (.@i = 0; .@i < 23 && .bgm < 0; .@i++)
if (.bgm_start[.@i] >= .@time && .@time <= .bgm_end[.@i])
.bgm = .@i;
end;
}
Comments
0 B
|👍
/👎