SD.txt

(2 KB) Pobierz
// By Kylu
const  
  Czas = 0.1 // Co ile ma walic w potwora z sd (dla otsow 0.1 best)
  Potwory = ['Dragon', 'Dragon Lord', 'Warlock', 'Hero', 'Hydra', 'Demon', 'Black Knight']  // Tablica potworow
  ID_Runy = 3155 // ID Runki 


Function PlayeronScreen : boolean;
var
    x: integer;
begin
    Result := nil;
    updateworld;
    for x := 0 to Creatures.Count - 1 do begin
        if x >= Creatures.Count then Break;
        if Creatures.Creature[x].Z <> Self.Z then Continue;
        if Creatures.Creature[x].Id = Self.Id then Continue;
        if Creatures.Creature[x].Npc = False then begin
            Result := True;
            Exit;
        end;
    end;
    Result := False;
end;

function GetCreatureByName(Name: string): TCreature;     
var     
  x: integer;     
begin     
  Result := nil;     
  for x := 0 to Creatures.Count - 1 do     
  begin     
    if x >= Creatures.Count then Break;
    if Creatures.Creature[x].Z <> Self.Z then Continue;	
    if Creatures.Creature[x].Name = Name then    
    begin     
      Result := Creatures.Creature[x];     
      Exit;     
    end;     
  end;     
end;     

procedure Attack(Name:string);     

begin     
  updateworld;     
  Monster :=GetCreatureByName(Name);     
  If Not PlayeronScreen then begin
  if monster <> nil then     
  begin     
    Self.Containers.UseItemWithCreature(ID_Runy, Monster);     
    updateworld;     
  end     
end;     
end;

var        
   Z:integer;
   i:integer;
   j:integer;
while not terminated do
  
begin  
  Yes := false;  
  UpdateWorld;  
  for i := 0 to creatures.Count - 1 do
  for j := Low(Potwory) to High(Potwory) do
  begin  
    if creatures.Creature[i].Z <> Self.Z then Continue;  
    If Creatures.Creature[i].Name = Potwory[j] then  
    begin   
      Yes := true;  
      repeat  
        Attack(Potwory[j]);  
        Sleep(Czas * 1000);  
        UpdateWorld;  
        for g := 0 to creatures.Count -1 do  
        begin  
          if creatures.Creature[g].Z = Self.Z then
          If Creatures.Creature[g].Name = Potwory[j] then  
          Yes := True else Yes := false; else Yes := false;  
        end;  
      until Yes = false;  
    end;  
    sleep(10);  
  end;  
  Sleep(10);  
end; 
Zgłoś jeśli naruszono regulamin