// Invasion Event [NubDes] Style // Added Config for ingame Settings [Prize for normal monsters, Prize for Boss Monster, Start, and Off,] // Requested by Abdulla prontera,150,150,3 script Invasion Manager 100,{ function Invasion; if( getgmlevel() < 99 ) goto L_NotGM; mes "[^3399FF Invasion Manager ^000000]"; mes "Hello, GameMaster.."; mes "What do you want to do?"; switch(select("Set Prize:Set Prize for Boss:Start the Invasion:Clean the Invasion:Nothing")) { case 1: next; mes "[^3399FF Invasion Manager ^000000]"; mes "Please type in the new prize id."; input .@invaprizeid; if (getitemname(.@invaprizeid) == "null" || getitemname(.@invaprizeid) == "") {next; mes "^3399FF[Disguise CP2]^000000"; mes "Error"; mes "This item does not exist in the database..."; close;} set $invaprize, .@invaprizeid; next; mes "[^3399FF Invasion Manager ^000000]"; mes "Please type in the amount."; input .@invaprizeamount; if (!.@invaprizeamount) set .@invaprizeamount,1 ; set $invaprizecount,.@invaprizeamount; next; mes "[^3399FF Invasion Manager ^000000]"; mes "Prize has been set to ^E50000 "+ getitemname($invaprize)+ "^000000 and the amount to ^E50000 " +$invaprizecount+"^000000"; close; case 2: next; mes "[^3399FF Invasion Manager ^000000]"; mes "Please type in the new prize id."; input .@bossbossinvaprizeid; if (getitemname(.@bossbossinvaprizeid) == "null" || getitemname(.@bossbossinvaprizeid) == "") {next; mes "^3399FF[Disguise CP2]^000000"; mes "Error"; mes "This item does not exist in the database..."; close;} set $bossinvaprize, .@bossbossinvaprizeid; next; mes "[^3399FF Invasion Manager ^000000]"; mes "Please type in the amount."; input .@bossinvaprizeamount; if (!.@bossinvaprizeamount) set .@bossinvaprizeamount,1 ; set $bossinvaprizecount,.@bossinvaprizeamount; next; mes "[^3399FF Invasion Manager ^000000]"; mes "Prize has been set to ^E50000 "+ getitemname($bossinvaprize)+ "^000000 and the amount to ^E50000 " +$bossinvaprizecount+"^000000"; close; case 3: goto L_StartInva; case 4: goto L_CleanInva; case 5: close; } close; L_NotGM: mes "You are not a GM."; close; // Some config [NubDes] --------- Maps to config.. just add something like these "izlude","prontera","aldebaran","geffen"; OnInit: setarray .Maps$[0],"izlude","prontera","geffen"; end; // ------------------------------ L_StartInva: OnMinute00: // Automated timer > Starts @ 00:00:00 Server time OnMinute30: // Automated timer > Starts @ 00:30:00 Every 30 of server times for example 01:30:00 will be start this event 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 : Invasion( ,,,,....,, ); break; Case 0: Invasion( 1002,10 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time Case 1: Invasion( 1004,10 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time Case 2: Invasion( 1007,10 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time Case 3: Invasion( 1001,10 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time } initnpctimer; end; L_CleanInva: OnTimer3600000: set .Invasion,0; announce "Invasion End.",0; killmonster .SelectedMap$,"All"; end; function Invasion { monster .SelectedMap$,0,0,"[ Invasion Monster ]",getarg(0),getarg(1),strnpcinfo(0)+"::OnBossKilled"; for( set .@i,2; getarg( .@i,0 ); set .@i,.@i + 2 ) monster .SelectedMap$,0,0,"[ Invasion Monster ]",getarg(.@i),getarg(.@i+1),strnpcinfo(0)+"::OnMobKilled"; announce "Invasion Started at "+.SelectedMap$+" .. Hurry Up !!.",0; } OnBossKilled: getitem $invaprize,$invaprizecount; // <---- Reward for each mob killed if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ) ){ mapannounce .SelectedMap$,"Invasion Monster(s) - Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBossKilled" ),0; }else{ killmonster .SelectedMap$,"All"; mapannounce .SelectedMap$,"All Monster has been Killed, The Invasion Boss has showned up!!",0; monster .SelectedMap$,0,0,"[ Invasion Boss ]",1511,1,strnpcinfo(0)+"::OnBoxKilled"; } end; OnMobKilled: if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ) ){ mapannounce .SelectedMap$,"Monsters Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ),0; } end; OnBoxKilled: getitem $bossinvaprize,$bossinvaprizecount; // <---- Reward for if the boss Killed if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ) ){ mapannounce .SelectedMap$,"Invasion Boss Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnBoxKilled" ),0; }else{ announce "Monster Invasion Event end Successfully.",0; stopnpctimer; } end; }