a3_exile_occupation/scripts/reactions/unitMPHit.sqf
second_coming b08f08ec0c v19 tweaks & fixes
Survivor AI now attack hostile players. Survivor side changed from WEST
to CIVILIAN
2016-04-15 01:49:24 +01:00

31 lines
869 B
Plaintext

// Get the variables from the event handler
_unit = _this select 0;
_aggressor = _this select 1;
_damage = _this select 2;
// remove the eventhandler to stop it triggering multiple times simultaneously
_unit removeAllMPEventHandlers "mphit";
if (side _aggressor == RESISTANCE) then
{
// Make victim and his group aggressive to players
_initialGroup = group _unit;
_group = createGroup WEST;
{
_unit = _x;
//[_unit] joinSilent grpNull;
[_unit] joinSilent _group;
}foreach units _initialGroup;
_group reveal [_aggressor, 2.5];
_group move (position _aggressor);
diag_log format["::testing:: unit %1 damaged by %2",_unit,_aggressor];
};
if(alive _unit) then
{
// reapply the eventhandler
_unit addMPEventHandler ["mphit", "_this call SC_fnc_unitMPHit;"];
};