G
Groma
Пример как менять оружие когда моб близко, как вариант лук и дагер.
const
DAGGER_ID = 11951;
BOW_ID = 11975;
CHANGE_RANGE = 200;
var
dagger,bow: tl2item;
begin
while delay(1000) do begin
if user.target.valid and not user.target.dead and user.target.attackable then
if (user.distto(user.target) > CHANGE_RANGE) then begin
if inventory.user.byid(BOW_ID,bow) and not bow.equipped then engine.useitem(bow);
end else begin
if inventory.user.byid(DAGGER_ID,dagger) and not dagger.equipped then engine.useitem(dagger);
end;
end;
end.
© krn
const
DAGGER_ID = 11951;
BOW_ID = 11975;
CHANGE_RANGE = 200;
var
dagger,bow: tl2item;
begin
while delay(1000) do begin
if user.target.valid and not user.target.dead and user.target.attackable then
if (user.distto(user.target) > CHANGE_RANGE) then begin
if inventory.user.byid(BOW_ID,bow) and not bow.equipped then engine.useitem(bow);
end else begin
if inventory.user.byid(DAGGER_ID,dagger) and not dagger.equipped then engine.useitem(dagger);
end;
end;
end.
© krn