Массовый свип (сбор спойла) мобов в паровозе без умения Массовое Присвоение

in la2 •  6 years ago 

procedure SweepThread(dist: integer);
var
sweep: TL2Skill;
mob: TL2Npc;
point: TXYZ;
begin
while Delay(500) do begin // запускаем бесконечный цикл
if (Engine.Status = lsOnline) // если мы онлайн
and SkillList.ByID(42, sweep) then begin // и у нас есть умение Sweep [id: 42], то
mob:= GetNearestSweepableMob(dist); // ищем ближайшего моба которого можно свипать
if (mob <> nil) then begin // если моба найден, то
if Engine.SetTarget(mob) then Delay(99); // берем в таргет моба
if (User.DistTo(mob) > 100) then begin // если дистацния до моба > 100, то
point:= CalcXYZ(User, mob, -20); // вычисляем координаты точки, чтобы подойти на дистацию свипа
if Engine.MoveTo(point.X, point.Y, point.Z) then Delay(500); // подходим в найденную точку
end;
if Engine.UseSkill(sweep) then // если мы успешно использовали свип, то
while (sweep.EndTime <> 0) do Delay(99); // ждем пока он не откатится
end;
end;
end;
end;

function GetNearestSweepableMob(dist: integer): TL2Npc; // возвращает ближайшего моба, которого можно свипать
var i: integer;
begin
Result:= nil;
for i:= 0 to NpcList.Count-1 do begin // пробегаем по списку NPC вокруг нас
if (NpcList(i).Valid) // если моб валиден
and (User.DistTo(NpcList(i)) < dist) // и дистанция до него меньше максимально допустимой
and (NpcList(i).Dead) // и этот моб мертв
and (NpcList(i).Sweepable) then begin // и с него можно собрать спойл
Result:= NpcList(i); // то запоминаем его в результат
dist:= User.DistTo(NpcList(i)); // обновляем значение максимально допустимой дистанции
end;
end;
end;

begin
Script.NewThread(@SweepThread, Pointer(300)); // вторым агрументов указываем макс дистанцию для свипа
// code...

Delay(-1);
end.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Source
Plagiarism is the copying & pasting of others work without giving credit to the original author or artist. Plagiarized posts are considered spam.

Spam is discouraged by the community, and may result in action from the cheetah bot.

More information and tips on sharing content.

If you believe this comment is in error, please contact us in #disputes on Discord

Hi! I am a robot. I just upvoted you! I found similar content that readers might be interested in:
https://adrenalinebot.com/ru/api/example/mass-sweep-of-mobs-in-trains-without-skill-sweeper-festival

Hello @vicmur! This is a friendly reminder that you have 3000 Partiko Points unclaimed in your Partiko account!

Partiko is a fast and beautiful mobile app for Steem, and it’s the most popular Steem mobile app out there! Download Partiko using the link below and login using SteemConnect to claim your 3000 Partiko points! You can easily convert them into Steem token!

https://partiko.app/referral/partiko

Congratulations @vicmur! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!