Advertisement
Emistry

[RO] NPC Portal - Specific Hours

May 1st, 2017
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. // https://rathena.org/board/topic/110756-npc-that-opens-at-certain-times/
  2.  
  3. prontera,155,181,5 script Sample 4_F_KAFRA1,{
  4. .@aid = getcharid(3);
  5.  
  6. for ( .@i = 0; .@i < .aid_size; .@i++ )
  7. if ( .aid[.@i] == .@aid ) {
  8. mes "You can only enter once per session.";
  9. close;
  10. }
  11.  
  12. .aid[.aid_size] = .@aid;
  13. .aid_size++;
  14.  
  15. addtimer ( .duration * 60000 ), .npc_name$ + "::OnKick";
  16. warp .map$,0,0;
  17. end;
  18.  
  19. OnInit:
  20. // map name
  21. .map$ = "guild_vs5";
  22. // duration stay in map
  23. .duration = 10;
  24. // duration the npc available
  25. .minute = 60;
  26.  
  27. .npc_name$ = strnpcinfo(3);
  28. donpcevent .npc_name$+"::OnHide";
  29. end;
  30.  
  31. OnClock1500:
  32. OnClock1900:
  33. deletearray .aid;
  34. .aid_size = 0;
  35. hideoffnpc .npc_name$;
  36. sleep ( .minute * 60000 ); // available for 1 hour
  37.  
  38. OnHide:
  39. mapwarp .map$, "prontera",155,181;
  40. hideonnpc .npc_name$;
  41. end;
  42.  
  43. OnKick:
  44. if ( strcharinfo(3) == .map$ ) {
  45. warp "prontera",155,181;
  46. }
  47. end;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement