local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local ScenarioFramework = import('/lua/ScenarioFramework.lua')
function OnPopulate()
ScenarioUtils.InitializeArmies()
end
function OnStart(self)
ForkThread(HealthAdjustor)
end
local DAMAGEAREAName
local location
local px, py, pz
local rect
local units
local health
local preAdjHealth
function HealthAdjustor(self)
while true do
for k = 1, 1 do
DAMAGEAREAName = 'DAMAGEAREA_' .. k
location = ScenarioUtils.MarkerToPosition(DAMAGEAREAName)
px, py, pz = unpack(location)
rect = Rect(px-25, pz-25, px+25, pz+25)
units = GetUnitsInRect(rect)
end
for _, instigator in units do
if VDist3(instigator:GetPosition(), location) <= 25 then
health = instigator:GetHealth()
instigator:AdjustHealth(instigator, -30)
end
end
WaitSeconds(10)
end
end
Statistics: Posted by Ghoustaq — 20 Mar 2018, 18:19
Statistics: Posted by Sprouto — 05 Mar 2018, 14:44