Autor Wiadomość
jabol123
PostWysłany: Czw 21:16, 05 Mar 2009    Temat postu: Robienie Runek przed Domkiem

Gdy gracz na ekranie lub nas atakuje skrypt wchodzi do domku.. Gdy gracz sobie pójdzie wychodzi i dalej robi runki.

Kod:

var
 X1: Integer;
 Y1: Integer;
 X2: Integer;
 Y2: Integer;
 Player: TSelf;
 HP: Integer;
 stay: Boolean;
 
 
 //Made for TibiaBot NG by LordofWar.
 //Created by Forge, copyright 2006-2007.
 //Usage, stand on the square that it will run to if attacked or if it see someone,
 //then execute the script.
 
procedure Event_Attacked(ID: integer);
begin
  UpdateWorld;
  Player.MoveTo(X1, Y1, Player.Z);
  stay := true;
  UpdateWorld;
end;


function Event_HP(hitpoint: integer): boolean;
var
 Player: TSelf;
begin
 result := false;
 if(Player.health < Player.MaximumHealth) then begin
   result := True;
   stay := True;
 end;
end;
 
function GetCreature: byte;
var
  x: integer;
begin
  updateworld;
  result := 0;
  for x := 0 to Creatures.Count - 1 do
  begin
    if Creatures.Creature[x].NPC = false then
    if(Creatures.Creature[x].Name <> self.Name) then begin
     if(Creatures.Creature[x].Z = Self.Z) then begin
      result := 1;
      exit;
     end;
    end;
  end;
end;


begin
  UpdateWorld;
  self.whisper('[5 sec] Goto the place you want to go if someone enter screen or attack you!');
  Sleep(5000);
  X1 := Player.X;
  Y1 := Player.Y;
  self.whisper('[4 sec] Good, now move to the place where you want to stand.');
  Sleep(4000);
  UpdateWorld;
  X2 := Player.X;
  Y2 := Player.Y;
  self.whisper('[0 sec] Great! Now we start it ;)');
  stay := false;
  while not Terminated do
  begin
    if event_hp(HP) = true then begin
      Player.MoveTo(X1, Y1, Player.Z);
    end;
    if GetCreature = 1 then begin
     Self.MoveTo(X1, Y1, Self.Z);
     Sleep(2000);
     exit;
    end;
   
   if GetCreature = 0 then begin
    Self.MoveTo(X2, Y2, Self.Z);
   end;
   
   sleep(500);
   
  end;
end;

Powered by phpBB © 2001, 2005 phpBB Group