Hi Guys,
I got this script from one of Emistry's replies in the past. I edited the thing to suit our liking. However though it works on the first reload. But it doesnt automatically do it every hour. Im very new to scripting and cant seem to find anything wrong with it. And theres no error's on VNC as well.
Thank you in advance.
- script Sample -1,{
function Invasion;
OnInit:
setarray .Maps$[0],"moscovia","dewata","brasilis","malangdo";
end;
OnWhisperGlobal:
if( getgmlevel() < 90 ) end;
OnMinute14:
if( .Invasion ) end;
set .Invasion,1;
set .SelectedMap$,.Maps$[ rand( getarraysize(.Maps$) ) ];
switch( rand(4) ){
default: end;
// MAX : ~64 Different Monster in each Cases( 1 BOSS + 63 Normal )
// Case <X>: Invasion( <BOSS>,<Amount>,<MOBID>,<AMOUNT>,....,<MOBID>,<AMOUNT> ); break;
Case 0: Invasion( 1815,300 ); break;
Case 1: Invasion( 1815,400 ); break;
Case 2: Invasion( 1815,350 ); break;
Case 3: Invasion( 1815,450 ); break;
}
initnpctimer;
end;
OnTimer1800000:
set .Invasion,0;
announce "Time's Up !! Invasion End.",0;
killmonster .SelectedMap$,"All";
end;
function Invasion {
monster .SelectedMap$,0,0,"Virus",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled";
for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 )
monster .SelectedMap$,0,0,"INVASION MOB",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled";
announce "To all RevRo players! Monsters are invading "+.SelectedMap$+" Help us and you will be rewarded greatly!",0;
}
OnBossKilled:
// getitem 512,100;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ) ){
mapannounce .SelectedMap$,"Monsters remaing : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ),0;
}else{
killmonster .SelectedMap$,"All";
mapannounce .SelectedMap$,"ALL monsters has been Killed, Treasure BOX has been Summoned",0;
monster .SelectedMap$,0,0,"TREASURE BOX",1333,10,strnpcinfo(0)+"::OnBoxKilled";
}
end;
OnMobKilled:
// getitem 512,1;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ) ){
mapannounce .SelectedMap$,"Monsters Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ),0;
}
end;
OnBoxKilled:
// getitem 607,1;
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ) ){
mapannounce .SelectedMap$,"Treasure Box Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ),0;
}else{
announce "Invasion Event end Successfully.",0;
stopnpctimer;
}
end;
}