Exori Hur/San/Con

const
CreatureList = ['Demon']; //Nome do biixo
SpellList = ['Exori Hur']; //Nome da magiia
ManaList = [120]; //Minimo de mana que precisa ter para usar a magia
HealthList = [20]; //Com qnts % vai parar de usar a magia
RangeList = [8]; //Qnts SQM vai tar do bicho para começar a soltar a magia!

function GetCreatureByID(ID: integer): TCreature;
var
x: integer;
begin
Result := nil;
for x := 0 to Creatures.Count - 1 do
if Creatures.Creature[x].ID = ID then
Result := Creatures.Creature[x];
end;

var
Creature: TCreature;
Range,X,ID: Integer;

begin
while not Terminated do
begin
UpdateWorld;
if (Self.Attacking) then
begin
Creature:=GetCreatureByID(Self.Attacking);
if (Assigned(Creature)) then
begin
ID:=-1;
for X:=Low(CreatureList) to High(CreatureList) do
if (CreatureList[X] = Creature.Name) then
ID:=X;
if (ID > -1) then
begin
Range := Round(Sqrt(Sqr(Self.X - Creature.X) + Sqr(Self.Y - Creature.Y)));
if (Range <= RangeList[ID]) and (Self.Mana >= ManaList[ID]) and (Creature.Health >= HealthList[ID]) then
Self.Say(SpellList[ID]);
end;
end;
end;
Sleep(1800);
end;
end;

Pesquisar no site

By Chuck Norriz © 2009 Todos os direitos reservados.