12 [
Attribute(
"60",
UIWidgets.EditBox,
"Reset timer to this time [s] when task is activated by player or by killing enemy",
"0 inf")]
18 [
Attribute(
"10",
UIWidgets.EditBox,
"Bonus xp for enemy killed when task is completed",
"0 inf")]
21 [
Attribute(
"5",
UIWidgets.EditBox,
"Bonus xp for enemy killed when task is failed",
"0 inf")]
38 SCR_ChimeraCharacter character;
39 CharacterControllerComponent charControl;
41 if (!assigneePlayerIDs)
48 bool isAnyAssignedPlayerInZone =
false;
49 foreach (
int playerId : assigneePlayerIDs)
51 character = SCR_ChimeraCharacter.Cast(playerManager.GetPlayerControlledEntity(playerId));
55 charControl = character.GetCharacterController();
56 if (!charControl || charControl.IsDead())
69 #ifdef ATTACK_TASK_DEBUG
74 isAnyAssignedPlayerInZone =
true;
86 #ifdef ATTACK_TASK_DEBUG
95 #ifdef ATTACK_TASK_DEBUG
104 #ifdef ATTACK_TASK_DEBUG
116 bool wasAssignedPlayerKilled;
122 wasAssignedPlayerKilled =
true;
124 #ifdef ATTACK_TASK_DEBUG
125 PrintFormat(
"Attack task, playerID:%1 was killed and removed from combat list", instigatorContextData.GetVictimPlayerID(), level:
LogLevel.DEBUG);
133 IEntity victimEntity = instigatorContextData.GetVictimEntity();
137 IEntity killerEntity = instigatorContextData.GetKillerEntity();
142 if (wasAssignedPlayerKilled)
146 #ifdef ATTACK_TASK_DEBUG
147 PrintFormat(
"Attack task, playerID:%1 was killed by enemy", instigatorContextData.GetVictimPlayerID(), level:
LogLevel.DEBUG);
159 if (!ownerFactionKeys || !ownerFactionKeys.Contains(killerFaction.GetFactionKey()))
167 int killerId = instigatorContextData.GetKillerPlayerID();
171 AIControlComponent aiControlComponent = AIControlComponent.Cast(killerEntity.
FindComponent(AIControlComponent));
172 if (!aiControlComponent)
175 AIAgent agent = aiControlComponent.GetAIAgent();
191 group = groupManager.GetPlayerGroup(killerId);
205 #ifdef ATTACK_TASK_DEBUG
206 Print(
"Attack task, somebody was killed in the zone, timer was reset",
LogLevel.DEBUG);
232 #ifdef ATTACK_TASK_DEBUG
233 Print(
"Attack task, playerId"+playerId+
" is registered to combat list",
LogLevel.DEBUG);
247 SCR_XPHandlerComponent xpHandler = SCR_XPHandlerComponent.Cast(
GetGame().
GetGameMode().FindComponent(SCR_XPHandlerComponent));
253 if (!assigneePlayerIDs)
270 int taskXp = xpHandler.GetXPRewardAmount(xpRewardType);
274 float bonusMultiplier = 1 + (bonusXp / taskXp);
276 foreach (
int playerID : assigneePlayerIDs)
280 xpHandler.AwardXP(playerID, xpRewardType, bonusMultiplier,
false);
282 #ifdef ATTACK_TASK_DEBUG
294 super.SetTaskState(state);
309 super.EOnInit(owner);
ArmaReforgerScripted GetGame()
ref array< int > m_aCombatPlayerList
ref array< int > m_aRewardPlayerList
array of playerIDs
bool m_bWasActivated
array of playerIDs
WorldTimestamp m_EvaluationTimestamp
override void SetTaskState(SCR_ETaskState state)
void ~SCR_AttackTaskEntity()
WorldTimestamp m_TaskActivatedTimestamp
SCR_AttackTaskEntityClass PERIODICAL_CHECK_INTERVAL
int m_iKilledAssignedPlayers
int m_iEnemyKillBonusXp_TaskFailed
int m_iEnemyKillBonusXp_TaskCompleted
SCR_BaseGameMode GetGameMode()
RplComponent m_RplComponent
SCR_ECharacterDeathStatusRelations
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void OnControllableDestroyed(IEntity entity, IEntity killerEntity, Instigator instigator, notnull SCR_InstigatorContextData instigatorContextData)
void RegisterPlayer(int iPlayerID, IEntity playerEntity)
array< int > GetTaskAssigneePlayerIDs()
void SCR_Task(IEntitySource src, IEntity parent)
array< string > GetOwnerFactionKeys()
bool IsTaskAssignedTo(SCR_TaskExecutor executor, out SCR_TaskExecutor match=null)
SCR_TaskSystem m_TaskSystem
proto external Managed FindComponent(typename typeName)
proto external vector GetOrigin()
ScriptInvokerBase< SCR_BaseGameMode_OnControllableDestroyed > GetOnControllableDestroyed()
static Faction GetEntityFaction(notnull IEntity entity)
override void EOnInit(IEntity owner)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute