Added party to Gridania opening, fixed BattleActionx18 and made it so x18 is used for packets with more than 10 targets. Changed how death works. Added respawn time and roam modifiers. Added TryAggro functions and moved aggroing out of roaming and helpplayers. Fixed high cpu usage in zone's OnUpdate function. Fixed work value in player update

This commit is contained in:
yogurt 2017-12-08 00:58:39 -06:00
parent 520ae7a119
commit 1275c8b5da
61 changed files with 1226 additions and 223 deletions

View file

@ -10,12 +10,12 @@ function onCreate(starterPlayer, contentArea, director)
--mob3 = contentArea:SpawnActor(2201407, "mob3", 375.125, 4.4, -703.591, -1.54);
yda = GetWorldManager().SpawnBattleNpcById(6, contentArea);
papalymo = GetWorldManager().SpawnBattleNpcById(7, contentArea);
yda:ChangeState(2);
mob1 = GetWorldManager().SpawnBattleNpcById(3, contentArea);
mob2 = GetWorldManager().SpawnBattleNpcById(4, contentArea);
--yda:ChangeState(2);
mob1 = GetWorldManager().SpawnBattleNpcById(3, contentArea);
mob2 = GetWorldManager().SpawnBattleNpcById(4, contentArea);
mob3 = GetWorldManager().SpawnBattleNpcById(5, contentArea);
starterPlayer.currentParty.members:Add(yda.actorId);
starterPlayer.currentParty.members:Add(papalymo.actorId);
starterPlayer.currentParty:AddMember(papalymo.actorId);
starterPlayer.currentParty:AddMember(yda.actorId);
starterPlayer:SetMod(modifiersGlobal.MinimumHpLock, 1);
@ -35,6 +35,47 @@ end
function onDestroy()
end
--Iterating over allies using the for...in syntax throws an except and lags the server.
--This function probably isn't needed either way, it does the smae thing as TryAggro in ally
function onUpdate(tick, area)
if area then
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
if allies then
for i = 0, #allies - 1 do
if allies[i] then
if not allies[i]:IsEngaged() then
if player:IsEngaged() and player.target then
allies[i].neutral = false
allies[i].isAutoAttackEnabled = true
allies[i]:SetMod(modifiersGlobal.Speed, 8)
allyGlobal.EngageTarget(allies[i], player.target)
exitLoop = true
break
-- todo: support scripted paths
elseif allies[i]:GetSpeed() > 0 then
end
end
end
end
end
if exitLoop then
resumeChecks = false
break
end
end
end
if not resumeChecks then
return
end
end
end