NG Phorum

Forum o bocie TibiaNG oraz ElfBotNG

  • Nie jesteś zalogowany.
  • Polecamy: Komputery

#1 2009-05-02 10:02:53

Admin

Administrator

Zarejestrowany: 2009-04-02
Posty: 24
Punktów :   

Exori hur w wybranego potwora

[hide]

Kod:

const
MonsterName = 'Nazwa Potwora' ;
Attack_Spell = 'exori hur' ;
Min_Mana = 100 ;
Min_Monster_HP = 1 ; 
Max_Monster_HP = 100 ;
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;[/hide]

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Polityka cookies - Wersja Lo-Fi

[ Generated in 0.009 seconds, 11 queries executed ]


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.shinobiworld-pbf.pun.pl www.probleszno.pun.pl www.extreamsquad.pun.pl www.everold.pun.pl www.naruto-arena-x.pun.pl