// https://rathena.org/board/topic/110756-npc-that-opens-at-certain-times/
prontera,155,181,5 script Sample 4_F_KAFRA1,{
.@aid = getcharid(3);
for ( .@i = 0; .@i < .aid_size; .@i++ )
if ( .aid[.@i] == .@aid ) {
mes "You can only enter once per session.";
close;
}
.aid[.aid_size] = .@aid;
.aid_size++;
addtimer ( .duration * 60000 ), .npc_name$ + "::OnKick";
warp .map$,0,0;
end;
OnInit:
// map name
.map$ = "guild_vs5";
// duration stay in map
.duration = 10;
// duration the npc available
.minute = 60;
.npc_name$ = strnpcinfo(3);
donpcevent .npc_name$+"::OnHide";
end;
OnClock1500:
OnClock1900:
deletearray .aid;
.aid_size = 0;
hideoffnpc .npc_name$;
sleep ( .minute * 60000 ); // available for 1 hour
OnHide:
mapwarp .map$, "prontera",155,181;
hideonnpc .npc_name$;
end;
OnKick:
if ( strcharinfo(3) == .map$ ) {
warp "prontera",155,181;
}
end;
}
Comments
0 B
|👍
/👎