Script Name: Invincibility for Cappers
Script Description: Every time you capture the flag, you gain 1 more chance to use the invincibility command, which lasts for a specified amount of time.
Original Author: Curt
Core Version: 2.6.2
Code: const
Color = $FFFFFFFF;
Time = 10;
var
InvinCount, Invincable: array[1..32] of byte;
procedure AppOnIdle(Ticks: integer);
var
i: byte;
begin
for i := 1 to 32 do if Invincable[i] > 0 then begin
Invincable[i] := Invincable[i] - 1;
if Invincable[i] = 0 then WriteConsole(i,'You are no longer invincable.',Color);
end;
end;
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
if (Text = '/inv') or (Text = '/invin') or (Text = '/invincible') or (Text = '/invincibility') then begin
if Invincable[ID] = 0 then begin
if InvinCount[ID] > 0 then begin
InvinCount[ID] := InvinCount[ID] - 1;
Invincable[ID] := Time;
WriteConsole(ID,'You are now invincible for ' + InttoStr(Time) + ' second' + iif(Time = 1,'','s') + '.',Color);
end else WriteConsole(ID,'You do not have enough remaining captures available.',Color);
end else WriteConsole(ID,'You are already invincible.',Color);
end;
end;
procedure OnFlagScore(ID, TeamFlag: byte);
begin
InvinCount[ID] := InvinCount[ID] + 1;
end;
function OnPlayerDamage(Victim, Shooter: byte; Damage: integer): integer;
begin
if Invincable[Victim] = 0 then Result := Damage else Result := 0;
end;
In request from Ttil_Np.csWoW