Jump to content
  • 0

Please help with this Invasion script.


aferny

Question


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  20
  • Reputation:   0
  • Joined:  09/28/20
  • Last Seen:  

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;

}

 

Edited by Patskie
code
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  49
  • Topics Per Day:  0.01
  • Content Count:  1511
  • Reputation:   227
  • Joined:  08/03/12
  • Last Seen:  

2 hours ago, aferny said:

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.

 

 

I think the script should active for every minute 14 ? Whisper by GM Level 90 and above to activate it.

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.01
  • Content Count:  20
  • Reputation:   0
  • Joined:  09/28/20
  • Last Seen:  

8 hours ago, Chaos92 said:

I think the script should active for every minute 14 ? Whisper by GM Level 90 and above to activate it.


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;

 

Thanks for the reply. But i didnt read the post of Emistry fully. He put a fix towards the bottom. It all works now ?

Edited by aferny
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...