mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
Merge pull request #812 from ravmustang/Community-Stats-#2
Community stats 2
This commit is contained in:
commit
7db78f5292
@ -57,9 +57,7 @@ switch _unitClass do {
|
|||||||
_units pushBack _unit;
|
_units pushBack _unit;
|
||||||
_unit call _disableAI;
|
_unit call _disableAI;
|
||||||
[_unit,_trgt] execFSM "\x\addons\a3_epoch_code\System\cloak.fsm";
|
[_unit,_trgt] execFSM "\x\addons\a3_epoch_code\System\cloak.fsm";
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AntagonistKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "GreatWhite_F": {
|
case "GreatWhite_F": {
|
||||||
@ -70,9 +68,7 @@ switch _unitClass do {
|
|||||||
_units pushBack _unit;
|
_units pushBack _unit;
|
||||||
_unit call _disableAI;
|
_unit call _disableAI;
|
||||||
[_unit] execFSM "\x\addons\a3_epoch_code\System\Shark_Brain.fsm";
|
[_unit] execFSM "\x\addons\a3_epoch_code\System\Shark_Brain.fsm";
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AntagonistKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -96,9 +92,7 @@ switch _unitClass do {
|
|||||||
_unit setVariable ["sapperHndl",_sapperHndl];
|
_unit setVariable ["sapperHndl",_sapperHndl];
|
||||||
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||||
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AntagonistKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -113,9 +107,7 @@ switch _unitClass do {
|
|||||||
_unit setVariable ["sapperHndl",_sapperHndl];
|
_unit setVariable ["sapperHndl",_sapperHndl];
|
||||||
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||||
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AntagonistKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "Epoch_SapperB_F": {
|
case "Epoch_SapperB_F": {
|
||||||
@ -129,9 +121,7 @@ switch _unitClass do {
|
|||||||
_unit setVariable ["sapperHndl",_sapperHndl];
|
_unit setVariable ["sapperHndl",_sapperHndl];
|
||||||
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
_unit addEventHandler ["FiredNear", format ["%1 setFSMVariable [""_sFiredNear"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||||
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
_unit addEventHandler ["Hit", format ["%1 setFSMVariable [""_sHit"",[_this select 1, _this select 2]];",_sapperHndl]];
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AntagonistKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AntagonistKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "I_UAV_01_F": {
|
case "I_UAV_01_F": {
|
||||||
@ -147,9 +137,7 @@ switch _unitClass do {
|
|||||||
_driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"];
|
_driver = _grp createUnit["I_UAV_AI", position _unit, [], 0, "CAN_COLLIDE"];
|
||||||
_driver moveInAny _unit;
|
_driver moveInAny _unit;
|
||||||
[_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm";
|
[_unit, _trgt] execFSM "\x\addons\a3_epoch_code\System\Copter_brain.fsm";
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AIKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AIKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case "PHANTOM": {
|
case "PHANTOM": {
|
||||||
@ -198,9 +186,7 @@ switch _unitClass do {
|
|||||||
_unit enableAI "MOVE";
|
_unit enableAI "MOVE";
|
||||||
_unit enableAI "ANIM";
|
_unit enableAI "ANIM";
|
||||||
_unit disableAI "FSM";
|
_unit disableAI "FSM";
|
||||||
_unit addEventHandler ["Killed", {
|
_unit addEventHandler ["Killed", {[_this, "AIKills", 1, true] call Epoch_unit_onKilledEH;}];
|
||||||
[player, _this select 1, "AIKills", 1, true, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
|
||||||
}];
|
|
||||||
// randomize skill
|
// randomize skill
|
||||||
for "_i" from 0 to ((count _arrSkills)-1) do {
|
for "_i" from 0 to ((count _arrSkills)-1) do {
|
||||||
_aiskill = floor random (_arrVals select _i);
|
_aiskill = floor random (_arrVals select _i);
|
||||||
|
25
Sources/epoch_code/compile/EPOCH_unit_onKilledEH.sqf
Normal file
25
Sources/epoch_code/compile/EPOCH_unit_onKilledEH.sqf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
Author: DirtySanchez - EpochMod.com
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Antagonist killed event handler
|
||||||
|
|
||||||
|
Licence:
|
||||||
|
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||||
|
|
||||||
|
Github:
|
||||||
|
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/compile/EPOCH_unit_onKilledEH.sqf
|
||||||
|
*/
|
||||||
|
params [ ["_killedEH",[]], ["_statType","AIKills"], ["_adjust", 0], ["_toClient", false] ];
|
||||||
|
if(_killedEH isEqualTo [])exitWith{diag_log "EPOCHDebug: unit_onKilledEH -1- EH sent empty array";};
|
||||||
|
if(_statType isEqualTo "")exitWith{diag_log "EPOCHDebug: unit_onKilledEH -2- stat Type is empty string";};
|
||||||
|
if(_adjust isEqualTo 0)exitWith{diag_log "EPOCHDebug: unit_onKilledEH -3- stat adjustment is 0";};
|
||||||
|
|
||||||
|
_unit = _killedEH select 0;
|
||||||
|
_killer = _killedEH select 1;
|
||||||
|
if(_unit isEqualTo _killer)exitWith{
|
||||||
|
//diag_log "EPOCHDebug: unit_onKilledEH -4- unit is killer";
|
||||||
|
};
|
||||||
|
[player, _killer, _statType, _adjust, _toClient, Epoch_personalToken] remoteExec ["EPOCH_fnc_updatePlayerStats",2];
|
@ -43,6 +43,7 @@ class CfgClientFunctions
|
|||||||
class zombieSpawn {};
|
class zombieSpawn {};
|
||||||
class makeMarker {};
|
class makeMarker {};
|
||||||
class removeMarker {};
|
class removeMarker {};
|
||||||
|
class unit_onKilledEH {};
|
||||||
};
|
};
|
||||||
class building
|
class building
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user