viewing paste bg_emp_guardian | 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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
prontera,156,189,5  script  kjdshfkjsf  100,{
    setoption Option_Xmas, 1;
    sleep2 5000;
    setoption Option_Xmas, 0;
    end;
}
 
-   script  bg_emp_1vs1#main    -1,{
OnInit:
    .minplayer2start = 1; // minimum player to start
    .eventlasting = 30 * 60; // abort the system if there's no progress, 30 mins * seconds
    setarray .rewardwin, 501,10, 502,5, 503,3; // reward to winning team
    setarray .rewardlose, 501,5, 502,3, 503,1; // reward to losing team
    setarray .rewarddraw, 501,3, 502,1; // reward to both teams when draw
 
    .rewardwinsize = getarraysize( .rewardwin );
    .rewardlosesize = getarraysize( .rewardlose );
    .rewarddrawsize = getarraysize( .rewarddraw );
    setarray .guardian_xy,
        168,266,
        168,202,
        168,137,
        148,266,
        148,202,
        148,137;
    mapwarp "event_01", "prontera", 157,182;
    end;
OnStart:
    .@redcount = getwaitingroomstate( 0, .rednpcname$ );
    .@bluecount = getwaitingroomstate( 0, .bluenpcname$ );
    if ( .@redcount < .minplayer2start || .@bluecount < .minplayer2start ) {
        announce "Battleground Emperium : Red ["+ .@redcount +"/"+ .minplayer2start +"] | Blue ["+ .@bluecount +"/"+ .minplayer2start +"]", bc_all;
        end;
    }
    .red = waitingroom2bg( "event_01", 157,352, strnpcinfo(0)+"::OnRedQuit", strnpcinfo(0)+"::OnRedDead", .rednpcname$ );
    copyarray getd(".team"+ .red +"aid"), $@arenamembers, $@arenamembersnum;
    .blue = waitingroom2bg( "event_01", 157,50, strnpcinfo(0)+"::OnBlueQuit", strnpcinfo(0)+"::OnBlueDead", .bluenpcname$ );
    copyarray getd(".team"+ .blue +"aid"), $@arenamembers, $@arenamembersnum;
    .teamcount[.red] = .teamcount[.blue] = .minplayer2start;
    .teamname$[.red] = "Red";
    .teamname$[.blue] = "Blue";
    delwaitingroom .rednpcname$;
    delwaitingroom .bluenpcname$;
    disablenpc .rednpcname$;
    disablenpc .bluenpcname$;
    bg_warp .red, "event_01",157,352;
    bg_warp .blue, "event_01",157,50;
    bg_monster .red,"event_01", 157,338, "--ja--",1915, strnpcinfo(0)+"::OnRedDown";
    bg_monster .blue,"event_01", 157,64, "--ja--",1914, strnpcinfo(0)+"::OnBlueDown";
    for ( .@i = 0; .@i < 6; .@i++ )
        bg_monster 0, "event_01", .guardian_xy[ .@i *2 ], .guardian_xy[ .@i *2 +1 ], "--ja--", 2901, strnpcinfo(0) +"::Onguard"+ .@i +"down";
    sleep .eventlasting * 1000;
    killmonsterall "event_01", strnpcinfo(0)+"::OnRedDown";
    if ( .winside == .red ) {
        mapannounce "event_01", " Red side wins !", bc_map;
        callsub L_reward, .red,  .rewardwin,  .rewardwinsize;
        callsub L_reward, .blue, .rewardlose, .rewardlosesize;
    }
    else if ( .winside == .blue ) {
        mapannounce "event_01", " Blue side wins !", bc_map;
        callsub L_reward, .blue, .rewardwin, .rewardwinsize;
        callsub L_reward, .red, .rewardlose, .rewardlosesize;
    }
    else {
        mapannounce "event_01", "Time Out. Aborting the match.", bc_map;
        callsub L_reward, .red,  .rewarddraw, .rewarddrawsize;
        callsub L_reward, .blue, .rewarddraw, .rewarddrawsize;
    }
    sleep 5000;
    mapwarp "event_01", "prontera", 157,182;
    bg_destroy .red;
    bg_destroy .blue;
    deletearray getd(".team"+ .red +"aid");
    deletearray  getd(".team"+ .blue +"aid");
    .winside = .teamcount[.red] = .teamcount[.blue] = 0;
    .teamname$[.red] = .teamname$[.blue] = "";
    enablenpc .rednpcname$;
    enablenpc .bluenpcname$;
    donpcevent .rednpcname$ +"::OnStart";
    donpcevent .bluenpcname$ +"::OnStart";
    end;
L_reward:
    for ( .@i = 0; .@i < .teamcount[ getarg(0) ]; .@i++ )
        for ( .@j = 0; .@j < getarg(2); .@j += 2 )
            getitem getelementofarray( getarg(1), .@j ), getelementofarray( getarg(1), .@j +1 ), getd( ".team"+ getarg(0) +"aid["+ .@i +"]" );
    return;
Onguard0down: callsub L_guard_down, 0;
Onguard1down: callsub L_guard_down, 1;
Onguard2down: callsub L_guard_down, 2;
Onguard3down: callsub L_guard_down, 3;
Onguard4down: callsub L_guard_down, 4;
Onguard5down: callsub L_guard_down, 5;
L_guard_down:
    if ( getcharid(4) == .red )
        .@killed_bg = .red;
    else if ( getcharid(4) == .blue )
        .@killed_bg = .blue;
    sleep 8000;
    bg_monster .@killed_bg, "event_01", .guardian_xy[ getarg(0) *2 ], .guardian_xy[ getarg(0) *2 +1 ], "--ja--", 2901, strnpcinfo(0) +"::Onguard"+ getarg(0) +"down";
    end;
OnRedDown: callsub L_EmpDown, .red, .blue;
OnBlueDown: callsub L_EmpDown, .blue, .red;
L_EmpDown:
    mapannounce "event_01", strcharinfo(0) +" has Destroy "+ .teamname$[ getarg(0) ] +"'s side Emperium.", bc_map;
    .winside = getarg(1);
    awake strnpcinfo(0);
    end;
OnRedDead:
OnBlueDead:
    sleep2 1250;
    percentheal 100,100;
    if ( !getcharid(4) ) end;
    pcblockmove getcharid(3), 1;
    setoption Option_Invisible, 1;
    sleep2 5000;
    setoption Option_Invisible, 0;
    pcblockmove getcharid(3), 0;
    end;
OnRedQuit: callsub L_quit, .red, .blue;
OnBlueQuit: callsub L_quit, .blue, .red;
L_quit:
    percentheal 100, 100;
    while ( getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ) != getcharid(3) && .@i < .teamcount[ getarg(0) ] ) .@i++;
    deletearray getd( ".team"+ getarg(0) +"aid["+ .@i +"]" ), 1;
    .teamcount[ getarg(0) ]--;
    if ( .teamcount[ getarg(0) ] ) end;
    mapannounce "event_01", "All "+ .teamname$[ getarg(0) ] +" team members has Quit !", bc_map, 0xff3333; // purposely use different color
    .winside = getarg(1);
    awake strnpcinfo(0);
    end;
}
 
prontera,155,182,5  script  Red side#bg_emp 733,{
    end;
OnInit:
    sleep 1;
    set getvariableofnpc( .rednpcname$, "bg_emp_1vs1#main" ), strnpcinfo(0);
OnStart:
    waitingroom "Red Team", getvariableofnpc( .minplayer2start, "bg_emp_1vs1#main" ) +1, "bg_emp_1vs1#main::OnStart", 1;
    end;
}
 
prontera,159,182,5  script  Blue side#bg_emp    734,{
    end;
OnInit:
    sleep 1;
    set getvariableofnpc( .bluenpcname$, "bg_emp_1vs1#main" ), strnpcinfo(0);
OnStart:
    waitingroom "Blue Team", getvariableofnpc( .minplayer2start, "bg_emp_1vs1#main" ) +1, "bg_emp_1vs1#main::OnStart", 1;
    end;
}
 
event_01    mapflag battleground
event_01    mapflag nosave  SavePoint
event_01    mapflag nowarp
event_01    mapflag nowarpto
event_01    mapflag noreturn
event_01    mapflag nomemo
event_01    mapflag noteleport
event_01    mapflag nopenalty
event_01    mapflag nobranch
event_01    mapflag noicewall
Viewed 1287 times, submitted by AnnieRuru.