Скрипт
Code: Select all
Program Provocation;
type TProvocationTargets = record
First: Cardinal;
Second: Cardinal;
end;
function CheckDistance(CreatureA, CreatureB : Cardinal): Integer;
begin
Result := Dist(GetX(CreatureA), GetY(CreatureA), GetX(CreatureA), GetY(CreatureB));
end;
procedure FindCorpsesAndLoot();
var
i : Integer;
corpses: TCardinalDynArray;
begin
FindType($2006, Ground);
corpses := GetFoundItems();
for i:=0 to Length(corpses)-1 do
begin
newMoveXY(GetX(corpses[i]), GetY(corpses[i]), true, 1, true);
UseObject(corpses[i]);
Wait(1000);
AddToSystemJournal(IntToStr(FindTypeEx($0EED, $0000, corpses[i], true)));
if (FindCount > 0) then
begin
MoveItem(FindItem, 0, Backpack, 0,0,0);
Wait(1000);
end;
Ignore(corpses[i]);
end;
end;
{
* Info * : ID: $025ADDF0 Name: a spectral spellbinder Type: $001A Color: $0000
* Info * : Quantity: 0 X: 3665 Y: 2492 Z: 0
* Info * : Tooltip: a spectral spellbinder
* Info * : ID: $025ADBC4 Name: a zombie Type: $0003 Color: $0000
* Info * : Quantity: 0 X: 3630 Y: 2515 Z: 0
* Info * : Tooltip: a zombie
* Info * : ID: $0297B074 Name: a skeleton Type: $0038 Color: $0000
* Info * : Quantity: 0 X: 3624 Y: 2463 Z: 2
* Info * : Tooltip: a skeleton
}
procedure SeekAndDestroy();
var
i, q, m1 : Integer;
creatures: TCardinalDynArray;
ctime : TDateTime;
begin
FindTypesArrayEx([$1A, $3, $38, $32, $27, $93], [$FFFF], [Ground], false);
creatures := GetFoundItems();
for i := 0 to Length(creatures)-1 do begin
if NOT (IsObjectExists(creatures[i])) or (GetX(creatures[i]) = 0) then Continue;
//NewMoveXY(GetX(creatures[i]), GetY(creatures[i]), true, 1, true);
//Cast('Consecrate Weapon');
//Cast('Pain spike');
//if (WaitForTarget(5000)) then
//TargetToObject(creatures[i]);
AddToSystemJournal('Creature: ' + IntToStr(creatures[i]));
ctime := Now;
if Mana > 10 then
//Cast('Consecrate Weapon');
Cast('Lightning strike');
repeat
NewMoveXY(GetX(creatures[i]), GetY(creatures[i]), true, 1, true);
Attack(creatures[i]);
wait(1000);
q := q + 1;
m1 := InJournalBetweenTimes('have gained', ctime, Now);
until (m1<>-1) or Dead or (q > 300) or NOT IsObjectExists(creatures[i]);
FindCorpsesAndLoot();
end;
end;
function FindTargets(AnimalTypes: Array of Word; Ignored: Cardinal): TProvocationTargets;
var
i, k, q, m1, m2: Integer;
// tmpCreature: Cardinal;
creatures: TCardinalDynArray;
ctime : TDateTime;
begin
Result.First := $0;
Result.Second := $0;
for i := 0 to Length(AnimalTypes)-1 do
begin
FindType(AnimalTypes[i], Ground);
creatures := GetFoundItems();
// AddToSystemJournal(IntToStr(Length(creatures)));
for k := 0 to Length(creatures)-1 do
begin
if (Result.First = $0) then
begin
Result.First := creatures[k];
NewMoveXY(GetX(creatures[k]), GetY(creatures[k]), true, 1, true);
Continue;
end;
if (Result.Second = $0) then // AND
while (CheckDistance(Result.First, creatures[k]) < 15) AND (IsObjectExists(Result.First)) AND (IsObjectExists(creatures[k]) AND NOT (creatures[k] = Result.First)) do
begin
Result.Second := creatures[k];
NewMoveXY(GetX(Result.First), GetY(Result.Second), true, 1, true);
ctime := Now;
UseSkill('Provocation');
if WaitForTarget(5000) then
begin
TargetToObject(Result.First);
if WaitForTarget(5000) then TargetToObject(Result.Second);
end;
repeat
wait(100);
q := q + 1;
m1 := InJournalBetweenTimes('tell someone to attack themselves | are too far away from one or both | cannot see that', ctime, Now);
m2 := InJournalBetweenTimes('are trying to play is no longer in your backpack', ctime, Now);
if (m2 <> -1) then begin
UseSkill('Provocation');
if WaitForTarget(5000) then TargetToObject(FindType($0E9C, Backpack));
end;
if (m1<>-1) then Exit;
until Dead or (q > 100);
FindCorpsesAndLoot();
end;
end;
end;
end;
function SetPoint(x, y : Word): TPoint;
begin
Result.x := x;
Result.y := y;
end;
var
//creatures: Array of Word;
waypoints: Array of TPoint;
procedure InitLevels();
begin
//Level1
// creatures := [$00DC, $0122, $00EA, $00ED, $003F, $0005, $00E1, $0027,
// $00D3, $00D4, $00D6, $00CD, $00D9, $00D1];
// waypoints := [SetPoint(3468, 2412), SetPoint(3478, 2392), SetPoint(3506, 2384),
// SetPoint(3541, 2385), SetPoint(3546, 2415), SetPoint(3526, 2449), SetPoint(3427, 2496)];
//Level2
// creatures := [$00D6, $001A, $0027, $0038, $0003, $0027, $00E1, $00A7, $00EA, $00ED, $00D3];
// waypoints := [SetPoint(3619, 2391), SetPoint(3622, 2417), SetPoint(3638, 2430), SetPoint(3665, 2432), SetPoint(3686, 2412), SetPoint(3704, 2429), SetPoint(3717, 2460), SetPoint(3718, 2494), SetPoint(3662, 2471), SetPoint(3623, 2492), SetPoint(3621, 2524), SetPoint(3604, 2540), SetPoint(3662, 2471), SetPoint(3585, 2543), SetPoint(3662, 2471), SetPoint(3561, 2562), SetPoint(3662, 2471), SetPoint(3570, 2505), SetPoint(3579, 2477), SetPoint(3577, 2439)];
waypoints := [SetPoint(3614, 2436), SetPoint(3609, 2458), SetPoint(3667, 2463), SetPoint(3695, 2493), SetPoint(3714, 2505), SetPoint(3707, 2520), SetPoint(3683, 2526), SetPoint(3663, 2522), SetPoint(3643, 2523), SetPoint(3625, 2521), SetPoint(3601, 2530), SetPoint(3585, 2593), SetPoint(3588, 2498)];
end;
procedure MainProc();
var
//targets: TProvocationTargets;
//creatureTypes: Array of Word;// = ($00DC, $0122, $00EA, $00ED, $003F, $0005, $00E1, $0027);
i : Integer;
begin
while (true) do
for i := 0 to Length(waypoints)-1 do
begin
NewMoveXY(waypoints[i].x, waypoints[i].y, true, 1, true);
SeekAndDestroy();
end;
end;
begin
//Body of Script
FindDistance:= 40;
IgnoreReset();
Ignore(1075753032);
Ignore(1074786546);
//FindCorpsesAndLoot();
//Exit;
MoveOpenDoor := true;
InitLevels();
MainProc();
end.