diff --git a/README.md b/README.md index 6cb1a62..7ee2b8e 100644 --- a/README.md +++ b/README.md @@ -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 + diff --git a/mpmissions/dayzOffline.chernarusplus/init.c b/mpmissions/dayzOffline.chernarusplus/init.c new file mode 100644 index 0000000..164c39a --- /dev/null +++ b/mpmissions/dayzOffline.chernarusplus/init.c @@ -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(); +} \ No newline at end of file