prontera,155,185,5 script start 1_F_MARIA,{
if ( .start ) {
mes "capture all the flags to win faster !";
close;
}
select "Start";
donpcevent strnpcinfo(0)+"::OnStart";
close;
OnStart:
disablenpc "start";
enablenpc "Flag_1#1";
enablenpc "Flag_2#2";
enablenpc "Flag_3#3";
enablenpc "Flag_4#4";
enablenpc "Flag_5#5";
end;
// total 11 lines without labels and bracket
OnTimer1000: callsub L_addscore, 5;
OnTimer3000: callsub L_addscore, 4;
OnTimer6000: callsub L_addscore, 3;
OnTimer9000: callsub L_addscore, 2;
OnTimer12000: callsub L_addscore, 1;
L_addscore:
if ( .capturedamount != getarg(0) ) end;
.score += .point[ .capturedamount ];
if ( .score < 100 ) {
bg_updatescore "prontera", 0, .score;
initnpctimer;
end;
}
// until here
bg_updatescore "prontera", 0, 100;
announce "You win !", bc_all;
sleep 3000;
.start = .capturedid = .capturedamount = .score = 0;
for ( .@i = 1; .@i <= 5; .@i++ ) {
disablenpc "Flag_"+ .@i +"#"+ .@i;
setnpcdisplay "Flag_"+ .@i +"#"+ .@i, GUILD_FLAG;
}
enablenpc "start";
bg_updatescore "prontera", 0, 0;
end;
OnInit:
// copy paste this part from that script ...
// I even make this CONFIGURABLE !!
.tick[1] = 12000; // when capture 1 flag ...
.point[1] = 1; // 12 seconds to gain 1 point
.tick[2] = 9000; // when capture 2 flags ...
.point[2] = 1; // 9 seconds to gain 1 point
.tick[3] = 6000; // when capture 3 flags ...
.point[3] = 1; // 6 seconds to gain 1 point
.tick[4] = 3000; // when capture 4 flags ...
.point[4] = 1; // 3 seconds to gain 1 point
.tick[5] = 1000; // when capture ALL flags ...
.point[5] = 3; // gain 3 points every second !
for ( .@i = 1; .@i <= 5; .@i++ )
disablenpc "Flag_"+ .@i +"#"+ .@i;
end;
}
- script Flag FAKE_NPC,{
.@flagid = atoi( strnpcinfo(2) );
if ( getvariableofnpc( .capturedid, "start" ) & (1 << .@flagid) ) {
dispbottom "You already captured this flag";
end;
}
progressbar "", 3;
set getvariableofnpc( .capturedid, "start" ), getvariableofnpc( .capturedid, "start" ) | 1 << .@flagid;
set getvariableofnpc( .capturedamount, "start" ), getvariableofnpc( .capturedamount, "start" ) + 1;
setnpcdisplay strnpcinfo(0), 1_FLAG_EAGLE;
initnpctimer "start";
end;
}
prontera,151,180,4 duplicate(Flag) Flag_1#1 GUILD_FLAG
prontera,153,180,4 duplicate(Flag) Flag_2#2 GUILD_FLAG
prontera,155,180,4 duplicate(Flag) Flag_3#3 GUILD_FLAG
prontera,157,180,4 duplicate(Flag) Flag_4#4 GUILD_FLAG
prontera,159,180,4 duplicate(Flag) Flag_5#5 GUILD_FLAG
prontera mapflag battleground 2