blink_land.land_xy(fx, fy, ax, ay, range, over, min_r)#blink_land
Where a point jump lands for the point it is aimed at: dota's rule in one function.
"requires": { "blink_land": "^1.0" }local blink_land = require("lib/blink_land")Players install nothing: the script brings the library, any version inside the range. Edit scripts/lib/blink_land/ in a dev session to try a change before you publish.
lib/blink_land
Where a point jump lands for the point it is aimed at: dota's rule in one function. The ready-blink
mark (theme/zones through utea/blink_range) and the aim preview (hud/lib/aim) both draw from it.
local BL = require("lib/blink_land")
local p, kind = BL.land(ability, hero_pos, cursor)
| aim | kind | lands |
|---|---|---|
inside the cast range (plus SLACK 1 for float noise) |
in |
on the point |
| past it, OVERSHOOT (every blink dagger, anti-mage, queen of pain) | edge |
at the cast range along the aim |
| past it, no OVERSHOOT (fallen sky) | walk |
on the point, after a walk in |
under min_blink_range |
min |
pushed out to it |
The daggers' kv still carries blink_range_clamp (960, arcane 1120), but 7.39 removed the overshoot
penalty and the lib does not read it. Live check 2026-11-30, lab, Anti-Mage 25 with item_blink, distance
the hero moved:
| cast | aim distance | moved |
|---|---|---|
| item_blink, synthetic order | 1210, 1300, 1600, 2200 (x2), 5000 | 1200 each |
| item_blink, real click on the slot and the ground | ~4000 (x2) | 1200 each |
| item_blink, synthetic order | 800 | 800 |
| antimage_blink lvl 4 | 700 / 2000 / 120 | 700 / 1100 / 200 |
| call | what |
|---|---|
land_xy(fx, fy, ax, ay, range, over, min) |
the rule on numbers: landing x, y, kind |
reach(ab) |
live cast_range() (bonuses folded in), OVERSHOOT, min range |
land(ab, from, aim) |
land_xy on a live ability, a Vector with the aim's z |
Offline test: tools\lua\lua.exe scripts\lib\blink_land\selftest.lua.
The code of 1.0.0 as the client gets it. The bundle's bytecode is built from these files.
init.lua64 lines
-- lib/blink_land: where a point jump really lands for the point it is aimed at, the one copy of
-- dota's rule. the ready-blink mark and the aim preview draw it (#1153).
--
-- dota's rule, measured live 2026-11-30 (item_blink, antimage_blink; synthetic order and a real click):
-- inside the cast range lands on the point
-- past it, OVERSHOOT lands at the cast range along the aim (every blink dagger since 7.39,
-- anti-mage, queen of pain). the kv still carries blink_range_clamp 960 /
-- 1120: dead, the dagger lands at 1200
-- past it, no OVERSHOOT walks in first, then lands on the point (fallen sky)
-- under min_blink_range pushed out to it (anti-mage)
--
-- local BL = require("lib/blink_land")
-- local p, kind = BL.land(ability, from, aim) -- kind: in | edge | walk | min
local B = {}
B.OVERSHOOT = 274877906944
B.SLACK = 1 -- an aim on the ring with float noise past it is still inside
local sqrt = math.sqrt
-- pure: from, aim as numbers; range, over (OVERSHOOT), min. returns the landing x, y and its kind
function B.land_xy(fx, fy, ax, ay, range, over, min_r)
local dx, dy = ax - fx, ay - fy
local d = sqrt(dx * dx + dy * dy)
if d < 1e-3 then return fx, fy, "in" end
local ux, uy = dx / d, dy / d
if min_r and min_r > 0 and d < min_r then return fx + ux * min_r, fy + uy * min_r, "min" end
if not range or range <= 0 or d <= range + B.SLACK then return ax, ay, "in" end
if not over then return ax, ay, "walk" end
return fx + ux * range, fy + uy * range, "edge"
end
local function call(e, m, ...)
local f = e and e[m]
if not f then return nil end
local ok, v = pcall(f, e, ...)
if ok then return v end
return nil
end
-- the live numbers: cast range with its bonuses folded in (e:cast_range), OVERSHOOT, min_blink_range
function B.reach(ab)
local range = tonumber(call(ab, "cast_range")) or 0
local min_r = tonumber(call(ab, "special", "min_blink_range")) or 0
local over = call(ab, "has_behavior", B.OVERSHOOT) == true
return range, over, min_r > 0 and min_r or nil
end
local function xy(p)
if p.x ~= nil then return p.x, p.y, p.z end
return p:GetX(), p:GetY(), p:GetZ()
end
-- landing of ability from `from` aimed at `aim` (vectors), on the aim's z
function B.land(ab, from, aim)
local fx, fy = xy(from)
local ax, ay, az = xy(aim)
local range, over, min_r = B.reach(ab)
local x, y, kind = B.land_xy(fx, fy, ax, ay, range, over, min_r)
return Vector(x, y, az or 0), kind
end
return B
pack.json2 lines
{ "kind": "lib", "version": "1.0.0" }
No release notes recorded for this listing.
No published script needs it yet.
More from this author
lotus
by hunnycThe lotus pools: how many lotuses each holds and when the next one grows.
"requires": { "lotus": "^1.0" }local lotus = require("lib/lotus")order_watch
by hunnycWatches the orders our scripts send and reports three invariants as a red line with the module names (#1184):
"requires": { "order_watch": "^1.0" }local order_watch = require("lib/order_watch")order_class
by hunnycThe class an order carries into `hk_order` (#1103): reaction, chain, window, background, owner.
"requires": { "order_class": "^1.0" }local order_class = require("lib/order_class")