Forum www.elfngboot.fora.pl Strona Główna
 Strona glówna  •  FAQ  •  Szukaj  •  Użytkownicy  •  Grupy  •  Galerie  •  Rejestracja  •   Profil  •  Zaloguj się, by sprawdzić wiadomości  •  Zaloguj 
Atakowanie najpierw wybranego potwora. 
Napisz nowy temat   Odpowiedz do tematu    Forum www.elfngboot.fora.pl Strona Główna -> Bot NG / Skrypty
Zobacz poprzedni temat :: Zobacz następny temat  
Autor
Wiadomość
jabol123
Administrator



Dołączył: 05 Mar 2009
Posty: 26
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

PostWysłany: Czw 21:13, 05 Mar 2009  

Atakowanie najpierw wybranego potworka ;]
Wpisujemy w kolejności w jakiej mają być atakowane.

Kod:

Const
Name=['Dwarf Guard', 'Dwarf Soldier'];
SwitchAt=10;// the % of the current attacked monster
            //that if the monster has lass % hp than this, we Will NOt change to the stronger monster.
function GetPlace(st:string):integer;
var
x:integer;
begin
Result:=1000;
for x:=Low(Name) To High(Name) do
  begin
   if Name[x]=st then
   Result:=x;
   end;
end;

function GetCreatureByID(ID: integer): 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].ID = ID then
    begin
      Result := Creatures.Creature[x];
      Exit;
    end;
  end;
end;

function IsCreatureBesideYou(c: TCreature): boolean;
begin
   UpdateWorld;
   Result := False;
   if (abs(c.X-self.X) <= 6) and (abs(c.Y-self.Y) <= 6) then begin
    if c.Z = self.Z then begin
     Result := True;
    end;
   end;
end;

var
x:integer;
b:boolean;
begin
while not terminated do
  begin
    b:=false;
   updateworld;
   If (Self.Attacking<>0) then
    begin
    Creature:=GetCreatureByID(Self.Attacking);
     if Creature<>nil then
      if SwitchAt<Creature.Health then
      begin
       for x := 0 to Creatures.Count - 1 do
        begin
        updateworld;
         if b then break;
         if x >= Creatures.Count then Break;
         if Creatures.Creature[x].NPC then
         if Creatures.Creature[x].z=self.z then
         if Creatures.Creature[x].Name<>self.name then
         if Creatures.Creature[x].Attacking = false then
         if IsCreatureBesideYou(Creatures.Creature[x]) then
         if GetPlace(Creature.Name)>GetPlace(Creatures.Creature[x].Name) then
             begin
               sleep(100);
                updateworld;
                Creatures.Creature[x].attacking:=true;
                 B:=true;
              end;
         end;
       end;
      end;
     Sleep(100);
   end;
end;


Post został pochwalony 0 razy
Powrót do góry
Zobacz profil autora
Wyświetl posty z ostatnich:   
Napisz nowy temat   Odpowiedz do tematu    Forum www.elfngboot.fora.pl Strona Główna -> Bot NG / Skrypty Wszystkie czasy w strefie EET (Europa)
Strona 1 z 1
   
 
Opcje 
Zezwolenia Opcje
Kto jest na Forum Możesz pisać nowe tematy
Możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Kto jest na Forum
 
Jumpbox
Kto jest na Forum
Skocz do:  


fora.pl - załóż własne forum dyskusyjne za darmo
Theme FrayCan created by spleen & Download
Powered by phpBB © 2001, 2005 phpBB Group
Regulamin