User Tools

Site Tools



kdf_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
kdf_api [2026/09/29 23:57] – kitanoikdf_api [2026/09/29 23:59] (current) – kitanoi
Line 1012: Line 1012:
  ]],  ]],
 </code> </code>
 +
 +Example use for Everkeep trial:
 +
 +<code>
 + registerOnMapEffect = [[
 + function(a1,a2,a3)
 + -- 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, actionID, castPosX, castPosY, castPosZ, heading, mainTargetID, targets)
 + if (actionID == 37748 or actionID == 37749 or actionID == 37750) then
 + KitanoiFuncs.FollowTrust()
 + KitanoiSettings.avoidingtime = Now() + 3000
 + end
 + end
 + ]],
 + registerOnEntityChannel = [[
 + function(entityID, channelID, targetID, channelTimeMax)
 + -- 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's facing. The platform's map effect (17 NE, 18 SE, 19 SW, 20 NW),
 + -- stored by "Zoraal Ja - Forged Track Pattern", decides whether the lateral
 + -- 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), math.cos(h)
 + local rx, rz = math.cos(h), -math.sin(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():addTimedRect(13300, x, p.y, z, 20, 5, h)
 + if (KitanoiFuncs.CurrentAOEs[i]==nil) then
 + KitanoiFuncs.ConsoleLog("Adding correct AOE position")
 + local poly = KitanoiFuncs.SquarePolygon({x=x, y=p.y, z=z},5,20,h,0)
 + KitanoiSettings.avoidingtime = Now() + 16000
 + KitanoiFuncs.CurrentAOEs[entityID] = {
 + type = "poly",
 + 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's diagonal. Main-platform tiles are skipped.
 + 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():addTimedRect(7100, x, p.y, z, 5, 5, h)
 + end
 + end
 + end
 + ]],
 +</code>
 +`KitanoiFuncs.jkalsk` here works as `data` does in TensorReactions. A self clearing table for storing data.
  
 --------------------------------------------------------------- ---------------------------------------------------------------
kdf_api.txt · Last modified: 2026/09/29 23:59 by kitanoi