Habe die init.C von namaslk wollte kleidungen und rucksack hinzufügen . Dosen essen und trinkflasche ins backpack rein tun
siehe bild das hab ich ihn zu gefügt
Code
void main()
{
/*
[Namalsk] CE init (offline)
*/
CreateHive();
GetHive().InitOffline();
/*
[Namalsk] Weather init
Warning: DO NOT ALTER following values as they are interconnected with other Namalsk-specific systems!
To ensure correct functionality, it is necessary to include weaher init AFTER the hive init.
*/
Weather weather = GetGame().GetWeather();
weather.MissionWeather( true );
weather.GetOvercast().SetLimits( 0.30, 0.30 );
weather.GetRain().SetLimits( 1, 1 );
weather.GetFog().SetLimits( 0.5, 0.5 );
weather.GetOvercast().SetForecastChangeLimits( 0.1, 0.3 );
weather.GetOvercast().SetForecastTimeLimits( 1600, 2100 );
weather.GetOvercast().Set( Math.RandomFloatInclusive( 0.1, 0.2 ), 0, 0 );
weather.GetRain().Set( 0.5, 0, 0.5 );
weather.GetFog().Set( 0.5, 1.0, 0.5 );
weather.SetWindMaximumSpeed( 30 );
weather.SetWindFunctionParams( 0.5, 1.0, 42 );
weather.SetRainThresholds( 0.5, 1.0, 0.5 );
/*
[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:
12/1 -> 12/31
keep in mind that gameplay features are tied to the mission date (stored in the storage) and that it SHOULD remain this period!
while using:
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)
*/
int year, month, day, hour, minute;
GetGame().GetWorld().GetDate( year, month, day, hour, minute );
if ( month < 12 )
{
year = 2011;
month = 12;
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 )
{
// enable/disable event system, min time between events, max time between events
m_EventManagerServer.OnInitServer( true, 600, 800 );
// Register possible events along with their probability (0..1)
// any custom events MUST inherit from EventBase, otherwise they will fail to load!
m_EventManagerServer.RegisterEvent( Aurora, 1.0 );
m_EventManagerServer.RegisterEvent( Blizzard, 0.5 );
m_EventManagerServer.RegisterEvent( ExtremeCold, 0.4 );
m_EventManagerServer.RegisterEvent( Snowfall, 0.8 );
m_EventManagerServer.RegisterEvent( EVRStorm, 0.25 );
}
}
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 ) )
itemBs.SetQuantity( 4 );
player.SetQuickBarEntityShortcut( itemEnt, 0 );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "CombatKnife" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "FirefighterAxe_Green" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "Chemlight_White" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "Matchbox" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "" );
SetRandomHealth( itemEnt );
player.SetQuickBarEntityShortcut( itemEnt, 1 );
}
// pants
itemClothing = player.FindAttachmentBySlotName( "Legs" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.GetInventory().CreateInInventory( "Heatpack" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "Heatpack" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "MountainBag_Blue" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "" );
SetRandomHealth( itemEnt );
int throwDice = Math.RandomInt( 0, 2 );
if ( throwDice == 0 )
itemEnt = itemClothing.GetInventory().CreateInInventory( "" );
else
itemEnt = itemClothing.GetInventory().CreateInInventory( "" );
player.SetQuickBarEntityShortcut( itemEnt, 2 );
}
// shoes
itemClothing = player.FindAttachmentBySlotName( "Feet" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
}
// Backpack
itemClothing = player.FindAttachmentBySlotName( "Backpack" );
if ( itemClothing )
{
SetRandomHealth( itemClothing );
itemEnt = itemClothing.GetInventory().CreateInInventory( "dzn_SodaCan_Pipsi" );
SetRandomHealth( itemEnt );
itemEnt = itemClothing.GetInventory().CreateInInventory( "dzn_BakedBeansCan" );
SetRandomHealth( itemEnt );
}
// bump fresh spawn water and energy values (to compensate for the frozen food and harder-to-get wells)
player.GetStatWater().Set( 800 );
player.GetStatEnergy().Set( 800 );
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission();
};
Alles anzeigen