Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script MVPTimer -1,{
- OnInit:
- // Mvp ids
- setarray $MVP_id[0],id1,id2,id3;
- // Mvp maps NO GAT's!
- setarray $MVP_maps$[0],"map1","map2","map3";
- // Respawn time (HOURS)
- setarray $MVP_tm[0],tm1,tm2,tm3;
- initnpctimer;
- // IT SHOULD FALL HERE! _NO_ end;
- OnTimer3600: // After a hour
- for( set .@i,0; .@i < getarraysize($MVP_id); set .@i, .@i+1 )
- {
- set .@time, $MVP_tm[.@i]*3600; // Conversion to seconds so we can use gettimetick
- if( ($MVP_last_respawn[.@i] + .@time) > gettimetick(2) || $MVP_alive[.@i] == 1 )
- continue; // Time has yet to pass
- monster $MVP_maps$[.@i],0,0,"--ja--",$MVP_id[.@i],1;
- // Defines last respawn
- set $MVP_last_respawn[.@i], gettimetick(2);
- set $MVP_alive[.@i], 1;
- }
- setnpctimer 0;
- end;
- OnNPCKillEvent:
- if( getmonsterinfo(killedrid, MOB_MVPEXP) > 0 ) // To minimize overhead
- {
- for( set .@i,0; .@i < getarraysize($MVP_id); set .@i, .@i+1 )
- {
- if( killedrid == $MVP_id[.@i] )
- set $MVP_alive[.@i], 0;
- }
- }
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement