viewing paste Unknown #14407 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
// 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";
bindatcmd "invastart",strnpcinfo(3)+"::OnStart";
bindatcmd "invaclean",strnpcinfo(3)+"::OnClean";
// ------------------------------
 
L_StartInva:
OnStart:
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 <X>: Invasion( <BOSS>,<Amount>,<MOBID>,<AMOUNT>,....,<MOBID>,<AMOUNT> ); break;
        case 0: Invasion( 1023,50 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time
        case 1: Invasion( 1273,50 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time
        case 2: Invasion( 1686,50 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time
        case 3: Invasion( 1213,50 ); break; // Set here the mobs.. you can put 2 or more mobs in the same time
}
 
L_CleanInva:
OnClean:
OnTimer3600000:
set .Invasion,0;
announce "Invasion End.",0;
killmonster .SelectedMap$,"All";
 
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 ]",1190,1,strnpcinfo(0)+"::OnBoxKilled";
}
 
OnMobKilled:
if( mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ) ){
        mapannounce .SelectedMap$,"Monsters Remain : "+mobcount( .SelectedMap$,strnpcinfo(0)+"::OnMobKilled" ),0;
}
 
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;
}
 
}
Viewed 403 times, submitted by unknown.