Script enables to use soulshots (Soulshot (A-grade)) when bot attacks mob with ID: 21388. Otherwise soulshots are not enabled, so not used / consumed.
const
TargetIDs: array[0..0] of Cardinal = (21388);
function ShouldEnableSS(target: TL2Live): boolean;
var
i: Integer;
begin
Result := False;
for i := 0 to High(TargetIDs) do
begin
if target.ID = TargetIDs[i] then
begin
Result := True;
Exit;
end;
end;
end;
begin
while (Engine.Status <> lsOnline) do
Delay(100);
while true do
begin
if (Engine.Status = lsOnline) then
begin
if ShouldEnableSS(User.Target) then
begin
Engine.AutoSoulShot('Soulshot (A-grade)', True); // Enable soulshots
end
else
begin
Engine.AutoSoulShot('Soulshot (A-grade)', False); // Disable soulshots
end;
end;
delay(1000);
end;
end.
note this line:
TargetIDs: array[0..0] of Cardinal = (21388);
If you have only the 21388, must be 0..0. If you need to add more ids, you have to increase the array too. For example of 3 ids should be:
TargetIDs: array[0..2] of Cardinal = (123,456,789);
Author: Velmsun