2017-09-16 02:50:32 +01:00
|
|
|
require ("global")
|
|
|
|
require ("magic")
|
|
|
|
require ("weaponskill")
|
|
|
|
|
|
|
|
allyGlobal =
|
|
|
|
{
|
2017-10-05 18:37:51 +01:00
|
|
|
}
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onSpawn(ally, target)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onEngage(ally, target)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onAttack(ally, target, damage)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onDamageTaken(ally, attacker, damage)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas)
|
2017-10-05 18:37:51 +01:00
|
|
|
allyGlobal.HelpPlayers(ally, contentGroupCharas)
|
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onDeath(ally, player, lastAttacker)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.onDespawn(ally)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.HelpPlayers(ally, contentGroupCharas, pickRandomTarget)
|
|
|
|
if contentGroupCharas then
|
|
|
|
for _, chara in pairs(contentGroupCharas) do
|
|
|
|
if chara then
|
|
|
|
-- probably a player, or another ally
|
|
|
|
-- todo: queue support actions, heal, try pull hate off player etc
|
|
|
|
if chara.IsPlayer() then
|
|
|
|
-- do stuff
|
|
|
|
if not ally.IsEngaged() then
|
|
|
|
if chara.IsEngaged() then
|
2017-10-05 18:37:51 +01:00
|
|
|
allyGlobal.EngageTarget(ally, chara.target, nil)
|
|
|
|
end
|
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
elseif chara.IsMonster() and chara.IsEngaged() then
|
2017-10-05 18:37:51 +01:00
|
|
|
if not ally.IsEngaged() then
|
|
|
|
allyGlobal.EngageTarget(ally, chara.target, nil)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.HealPlayer(ally, player)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.SupportAction(ally, player)
|
|
|
|
|
2017-10-05 18:37:51 +01:00
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
|
|
|
|
function allyGlobal.EngageTarget(ally, target, contentGroupCharas)
|
|
|
|
if contentGroupCharas then
|
|
|
|
for _, chara in pairs(contentGroupCharas) do
|
|
|
|
if chara.IsMonster() then
|
|
|
|
if chara.allegiance ~= ally.allegiance then
|
2017-10-05 18:37:51 +01:00
|
|
|
ally.Engage(chara)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2017-09-16 02:50:32 +01:00
|
|
|
elseif target then
|
2017-10-05 18:37:51 +01:00
|
|
|
ally.Engage(target)
|
|
|
|
end
|
|
|
|
end
|