mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-08 21:44:35 +02:00
moved ally engage stuff to ContentArea onUpdate
This commit is contained in:
parent
520ae7a119
commit
27200b8df5
15 changed files with 115 additions and 98 deletions
|
@ -1,4 +1,5 @@
|
|||
require ("global")
|
||||
require ("ally")
|
||||
require ("modifiers")
|
||||
|
||||
function onCreate(starterPlayer, contentArea, director)
|
||||
|
@ -33,6 +34,42 @@ function onCreate(starterPlayer, contentArea, director)
|
|||
|
||||
end
|
||||
|
||||
function onUpdate(area, tick)
|
||||
local players = area:GetPlayers()
|
||||
local mobs = area:GetMonsters()
|
||||
local allies = area:GetAllies()
|
||||
local resumeChecks = true
|
||||
for player in players do
|
||||
if player then
|
||||
local exitLoop = false
|
||||
for ally in allies do
|
||||
if ally then
|
||||
if not ally:IsEngaged() then
|
||||
if player:IsEngaged() then
|
||||
ally.neutral = false
|
||||
ally.isAutoAttackEnabled = true
|
||||
ally:SetMod(modifiersGlobal.Speed, 8)
|
||||
allyGlobal.EngageTarget(ally, player.target)
|
||||
exitLoop = true
|
||||
break
|
||||
-- todo: support scripted paths
|
||||
elseif ally:GetSpeed() > 0 then
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if exitLoop then
|
||||
resumeChecks = false
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not resumeChecks then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
function onDestroy()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue