This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| kdf_api [2026/09/29 23:57] – kitanoi | kdf_api [2026/09/29 23:59] (current) – kitanoi | ||
|---|---|---|---|
| Line 1012: | Line 1012: | ||
| ]], | ]], | ||
| </ | </ | ||
| + | |||
| + | Example use for Everkeep trial: | ||
| + | |||
| + | < | ||
| + | registerOnMapEffect = [[ | ||
| + | function(a1, | ||
| + | -- Map effects 17-20 = Forged Track platform patterns (17 NE, 18 SE, 19 SW, 20 NW). | ||
| + | -- a2 == 1: crossed (lateral offset mirrored), a2 == 16: straight, a2 == 4: cleared. | ||
| + | if (a1 >= 17 and a1 <= 20) then | ||
| + | if TensorCore.mGetPlayer().localmapid == 1200 then | ||
| + | KitanoiFuncs.jkalsk.zj_forged = KitanoiFuncs.jkalsk.zj_forged or {} | ||
| + | if a2 == 1 then | ||
| + | KitanoiFuncs.jkalsk.zj_forged[a1] = -1 | ||
| + | elseif a2 == 16 then | ||
| + | KitanoiFuncs.jkalsk.zj_forged[a1] = 1 | ||
| + | elseif a2 == 4 then | ||
| + | KitanoiFuncs.jkalsk.zj_forged[a1] = nil | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | ]], | ||
| + | registerOnEntityCast = [[ | ||
| + | function(entityID, | ||
| + | if (actionID == 37748 or actionID == 37749 or actionID == 37750) then | ||
| + | KitanoiFuncs.FollowTrust() | ||
| + | KitanoiSettings.avoidingtime = Now() + 3000 | ||
| + | end | ||
| + | end | ||
| + | ]], | ||
| + | registerOnEntityChannel = [[ | ||
| + | function(entityID, | ||
| + | -- Side-platform sword (Forged Track 37729) is a fake line; the real hit (37730) | ||
| + | -- comes ~13.3s later from a hidden sword on the main platform, 30y further along | ||
| + | -- the sword' | ||
| + | -- stored by " | ||
| + | -- offset is mirrored (-1, crossed pattern) or kept (1, straight pattern). | ||
| + | if (channelID == 37748) then | ||
| + | KitanoiFuncs.FollowTrust() | ||
| + | KitanoiSettings.avoidingtime = Now() + 2000 | ||
| + | end | ||
| + | local ent = TensorCore.mGetEntity(entityID) | ||
| + | if ent then | ||
| + | local p = ent.pos | ||
| + | local dx, dz = p.x - 100, p.z - 100 | ||
| + | local idx | ||
| + | if dx > 0 then | ||
| + | idx = dz < 0 and 17 or 18 | ||
| + | else | ||
| + | idx = dz > 0 and 19 or 20 | ||
| + | end | ||
| + | local s = KitanoiFuncs.jkalsk.zj_forged and KitanoiFuncs.jkalsk.zj_forged[idx] | ||
| + | if s then | ||
| + | local h = p.h | ||
| + | local fx, fz = math.sin(h), | ||
| + | local rx, rz = math.cos(h), | ||
| + | local fwd = dx * fx + dz * fz + 30 | ||
| + | local lat = (dx * rx + dz * rz) * s | ||
| + | local x = 100 + fwd * fx + lat * rx | ||
| + | local z = 100 + fwd * fz + lat * rz | ||
| + | TensorCore.getMoogleDrawer(): | ||
| + | if (KitanoiFuncs.CurrentAOEs[i]==nil) then | ||
| + | KitanoiFuncs.ConsoleLog(" | ||
| + | local poly = KitanoiFuncs.SquarePolygon({x=x, | ||
| + | KitanoiSettings.avoidingtime = Now() + 16000 | ||
| + | KitanoiFuncs.CurrentAOEs[entityID] = { | ||
| + | type = " | ||
| + | entity = entityID, | ||
| + | target = 0, | ||
| + | aoeID = 0, | ||
| + | name = "", | ||
| + | poly = poly, | ||
| + | pos = {x=x, y=p.y, z=z}, | ||
| + | length = 20, | ||
| + | width = 5, | ||
| + | heading = h, | ||
| + | casttime = 13.3, | ||
| + | channelingtime = 0, | ||
| + | deletetime = KitanoiFuncs.Now() + 13300, | ||
| + | |||
| + | } | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | |||
| + | -- Side-platform tile (Chasm of Vollok 37720) is a preview; the real 5x5 hit (37722) | ||
| + | -- comes ~7.1s later from a Zoraal Ja clone (12882) 30y toward the arena center | ||
| + | -- along the platform' | ||
| + | if ent then | ||
| + | local p = ent.pos | ||
| + | local dx, dz = p.x - 100, p.z - 100 | ||
| + | if dx * dx + dz * dz > 400 then | ||
| + | local x = p.x + (dx > 0 and -21.2132 or 21.2132) | ||
| + | local z = p.z + (dz > 0 and -21.2132 or 21.2132) | ||
| + | local h = p.h | ||
| + | x = x - 2.5 * math.sin(h) | ||
| + | z = z - 2.5 * math.cos(h) | ||
| + | TensorCore.getMoogleDrawer(): | ||
| + | end | ||
| + | end | ||
| + | end | ||
| + | ]], | ||
| + | </ | ||
| + | `KitanoiFuncs.jkalsk` here works as `data` does in TensorReactions. A self clearing table for storing data. | ||
| --------------------------------------------------------------- | --------------------------------------------------------------- | ||