From 01c8641ff26a65fea229ef219483a3756bdce3f2 Mon Sep 17 00:00:00 2001 From: vbawol Date: Wed, 30 Aug 2017 17:15:14 -0500 Subject: [PATCH] Conditional Loot table feature and reworking antagonist spawning - We no longer spawn antagonists on opening loot containers or trash. Instead we have the client spawn them from a new weighted array. Note: Admins can control what AI are spawning by removing from array (antagonistChances) or setting chance to 0 - moved EPOCH_spawnIndex and EPOCH_spawnLimits to master loop init instead of both_init as it is only needed client side. - loot table updates for extra logic condition. --- .../compile/setup/masterLoop/Event7.sqf | 13 +- .../compile/setup/masterLoop/init.sqf | 46 +- Sources/epoch_code/init/both_init.sqf | 29 - .../Configs/CfgClientFunctions.hpp | 648 +++++++++--------- .../epoch_config/Configs/CfgEpochClient.hpp | 69 +- .../EPOCH_server_destroyTrash.sqf | 16 - .../EPOCH_server_lootContainer.sqf | 9 - Sources/epoch_server/config.cpp | 7 + .../epoch_server/init/server_variables.sqf | 3 +- .../configs/CfgLootTable.h | 6 +- .../configs/CfgLootTable_CUP.h | 6 +- .../configs/CfgLootTable_MAD.h | 6 +- .../configs/CfgLootTable_MADCUP.h | 6 +- .../configs/CfgMainTable.h | 17 - 14 files changed, 464 insertions(+), 417 deletions(-) diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event7.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event7.sqf index 75657c38..adcd233a 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event7.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event7.sqf @@ -1,14 +1,7 @@ _spawnChance = ((EPOCH_playerNuisance + EPOCH_playerSoiled)/2) max 1; -if (random _droneRndChance < _spawnChance) then { - "I_UAV_01_F" call EPOCH_unitSpawnIncrease; -}; -if (EPOCH_mod_Ryanzombies_Enabled) then { - if (random _zombieRngChance < _spawnChance) then { - ["EPOCH_RyanZombie_1",12] call EPOCH_unitSpawnIncrease; - }; -}; -if (random _sapperRndChance < _spawnChance) then { - "Epoch_Sapper_F" call EPOCH_unitSpawnIncrease; +// add more antagonist spawn chances +if (random _antagonistRndChance < _spawnChance) then { + (selectRandomWeighted _antagonistChances) call EPOCH_unitSpawnIncrease; }; // diag_log format["DEBUG: _spawnChance %1",_spawnChance]; diff --git a/Sources/epoch_code/compile/setup/masterLoop/init.sqf b/Sources/epoch_code/compile/setup/masterLoop/init.sqf index 3a5dc482..3712275c 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/init.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/init.sqf @@ -23,9 +23,8 @@ _panic = false; _prevEnergy = EPOCH_playerEnergy; // init config data -_sapperRndChance = ["CfgEpochClient", "sapperRngChance", 100] call EPOCH_fnc_returnConfigEntryV2; -_zombieRngChance = ["CfgEpochClient", "zombieRngChance", 50] call EPOCH_fnc_returnConfigEntryV2; -_droneRndChance = ["CfgEpochClient", "droneRngChance", 100] call EPOCH_fnc_returnConfigEntryV2; +_antagonistRndChance = ["CfgEpochClient", "antagonistRngChance", 100] call EPOCH_fnc_returnConfigEntryV2; + _baseHungerLoss = ["CfgEpochClient", "baseHungerLoss", 2] call EPOCH_fnc_returnConfigEntryV2; _baseThirstLoss = ["CfgEpochClient", "baseThirstLoss", 2] call EPOCH_fnc_returnConfigEntryV2; _energyCostNV = ["CfgEpochClient", "energyCostNV", 3] call EPOCH_fnc_returnConfigEntryV2; @@ -36,6 +35,47 @@ _hudConfigs = ["CfgEpochClient", "hudConfigs", []] call EPOCH_fnc_returnConfigEn EPOCH_chargeRate = 0; EPOCH_playerIsSwimming = false; +_antagonistChanceDefaults = [ + "Epoch_Cloak_F",0.07, + "Epoch_Sapper_F",0.25, + "Epoch_SapperG_F",0.12, + "Epoch_SapperB_F",0.06, + "I_UAV_01_F",0.2, + "PHANTOM",0.01, + "EPOCH_RyanZombie_1",0.25 +]; +_antagonistChances = ["CfgEpochClient", "antagonistChances", _antagonistChanceDefaults] call EPOCH_fnc_returnConfigEntryV2; + + +// Init antagonist spawn limits +EPOCH_spawnIndex = []; +EPOCH_spawnLimits = []; +_antagonistSpawnDefaults = [ + ["Epoch_Cloak_F", 1], + ["GreatWhite_F", 2], + ["Epoch_Sapper_F",2], + ["Epoch_SapperG_F",1], + ["Epoch_SapperB_F",1], + ["I_UAV_01_F",2], + ["PHANTOM",1], + ["B_Heli_Transport_01_F",1], + ["EPOCH_RyanZombie_1",12] +]; +_spawnLimits = ["CfgEpochClient", "antagonistSpawnIndex", _antagonistSpawnDefaults] call EPOCH_fnc_returnConfigEntryV2; + +{ + _x params ["_spawnName","_spawnLimit"]; + if (_spawnName isEqualTo "EPOCH_RyanZombie_1") then { + if (EPOCH_mod_Ryanzombies_Enabled) then { + EPOCH_spawnIndex pushBack _spawnName; + EPOCH_spawnLimits pushBack _spawnLimit; + }; + } else { + EPOCH_spawnIndex pushBack _spawnName; + EPOCH_spawnLimits pushBack _spawnLimit; + }; +} forEach _spawnLimits; + // default data if mismatch if !(EPOCH_playerSpawnArray isEqualTypeParams EPOCH_spawnIndex) then{ EPOCH_playerSpawnArray = []; diff --git a/Sources/epoch_code/init/both_init.sqf b/Sources/epoch_code/init/both_init.sqf index ea38fecb..98efb79c 100644 --- a/Sources/epoch_code/init/both_init.sqf +++ b/Sources/epoch_code/init/both_init.sqf @@ -88,35 +88,6 @@ EPOCH_communityStatsDefaults = _communityStatsInit; } forEach _communityStatsInit; EPOCH_communityStatsCount = count EPOCH_communityStats; - -// Init antagonist spawn limits -EPOCH_spawnIndex = []; -EPOCH_spawnLimits = []; -_antagonistSpawnDefaults = [ - ["Epoch_Cloak_F", 1], - ["GreatWhite_F", 2], - ["Epoch_Sapper_F",2], - ["Epoch_SapperG_F",1], - ["Epoch_SapperB_F",1], - ["I_UAV_01_F",2], - ["PHANTOM",1], - ["B_Heli_Transport_01_F",1], - ["EPOCH_RyanZombie_1",12] -]; -_spawnLimits = ["CfgEpochClient", "antagonistSpawnIndex", _antagonistSpawnDefaults] call EPOCH_fnc_returnConfigEntryV2; -{ - _x params ["_spawnName","_spawnLimit"]; - if (_spawnName isEqualTo "EPOCH_RyanZombie_1") then { - if (EPOCH_mod_Ryanzombies_Enabled) then { - EPOCH_spawnIndex pushBack _spawnName; - EPOCH_spawnLimits pushBack _spawnLimit; - }; - } else { - EPOCH_spawnIndex pushBack _spawnName; - EPOCH_spawnLimits pushBack _spawnLimit; - }; -} forEach _spawnLimits; - //GroupSize (number) // Price (String) EPOCH_group_upgrade_lvl = ["CfgEpochClient", "group_upgrade_lvl", [4,"100",6,"300",8,"500",10,"1000",12,"1500",13,"1750",14,"2000",15,"3000",16,"5000"]] call EPOCH_fnc_returnConfigEntryV2; diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index d65b93db..d2b3f587 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -1,331 +1,353 @@ /*[[[cog from arma_config_tools import *; json_to_arma()]]]*/ /* - @author = "Aaron Clark - https://EpochMod.com"; - @contributors[] = {"Raimonds Virtoss","Andrew Gregory"}; - @description = "Custom Epoch Client Only functions"; - @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/CfgClientFunctions.hpp"; + @author = "Aaron Clark - https://EpochMod.com"; + @contributors[] = {"Raimonds Virtoss","Andrew Gregory"}; + @description = "Custom Epoch Client Only functions"; + @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/CfgClientFunctions.hpp"; */ class CfgClientFunctions { - version = 1; - class A3E - { - tag = "EPOCH"; - file = "epoch_code\compile"; - class generic - { - file = "epoch_code\compile"; - class localCleanup {}; - class unitSpawnIncrease {}; - class unitSpawnDecrease {}; - class QuickTakeAll {}; - class QuickTakeLoad {}; - class effectCrypto {}; - class handleServerMessage {}; - class updateLoadingScreen {}; - class EnterBuilding {}; - class lootTrash {}; - class debugMonitor {}; - class interact {}; - class chopWood {}; - class fish {}; - class mineRocks {}; - class UnisexCheck {}; - class PutHandler {}; - class niteLight {}; - class LootIT {}; - class supportCopter {}; - class consumeItem {}; - class unitSpawn {}; - class onEachFrame {}; - class callSapperMigration {}; - class zombieSpawn {}; - class makeMarker {}; - class removeMarker {}; + version = 1; + class A3E + { + tag = "EPOCH"; + file = "epoch_code\compile"; + class generic + { + file = "epoch_code\compile"; + class localCleanup {}; + class unitSpawnIncrease {}; + class unitSpawnDecrease {}; + class QuickTakeAll {}; + class QuickTakeLoad {}; + class effectCrypto {}; + class handleServerMessage {}; + class updateLoadingScreen {}; + class EnterBuilding {}; + class lootTrash {}; + class debugMonitor {}; + class interact {}; + class chopWood {}; + class fish {}; + class mineRocks {}; + class UnisexCheck {}; + class PutHandler {}; + class niteLight {}; + class LootIT {}; + class supportCopter {}; + class consumeItem {}; + class unitSpawn {}; + class onEachFrame {}; + class callSapperMigration {}; + class zombieSpawn {}; + class makeMarker {}; + class removeMarker {}; class unit_onKilledEH {}; - }; - class building - { - class maintainIT {}; - class lockCheck {}; - class countdown {}; - class fnc_SelectTargetBuild {}; - class isBuildAllowed {}; - class simulSwap {}; - class staticMove {}; - class upgradeBUILD {}; - class removeBUILD {}; - class changeWallState {}; - class checkBuild {}; - }; - class traders - { - class NpcTrade_return {}; - class startInteract {}; - class startInteractNPC {}; - class npcTraderAdd {}; - class npcTraderAdd2 {}; - class npcTraderAdd3 {}; - class startNPCTraderMenu {}; - class NPCTraderMenuFilter {}; - class startNpcTrade {}; - class tradeFilter {}; - class takeCrypto {}; - class startBankTransfer {}; + }; + class building + { + class maintainIT {}; + class lockCheck {}; + class countdown {}; + class fnc_SelectTargetBuild {}; + class isBuildAllowed {}; + class simulSwap {}; + class staticMove {}; + class upgradeBUILD {}; + class removeBUILD {}; + class changeWallState {}; + class checkBuild {}; + }; + class traders + { + class NpcTrade_return {}; + class startInteract {}; + class startInteractNPC {}; + class npcTraderAdd {}; + class npcTraderAdd2 {}; + class npcTraderAdd3 {}; + class startNPCTraderMenu {}; + class NPCTraderMenuFilter {}; + class startNpcTrade {}; + class tradeFilter {}; + class takeCrypto {}; + class startBankTransfer {}; class calcDamageCost {}; - }; - class interface_event_handlers - { - class KeyDown {}; - class KeyUp {}; - class onChar {}; - }; - class event_handlers - { - class getInMan {}; - class getOutMan {}; - class InventoryClosed {}; - class InventoryOpened {}; - }; - class setup - { - class masterLoop {}; - class clientInit {}; - class clientRespawn {}; - class clientRevive {}; - class client_rejectPlayer {}; - class clientKeyMap {}; - }; - class p2p_trading - { - class startTRADEREQ {}; - class startTrade {}; - class tradeRequest {}; - class TradeLoop {}; - class makep2pTrade {}; - }; - class functions - { - class worldObjectType {}; - class returnConfig {}; - class returnConfigV2 {}; - class colorRange {}; - class convertTemp {}; - class fnc_playerDeath {}; - class fnc_playerFired {}; - class fnc_isInsideBuilding {}; - class fnc_Weather {}; - class fnc_findSafePos {}; - class fnc_addItemOverflow {}; - class pushCustomVar {}; - class itemData {}; - class itemPicture {}; - class itemDisplayName {}; - class SortArrayByDistance {}; - class fnc_findRandomPosBehind {}; - class fnc_stringLeft {}; - class fnc_findSapperStalkLocation {}; - class fnc_dirToFuzzy {}; - class fnc_cursorTarget {}; - class fnc_triggerAntagonist {}; - class fnc_playerDeathDetonate {}; - class fnc_playerDeathMorph {}; - class fnc_playerSetVariable {}; - class fnc_playerAttachToAntagonist {}; - class fnc_dynamicFSM {}; - class fnc_vectorDivide {}; - class giveAttributes {}; - class fnc_spawnEffects {}; - class fnc_arrayStringToBool {}; - class client_updatePlayerStat {}; - class fnc_getHitPointsDamageAverage {}; - }; - class environment - { - class client_earthQuake {}; - class client_loadAnimalBrain {}; - class client_bitePlayer {}; - }; - class vehicles - { - class client_repairVehicle {}; - class client_lockVehicle {}; - class client_fillVehicle {}; - class client_gearVehicle {}; + }; + class interface_event_handlers + { + class KeyDown {}; + class KeyUp {}; + class onChar {}; + }; + class event_handlers + { + class getInMan {}; + class getOutMan {}; + class InventoryClosed {}; + class InventoryOpened {}; + }; + class setup + { + class masterLoop {}; + class clientInit {}; + class clientRespawn {}; + class clientRevive {}; + class client_rejectPlayer {}; + class clientKeyMap {}; + }; + class p2p_trading + { + class startTRADEREQ {}; + class startTrade {}; + class tradeRequest {}; + class TradeLoop {}; + class makep2pTrade {}; + }; + class functions + { + class worldObjectType {}; + class returnConfig {}; + class returnConfigV2 {}; + class colorRange {}; + class convertTemp {}; + class fnc_playerDeath {}; + class fnc_playerFired {}; + class fnc_isInsideBuilding {}; + class fnc_Weather {}; + class fnc_findSafePos {}; + class fnc_addItemOverflow {}; + class pushCustomVar {}; + class itemData {}; + class itemPicture {}; + class itemDisplayName {}; + class SortArrayByDistance {}; + class fnc_findRandomPosBehind {}; + class fnc_stringLeft {}; + class fnc_findSapperStalkLocation {}; + class fnc_dirToFuzzy {}; + class fnc_cursorTarget {}; + class fnc_arrayToLogic {}; + class fnc_returnHudVar {}; + class fnc_triggerAntagonist {}; + class fnc_playerDeathDetonate {}; + class fnc_playerDeathMorph {}; + class fnc_playerSetVariable {}; + class fnc_playerAttachToAntagonist {}; + class fnc_dynamicFSM {}; + class fnc_vectorDivide {}; + class giveAttributes {}; + class fnc_spawnEffects {}; + class fnc_arrayStringToBool {}; + class client_updatePlayerStat {}; + class fnc_getHitPointsDamageAverage {}; + }; + class environment + { + class client_earthQuake {}; + class client_loadAnimalBrain {}; + class client_bitePlayer {}; + }; + class vehicles + { + class client_repairVehicle {}; + class client_lockVehicle {}; + class client_fillVehicle {}; + class client_gearVehicle {}; class client_upgradeVehicle {}; class client_upgradeVehicleCheck {}; class client_VehicleMaintananceCheck {}; class client_VehicleMaintananceDo {}; - }; - class missions - { - class mission_accept {}; - class mission_cage_sapper {}; - class mission_returnObj {}; - }; - class inventory - { - class selectInventoryItem {}; - class itemInteractClick {}; - class itemInteractDblClick {}; - class uniformArmorCalc {}; - class gearArmorCalc {}; - class factorArmor {}; - class maxArmorInit {}; - class initUI {}; - class refeshUI {}; + }; + class missions + { + class mission_accept {}; + class mission_cage_sapper {}; + class mission_returnObj {}; + }; + class inventory + { + class selectInventoryItem {}; + class itemInteractClick {}; + class itemInteractDblClick {}; + class uniformArmorCalc {}; + class gearArmorCalc {}; + class factorArmor {}; + class maxArmorInit {}; + class initUI {}; + class refeshUI {}; class equip {}; class itemTypeSlot {}; - }; - class servicepoint - { - class SP_Check {}; - class SP_Rearm {}; - class SP_Refuel {}; - class SP_Repair {}; - class SP_Start {}; - }; - class customs - { - file = "epoch_code\customs"; - class custom_EH_FiredMan {}; - class custom_EH_GetInMan {}; - class custom_EH_GetOutMan {}; - class custom_EH_InventoryClosed {}; - class custom_EH_InventoryOpened {}; - class custom_EH_KeyDown {}; - class custom_EH_KeyUp {}; - class custom_EH_Killed {}; - class custom_EH_Put {}; - class custom_EH_Take {}; - class custom_KeyMap {}; - class custom_OnEachFrame {}; + }; + class servicepoint + { + class SP_Check {}; + class SP_Rearm {}; + class SP_Refuel {}; + class SP_Repair {}; + class SP_Start {}; + }; + class customs + { + file = "epoch_code\customs"; + class custom_EH_FiredMan {}; + class custom_EH_GetInMan {}; + class custom_EH_GetOutMan {}; + class custom_EH_InventoryClosed {}; + class custom_EH_InventoryOpened {}; + class custom_EH_KeyDown {}; + class custom_EH_KeyUp {}; + class custom_EH_Killed {}; + class custom_EH_Put {}; + class custom_EH_Take {}; + class custom_KeyMap {}; + class custom_OnEachFrame {}; class custom_radioActions {}; - }; - class messaging - { - file = "epoch_code\gui\scripts\messaging"; - class message {}; - class message_old1 {}; - class message_old2 {}; - }; - class looting - { - class spawnLoot {}; - }; - class gui - { - file = "epoch_code\gui\scripts"; - class onPause {}; - class showStats {}; - class 3DctrlPitchYaw {}; - class 3DctrlSpin {}; - class 3DctrlYaw {}; - class InterruptConfig {}; - class InterruptConfigActions {}; - class getIDC {}; - class guiObjHP {}; - class secureStorageHandler {}; - class genderSelection {}; - class getColorScheme {}; - class dragControl {}; - }; - class animations - { - file = "epoch_code\gui\scripts\animations"; - class 2DCtrlShake {}; + }; + class messaging + { + file = "epoch_code\gui\scripts\messaging"; + class message {}; + class message_old1 {}; + class message_old2 {}; + }; + class looting + { + class spawnLoot {}; + }; + class gui + { + file = "epoch_code\gui\scripts"; + class onPause {}; + class showStats {}; + class 3DctrlPitchYaw {}; + class 3DctrlSpin {}; + class 3DctrlYaw {}; + class InterruptConfig {}; + class InterruptConfigActions {}; + class getIDC {}; + class guiObjHP {}; + class secureStorageHandler {}; + class genderSelection {}; + class getColorScheme {}; + class dragControl {}; + }; + class animations + { + file = "epoch_code\gui\scripts\animations"; + class 2DCtrlShake {}; class 2DCtrlHeartbeat {}; - }; - class config + }; + class config + { + file = "epoch_code\gui\scripts\config"; + class config_keymap {}; + }; + class dynamenu + { + file = "epoch_code\gui\scripts\dynamenu"; + class dynamicMenu {}; + class dynamicMenuPopulate {}; + class dynamicMenuCleanup {}; + }; + class dynamicHUD + { + file = "epoch_code\gui\scripts\dynamicHUD"; + class dynamicHUD_adjust {}; + class dynamicHUD_loadSave {}; + class dynamicHUD_start {}; + class getHUDCtrl {}; + }; + class gui_craft + { + file = "epoch_code\gui\scripts\craftingv2"; + class crafting_animate {}; + class crafting_ctrl_collector {}; + class crafting_dev_toggle {}; + class crafting_getConfig {}; + class crafting_checkGear {}; + class crafting_checkNearby {}; + class crafting_checkResources {}; + class crafting_craft {}; + class crafting_progress {}; + class crafting_load {}; + class crafting_unload {}; + class crafting_LB_click {}; + class crafting_LB_defaults {}; + class crafting_LB_doubleClick {}; + class crafting_colorScheme {}; + }; + class group + { + file = "epoch_code\gui\scripts\group"; + class Group_invitePlayer {}; + class Group_BtnMod {}; + class Group_BtnInvite {}; + class Group_onLoad {}; + class Group_List {}; + class Group_Combo {}; + class Group_BtnLeave {}; + class Group_BtnKick {}; + class cGroup_groupText {}; + class cGroup_onLoad {}; + class cGroup_BtnCreate {}; + class iGroup_acceptInvite {}; + class iGroup_onLoad {}; + class iGroup_refresh {}; + class Group_update {}; + }; + class groupTemp { - file = "epoch_code\gui\scripts\config"; - class config_keymap {}; - }; - class dynamenu - { - file = "epoch_code\gui\scripts\dynamenu"; - class dynamicMenu {}; - class dynamicMenuPopulate {}; - class dynamicMenuCleanup {}; - }; - class dynamicHUD - { - file = "epoch_code\gui\scripts\dynamicHUD"; - class dynamicHUD_adjust {}; - class dynamicHUD_loadSave {}; - class dynamicHUD_start {}; - class getHUDCtrl {}; - }; - class gui_craft - { - file = "epoch_code\gui\scripts\craftingv2"; - class crafting_animate {}; - class crafting_ctrl_collector {}; - class crafting_dev_toggle {}; - class crafting_getConfig {}; - class crafting_checkGear {}; - class crafting_checkNearby {}; - class crafting_checkResources {}; - class crafting_craft {}; - class crafting_progress {}; - class crafting_load {}; - class crafting_unload {}; - class crafting_LB_click {}; - class crafting_LB_defaults {}; - class crafting_LB_doubleClick {}; - class crafting_colorScheme {}; - }; - class group - { - file = "epoch_code\gui\scripts\group"; - class Group_invitePlayer {}; - class Group_BtnMod {}; - class Group_BtnInvite {}; - class Group_onLoad {}; - class Group_List {}; - class Group_Combo {}; - class Group_BtnLeave {}; - class Group_BtnKick {}; - class cGroup_groupText {}; - class cGroup_onLoad {}; - class cGroup_BtnCreate {}; - class iGroup_acceptInvite {}; - class iGroup_onLoad {}; - class iGroup_refresh {}; - class Group_update {}; - }; - class gui_inventory - { - file = "epoch_code\gui\scripts\inventory"; - class Inventory_Group {}; - class Inventory_iGroup {}; - }; - class gui_missions - { - file = "epoch_code\gui\scripts\missions"; - class mission_refresh {}; - class mission_description {}; - }; - class gui_postProcessing - { - file = "epoch_code\gui\scripts\post_process"; - class postprocessCreate {}; - class postprocessAdjust {}; - class postprocessDestroy {}; - class setDrunk {}; - class setRadiation {}; - }; - class worldToScreen - { - file = "epoch_code\gui\scripts\worldToScreen"; - class gui3DCooldown {}; - class gui3DCooldownEH {}; - class gui3DWorldPos {}; - class gui3DWorldPosEH {}; - class gui3DModelPos {}; - class gui3DModelPosEH {}; - }; + file = "epoch_code\gui\scripts\groupTemp"; + class tempGroup_invitePlayer {}; + class tempGroup_BtnMod {}; + class tempGroup_BtnInvite {}; + class tempGroup_onLoad {}; + class tempGroup_List {}; + class tempGroup_Combo {}; + class tempGroup_BtnLeave {}; + class tempGroup_BtnKick {}; + class cTempGroup_onLoad {}; + class cTempGroup_BtnCreate {}; + class iTempGroup_acceptInvite {}; + class iTempGroup_onLoad {}; + class iTempGroup_refresh {}; + class tempGroup_update {}; + }; + class gui_inventory + { + file = "epoch_code\gui\scripts\inventory"; + class Inventory_Group {}; + class Inventory_iGroup {}; + class Inventory_tempGroup {}; + class Inventory_itempGroup {}; + }; + class gui_missions + { + file = "epoch_code\gui\scripts\missions"; + class mission_refresh {}; + class mission_description {}; + }; + class gui_postProcessing + { + file = "epoch_code\gui\scripts\post_process"; + class postprocessCreate {}; + class postprocessAdjust {}; + class postprocessDestroy {}; + class setDrunk {}; + class setRadiation {}; + }; + class worldToScreen + { + file = "epoch_code\gui\scripts\worldToScreen"; + class gui3DCooldown {}; + class gui3DCooldownEH {}; + class gui3DWorldPos {}; + class gui3DWorldPosEH {}; + class gui3DModelPos {}; + class gui3DModelPosEH {}; + }; class favBar { file = "epoch_code\gui\scripts\favBar"; class favBar_draw {}; @@ -337,7 +359,7 @@ class CfgClientFunctions class favBar_getGearItem {}; class favBar_modifier {}; }; - }; + }; }; /*[[[end]]]*/ diff --git a/Sources/epoch_config/Configs/CfgEpochClient.hpp b/Sources/epoch_config/Configs/CfgEpochClient.hpp index 1cef4de7..7f39a531 100644 --- a/Sources/epoch_config/Configs/CfgEpochClient.hpp +++ b/Sources/epoch_config/Configs/CfgEpochClient.hpp @@ -18,9 +18,7 @@ class CfgEpochClient ArmAVersion = 168; debug = "false"; // true = enable extra rpt debug lines, false to disable - sapperRngChance = 100; // increase number to reduce chances and reduce to increase. Default 100 - droneRngChance = 100; // increase number to reduce chances and reduce to increase. Default 100 - zombieRngChance = 50; // increase number to reduce chances and reduce to increase. Default 50 + antagonistRngChance = 100; // increase number to reduce chances and reduce to increase. Default 100 baseHungerLoss = 2; // increase number to speed up rate of Hunger loss baseThirstLoss = 2; // increase number to speed up rate of Thirst loss @@ -57,11 +55,70 @@ class CfgEpochClient deathMorphClass[] = {"Epoch_Sapper_F","Epoch_SapperG_F","Epoch_SapperB_F","I_UAV_01_F","Epoch_Cloak_F"}; //Random selection of these classes when player morphs after death. Currently available: Epoch_Cloak_F, Epoch_SapperB_F, Epoch_Sapper_F, I_UAV_01_F niteLight[] = {0,1.88,22}; // 0 = disabled or 1 = enabled, Set ambient lighting at night: {Brightness of light,Height of light}. Default (Low Ambient): {1.88,22} | Twilight: {7.2,88} | Distant: {12.8,142} ryanZombiesEnabled = "true"; - antagonistSpawnIndex[] = {{"Epoch_Cloak_F",1},{"GreatWhite_F",2},{"Epoch_Sapper_F",2},{"Epoch_SapperG_F",1},{"Epoch_SapperB_F",1},{"I_UAV_01_F",2},{"PHANTOM",1},{"B_Heli_Transport_01_F",1},{"EPOCH_RyanZombie_1",12},{"I_Soldier_EPOCH",1}}; // {"type", limit} - customVarsDefaults[] = {{"Temp",98.6,{106.7,95,102,105,96,95}},{"Hunger",1500,{5000,0,5001,5001,1250,0}},{"Thirst",750,{2500,0,2501,2501,625,0}},{"AliveTime",0,{-2,0}},{"Energy",0,{2500,0}},{"Wet",0,{100,0,35,55,-1,-1}},{"Soiled",0,{100,0,35,55,-1,-1}},{"Immunity",0,{100,0}},{"Toxicity",0,{100,0,35,55,-1,-1}},{"Stamina",100,{"EPOCH_playerStaminaMax",0}},{"Crypto",0,{250000,0}},{"HitPoints",{0,0,0,0},{1,0,0.5,1,-1,-1}},{"BloodP",100,{190,0,120,140,70,50}},{"SpawnArray",{},{}},{"Karma",0,{50000,-50000}},{"Alcohol",0,{100,0,35,55,-1,-1}},{"Radiation",0,{100,0,35,55,-1,-1}},{"Nuisance",0,{100,0}},{"MissionArray",{},{}}}; // EPOCH_player + varName, default value, {max,min,high-warn,high-critical,low-warn,low-critical} + + antagonistChances[] = { + // {"type", chance} + "Epoch_Cloak_F",0.06, + "GreatWhite_F",0, + "Epoch_Sapper_F",0.12, + "Epoch_SapperG_F",0.06, + "Epoch_SapperB_F",0.03, + "I_UAV_01_F",0.12, + "PHANTOM",0.03, + "B_Heli_Transport_01_F",0, + "EPOCH_RyanZombie_1",0.12, + "I_Soldier_EPOCH",0 + }; + + antagonistSpawnIndex[] = { + // {"type", limit} + {"Epoch_Cloak_F",1}, + {"GreatWhite_F",2}, + {"Epoch_Sapper_F",2}, + {"Epoch_SapperG_F",1}, + {"Epoch_SapperB_F",1}, + {"I_UAV_01_F",2}, + {"PHANTOM",1}, + {"B_Heli_Transport_01_F",1}, + {"EPOCH_RyanZombie_1",12}, + {"I_Soldier_EPOCH",1} + }; + customVarsDefaults[] = { + // EPOCH_player + varName, default value, {max,min,high-warn,high-critical,low-warn,low-critical} + {"Temp",98.6,{106.7,95,102,105,96,95}}, + {"Hunger",1500,{5000,0,5001,5001,1250,0}}, + {"Thirst",750,{2500,0,2501,2501,625,0}}, + {"AliveTime",0,{-2,0}}, + {"Energy",0,{2500,0}}, + {"Wet",0,{100,0,35,55,-1,-1}}, + {"Soiled",0,{100,0,35,55,-1,-1}}, + {"Immunity",0,{100,0}}, + {"Toxicity",0,{100,0,35,55,-1,-1}}, + {"Stamina",100,{"EPOCH_playerStaminaMax",0}}, + {"Crypto",0,{250000,0}}, + {"HitPoints",{0,0,0,0},{1,0,0.5,1,-1,-1}}, + {"BloodP",100,{190,0,120,140,70,50}}, + {"SpawnArray",{},{}}, + {"Karma",0,{50000,-50000}}, + {"Alcohol",0,{100,0,35,55,-1,-1}}, + {"Radiation",0,{100,0,35,55,-1,-1}}, + {"Nuisance",0,{100,0}}, + {"MissionArray",{},{}} + }; // add any stats and their starting number here for better community integration and neat stats tracking too! defineCommunityStats[] = {{"Murders",0},{"Deaths",0},{"Suicides",0},{"Revives",0},{"TraderMissions",0},{"AIKills",0},{"AntagonistKills",0},{"ZombieKills",0}}; - hudConfigs[] = {{{"BloodP","","",{"getPlayerDamage",">=",0.7}},"topRight","x\addons\a3_epoch_code\Data\UI\bleeding_ca.paa",{"forceUpdate"}},{{"Oxygen","getPlayerOxygenRemaining","",{},{1,0,2,2,1,0.55}},"topRight","x\addons\a3_epoch_code\Data\UI\oxygen_ca.paa"},{"Hunger","topRight","x\addons\a3_epoch_code\Data\UI\hunger_ca.paa",{"forceBloodRise"}},{"Thirst","topRight","x\addons\a3_epoch_code\Data\UI\thirst_ca.paa",{"forceBloodRise"}},{"Temp","topRight",{"x\addons\a3_epoch_code\Data\UI\hot_ca.paa","x\addons\a3_epoch_code\Data\UI\cold_ca.paa"},{"forceFatigue"}},{"Toxicity","topRight","x\addons\a3_epoch_code\Data\UI\hazzard_ca.paa"},{"Alcohol","topRight","x\addons\a3_epoch_code\Data\UI\drunk_ca.paa"},{"Soiled","topRight","x\addons\a3_epoch_code\Data\UI\soiled_ca.paa"},{"Radiation","topRight","x\addons\a3_epoch_code\Data\UI\rads_ca.paa"},{{"HitPoints","getPlayerHitPointDamage","HitLegs"},"topRight","x\addons\a3_epoch_code\Data\UI\broken_ca.paa"}}; + hudConfigs[] = { + {{"BloodP","","",{"getPlayerDamage",">=",0.7}},"topRight","x\addons\a3_epoch_code\Data\UI\bleeding_ca.paa",{"forceUpdate"}}, + {{"Oxygen","getPlayerOxygenRemaining","",{},{1,0,2,2,1,0.55}},"topRight","x\addons\a3_epoch_code\Data\UI\oxygen_ca.paa"}, + {"Hunger","topRight","x\addons\a3_epoch_code\Data\UI\hunger_ca.paa",{"forceBloodRise"}}, + {"Thirst","topRight","x\addons\a3_epoch_code\Data\UI\thirst_ca.paa",{"forceBloodRise"}}, + {"Temp","topRight",{"x\addons\a3_epoch_code\Data\UI\hot_ca.paa","x\addons\a3_epoch_code\Data\UI\cold_ca.paa"},{"forceFatigue"}}, + {"Toxicity","topRight","x\addons\a3_epoch_code\Data\UI\hazzard_ca.paa"}, + {"Alcohol","topRight","x\addons\a3_epoch_code\Data\UI\drunk_ca.paa"}, + {"Soiled","topRight","x\addons\a3_epoch_code\Data\UI\soiled_ca.paa"}, + {"Radiation","topRight","x\addons\a3_epoch_code\Data\UI\rads_ca.paa"}, + {{"HitPoints","getPlayerHitPointDamage","HitLegs"},"topRight","x\addons\a3_epoch_code\Data\UI\broken_ca.paa"} + }; group_upgrade_lvl[] = {4,"1000",6,"1500",8,"2000",10,"2500",12,"3000",14,"3500",16,"4000",32,"8000",64,"16000"}; // controls max group limit and cost // Event handler code displayAddEventHandler[] = {"keyDown","keyUp"}; diff --git a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_destroyTrash.sqf b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_destroyTrash.sqf index 148575b5..98ca7278 100644 --- a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_destroyTrash.sqf +++ b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_destroyTrash.sqf @@ -46,21 +46,5 @@ if (alive _object) then { }; }; - if ((random 1) <= EPOCH_antagonistChanceTrash) then { - _nearPlayers = _posWH nearEntities[["Epoch_Male_F", "Epoch_Female_F"], 50]; - - if (!(_nearPlayers isEqualTo[])) then { - _target = selectRandom _nearPlayers; - - _antagTable = ["Trash", "CfgMainTable", "antagonists"] call EPOCH_weightedArray; - - _antagTableArray = _antagTable select 0; - if !(_antagTableArray isEqualTo[]) then{ - _weightedArray = _antagTable select 1; - _triggerType = _antagTableArray select(selectRandom _weightedArray); - [_target, _triggerType] call EPOCH_server_triggerEvent; - }; - }; - }; }; true diff --git a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootContainer.sqf b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootContainer.sqf index 76832fb1..0b032da3 100644 --- a/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootContainer.sqf +++ b/Sources/epoch_server/compile/epoch_looting/EPOCH_server_lootContainer.sqf @@ -55,13 +55,4 @@ if !(_object in EPOCH_cleanupQueue) then { [_errorMsg, 5] remoteExec ['Epoch_message',_player]; }; - if ((random 1) <= EPOCH_antagonistChanceLoot) then{ - _antagTable = [_type, "CfgMainTable", "antagonists"] call EPOCH_weightedArray; - _antagTableArray = _antagTable select 0; - if !(_antagTableArray isEqualTo[]) then{ - _weightedArray = _antagTable select 1; - _triggerType = _antagTableArray select(selectRandom _weightedArray); - [_player, _triggerType] call EPOCH_server_triggerEvent; - }; - }; }; diff --git a/Sources/epoch_server/config.cpp b/Sources/epoch_server/config.cpp index 07e80747..a14eb2c6 100644 --- a/Sources/epoch_server/config.cpp +++ b/Sources/epoch_server/config.cpp @@ -27,6 +27,13 @@ class CfgServerFunctions class server_deleteGroup {}; class server_invitePlayer {}; }; + class epoch_grouptemp { + class server_upgradeTempGroup {}; + class server_updatePlayerTempGroup {}; + class server_createTempGroup {}; + class server_deleteTempGroup {}; + class server_invitePlayerTempGroup {}; + }; class epoch_bases { class swapBuilding {}; class saveBuilding {}; diff --git a/Sources/epoch_server/init/server_variables.sqf b/Sources/epoch_server/init/server_variables.sqf index 71518800..e9fb4965 100644 --- a/Sources/epoch_server/init/server_variables.sqf +++ b/Sources/epoch_server/init/server_variables.sqf @@ -36,12 +36,11 @@ private _configArray = [ ["lootMultiplier", 0.5], ["WeatherStaticForecast", []], ["showEarthQuakes", true], + ["showSatellites", true], ["showShippingContainers", true], ["cloneCost", 100], ["vehicleLockTime", 1800], - ["antagonistChanceTrash", 0.09], ["antagonistChancePDeath", 0.33], - ["antagonistChanceLoot", 0.09], ["taxRate", 0.1], ["starterTraderItems", [[], []]], ["SHOW_TRADERS", true], diff --git a/Sources/epoch_server_settings/configs/CfgLootTable.h b/Sources/epoch_server_settings/configs/CfgLootTable.h index 347561b4..96f0fd8b 100644 --- a/Sources/epoch_server_settings/configs/CfgLootTable.h +++ b/Sources/epoch_server_settings/configs/CfgLootTable.h @@ -1342,9 +1342,9 @@ class CfgLootTable { { "H_92_EPOCH", "item" }, 1 }, { { "H_104_EPOCH", "item" }, 1 }, { { "H_105_EPOCH", "item" }, 1 }, - { { "wolf_mask_epoch", "item" }, 1 }, - { { "pkin_mask_epoch", "item" }, 1 }, - { { "clown_mask_epoch", "item" }, 1 } + { { "wolf_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "pkin_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "clown_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} } // only available in october }; }; }; diff --git a/Sources/epoch_server_settings/configs/CfgLootTable_CUP.h b/Sources/epoch_server_settings/configs/CfgLootTable_CUP.h index d701116c..e8353235 100644 --- a/Sources/epoch_server_settings/configs/CfgLootTable_CUP.h +++ b/Sources/epoch_server_settings/configs/CfgLootTable_CUP.h @@ -1905,9 +1905,9 @@ class CfgLootTable_CUP { { "H_92_EPOCH", "item" }, 1 }, { { "H_104_EPOCH", "item" }, 1 }, { { "H_105_EPOCH", "item" }, 1 }, - { { "wolf_mask_epoch", "item" }, 1 }, - { { "pkin_mask_epoch", "item" }, 1 }, - { { "clown_mask_epoch", "item" }, 1 } + { { "wolf_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "pkin_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "clown_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} } // only available in october }; }; }; diff --git a/Sources/epoch_server_settings/configs/CfgLootTable_MAD.h b/Sources/epoch_server_settings/configs/CfgLootTable_MAD.h index 6e44c269..658eae59 100644 --- a/Sources/epoch_server_settings/configs/CfgLootTable_MAD.h +++ b/Sources/epoch_server_settings/configs/CfgLootTable_MAD.h @@ -1350,9 +1350,9 @@ class CfgLootTable_MAD { { "H_92_EPOCH", "item" }, 1 }, { { "H_104_EPOCH", "item" }, 1 }, { { "H_105_EPOCH", "item" }, 1 }, - { { "wolf_mask_epoch", "item" }, 1 }, - { { "pkin_mask_epoch", "item" }, 1 }, - { { "clown_mask_epoch", "item" }, 1 } + { { "wolf_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "pkin_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "clown_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} } // only available in october }; }; }; diff --git a/Sources/epoch_server_settings/configs/CfgLootTable_MADCUP.h b/Sources/epoch_server_settings/configs/CfgLootTable_MADCUP.h index 3e7c505c..aca31717 100644 --- a/Sources/epoch_server_settings/configs/CfgLootTable_MADCUP.h +++ b/Sources/epoch_server_settings/configs/CfgLootTable_MADCUP.h @@ -1913,9 +1913,9 @@ class CfgLootTable_MADCUP { { "H_92_EPOCH", "item" }, 1 }, { { "H_104_EPOCH", "item" }, 1 }, { { "H_105_EPOCH", "item" }, 1 }, - { { "wolf_mask_epoch", "item" }, 1 }, - { { "pkin_mask_epoch", "item" }, 1 }, - { { "clown_mask_epoch", "item" }, 1 } + { { "wolf_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "pkin_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} }, // only available in october + { { "clown_mask_epoch", "item" }, 1, {"getDate", 1, "==", 10} } // only available in october }; }; }; diff --git a/Sources/epoch_server_settings/configs/CfgMainTable.h b/Sources/epoch_server_settings/configs/CfgMainTable.h index a044f7c0..633d4eb9 100644 --- a/Sources/epoch_server_settings/configs/CfgMainTable.h +++ b/Sources/epoch_server_settings/configs/CfgMainTable.h @@ -20,15 +20,6 @@ class CfgMainTable lootMin = 1; LootMax = 1; tables[] = { "Food" }; - antagonists[] = { - { "Zombie", 40 }, - { "UAV", 15 }, - { "Cloak", 10 }, // Night = Epoch_Cloak_F, Day = Epoch_Sapper_F - { "Sapper", 20 }, - { "SapperG", 5 }, - { "SapperB", 5 }, - { "PHANTOM", 5 } - }; }; class Tree : Default { @@ -62,14 +53,6 @@ class CfgMainTable { "Generic", 15 }, { "GenericLarge", 18 } }; - antagonists[] = { - { "Zombie", 45 }, - { "UAV", 15 }, - { "Cloak", 10 }, // Night = Epoch_Cloak_F, Day = Epoch_Sapper_F - { "Sapper", 20 }, - { "SapperG", 5 }, - { "SapperB", 5 } - }; }; class TrashSmall : Default {