Init LazerJammer
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
local AH64CodeTable = {
|
||||
1688,
|
||||
1788,
|
||||
1782,
|
||||
1777,
|
||||
1732,
|
||||
1621,
|
||||
1111,
|
||||
2111,
|
||||
4121,
|
||||
4311,
|
||||
4511,
|
||||
4711,
|
||||
5111,
|
||||
5311,
|
||||
5511,
|
||||
5711,
|
||||
}
|
||||
|
||||
-- testing code
|
||||
local function startJammer(fromUnitName,targetTable)
|
||||
if not fromUnitName then return end
|
||||
if not targetTable then return end
|
||||
|
||||
local jammerUnit = Unit.getByName(fromUnitName)
|
||||
local ray_InfraRed = Spot.createInfraRed(jammerUnit, {x = 0, y = 1.5, z = 0}, targetTable)
|
||||
local ray_lazer = Spot.createLaser(jammerUnit, {x = 0, y = 1.5, z = 0}, targetTable, 1688)
|
||||
|
||||
if ray_lazer:getCategory() == Spot.Category.LASER and ray_InfraRed:getCategory() == Spot.Category.INFRA_RED then
|
||||
Utils.Debug('LazerJammer active')
|
||||
end
|
||||
end
|
||||
|
||||
local targetPoint = trigger.misc.getZone('JammerZone').point
|
||||
local target = {x=targetPoint.x,y=land.getHeight({x=targetPoint.x,y=targetPoint.z}),z=targetPoint.z}
|
||||
|
||||
timer.scheduleFunction(function (vars)
|
||||
local fromUnitName = vars.unitName
|
||||
local target = vars.target
|
||||
|
||||
startJammer(fromUnitName,target)
|
||||
end,{unitName = 'LazerJammer-1-1', target = target},timer.getTime()+10)
|
||||
Reference in New Issue
Block a user