myspace / Data /CombatTask.lua
sirnii's picture
Upload 1816 files
b6a38d7 verified
raw
history blame
22.4 kB
-- ========== GENERATED BY CombatTask Editor DO NOT EDIT MANUALLY! ==========
PlaceObj('CombatTask', {
competition = true,
description = T(845938577236, --[[CombatTask DamageCompetition description]] "<Nick> should deal more damage than <Nick(otherUnitId)>"),
group = "Competition",
holdUntilEnd = true,
id = "DamageCompetition",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "DamageDone",
Handler = function (self, attacker, target, dmg, hit_descr)
if IsMerc(attacker) and IsKindOf(target, "Unit") and target:IsOnEnemySide(attacker) then
local task = FindActiveCombatTask(self.id)
if dmg > 0 and task then
if task.unitId == attacker.session_id then
task:Update(dmg)
elseif task.otherUnitId == attacker.session_id then
task:Update(0, dmg)
end
end
end
end,
}),
},
name = T(224628040381, --[[CombatTask DamageCompetition name]] "Damage Competition"),
requiredProgress = 0,
})
PlaceObj('CombatTask', {
competition = true,
description = T(841992932482, --[[CombatTask KillCompetition description]] "<Nick> should make more kills than <Nick(otherUnitId)>"),
group = "Competition",
holdUntilEnd = true,
id = "KillCompetition",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "Attack",
Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
if IsMerc(attacker) then
local kills = EnemiesKilled(attacker, results)
local task = FindActiveCombatTask(self.id)
if kills > 0 and task then
if task.unitId == attacker.session_id then
task:Update(kills)
elseif task.otherUnitId == attacker.session_id then
task:Update(0, kills)
end
end
end
end,
}),
},
name = T(769258541854, --[[CombatTask KillCompetition name]] "Kill Competition"),
requiredProgress = 0,
})
PlaceObj('CombatTask', {
description = T(333205819142, --[[CombatTask AutomaticKills description]] "The team must kill <requiredProgress> opponents with assault rifles or SMGs"),
group = "Default",
id = "AutomaticKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOfClasses(results.weapon, "AssaultRifle", "SubmachineGun") then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(226845938375, --[[CombatTask AutomaticKills name]] "Automatic Kills"),
requiredProgress = 3,
selectionConditions = {
PlaceObj('CheckOR', {
Conditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "AssaultRifle",
}),
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "SubmachineGun",
}),
},
}),
},
statGainRolls = {
"Marksmanship",
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(335291031338, --[[CombatTask DamageDealer description]] "<Nick> should inflict <requiredProgress> damage to the enemies"),
favouredConditions = {
PlaceObj('UnitHasPerk', {
HasPerk = "Psycho",
TargetUnit = "current unit",
}),
},
group = "Default",
id = "DamageDealer",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "DamageDone",
Handler = function (self, attacker, target, dmg, hit_descr)
if IsMerc(attacker) and IsKindOf(target, "Unit") and target:IsOnEnemySide(attacker) then
local task = attacker:FirstCombatTaskById(self.id)
if task then
task:Update(dmg)
end
end
end,
}),
},
name = T(823186688823, --[[CombatTask DamageDealer name]] "Destruction Distributor"),
requiredProgress = 150,
statGainRolls = {
"Strength",
},
})
PlaceObj('CombatTask', {
description = T(171286303887, --[[CombatTask ElusiveKiller description]] "<Nick> should make a kill and never suffer damage in the conflict"),
group = "Default",
holdUntilEnd = true,
id = "ElusiveKiller",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "Attack",
Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
if IsMerc(attacker) and IsEnemyKill(attacker, results) then
local task = attacker:FirstCombatTaskById(self.id)
if task then task:Update(1) end
end
end,
}),
PlaceObj('MsgReaction', {
Event = "DamageDone",
Handler = function (self, attacker, target, dmg, hit_descr)
if IsMerc(target) then
local task = target:FirstCombatTaskById(self.id)
if task then task:Fail() end
end
end,
}),
},
name = T(996733824590, --[[CombatTask ElusiveKiller name]] "Elusive Killer"),
statGainRolls = {
"Agility",
},
})
PlaceObj('CombatTask', {
description = T(329933122394, --[[CombatTask ExplosiveKills description]] "The team should kill <requiredProgress> opponents in explosions"),
favouredConditions = {
PlaceObj('UnitHasPerk', {
HasPerk = "Throwing",
TargetUnit = "current unit",
}),
},
group = "Default",
id = "ExplosiveKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "UnitDieStart",
Handler = function (self, unit, attacker)
if IsMerc(attacker) then
local task = FindActiveCombatTask(self.id)
if task then
if unit.on_die_hit_descr and unit.on_die_hit_descr.explosion and unit:IsOnEnemySide(attacker) and not unit.immortal then
task:Update(1)
end
end
end
end,
}),
},
name = T(327792067279, --[[CombatTask ExplosiveKills name]] "Explosive Kills"),
requiredProgress = 2,
selectionConditions = {
PlaceObj('CheckOR', {
Conditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "Grenade",
}),
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "HeavyWeapon",
}),
},
}),
},
statGainRolls = {
"Explosives",
},
})
PlaceObj('CombatTask', {
description = T(927408184696, --[[CombatTask GroinKiller description]] "The team must kill <requiredProgress> enemies with attacks in the groin."),
group = "Default",
id = "GroinKiller",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and target and target.species == "Human" and attack_args.target_spot_group == "Groin" then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(1) end
end
end
end,
}),
},
name = T(639828499284, --[[CombatTask GroinKiller name]] "Make them Suffer"),
requiredProgress = 3,
statGainRolls = {
"Dexterity",
"Marksmanship",
},
})
PlaceObj('CombatTask', {
description = T(443919022423, --[[CombatTask HandgunKills description]] "The team must kill <requiredProgress> opponents with a handgun."),
group = "Default",
id = "HandgunKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOfClasses(results.weapon, "Pistol", "Revolver") then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(542106263178, --[[CombatTask HandgunKills name]] "Handgun Kills"),
requiredProgress = 3,
selectionConditions = {
PlaceObj('CheckOR', {
Conditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "Pistol",
}),
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "Revolver",
}),
},
}),
},
statGainRolls = {
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(205022452436, --[[CombatTask Headhunter description]] "The team must make <requiredProgress> headshots."),
group = "Default",
id = "Headhunter",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) then
local headshots = 0
for _, shot in ipairs(results.shots) do
for _, hit in ipairs(shot.hits) do
if hit.spot_group and hit.spot_group == "Head" then
headshots = headshots + 1
end
end
end
if headshots > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(headshots) end
end
end
end,
}),
},
name = T(932478123102, --[[CombatTask Headhunter name]] "Headhunter"),
requiredProgress = 5,
statGainRolls = {
"Marksmanship",
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(229072979907, --[[CombatTask LimbShots description]] "The team must make <requiredProgress> limb shots"),
group = "Default",
id = "LimbShots",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) then
local limbShots = 0
for _, shot in ipairs(results.shots) do
for _, hit in ipairs(shot.hits) do
if hit.spot_group and (hit.spot_group == "Legs" or hit.spot_group == "Arms") then
limbShots = limbShots + 1
end
end
end
if limbShots > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(limbShots) end
end
end
end,
}),
},
name = T(205504297105, --[[CombatTask LimbShots name]] "Mutilator"),
requiredProgress = 5,
statGainRolls = {
"Marksmanship",
},
})
PlaceObj('CombatTask', {
description = T(278405651391, --[[CombatTask MachineGunKills description]] "The team must kill <requiredProgress> opponents with a machine gun."),
group = "Default",
id = "MachineGunKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOf(results.weapon, "MachineGun") then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(349362366984, --[[CombatTask MachineGunKills name]] "Machine Gun Kills"),
requiredProgress = 3,
selectionConditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "MachineGun",
}),
},
statGainRolls = {
"Strength",
},
})
PlaceObj('CombatTask', {
description = T(721165610277, --[[CombatTask MeleeKills description]] "The team must kill <requiredProgress> opponents with melee attacks."),
group = "Default",
id = "MeleeKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and results.melee_attack then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(557045464354, --[[CombatTask MeleeKills name]] "Melee Kills"),
requiredProgress = 3,
selectionConditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "MeleeWeapon",
}),
},
statGainRolls = {
"Agility",
"Strength",
},
})
PlaceObj('CombatTask', {
description = T(956158880979, --[[CombatTask PointBlank description]] "<Nick> must kill <requiredProgress> enemies at point-blank range."),
group = "Default",
id = "PointBlank",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if not IsMerc(attacker) then
return
end
local kills = 0
local weapon = attack_args and attack_args.weapon
for _, unit in ipairs(results.killed_units) do
if attacker:IsOnEnemySide(unit) then
if attacker:IsPointBlankRange(unit) then
kills = kills + 1
end
end
end
if kills > 0 then
local task = attacker:FirstCombatTaskById(self.id)
if task then
task:Update(kills)
end
end
end,
}),
},
name = T(282408867052, --[[CombatTask PointBlank name]] "Point-Blank"),
requiredProgress = 2,
statGainRolls = {
"Health",
"Strength",
},
})
PlaceObj('CombatTask', {
description = T(993385738600, --[[CombatTask PrecisionHeadshots description]] "<Nick> should hit <requiredProgress> enemies with headshots aimed 3+ times"),
group = "Default",
id = "PrecisionHeadshots",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOf(target, "Unit") and target:IsOnEnemySide(attacker) then
if attack_args.target_spot_group == "Head" and not results.miss and IsFullyAimedAttack(attack_args) then
local task = attacker:FirstCombatTaskById(self.id)
if task then task:Update(1) end
end
end
end,
}),
},
name = T(174050258256, --[[CombatTask PrecisionHeadshots name]] "Put this apple..."),
requiredProgress = 3,
statGainRolls = {
"Dexterity",
"Marksmanship",
},
})
PlaceObj('CombatTask', {
description = T(966001057856, --[[CombatTask SameTurnKills description]] "<Nick> should kill <requiredProgress> opponents in the same turn."),
group = "Default",
id = "SameTurnKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "Attack",
Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
if IsMerc(attacker) then
local task = attacker:FirstCombatTaskById(self.id)
if not task then return end
if not g_Combat and not combat_starting then
-- reset progress if combat doesn't start
task:Update(-task.currentProgress)
else
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
task:Update(kills)
end
end
end
end,
}),
PlaceObj('MsgReaction', {
Event = "TurnEnded",
Handler = function (self, teamEnded, combatEnd)
if g_Teams[teamEnded].player_team and not combatEnd then
local task = FindActiveCombatTask(self.id)
if task then task:Update(-task.currentProgress) end
end
end,
}),
},
name = T(310758257957, --[[CombatTask SameTurnKills name]] "Killing Spree"),
requiredProgress = 2,
statGainRolls = {
"Agility",
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(134640217789, --[[CombatTask ShotgunKills description]] "The team must kill <requiredProgress> opponents with a shotgun."),
group = "Default",
id = "ShotgunKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOf(results.weapon, "Shotgun") then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(313568472782, --[[CombatTask ShotgunKills name]] "Shotgun Kills"),
requiredProgress = 3,
selectionConditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "Shotgun",
}),
},
statGainRolls = {
"Strength",
"Health",
},
})
PlaceObj('CombatTask', {
description = T(684260672157, --[[CombatTask SniperKills description]] "The team must kill <requiredProgress> opponents with a sniper rifle."),
group = "Default",
id = "SniperKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOf(results.weapon, "SniperRifle") then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(755273724300, --[[CombatTask SniperKills name]] "Sniper Rifle Kills"),
requiredProgress = 3,
selectionConditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "SniperRifle",
}),
},
statGainRolls = {
"Marksmanship",
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(154890444164, --[[CombatTask SpecialKills description]] "The team must make <requiredProgress> kills with special attacks."),
group = "Default",
id = "SpecialKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) then
if not IsBasicAttack(action, attack_args) then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end
end,
}),
},
name = T(215882327453, --[[CombatTask SpecialKills name]] "Specialist"),
requiredProgress = 3,
statGainRolls = {
"Wisdom",
"Leadership",
},
})
PlaceObj('CombatTask', {
description = T(377620512670, --[[CombatTask StealthyApproach description]] "<Nick> should start the first combat in Stealth and the team should kill <requiredProgress> opponents before the end of the first turn."),
favouredConditions = {
PlaceObj('UnitHasPerk', {
HasPerk = "Stealthy",
TargetUnit = "current unit",
}),
},
group = "Default",
id = "StealthyApproach",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "Attack",
Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
if IsMerc(attacker) then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
PlaceObj('MsgReaction', {
Event = "TurnStart",
Handler = function (self, team)
if g_Teams[team].player_team and g_Combat.current_turn >= 2 then
local task = FindActiveCombatTask(self.id)
if task then task:Fail() end
end
end,
}),
PlaceObj('MsgReaction', {
Event = "CombatStart",
Handler = function (self, dynamic_data)
local task = FindActiveCombatTask(self.id)
if task then
local fail = false
if g_Combat.starting_unit and g_Combat.starting_unit.session_id ~= task.unitId then
task:Fail()
return
end
local unit = g_Units[task.unitId]
if not unit:HasStatusEffect("Hidden") then task:Fail() end
end
end,
}),
},
name = T(965484524496, --[[CombatTask StealthyApproach name]] "Stealthy Approach"),
requiredProgress = 2,
selectionConditions = {
PlaceObj('UnitHasPerk', {
HasPerk = "Stealthy",
TargetUnit = "current unit",
}),
},
statGainRolls = {
"Agility",
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(170953530026, --[[CombatTask TakeLessDamage description]] "The team should take less than <requiredProgress> damage in the conflict."),
group = "Default",
id = "TakeLessDamage",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "DamageDone",
Handler = function (self, attacker, target, dmg, hit_descr)
if IsMerc(target) then
local task = FindActiveCombatTask(self.id)
if task then
task:Update(dmg)
end
end
end,
}),
},
name = T(974373173731, --[[CombatTask TakeLessDamage name]] "Careful Combatant"),
requiredProgress = 50,
reverseProgress = true,
statGainRolls = {
"Medical",
"Leadership",
},
})
PlaceObj('CombatTask', {
description = T(500135776127, --[[CombatTask TankWounds description]] "No merc other than <Nick> should take wounds from damage this combat"),
group = "Default",
hideProgress = true,
holdUntilEnd = true,
id = "TankWounds",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "StatusEffectAdded",
Handler = function (self, obj, id, stacks)
if IsMerc(obj) and id == "Wounded" then
local task = FindActiveCombatTask(self.id)
if task and task.unitId ~= obj.session_id then
task:Fail()
end
end
end,
}),
},
name = T(437732136157, --[[CombatTask TankWounds name]] "Ardent Defender"),
requiredProgress = 0,
statGainRolls = {
"Health",
},
})
PlaceObj('CombatTask', {
description = T(567465673654, --[[CombatTask ThrowKills description]] "<Nick> must kill <requiredProgress> opponent with a knife throw."),
group = "Default",
id = "ThrowKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOf(results.weapon, "MeleeWeapon") and action.id == "KnifeThrow" then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = attacker:FirstCombatTaskById(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(119727567879, --[[CombatTask ThrowKills name]] "Knife Juggler"),
selectionConditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "ThrowableKnife",
}),
},
statGainRolls = {
"Dexterity",
},
})
PlaceObj('CombatTask', {
description = T(877038884070, --[[CombatTask UnarmedKills description]] "<Nick> must kill <requiredProgress> opponent with unarmed attacks."),
group = "Default",
id = "UnarmedKills",
msg_reactions = {
PlaceObj('MsgReaction', {
Event = "OnAttack",
Handler = function (self, attacker, action, target, results, attack_args)
if IsMerc(attacker) and IsKindOf(results.weapon, "Unarmed") then
local kills = EnemiesKilled(attacker, results)
if kills > 0 then
local task = FindActiveCombatTask(self.id)
if task then task:Update(kills) end
end
end
end,
}),
},
name = T(315709994208, --[[CombatTask UnarmedKills name]] "Brutalizer"),
selectionConditions = {
PlaceObj('UnitHasWeaponKind', {
TargetUnit = "current unit",
weaponKind = "Unarmed",
}),
PlaceObj('UnitHasStat', {
Amount = 75,
Stat = "Strength",
TargetUnit = "current unit",
}),
},
statGainRolls = {
"Strength",
},
})