Dayz_HardCore/init.c

263 lines
11 KiB
C

#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\BEREZINO_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\BEREZINO_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\CERNAYA_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\CERNAYA_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\KARMANOVKA_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\KRASNOSTAV_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\KRASNOSTAV_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\NOVAYA_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\NOVAYA_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\NOVODMITROVSK_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\NOVODMITROVSK_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\NOVODMITROVSK_AI3.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\NOVY_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\PUSTOSKKA_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\STARY_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\SVETLOJARSK_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\SVETLOJARSK_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\SVETLOJARSK_AI3.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\VYBOR_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\VYBORAIR_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\VYBORAIR_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\VYBORAIR_AI3.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\VYBORAIR_AI4.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\VYBORAIR_AI5.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\ZELENOGORSK_AI1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\ZELENOGORSK_AI2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionC1.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionC2.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionC3.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionC4.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionKab.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionNWA.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionPav.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionTisy.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionTroick.c"
#include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\BotMissions\\Original\\BotGroupMissionZel.c"
void main()
{
//Start bot mission module
BotGroupMission_BEREZINO_AI1();
BotGroupMission_BEREZINO_AI2();
BotGroupMission_CERNAYA_AI1();
BotGroupMission_CERNAYA_AI2();
BotGroupMission_KARMANOVKA_AI1();
BotGroupMission_KRASNOSTAV_AI1();
BotGroupMission_KRASNOSTAV_AI2();
BotGroupMission_NOVAYA_AI1();
BotGroupMission_NOVAYA_AI2();
BotGroupMission_NOVODMITROVSK_AI1();
BotGroupMission_NOVODMITROVSK_AI2();
BotGroupMission_NOVODMITROVSK_AI3();
BotGroupMission_NOVY_AI1();
BotGroupMission_PUSTOSKKA_AI1();
BotGroupMission_STARY_AI1();
BotGroupMission_SVETLOJARSK_AI1();
BotGroupMission_SVETLOJARSK_AI2();
BotGroupMission_SVETLOJARSK_AI3();
BotGroupMission_VYBOR_AI1();
BotGroupMission_VYBORAIR_AI1();
BotGroupMission_VYBORAIR_AI2();
BotGroupMission_VYBORAIR_AI3();
BotGroupMission_VYBORAIR_AI4();
BotGroupMission_VYBORAIR_AI5();
BotGroupMission_ZELENOGORSK_AI1();
BotGroupMission_ZELENOGORSK_AI2();
BotGroupMissionC1();
BotGroupMissionC2();
BotGroupMissionC3();
BotGroupMissionC4();
BotGroupMissionKab();
BotGroupMissionNWA();
BotGroupMissionPav();
BotGroupMissionTroick();
BotGroupMissionTisy();
BotGroupMissionZel();
//PopstApoWeather
Weather weather = g_Game.GetWeather();
weather.MissionWeather(true); // false = use weather controller from Weather.c
Get_ab_PostApoWeather().GOOD_WEATHER_CHANCE = 75;
Get_ab_PostApoWeather().STORM_WEATHER_CHANCE = 50;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_CHANCE = 50;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_TIMEOUT = 30 * 60;
Get_ab_PostApoWeather().CLEAR_WEATHER_DURATION_MIN = 15 * 60;
Get_ab_PostApoWeather().CLEAR_WEATHER_DURATION_MAX = 30 * 60;
Get_ab_PostApoWeather().GOOD_WEATHER_DURATION_MIN = 20 * 60;
Get_ab_PostApoWeather().GOOD_WEATHER_DURATION_MAX = 30 * 60;
Get_ab_PostApoWeather().BAD_WEATHER_DURATION_MIN = 20 * 60;
Get_ab_PostApoWeather().BAD_WEATHER_DURATION_MAX = 30 * 60;
Get_ab_PostApoWeather().STORM_WEATHER_DURATION_MIN = 5 * 60;
Get_ab_PostApoWeather().STORM_WEATHER_DURATION_MAX = 15 * 60;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_DURATION_MIN = 8 * 60;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_DURATION_MAX = 15 * 60;
Get_ab_PostApoWeather().CLEAR_WEATHER_PARAMS_OVERCAST_MIN = 0.0;
Get_ab_PostApoWeather().CLEAR_WEATHER_PARAMS_OVERCAST_MAX = 0.2;
Get_ab_PostApoWeather().CLEAR_WEATHER_PARAMS_FOG_MIN = 0.0;
Get_ab_PostApoWeather().CLEAR_WEATHER_PARAMS_FOG_MAX = 0.0;
Get_ab_PostApoWeather().CLEAR_WEATHER_PARAMS_WIND_MIN = 0.1;
Get_ab_PostApoWeather().CLEAR_WEATHER_PARAMS_WIND_MAX = 2.0;
Get_ab_PostApoWeather().GOOD_WEATHER_PARAMS_OVERCAST_MIN = 0.6;
Get_ab_PostApoWeather().GOOD_WEATHER_PARAMS_OVERCAST_MAX = 0.7;
Get_ab_PostApoWeather().GOOD_WEATHER_PARAMS_FOG_MIN = 0.0;
Get_ab_PostApoWeather().GOOD_WEATHER_PARAMS_FOG_MAX = 0.1;
Get_ab_PostApoWeather().GOOD_WEATHER_PARAMS_WIND_MIN = 0.1;
Get_ab_PostApoWeather().GOOD_WEATHER_PARAMS_WIND_MAX = 5.0;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_OVERCAST_MIN = 0.8;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_OVERCAST_MAX = 0.9;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_FOG_MIN = 0.05;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_FOG_MAX = 0.15;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_WIND_MIN = 5.0;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_WIND_MAX = 10.0;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_RAIN_MIN = 0.01;
Get_ab_PostApoWeather().BAD_WEATHER_PARAMS_RAIN_MAX = 0.5;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_OVERCAST_MIN = 0.9;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_OVERCAST_MAX = 0.9;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_FOG_MIN = 0.15;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_FOG_MAX = 0.3;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_WIND_MIN = 10.0;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_WIND_MAX = 20.0;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_RAIN_MIN = 0.6;
Get_ab_PostApoWeather().STORM_WEATHER_PARAMS_RAIN_MAX = 1.0;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_PARAMS_OVERCAST_MIN = 1.0;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_PARAMS_OVERCAST_MAX = 1.0;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_PARAMS_FOG_MIN = 0.0;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_PARAMS_FOG_MAX = 0.0;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_PARAMS_WIND_MIN = 30.0;
Get_ab_PostApoWeather().ANOMALY_STORM_WEATHER_PARAMS_WIND_MAX = 40.0;
Get_ab_PostApoWeather().WEATHER_PARAMS_RAIN_THRESHOLD_OVERCAST_MIN = 0.55;
Get_ab_PostApoWeather().WEATHER_PARAMS_RAIN_THRESHOLD_OVERCAST_MAX = 1.0;
Get_ab_PostApoWeather().WEATHER_PARAMS_RAIN_THRESHOLD_STOP_TIME = 60.0;
Get_ab_PostApoWeather().Start();
//INIT ECONOMY--------------------------------------
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
//DATE RESET AFTER ECONOMY INIT-------------------------
int year, month, day, hour, minute;
int reset_month = 9, reset_day = 20;
GetGame().GetWorld().GetDate(year, month, day, hour, minute);
if ((month == reset_month) && (day < reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month == reset_month + 1) && (day > reset_day))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
else
{
if ((month < reset_month) || (month > reset_month + 1))
{
GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
}
}
}
}
class CustomMission: MissionServer
{
void SetRandomHealth(EntityAI itemEnt)
{
if ( itemEnt )
{
float rndHlt = Math.RandomFloat( 0.45, 0.65 );
itemEnt.SetHealth01( "", "", rndHlt );
}
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer( identity, characterName, pos, 0, "NONE" );
Class.CastTo( m_player, playerEnt );
GetGame().SelectPlayer( identity, m_player );
return m_player;
}
/* override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
EntityAI itemClothing;
EntityAI itemEnt;
ItemBase itemBs;
float rand;
itemClothing = player.FindAttachmentBySlotName( "Body" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.GetInventory().CreateInInventory( "Rag" );
if ( Class.CastTo( itemBs, itemEnt ) )
itemBs.SetQuantity( 3 );
string chemlightArray[] = { "Chemlight_White", "Chemlight_Yellow", "Chemlight_Green", "Chemlight_Red" };
int rndIndex = Math.RandomInt( 0, 4 );
itemEnt = itemClothing.GetInventory().CreateInInventory( chemlightArray[rndIndex] );
SetRandomHealth( itemEnt );
rand = Math.RandomFloatInclusive( 0.0, 1.0 );
if ( rand < 0.35 )
itemEnt = player.GetInventory().CreateInInventory( "Apple" );
else if ( rand > 0.65 )
itemEnt = player.GetInventory().CreateInInventory( "Pear" );
else
itemEnt = player.GetInventory().CreateInInventory( "Plum" );
SetRandomHealth( itemEnt );
itemEnt = player.GetInventory().CreateInInventory( "Pear" );
itemEnt = player.GetInventory().CreateInInventory( "Roadflare" );
itemEnt = player.GetInventory().CreateInInventory( "StoneKnife" );
}
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
SetRandomHealth( itemClothing );
itemClothing = player.FindAttachmentBySlotName( "Feet" );
if ( itemClothing )
SetRandomHealth( itemClothing );
}
*/
override void StartingEquipSetup(PlayerBase player, bool clothesChosen) // remember to remove the original void.
{
player.RemoveAllItems();
player.GetInventory().CreateInInventory("TrackSuitPants_LightBlue");
player.GetInventory().CreateInInventory("PrisonUniformJacket");
//player.GetInventory().CreateInInventory("AviatorGlasses");
player.GetInventory().CreateInInventory("AthleticShoes_Blue");
player.GetInventory().CreateInInventory("Rag");
player.GetInventory().CreateInInventory("StoneKnife");
player.GetInventory().CreateInInventory("Roadflare");
player.GetInventory().CreateInInventory("Pear");
}
//More Wolves END
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
}