Czy ktos wie gdzie trzeba wpisac id potwroa zeby otworzylo mi ciala? Np dwarfa?
PHP:
var
Loot: array of integer;
LootCount: integer;
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 GetItemOnTile(ID: integer; Tile: TTile): TItem;
var
Z: integer;
begin
Result := nil;
for Z := 0 to Tile.Count - 1 do
begin
if Z >= Tile.Count then Break;
if Tile.Item[Z].ID = ID then
begin
Result := Tile.Item[Z];
Break;
end;
end;
end;
function GetItemFromOpenBackpack(Index, ID: integer): TItem;
var
y: integer;
begin
Result := nil;
if Index >= Self.Containers.Count then Exit;
for y := 0 to Self.Containers.Container[Index].Count - 1 do
begin
if y >= Self.Containers.Container[Index].Count then Break;
if Self.Containers.Container[Index].Item[y].ID = ID then
begin
Result := Self.Containers.Container[Index].Item[y];
Exit;
end;
end;
end;
procedure Event_ContainerOpened(Index, ID: integer; Name: string);
var
x: integer;
Found: boolean;
begin
if Index = 0 then Exit;
repeat
Found := False;
for x := 0 to LootCount - 1 do
begin
UpdateWorld;
Item := GetItemFromOpenBackpack(Index, Loot[x]);
if Item <> nil then
begin
Found := True;
Item.MoveToContainer(Self.Containers.Container[0], 0, 0);
Sleep(200);
end;
end;
until not Found;
end;
procedure Event_ItemCreated(ID, X, Y, Z: integer);
var
Corpse: TItem;
Tile: TTile;
begin
UpdateWorld;
if abs(Self.X - X) > 1 then Exit;
if abs(Self.Y - Y) > 1 then Exit;
if Self.Z <> Z then Exit;
Tile := GetTileFromXYZ(X, Y, Z);
if Tile = nil then Exit;
Corpse := GetItemOnTile(ID, Tile);
if Corpse = nil then Exit;
if (Corpse.Properties.Container) and (not Corpse.Properties.Movable) then Corpse.Open;
end;
begin
Loot := [3031, 3492]; //gold = 3031 and worms = 3492
LootCount := 2; //2 loot items
while not Terminated do
begin
ProcessEvents;
Sleep(100);
end;
end;