//
001-3.gat,71,70,0 script TestFlag 125,{
if ($@flag_a_capper$ == strcharinfo(0)) goto L_SOMEONE_ELSE;
if ($@flag_a_cap != 0) goto L_ALREADY_CAP;
set $@flag_a_capper$, strcharinfo(0);
mes "You will capture the flag in 10 seconds";
npctalk "This flag will be captured by " + ($@flag_a_capper$) + " in 10 seconds";
setnpctimer 0;
startnpctimer;
close;
end;
L_SOMEONE_ELSE:
mes "Someone else must try to capture before you can capture again!";
close;
end;
L_ALREADY_CAP:
mes "This flag is already captured!";
close;
end;
OnTimer10000:
set $@flag_a_cap, 1;
npctalk "Flag is now captured";
fakenpcname "TestFlag", "Captured by " + $@flag_a_capper$, 126;
if (attachrid(getcharid(3,$@flag_a_capper$)) == 0) end;
set PVP_POINTS, PVP_POINTS + 1;
end;
OnTimer30000:
npctalk "Flag will be freed in 30 seconds";
end;
OnTimer45000:
npctalk "Flag will be freed in 15 seconds";
end;
OnTimer55000:
npctalk "Flag will be freed in 5 seconds!";
end;
OnTimer60000:
npctalk "Flag is now free!";
set $@flag_a_cap, 0;
fakenpcname "TestFlag", "Uncaptured", 125;
end;
OnInit:
fakenpcname "TestFlag", "Uncaptured", 125;
set $@flag_a_cap, 0;
initnpctimer;
stopnpctimer;
}