2020-11-22 18:53:57 +00:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
[Namalsk] CE init (offline)
|
|
|
|
*/
|
|
|
|
CreateHive();
|
|
|
|
GetHive().InitOffline();
|
|
|
|
|
|
|
|
/*
|
|
|
|
[Namalsk] Mission time init
|
|
|
|
after CE init to determine if storage mission type is outside of the required time-frame
|
|
|
|
currently recommended time-frame is:
|
2020-12-01 20:02:58 +00:00
|
|
|
12/1 -> 12/31
|
2020-11-22 18:54:30 +00:00
|
|
|
keep in mind that gameplay features are tied to the mission date (stored in the storage) and that it SHOULD remain this period!
|
2020-11-22 18:53:57 +00:00
|
|
|
while using:
|
2020-11-22 18:54:30 +00:00
|
|
|
day accelerated 6 times (serverTimeAcceleration=6), resulting in an average 78 min of day-time (RL)
|
|
|
|
night accelerated 24 times (serverNightTimeAcceleration=4), resulting in an average of 26 min of night-time (RL)
|
2020-11-22 18:53:57 +00:00
|
|
|
*/
|
|
|
|
int year, month, day, hour, minute;
|
|
|
|
GetGame().GetWorld().GetDate( year, month, day, hour, minute );
|
|
|
|
|
2020-11-27 18:17:35 +00:00
|
|
|
if ( month < 12 )
|
2020-11-22 18:53:57 +00:00
|
|
|
{
|
|
|
|
year = 2011;
|
2020-11-27 18:17:35 +00:00
|
|
|
month = 12;
|
2020-11-22 18:53:57 +00:00
|
|
|
day = 1;
|
|
|
|
|
|
|
|
GetGame().GetWorld().SetDate( year, month, day, hour, minute );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class CustomMission: MissionServer
|
|
|
|
{
|
|
|
|
override void OnInit()
|
|
|
|
{
|
|
|
|
super.OnInit();
|
|
|
|
|
|
|
|
// this piece of code is recommended otherwise event system is switched on automatically and runs from default values
|
|
|
|
// comment this whole block if NOT using Namalsk Survival
|
|
|
|
if ( m_EventManagerServer )
|
|
|
|
{
|
2021-02-27 22:07:47 +00:00
|
|
|
// enable/disable event system, min time between events, max time between events, max number of events at the same time
|
2021-03-15 19:10:11 +00:00
|
|
|
m_EventManagerServer.OnInitServer( true, 550, 1000, 2 );
|
2021-02-27 22:07:47 +00:00
|
|
|
// registering events and their probability
|
2021-03-10 13:32:03 +00:00
|
|
|
m_EventManagerServer.RegisterEvent( Aurora, 0.85 );
|
2021-03-24 20:44:31 +00:00
|
|
|
m_EventManagerServer.RegisterEvent( Blizzard, 0.4 );
|
2021-02-27 22:07:47 +00:00
|
|
|
m_EventManagerServer.RegisterEvent( ExtremeCold, 0.4 );
|
2021-03-10 13:32:03 +00:00
|
|
|
m_EventManagerServer.RegisterEvent( Snowfall, 0.6 );
|
|
|
|
m_EventManagerServer.RegisterEvent( EVRStorm, 0.35 );
|
2021-02-27 22:07:47 +00:00
|
|
|
m_EventManagerServer.RegisterEvent( HeavyFog, 0.3 );
|
2020-11-22 18:53:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetRandomHealth(EntityAI itemEnt)
|
|
|
|
{
|
|
|
|
if (itemEnt)
|
|
|
|
{
|
|
|
|
float rndHlt = Math.RandomFloat( 0.50, 0.85 );
|
|
|
|
itemEnt.SetHealth01( "", "", rndHlt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
override void StartingEquipSetup( PlayerBase player, bool clothesChosen )
|
|
|
|
{
|
|
|
|
EntityAI itemClothing;
|
|
|
|
EntityAI itemEnt;
|
|
|
|
ItemBase itemBs;
|
|
|
|
float rand;
|
|
|
|
|
|
|
|
// top
|
|
|
|
itemClothing = player.FindAttachmentBySlotName( "Body" );
|
|
|
|
if ( itemClothing )
|
|
|
|
{
|
|
|
|
SetRandomHealth( itemClothing );
|
|
|
|
|
|
|
|
itemEnt = itemClothing.GetInventory().CreateInInventory( "Rag" );
|
|
|
|
if ( Class.CastTo( itemBs, itemEnt ) )
|
2021-07-12 18:12:53 +00:00
|
|
|
{
|
2021-10-25 22:38:46 +00:00
|
|
|
SetRandomHealth( itemEnt );
|
2021-08-24 06:32:12 +00:00
|
|
|
itemBs.SetQuantity( 4 );
|
2021-07-12 18:12:53 +00:00
|
|
|
itemBs.SetCleanness( 1 );
|
|
|
|
}
|
2020-11-25 17:11:09 +00:00
|
|
|
player.SetQuickBarEntityShortcut( itemEnt, 0 );
|
2020-11-22 18:53:57 +00:00
|
|
|
|
|
|
|
itemEnt = itemClothing.GetInventory().CreateInInventory( "RoadFlare" );
|
|
|
|
SetRandomHealth( itemEnt );
|
|
|
|
itemEnt = itemClothing.GetInventory().CreateInInventory( "RoadFlare" );
|
|
|
|
SetRandomHealth( itemEnt );
|
2020-11-25 17:11:09 +00:00
|
|
|
player.SetQuickBarEntityShortcut( itemEnt, 1 );
|
2020-11-22 18:53:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// pants
|
|
|
|
itemClothing = player.FindAttachmentBySlotName( "Legs" );
|
|
|
|
if ( itemClothing )
|
|
|
|
{
|
|
|
|
SetRandomHealth( itemClothing );
|
|
|
|
|
|
|
|
itemEnt = itemClothing.GetInventory().CreateInInventory( "Heatpack" );
|
|
|
|
SetRandomHealth( itemEnt );
|
|
|
|
|
|
|
|
int throwDice = Math.RandomInt( 0, 2 );
|
|
|
|
if ( throwDice == 0 )
|
|
|
|
itemEnt = itemClothing.GetInventory().CreateInInventory( "dzn_tool_watch" );
|
|
|
|
else
|
|
|
|
itemEnt = itemClothing.GetInventory().CreateInInventory( "dzn_tool_watch2" );
|
2020-11-25 17:11:09 +00:00
|
|
|
player.SetQuickBarEntityShortcut( itemEnt, 2 );
|
2020-11-22 18:53:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// shoes
|
|
|
|
itemClothing = player.FindAttachmentBySlotName( "Feet" );
|
|
|
|
if ( itemClothing )
|
|
|
|
{
|
|
|
|
SetRandomHealth( itemClothing );
|
|
|
|
}
|
|
|
|
|
|
|
|
// bump fresh spawn water and energy values (to compensate for the frozen food and harder-to-get wells)
|
|
|
|
player.GetStatWater().Set( 900 );
|
|
|
|
player.GetStatEnergy().Set( 1100 );
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
Mission CreateCustomMission(string path)
|
|
|
|
{
|
|
|
|
return new CustomMission();
|
2020-11-26 23:08:18 +00:00
|
|
|
};
|