Ir para conteúdo
Faça parte da equipe! (2024) ×
  • Quem está por aqui   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.

Scripts


Knight Deep
 Compartilhar

Posts Recomendados

Só alguns Scripts para quem precisa :D

 

Monk trainer

 

Const

SwitchAt=40;//switch to next monk when the current monk has less than 40% hp.

AttackAt=50;// attack a monk if the monk has more than 50% hp.

 

var

creature:tcreature;

 

function GetCreatureByNameHPHIGH(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

if Creatures.Creature[x].Health>AttackAt then

begin

Result := Creatures.Creature[x];

Exit;

end;

end;

end;

function Attacking: 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].Attacking then

begin

Result := True;

Exit;

end;

end;

end;

function GetAttackedCreature: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].Attacking=true then

begin

Result := Creatures.Creature[x];

Exit;

end;

end;

end;

 

 

begin

 

while not Terminated do

begin

UpdateWorld;

if not attacking then

begin

Creature:=GetCreatureByNameHPHIGH('Monk');

if Creature <> nil then

creature.attacking:=true;

end;

if attacking then

begin

Creature:=GetAttackedCreature;

if Creature <> nil then

if creature.Health < SwitchAt then creature.attacking:=false;

end;

sleep(1000);

end;

end;

 

Diagonal Dragon

 

Const

Wanted='Dragon';// whice monster to keep diagnoling

AttackAt = 25

RampsID = [1950, 1952, 1954, 1956, 385, 1947, 434, 414, 604]

 

var

x,Bla:Integer;

Looting: boolean;

 

 

function IsCreatureBesideYou(c: TCreature): boolean;

begin

UpdateWorld;

if (abs(c.X-self.X) <= 1) and (abs(c.Y-self.Y) <= 1) then begin

if c.Z = self.Z then

begin

Result := True;

Exit;

end;

end;

Result := False;

end;

 

 

function GetTileFromXYZ(X, Y, Z: integer): TTile;

begin

Result := nil;

if abs((Self.X - 7) - X) > 14 then Exit;

if abs((Self.Y - 5) - Y) > 11 then Exit;

if Self.Z <> Z then Exit;

Result := Screen.Tile[abs((Self.X - 7) - X), abs((Self.Y - 5) - Y)];

end;

function IsTileWalkable(Tile: TTile): boolean;

begin

Result := True;

for Z := 0 to Tile.Count - 1 do

begin

if Tile.Item[Z].Properties.Hole then

begin

Result := False;

end

else if Tile.Item[Z].Properties.Stairs then

begin

Result := False;

end

else if not Tile.Item[Z].Properties.Walkable then

begin

OutputDebugString('Not Walk: ' + IntToStr(Tile.Item[Z].ID));

Result := False;

end;

else

begin

for x := low(RampsID) to high(RampsID) do

begin

if Tile.Item[Z].ID = RampsID[x] then Result := False;

end;

end;

end;

end;

 

function GetCreatureBesideYou: TCreature;

begin

UpdateWorld;

Result := Nil;

for x := 0 to Creatures.Count - 1 do

begin

UpdateWorld;

if (Creatures.Creature[x].Name=Wanted) then

if IsCreatureBesideYou(Creatures.Creature[x]) then

begin

if Creatures.Creature[x].ID <> Self.ID then

begin

UpdateWorld;

Result := Creatures.Creature[x];

Exit;

end;

end;

end;

end;var

Moved:boolean;

 

begin

updateworld;

G:=false;

T:=false;

while not terminated do

begin

Bla:=Self.Containers.Count;

updateworld;

Creature:=GetCreatureBesideYou;

if Creature<>nil then

if Creatures.Creature[x].Health>AttackAt then

begin

if (Self.X<>Creature.X) and (Self.Y=Creature.Y) then

begin

Tile:=GetTileFromXYZ(Self.x,Self.y-1,self.z);

if Tile<>nil then

if IsTileWalkable(Tile) then

begin

Self.MoveUp;

Moved:=true;

end;

If (Moved=False) then

begin

Tile:=GetTileFromXYZ(Self.x,Self.y+1,self.z);

if Tile<>nil then

if IsTileWalkable(Tile) then

Self.MoveDown;

end;

end;

Moved:=false;

if (Self.X=Creature.X) and (Self.Y<>Creature.Y) then

begin

Tile:=GetTileFromXYZ(Self.x-1,Self.y,self.z);

if Tile<>nil then

if IsTileWalkable(Tile) then

begin

Self.MoveLeft;

Moved:=true;

end;

If (Moved=False) then

begin

Tile:=GetTileFromXYZ(Self.x+1,Self.y,self.z);

if Tile<>nil then

if IsTileWalkable(Tile) then

Self.MoveRight;

end;

end;

end;

sleep(1000);

end;

end;

 

Health Potion

 

const

minMana = 20; //Mana miníma para Soltar Exura

minHealth = 800; //minímo Para tomar o Potion

maxHealth = 1000; //Life minímo Para usar Exura

 

while not Terminated do

begin

UpdateWorld;

if (Self.Health < minHealth) then

begin

Self.Containers.UseItemWithSelf(239); //Alterar Conforme a potion a usar

Sleep(1000);

end;

else

begin

if (Self.Health < maxHealth) and (Self.Mana > minMana ) then

begin

Self.Say('Exura'); //pode ser alterado

Sleep(1500);

end;

end;

Sleep(100);

end;

Link para o comentário
Compartilhar em outros sites

Este tópico está impedido de receber novos posts.
 Compartilhar

×
×
  • Criar Novo...

Informação Importante

Nós fazemos uso de cookies no seu dispositivo para ajudar a tornar este site melhor. Você pode ajustar suas configurações de cookies , caso contrário, vamos supor que você está bem para continuar.