Const
List = ['Rotworm', 'Carrion Worm'];
Spell = 'Exori Frigo';
function TestMonster(Crea: TCreature): boolean;
begin
Result := false;
for z := Low(List) to High(List) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(List[z]) then
Result := 'true';
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;
while not terminated do
begin
updateworld;
if Self.Attacking nil then
begin
creature := GetCreatureByID(self.attacking);
if creature nil then
begin
updateworld;
if (abs(creature.x - self.x) <= 3) and (abs(creature.y - self.y) <= 3) then
if (TestMonster(creature)) then
begin
if Self.Attacking > 0 then
self.say(Spell);
sleep(2000);
end;
end;
sleep(200);
end;
end;
Atacar determinado monstro com determinada magia
Assinar:
Postar comentários
(
Atom
)
2 comentários | COMENTE AQUI!!! :
Ta com um probleminha na linha 31
Arrumar porfavor
ow tah dando erroor
Postar um comentário