mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
VUS #1
ItemInteractions for VehDoc's set for UPGRADE CfgVehicleUpgrade added for customizing materials needed Server function for upgrading vehicle CfgRemoteExec addition for server function above.
This commit is contained in:
parent
ae5458a775
commit
1dc4d147be
@ -309,6 +309,46 @@ switch _interactOption do {
|
||||
};
|
||||
};
|
||||
|
||||
case 15: { // Vehicle Upgrade
|
||||
_canUpgrade = true;
|
||||
_nearveh = nearestObjects[player,["Car","Truck","Heli","Boat","Plane"],15];
|
||||
if (_nearveh isequalto []) exitwith {
|
||||
["No Vehicle for upgrade found",5] call Epoch_message;_canUpgrade = false;
|
||||
};
|
||||
_veh = _nearveh select 0;
|
||||
_vehType = typeOf _veh;
|
||||
_classUpgrade = isClass(configFile >> "cfgVehicles" >> _vehType >> "Upgrades");
|
||||
if!(_classUpgrade)exitWith{
|
||||
["Vehicle can't be upgraded",5] call Epoch_message;_canUpgrade = false;
|
||||
};
|
||||
_reqMaterials = getArray(missionConfigFile >> "CfgVehicleUpgrades" >> _vehType >> "ReqMaterials");
|
||||
_crypto = 0;
|
||||
if(_reqMaterials isEqualTo [])exitWith{
|
||||
["Required Materials list not found, report this error to an admin",5] call Epoch_message;_canUpgrade = false;
|
||||
};
|
||||
{
|
||||
if((_x select 1) isEqualTo "Crypto")then{
|
||||
_crypto = _x select 0;
|
||||
};
|
||||
if(!((_x select 1) in (magazines player)) && !((_x select 1) isEqualTo "Crypto"))exitWith{
|
||||
[format["You do not have the required materials to upgrade your %1",_vehType],5] call Epoch_message;_canUpgrade = false;
|
||||
};
|
||||
}forEach _reqMaterials;
|
||||
if(_canUpgrade)then{
|
||||
{
|
||||
_count = _x select 0;
|
||||
_upgradeItem = _x select 1;
|
||||
for "_i" from 1 to _count do{
|
||||
if!(_upgradeItem isEqualTo "Crypto")then{
|
||||
player removeItem _upgradeItem;
|
||||
};
|
||||
};
|
||||
}forEach _reqMaterials;
|
||||
_upgradeToVeh = getText(missionConfigFile >> "CfgVehicleUpgrades" >> _vehType >> "upgradeToVehicle");
|
||||
[[_veh,_upgradeToVeh,_crypto],player,Epoch_personalToken] remoteExec ["EPOCH_server_upgrade_vehicle",2];
|
||||
};
|
||||
};
|
||||
|
||||
default {
|
||||
["Found nothing", 5] call Epoch_message;
|
||||
};
|
||||
|
@ -550,10 +550,14 @@ class CfgItemInteractions
|
||||
class ItemDoc6 : ItemDoc1 {};
|
||||
class ItemDoc7 : ItemDoc1 {};
|
||||
class ItemDoc8 : ItemDoc1 {};
|
||||
class ItemVehDoc1 : ItemDoc1 {};
|
||||
class ItemVehDoc2 : ItemDoc1 {};
|
||||
class ItemVehDoc3 : ItemDoc1 {};
|
||||
class ItemVehDoc4 : ItemDoc1 {};
|
||||
class ItemVehDoc1
|
||||
{
|
||||
interactAction = 15;
|
||||
interactText = "UPGRADE";
|
||||
};
|
||||
class ItemVehDoc2 : ItemVehDoc1 {};
|
||||
class ItemVehDoc3 : ItemVehDoc1 {};
|
||||
class ItemVehDoc4 : ItemVehDoc1 {};
|
||||
class ItemBulb : Default {};
|
||||
class ItemBurlap : Default {};
|
||||
class ItemBriefcaseE : Default {};
|
||||
|
@ -297,6 +297,11 @@ class CfgRemoteExec
|
||||
jip = 0;
|
||||
};
|
||||
class EPOCH_server_makeSP
|
||||
{
|
||||
allowedTargets = 2;
|
||||
jip = 0;
|
||||
};
|
||||
class EPOCH_server_upgrade_vehicle
|
||||
{
|
||||
allowedTargets = 2;
|
||||
jip = 0;
|
||||
|
110
Sources/epoch_config/Configs/CfgVehicleUpgrades.hpp
Normal file
110
Sources/epoch_config/Configs/CfgVehicleUpgrades.hpp
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
@author = "Aaron Clark - https://EpochMod.com";
|
||||
@contributors[] = {"DirtySanchez"};
|
||||
@description = "Vehicle Upgrade configs";
|
||||
@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_config/Configs/CfgItemInteractions.hpp";
|
||||
*/
|
||||
class CfgVehicleUpgrades
|
||||
{
|
||||
class C_Hatchback_01_EPOCH
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc1"},{1,"ItemCables"},{1,"CircuitParts"},{2,"VehicleRepairLg"}};
|
||||
upgradeToVehicle = "C_Hatchback_01_EPOCH1";
|
||||
};
|
||||
class C_Hatchback_01_EPOCH1
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc2"},{2,"SpareTire"},{2,"KitTankTrap"}};
|
||||
upgradeToVehicle = "C_Hatchback_01_EPOCH2";
|
||||
};
|
||||
class C_Hatchback_01_EPOCH2
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc3"},{2,"ItemPipe"},{2,"KitShelf"}};
|
||||
upgradeToVehicle = "C_Hatchback_01_EPOCH3";
|
||||
};
|
||||
class C_Hatchback_01_EPOCH3
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc4"},{1,"CircuitParts"},{2,"ItemScraps"},{1,"jerrycan_epoch"}};
|
||||
upgradeToVehicle = "C_Hatchback_01_EPOCH4";
|
||||
};
|
||||
class C_Hatchback_02_EPOCH
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc1"},{1,"ItemCables"},{1,"CircuitParts"},{2,"VehicleRepairLg"}};
|
||||
upgradeToVehicle = "C_Hatchback_02_EPOCH1";
|
||||
};
|
||||
class C_Hatchback_02_EPOCH1
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc2"},{2,"SpareTire"},{2,"KitTankTrap"}};
|
||||
upgradeToVehicle = "C_Hatchback_02_EPOCH2";
|
||||
};
|
||||
class C_Hatchback_02_EPOCH2
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc3"},{2,"ItemPipe"},{2,"KitShelf"}};
|
||||
upgradeToVehicle = "C_Hatchback_02_EPOCH3";
|
||||
};
|
||||
class C_Hatchback_02_EPOCH3
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc4"},{1,"CircuitParts"},{2,"ItemScraps"},{1,"jerrycan_epoch"}};
|
||||
upgradeToVehicle = "C_Hatchback_02_EPOCH4";
|
||||
};
|
||||
class C_Offroad_01_EPOCH
|
||||
{
|
||||
upgradeReqItems[] = {{1,"ItemVehDoc1"},{1,"ItemCables"},{1,"CircuitParts"},{2,"VehicleRepairLg"}};
|
||||
upgradeToVehicle = "C_Offroad_01_EPOCH1";
|
||||
};
|
||||
class C_Offroad_01_EPOCH1
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc2"},{2,"SpareTire"},{2,"KitTankTrap"}};
|
||||
upgradeToVehicle = "C_Offroad_01_EPOCH2";
|
||||
};
|
||||
class C_Offroad_01_EPOCH2
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc3"},{2,"ItemPipe"},{2,"KitShelf"}};
|
||||
upgradeToVehicle = "C_Offroad_01_EPOCH3";
|
||||
};
|
||||
class C_Offroad_01_EPOCH3
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc4"},{1,"CircuitParts"},{2,"ItemScraps"},{1,"jerrycan_epoch"}};
|
||||
upgradeToVehicle = "C_Offroad_01_EPOCH4";
|
||||
};
|
||||
class C_SUV_01_EPOCH
|
||||
{
|
||||
upgradeReqItems[] = {{1,"ItemVehDoc1"},{1,"ItemCables"},{1,"CircuitParts"},{2,"VehicleRepairLg"}};
|
||||
upgradeToVehicle = "C_SUV_01_EPOCH1";
|
||||
};
|
||||
class C_SUV_01_EPOCH1
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc2"},{2,"SpareTire"},{2,"KitTankTrap"}};
|
||||
upgradeToVehicle = "C_SUV_01_EPOCH2";
|
||||
};
|
||||
class C_SUV_01_EPOCH2
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc3"},{2,"ItemPipe"},{2,"KitShelf"}};
|
||||
upgradeToVehicle = "C_SUV_01_EPOCH3";
|
||||
};
|
||||
class C_SUV_01_EPOCH3
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc4"},{1,"CircuitParts"},{2,"ItemScraps"},{1,"jerrycan_epoch"}};
|
||||
upgradeToVehicle = "C_SUV_01_EPOCH4";
|
||||
};
|
||||
class B_G_Offroad_01_armed_EPOCH
|
||||
{
|
||||
upgradeReqItems[] = {{1,"ItemVehDoc1"},{1,"ItemCables"},{1,"CircuitParts"},{2,"VehicleRepairLg"}};
|
||||
upgradeToVehicle = "B_G_Offroad_01_armed_EPOCH1";
|
||||
};
|
||||
class B_G_Offroad_01_armed_EPOCH1
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc2"},{2,"SpareTire"},{2,"KitTankTrap"}};
|
||||
upgradeToVehicle = "B_G_Offroad_01_armed_EPOCH2";
|
||||
};
|
||||
class B_G_Offroad_01_armed_EPOCH2
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc3"},{2,"ItemPipe"},{2,"KitShelf"}};
|
||||
upgradeToVehicle = "B_G_Offroad_01_armed_EPOCH3";
|
||||
};
|
||||
class B_G_Offroad_01_armed_EPOCH3
|
||||
{
|
||||
ReqMaterials[] = {{1,"ItemVehDoc4"},{1,"CircuitParts"},{2,"ItemScraps"},{1,"jerrycan_epoch"}};
|
||||
upgradeToVehicle = "B_G_Offroad_01_armed_EPOCH4";
|
||||
};
|
||||
};
|
@ -74,6 +74,7 @@ disableRandomization[] = {"All"};
|
||||
#include "Configs\CfgItemInteractions.hpp"
|
||||
#include "Configs\CfgSay3Dhandler.hpp"
|
||||
#include "Configs\CfgSwitchMovehandler.hpp"
|
||||
#include "Configs\CfgVehicleUpgrades.hpp"
|
||||
|
||||
// A3 specific configs
|
||||
#include "Configs\CfgFunctions.hpp"
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
Author: Aaron Clark - EpochMod.com
|
||||
|
||||
Contributors: He-Man and DirtySanchez
|
||||
|
||||
Description:
|
||||
Upgrade vehicle
|
||||
|
||||
Licence:
|
||||
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
|
||||
*/
|
||||
params [["_array",[]],["_player",objnull],["_token","",[""]]];
|
||||
if (_array isequalto []) exitwith {
|
||||
diag_log "Array is empty";
|
||||
};
|
||||
if !([_player, _token] call EPOCH_server_getPToken) exitWith{
|
||||
diag_log "Tokencheck failed";
|
||||
};
|
||||
_array params [["_veh",objnull],["_UpgradeVeh",""],["_removeCrypto",[]]];
|
||||
if (isnull _veh) exitwith {
|
||||
diag_log "Vehicle is null";
|
||||
};
|
||||
if (_UpgradeVeh isequalto "") exitwith {
|
||||
diag_log "No Upgrade Vehicle Class";
|
||||
};
|
||||
if !(_removeCrypto isequalto []) && !(_removeCrypto isEqualTo 0) then {
|
||||
[_player,-_removeCrypto] remoteExec ["EPOCH_server_effectCrypto",2];
|
||||
};
|
||||
_slot = _veh getvariable ["vehicle_slot","-1"];
|
||||
if (_slot isequalto "-1") exitwith {
|
||||
diag_log "Vehicle has no Slot";
|
||||
};
|
||||
_pos = getposasl _veh;
|
||||
_dir = getdir _veh;
|
||||
deletevehicle _veh;
|
||||
waituntil {isnull _veh};
|
||||
_pos set [2,(_pos select 2)+0.5];
|
||||
_veh = createVehicle [_UpgradeVeh, [random 500, random 500,500], [], 0, "CAN_COLLIDE"];
|
||||
_veh setVariable ["VEHICLE_SLOT", _slot, true];
|
||||
_veh call EPOCH_server_setVToken;
|
||||
_veh call EPOCH_server_vehicleInit;
|
||||
_veh setdir _dir;
|
||||
_veh setposasl _pos;
|
||||
|
@ -94,6 +94,7 @@ class CfgServerFunctions
|
||||
class server_packStorage {};
|
||||
class server_packJack {};
|
||||
class spawn_vehicle {};
|
||||
class server_upgrade_vehicle {};
|
||||
};
|
||||
class epoch_server {
|
||||
class weightedArray {};
|
||||
|
Loading…
Reference in New Issue
Block a user