Exura Sio/UH em Amigo ou Voce


Const

MiniCreatureHP = 50; //Porcentagem de vida do amigo
ITEM_RUNE_UH = 3160; //ID da UH que ele usara se nao usar Sio
Name = 'Myfriend'; //Coloke o Nome do char

var
Creature: TCreature;
CreatureName: string;
function IsCreatureVisible(Name: string): boolean;
var
x: integer;
begin
Result := False;
for x := 0 to Creatures.Count - 1 do
begin
if x >= Creatures.Count then Break;
if Creatures.Creature[x].Name = Name then
begin
if Creatures.Creature[x].Visible then
begin
Result := True;
Exit;
end;
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;
begin
while not Terminated do
begin
UpdateWorld;
Creature := GetCreatureByName(Name);
If Creature<> nil then
If IsCreatureVisible(Name) then
begin
if ((Creature.Health) <(MiniCreatureHP)) and ((Self.Mana)>(70)) then
Self.Say('[red[exura sio "'+Name)
else
if ((Creature.Health) <(MiniCreatureHP)) then Self.Containers.UseItemWithCreature(ITEM_RUNE_UH, Creature);
end;
Sleep(1000);
end;
end;