Files
Dota-Zombie-Invasion/scripts/vscripts/black_shop_teleport.lua
T
2026-05-29 15:11:31 +07:00

27 lines
1.4 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
local ____exports = {}
--- Телепорт с чёрного рынка: в Hammer ставь info_target / path_corner с этими targetname.
____exports.BLACK_SHOP_TELEPORT_TARGETNAMES = {grove = "point_blackshop_tp_grove", two_sisters = "point_blackshop_tp_two_sisters", village_waterfall = "point_blackshop_tp_village_waterfall", ancient_ridge = "point_blackshop_tp_ancient_ridge"}
--- Если энтити с именем ещё нет на карте — подставляются эти координаты (подправь под свою карту).
local BLACK_SHOP_TELEPORT_FALLBACK = {
grove = Vector(-4200, 3600, 384),
two_sisters = Vector(-1800, 4100, 256),
village_waterfall = Vector(1400, -2800, 128),
ancient_ridge = Vector(5200, -1600, 512)
}
function ____exports.isBlackShopTeleportDestination(self, dest)
return dest ~= nil and ____exports.BLACK_SHOP_TELEPORT_TARGETNAMES[dest] ~= nil
end
function ____exports.resolveBlackShopTeleportPosition(self, destination)
if not ____exports.isBlackShopTeleportDestination(nil, destination) then
return nil
end
local targetname = ____exports.BLACK_SHOP_TELEPORT_TARGETNAMES[destination]
local marker = Entities:FindByName(nil, targetname)
if marker then
return marker:GetAbsOrigin()
end
return BLACK_SHOP_TELEPORT_FALLBACK[destination]
end
return ____exports