viewing paste Unknown #34947 | Text

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
prontera,234,200,4  script  Invasion NPC    4_F_NFLOSTGIRL,{
set .GM,50;//GM Level to access the GM Menu. Default: 50
 
    // GM menu 
    //It allows GMs Level 50 or more to Start and Stop invasions.
    if (getgmlevel()>.GM) {
        if (.mobs_left) {
            mes "An invasion is in progress..";
            mes "map = "+.maps$[.rand_map];
            mes "^FF0000"+.mobs_left+"^000000 Goblins left";
            mes " ";
            mes "Stop invasion?";
            if(select("No:Yes")==1) close;
            donpcevent "Invasion NPC::OnTimer1805000";
            mes "Invasion stopped";
            announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
            close;
        }
        mes "Start an invasion?";
        if(select("Yes:No")==2) close;
        donpcevent "Invasion NPC::OnStart";
        mes "Invasion started in "+.maps$[.rand_map]+".";
        close;
    }
    
    // If a player clicks the NPC, it displays:
    
    mes .mobs_left+" have invaded "+.maps$[.rand_map]+"!";
    close;
    
            /////////////////////////
            //The actual NPC Script//
            /////////////////////////
OnStart:
    set .mobs_left, 1;
    setarray .maps$[0], "prontera","morocc","payon","alberta","izlude","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","jawaii","ayothaya","lighthalzen","einbech","hugel","rachel";       // 3 maps to pick from, you can change them.
    set .rand_map, rand(19);                        // pick a random map
    initnpctimer;
    announce "Satan Morroc Invasion Begin.", bc_all,"0x666666",0;
    end;
    
    
OnTimer5000:    // 5 seconds later after the first broadcast
    announce "Get rid of these Satan Morocc!", bc_all,"0x666666",0;
    sleep2 10000;
    announce "We need your help!", bc_all,"0x666666",0;
    sleep2 10000;
    announce "They're destroying our precious city here in [ "+.maps$[.rand_map]+" ] Town. Hurry Up!", bc_all,"0x666666",0;
    monster .maps$[.rand_map],0,0,"Satan Morroc",$invasion_mvp_id,1,"Invasion NPC::OnMyMobDead";
    set .mobs_left, 1;
    end;
    
    
OnTimer1805000: // 30 minutes later, kills all the mobs.
    killmonster .maps$[.rand_map],"Invasion NPC::OnMyMobDead";
    set .mobs_left, 1;
 
    
OnStop://When the event is stopped by a GM, or all monsters dead.
    stopnpctimer;
    end;
 
OnNPCKillEvent:
    if(killedrid == $invasion_mvp_id) {
        announce strcharinfo(0)+" has defeated Satan Morocc!", bc_all;
        getitem 675,1;
    }
    end;
 
OnMyMobDead://When a Satans is killed
    set .mobs_left, .mobs_left-1;
    if (.mobs_left==0) {
        //announce strcharinfo(0)+" has defeated Satan Morocc!", bc_all,"0xFFFF33",0;
        
        
        //If you'd like to give a prize 
        //to the last player who killed a Goblin
        //Uncomment the following line, and fill accordingly:
            //getitem 675,1;
            //getitem 677,1;
            
            
        donpcevent "Invasion NPC::OnStop";
    } else {
        dispbottom "["+.mobs_left+"/1] Satan Morocc left.";
    }
    end;
 
    //Uncomment these lines to have the NPC do the invasion every hour
        //OnMinute00:
        donpcevent "Invasion NPC::OnStart";
    //Uncomment these lines to have the NPC do the invasion every 3 hours.
        OnClock0000:
        OnClock0300:
        OnClock0600:
        OnClock0900:
        OnClock1200:
        OnClock1500:
        OnClock1800:
        OnClock1201:
        donpcevent "Invasion NPC::OnStart";
 
OnInit:
    $invasion_mvp_id = 1917;
}
Viewed 903 times, submitted by Guest.