.: HUEH :.
SKRYPT NA LECZENIE POTIONAMI
const
MinHealth = 200; // "200" jest to ilo¶ć życia kiedy ma użyć potiona
ID_Potion = 266; // "266" jest to id health potiona, w razie potrzeby zmienić
NumberOfVialsToDrink = 1;
Delay = 2;
var
I: Integer;
begin
while not Terminated do
begin
UpdateWorld;
if Self.Health <= MinHealth then
for I:=1 to NumberOfVialsToDrink do
begin
if (Terminated) then break;
Self.Containers.UseItemWithSelf(ID_Potion);
Sleep(Delay*1000);
end;
Sleep(500);
end;
end;
SKRYPT NA ATAKOWANIE Z EXORI VIS/FRIGO/MORT/FLAM
const
frigo = ['banshee','wyvern'];
flam = ['carrion worm'];
tera = ['cyclops', 'cyclops drone', 'cyclops smith'];
vis = ['winter wolf'];
mort = ['rotworm'];
useWand = 1 // 1 to attack with wand also, 0 to do not attack with wand.
function GetExoriType(Crea: TCreature): String;
begin
Result := '';
for z := Low(frigo) to High(frigo) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(frigo[z]) then
Result := 'exori frigo';
end;
for z := Low(flam) to High(flam) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(flam[z]) then
Result := 'exori flam';
end;
for z := Low(tera) to High(tera) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(tera[z]) then
Result := 'exori tera';
end;
for z := Low(vis) to High(vis) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(vis[z]) then
Result := 'exori vis';
end;
for z := Low(mort) to High(mort) do
begin
if AnsiLowerCase(Crea.Name) = AnsiLowerCase(mort[z]) then
Result := 'exori mort';
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;
begin
sleepTime := 1100;
if useWand = 0 then
sleepTime := 1000;
while not terminated do
begin
updateworld;
if Self.Attacking <> nil then
begin
creature := GetCreatureByID(self.attacking);
if creature <> nil then
begin
exori := GetExoriType(creature);
if exori <> '' then
begin
updateworld;
if (abs(creature.x - self.x) <= 3) and (abs(creature.y - self.y) <= 3) and (self.z = creature.z) then
begin
if Self.Attacking > 0 then
if creature.visible then
self.say(exori);
end;
end;
end;
end;
sleep(sleepTime);
end;
end;
GRUPOWANIE ITEMÓW
procedure StackItems;
var
T: array of integer;
x, y, z: integer;
Temp: integer;
begin
T := VarArrayCreate([0, 19] , 3);
Temp := -1;
for x := 0 to Self.Containers.Count - 1 do
begin
if x >= Self.Containers.Count then Break;
for z := 0 to Self.Containers.Container[x].Count - 1 do
begin
T[z] := Self.Containers.Container[x].Item[z].ID;
end;
for y := 0 to Self.Containers.Container[x].Count - 1 do
begin
if y >= Self.Containers.Container[x].Count then Break;
if Self.Containers.Container[x].Item[y].Properties.Pilable then
begin
if Self.Containers.Container[x].Item[y].Amount < 100 then
begin
for z := y + 1 to Self.Containers.Container[x].Count - 1 do
begin
if T[z] = Self.Containers.Container[x].Item[y].ID then
begin
if Self.Containers.Container[x].Item[z].Amount < 100 then
begin
Self.Containers.Container[x].Item[y].movetocontainer(Self.Containers.Container[x], z, 0);
end;
end;
end;
end;
end;
end;
end;
end;
begin
while not Terminated do
begin
UpdateWorld;
StackItems;
Sleep(1000);
end;
end;
ZAMIANA 100 GP NA 1 PC
while not terminated do
begin
UpdateWorld;
for i := 0 to Self.Containers.Count - 1 do
begin
if terminated then break;
for g := 0 to Self.Containers.Container[i].Count - 1 do
begin
if terminated then break;
if Self.Containers.Container[i].Item[g].Amount = 100 then
if (Self.Containers.Container[i].Item[g].ID = 3031) or (Self.Containers.Container[i].Item[g].ID = 3035) then
Self.Containers.Container[i].Item[g].Use;
sleep(10);
end;
sleep(10);
end;
sleep(500);
end;