broken attempt at opening quest director combat

This commit is contained in:
Tahir Akhlaq 2017-10-05 18:37:51 +01:00
parent bab81a809c
commit a0c4d80c5e
3 changed files with 45 additions and 42 deletions

View File

@ -4,35 +4,35 @@ require ("weaponskill")
allyGlobal = allyGlobal =
{ {
}; }
function allyGlobal.onSpawn(ally, target) function allyGlobal.onSpawn(ally, target)
end; end
function allyGlobal.onEngage(ally, target) function allyGlobal.onEngage(ally, target)
end; end
function allyGlobal.onAttack(ally, target, damage) function allyGlobal.onAttack(ally, target, damage)
end; end
function allyGlobal.onDamageTaken(ally, attacker, damage) function allyGlobal.onDamageTaken(ally, attacker, damage)
end; end
function allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas) function allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas)
allyGlobal.HelpPlayers(ally, contentGroupCharas); allyGlobal.HelpPlayers(ally, contentGroupCharas)
end; end
function allyGlobal.onDeath(ally, player, lastAttacker) function allyGlobal.onDeath(ally, player, lastAttacker)
end; end
function allyGlobal.onDespawn(ally) function allyGlobal.onDespawn(ally)
end; end
function allyGlobal.HelpPlayers(ally, contentGroupCharas, pickRandomTarget) function allyGlobal.HelpPlayers(ally, contentGroupCharas, pickRandomTarget)
if contentGroupCharas then if contentGroupCharas then
@ -44,35 +44,37 @@ function allyGlobal.HelpPlayers(ally, contentGroupCharas, pickRandomTarget)
-- do stuff -- do stuff
if not ally.IsEngaged() then if not ally.IsEngaged() then
if chara.IsEngaged() then if chara.IsEngaged() then
allyGlobal.EngageTarget(ally, target, nil); allyGlobal.EngageTarget(ally, chara.target, nil)
end; end
end; end
elseif chara.IsMonster() and chara.IsEngaged() then elseif chara.IsMonster() and chara.IsEngaged() then
if not ally.IsEngaged() then
end; allyGlobal.EngageTarget(ally, chara.target, nil)
end; end
end; end
end; end
end; end
end
end
function allyGlobal.HealPlayer(ally, player) function allyGlobal.HealPlayer(ally, player)
end; end
function allyGlobal.SupportAction(ally, player) function allyGlobal.SupportAction(ally, player)
end; end
function allyGlobal.EngageTarget(ally, target, contentGroupCharas) function allyGlobal.EngageTarget(ally, target, contentGroupCharas)
if contentGroupCharas then if contentGroupCharas then
for _, chara in pairs(contentGroupCharas) do for _, chara in pairs(contentGroupCharas) do
if chara.IsMonster() then if chara.IsMonster() then
if chara.allegiance ~= ally.allegiance then if chara.allegiance ~= ally.allegiance then
ally.Engage(chara); ally.Engage(chara)
end; end
end; end
end; end
elseif target then elseif target then
ally.Engage(target); ally.Engage(target)
end; end
end; end

View File

@ -14,29 +14,30 @@ function onCreateContentArea(players, director, contentArea, contentGroup)
local worldManager = GetWorldManager(); local worldManager = GetWorldManager();
yshtola = GetWorldManager():SpawnBattleNpcById(6, contentArea); yshtola = GetWorldManager().SpawnBattleNpcById(6, contentArea);
stahlmann = GetWorldManager():SpawnBattleNpcById(7, contentArea); stahlmann = GetWorldManager().SpawnBattleNpcById(7, contentArea);
mob1 = GetWorldManager():SpawnBattleNpcById(3, contentArea); mob1 = GetWorldManager().SpawnBattleNpcById(3, contentArea);
mob2 = GetWorldManager():SpawnBattleNpcById(4, contentArea); mob2 = GetWorldManager().SpawnBattleNpcById(4, contentArea);
mob3 = GetWorldManager():SpawnBattleNpcById(5, contentArea); mob3 = GetWorldManager().SpawnBattleNpcById(5, contentArea);
local added = false; local added = false;
for i = 0, players.Count do for i = 0, players.Count do
local player = players[i]; local player = players[i];
print("asses "..players.Count)
if player.currentParty and not added then if player.currentParty and not added then
player.currentParty.members.Add(6); print("shitness")
player.currentParty.members:Add(yshtola.actorId);
print("cunt") print("cunt")
player.currentParty.members.Add(7); player.currentParty.members:Add(stahlmann.actorId);
print("dickbag") print("dickbag")
added = true; added = true;
end; end;
-- dont let player die -- dont let player die
player.SetMod(modifiersGlobal.MinimumHpLock, 1); player:SetMod(modifiersGlobal.MinimumHpLock, 1);
contentGroup:AddMember(player)
print("shittttt") print("shittttt")
contentGroup:AddMember(player); break
player:EndEvent();
i = i + 1;
end; end;
print("shit") print("shit")
contentGroup:AddMember(director); contentGroup:AddMember(director);

View File

@ -3,9 +3,9 @@ require ("global")
require ("ally") require ("ally")
function onSpawn(ally) function onSpawn(ally)
ally.isAutoAttackEnabled = false; ally.isAutoAttackEnabled = false
end; end
function onCombatTick(ally, target, tick, contentGroupCharas) function onCombatTick(ally, target, tick, contentGroupCharas)
allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas); allyGlobal.onCombatTick(ally, target, tick, contentGroupCharas)
end; end