Init.c Update

This commit is contained in:
SchnitzelPommes 2018-11-30 22:49:56 +01:00
parent 990bd75f89
commit 475584c91a
2 changed files with 85 additions and 0 deletions

View File

@ -10,3 +10,5 @@ Dayz Standalone UI Admin Tool
## Set VerifySignatures to 0 or Sign it everytime you rebuild
# Init.c not used Changed class name copy to your mpmissions folder

View File

@ -0,0 +1,83 @@
void main()
{
Hive ce = CreateHive();
if ( ce )
ce.InitOffline();
Weather weather = g_Game.GetWeather();
weather.GetOvercast().SetLimits( 0.0 , 1.0 );
weather.GetRain().SetLimits( 0.0 , 1.0 );
weather.GetFog().SetLimits( 0.0 , 0.25 );
weather.GetOvercast().SetForecastChangeLimits( 0.5, 0.8 );
weather.GetRain().SetForecastChangeLimits( 0.1, 0.3 );
weather.GetFog().SetForecastChangeLimits( 0.05, 0.10 );
weather.GetOvercast().SetForecastTimeLimits( 3600 , 3600 );
weather.GetRain().SetForecastTimeLimits( 300 , 300 );
weather.GetFog().SetForecastTimeLimits( 3600 , 3600 );
weather.GetOvercast().Set( Math.RandomFloatInclusive(0.0, 0.3), 0, 0);
weather.GetRain().Set( Math.RandomFloatInclusive(0.0, 0.2), 0, 0);
weather.GetFog().Set( Math.RandomFloatInclusive(0.0, 0.1), 0, 0);
weather.SetWindMaximumSpeed(30);
weather.SetWindFunctionParams(0.1, 1.0, 50);
}
class CustomMission1: MissionServer
{
void CustomMission()
{
}
void ~CustomMission()
{
}
void SetRandomHealth(EntityAI itemEnt)
{
int rndHlt = Math.RandomInt(40,100);
itemEnt.SetHealth("","",rndHlt);
}
override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
{
Entity playerEnt;
playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
Class.CastTo(m_player, playerEnt);
GetGame().SelectPlayer(identity, m_player);
return m_player;
}
override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
{
/*
player.RemoveAllItems();
EntityAI item = player.GetInventory().CreateInInventory(topsArray.GetRandomElement());
EntityAI item2 = player.GetInventory().CreateInInventory(pantsArray.GetRandomElement());
EntityAI item3 = player.GetInventory().CreateInInventory(shoesArray.GetRandomElement());
*/
EntityAI itemEnt;
ItemBase itemBs;
itemEnt = player.GetInventory().CreateInInventory("Rag");
itemBs = ItemBase.Cast(itemEnt);
itemBs.SetQuantity(4);
SetRandomHealth(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("RoadFlare");
itemBs = ItemBase.Cast(itemEnt);
}
};
Mission CreateCustomMission(string path)
{
return new CustomMission1();
}