What's new

- TibiaBot NG Skrypt NG.

Status
Not open for further replies.

Sexbastian

Advanced User
Joined
Sep 13, 2008
Messages
151
Reaction score
8
Age
30
Witam.

Chcia?bym aby kto? napisa? mi skrypt do ng, kt?ry b?dzie polega? na tym ?e, Bot atakuje potwora o "xxxx" nazwie z "xxx" czary lecz gdy hp spadnie poni?ej "xxxx" to przestaje atakowa?, a gdy si? uleczymy atakuje go od nowa!.

Za pomoc dam reputa!.
 
T

Thomass

Guest
Odp: Skrypt NG.

Witam.
Chcia?bym aby kto? napisa? mi skrypt do ng, kt?ry b?dzie polega? na tym ?e, Bot atakuje potwora o "xxxx" nazwie z "xxx" czary lecz gdy hp spadnie poni?ej "xxxx" to przestaje atakowa?, a gdy si? uleczymy atakuje go od nowa!.
Za pomoc dam reputa!.

PHP:
const
MonsterName = 'Nazwa Potwora' ;
Attack_Spell = 'Nazwa czaru' ;
Min_Mana = 100 ;
Min_Monster_HP = 1 ; 
Max_Monster_HP = 1000 ;
Range = 5 ;

var
x: Integer;
Creature:TCreature;

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 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].Name = Name then
begin
Result := Creatures.Creature[x];
Exit;
end;
end;
end;

function IsCreatureAttackable(c: TCreature): boolean;
begin
UpdateWorld;
Result := False;
if (c.Z = self.Z) and (abs(c.X-self.X) <= Range) and (abs(c.Y-self.Y) <= Range) and (c.outfit<>0) and (c.Health >= Min_Monster_HP) and (c.Health <= Max_Monster_HP) then
begin
Result := True;
end;
end;

while not Terminated do
begin
UpdateWorld;
Creature := GetCreatureByID(Self.Attacking);
if (Self.Mana >= Min_Mana) and (Creature <> nil) then
for i := low(monstername) to high(monstername) do
begin
if (MonsterName[i] = Creature.Name) and (IsCreatureAttackable(Creature)) then
begin
Self.Say(Attack_Spell);
sleep(2000);
end;
end;
sleep(100);
end;

Gdzie Min_Monster_HP = 1 ; to minimalna ilo?? ?ycia mobka, a Max_Monster_HP = 1000 ; to maksymalna ilo?? HP mobka.
 
Status
Not open for further replies.
Top