Advertisement
Emistry

[RO] Auto Map BGM

Mar 15th, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.98 KB | None | 0 0
  1.  
  2. -   script  bgm_main    -1,{
  3.    
  4.     function    func_AddBGM {
  5.         .bgm_name$[.bgm_size] = getarg(0, "");
  6.         .bgm_duration[.bgm_size] = getarg(1, 0);
  7.         .bgm_start[.bgm_size] = getarg(2, 0);
  8.         .bgm_end[.bgm_size] = getarg(3, 0);
  9.         .bgm_size++;
  10.     }
  11.    
  12.     OnInit:
  13.         .map$ = "prontera";
  14.        
  15.         // func_AddBGM("<bgm_file>", <bgm_duration>, <start_hour_minute>, <end_hour_minute>);
  16.         func_AddBGM("02", 183, 0000, 1100); // 12AM ~ 11AM play 02.bgm, last 183 seconds.
  17.         func_AddBGM("03", 150, 0630, 1445); // 0630AM ~ 1445PM play 03.bgm, last 150 seconds.
  18.         func_AddBGM("110", 158, 1500, 2359); // 1500PM ~ 2359PM play 110.bgm, last 158 seconds.
  19.        
  20.     OnTimer300000:
  21.     OnStart:
  22.         if (.bgm >= 0) {
  23.             playbgmall(.bgm_name$[.bgm], .map$);
  24.             setnpctimer ((300 - .bgm_duration[.bgm_size]) * 1000);
  25.         }
  26.         end;
  27.        
  28.     OnMinute00:
  29.         .bgm = -1;
  30.         .@time = atoi(gettimestr("%H%M", 4));
  31.         for (.@i = 0; .@i < 23 && .bgm < 0; .@i++)
  32.             if (.bgm_start[.@i] >= .@time && .@time <= .bgm_end[.@i])
  33.                 .bgm = .@i;
  34.         end;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement