Trader Snowman changed to Trader with Hat

This commit is contained in:
He-Man 2018-12-28 21:30:04 +01:00
parent 220fce033f
commit 1976a7b839
2 changed files with 28 additions and 36 deletions

View File

@ -47,7 +47,6 @@ _TraderInit = {
_this setVariable ["AI_ITEMS", _arr, true]; _this setVariable ["AI_ITEMS", _arr, true];
_this addEventHandler ["Killed", { _this call EPOCH_server_traderKilled; }]; _this addEventHandler ["Killed", { _this call EPOCH_server_traderKilled; }];
EPOCH_Traders pushback _this; EPOCH_Traders pushback _this;
if (_this iskindof "MAN") then {
addToRemainsCollector[_this]; addToRemainsCollector[_this];
_this addUniform _randomAIUniform; _this addUniform _randomAIUniform;
_this disableAI "FSM"; _this disableAI "FSM";
@ -57,6 +56,11 @@ _TraderInit = {
if (_HelloweenDeco) then { if (_HelloweenDeco) then {
removeHeadgear _this; removeHeadgear _this;
_this addHeadgear (selectrandom ["thor_mask_epoch","iron_mask_epoch","wolf_mask_epoch","pkin_mask_epoch","clown_mask_epoch","hockey_mask_epoch","plague_mask_epoch","ghostface_mask_epoch","skull_mask_epoch","witch_mask_epoch"]); _this addHeadgear (selectrandom ["thor_mask_epoch","iron_mask_epoch","wolf_mask_epoch","pkin_mask_epoch","clown_mask_epoch","hockey_mask_epoch","plague_mask_epoch","ghostface_mask_epoch","skull_mask_epoch","witch_mask_epoch"]);
}
else {
if (_WinterDeco) then {
removeHeadgear _this;
_this addHeadgear "santa_hat_epoch";
}; };
}; };
}; };
@ -166,13 +170,7 @@ for "_i" from 0 to (_maxTraderLimit-1) do {
}; };
}; };
EPOCH_TraderSlots deleteAt _traderSlotIndex; EPOCH_TraderSlots deleteAt _traderSlotIndex;
_agent = objnull;
if (_WinterDeco) then {
_agent = createvehicle ["snowmanDeco_EPOCH", _pos, [], 0, "NONE"];
}
else {
_agent = createAgent [_class, _pos, [], 0, "CAN_COLLIDE"]; _agent = createAgent [_class, _pos, [], 0, "CAN_COLLIDE"];
};
_agent call _TraderInit; _agent call _TraderInit;
_agent setPosATL _pos; _agent setPosATL _pos;
if (_arrchanged) then { if (_arrchanged) then {
@ -204,16 +202,10 @@ for "_i" from 0 to (_maxTraderLimit-1) do {
}; };
if (!(count (_arr select 0) >= _DynamicTraderRespawnCount) && (nearestobjects [_pos,["Plotpole_EPOCH"],_buildingJammerRange]) isequalto []) then { if (!(count (_arr select 0) >= _DynamicTraderRespawnCount) && (nearestobjects [_pos,["Plotpole_EPOCH"],_buildingJammerRange]) isequalto []) then {
EPOCH_TraderSlots deleteAt _traderSlotIndex; EPOCH_TraderSlots deleteAt _traderSlotIndex;
_agent = objnull;
if (_WinterDeco) then {
_agent = createvehicle ["snowmanDeco_EPOCH", _pos, [], 0, "NONE"];
}
else {
_agent = createAgent [_class, _pos, [], 0, "NONE"]; _agent = createAgent [_class, _pos, [], 0, "NONE"];
if !(EPOCH_forceStaticTraders) then { if !(EPOCH_forceStaticTraders) then {
[_agent, _home, _work] execFSM "\epoch_server\system\Trader_brain.fsm"; [_agent, _home, _work] execFSM "\epoch_server\system\Trader_brain.fsm";
}; };
};
_dir = random 360; _dir = random 360;
_agent call _TraderInit; _agent call _TraderInit;
if (surfaceiswater _pos) then { if (surfaceiswater _pos) then {

View File

@ -65,11 +65,6 @@ for "_i" from 1 to _spawnCount do {
if (daytime > _startTime && daytime < _endTime) then { if (daytime > _startTime && daytime < _endTime) then {
_pos = _work; _pos = _work;
}; };
_agent = objnull;
if (_WinterDeco) then {
_agent = createvehicle ["snowmanDeco_EPOCH", _pos, [], 0, "NONE"];
}
else {
_agent = createAgent [_aiClass, _pos, [], 0, "CAN_COLLIDE"]; _agent = createAgent [_aiClass, _pos, [], 0, "CAN_COLLIDE"];
addToRemainsCollector[_agent]; addToRemainsCollector[_agent];
_agent addUniform _randomAIUniform; _agent addUniform _randomAIUniform;
@ -79,6 +74,11 @@ for "_i" from 1 to _spawnCount do {
if (_HelloweenDeco) then { if (_HelloweenDeco) then {
removeHeadgear _agent; removeHeadgear _agent;
_agent addHeadgear (selectrandom ["thor_mask_epoch","iron_mask_epoch","wolf_mask_epoch","pkin_mask_epoch","clown_mask_epoch","hockey_mask_epoch","plague_mask_epoch","ghostface_mask_epoch","skull_mask_epoch","witch_mask_epoch"]); _agent addHeadgear (selectrandom ["thor_mask_epoch","iron_mask_epoch","wolf_mask_epoch","pkin_mask_epoch","clown_mask_epoch","hockey_mask_epoch","plague_mask_epoch","ghostface_mask_epoch","skull_mask_epoch","witch_mask_epoch"]);
}
else {
if (_WinterDeco) then {
removeHeadgear _agent;
_agent addHeadgear "santa_hat_epoch";
}; };
}; };
_agent allowdamage !_TraderGodMode; _agent allowdamage !_TraderGodMode;