Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Spawn helper function
- void SpawnObject( string type, vector position, vector orientation )
- {
- auto obj = GetGame().CreateObject( type, position );
- obj.SetPosition( position );
- obj.SetOrientation( orientation );
- obj.SetOrientation( obj.GetOrientation() ); //Collision fix
- obj.Update();
- obj.SetAffectPathgraph( true, false );
- if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );
- }
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\prisonship.c"
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\island01.c"
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\island02.c"
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\container.c"
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\islandmili.c"
- #include "$CurrentDir:\\mpmissions\\dayzOffline.chernarusplus\\caves.c"
- void main()
- {
- //INIT WEATHER BEFORE ECONOMY INIT------------------------
- Weather weather = g_Game.GetWeather();
- weather.MissionWeather(false); // false = use weather controller from Weather.c
- weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
- weather.GetRain().Set( 0, 0, 1);
- weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
- //INIT ECONOMY--------------------------------------
- Hive ce = CreateHive();
- if ( ce )
- ce.InitOffline();
- //Notification Server
- GetNotificationSystem().CreateNotification_Old("Hello", "Welcome to the server", ARGB(255, 255, 255, 255), 15);
- //Your custom spawned objects ATM IN GREENMT
- SpawnObject( "DC_BankingATM", "3701.592529 402.000000 5995.256836", "-31.990705 0.000000 0.000000" );
- SpawnObject( "DC_BankingATMRed", "3702.300537 402.000000 5995.728027", "-31.990705 0.000000 0.000000" );
- SpawnObject( "DC_BankingATMDarkGreen", "3703.015137 402.000000 5996.205078", "-31.990705 0.000000 0.000000" );
- SpawnObject( "DC_BankingATMDarkBlue", "3703.701904 402.000000 5996.666992", "-31.990705 0.000000 0.000000" );
- //spawned objects ATM IN Kumyrna
- SpawnObject( "DC_BankingATM", "8361.131836 292.019104 5991.822266", "10.000004 0.000000 0.000000" );
- SpawnObject( "DC_BankingATMYellow", "8361.958984 292.022705 5991.670898", "10.000004 0.000000 0.000000" );
- SpawnObject( "DC_BankingATMGray", "8363.551758 292.024048 5991.381836", "10.000004 0.000000 0.000000" );
- SpawnObject( "DC_BankingATMDarkBlue", "8362.740234 292.024811 5991.526855", "10.000004 0.000000 0.000000" );
- //Add Island
- prisonship();
- island01();
- island02();
- container();
- islandmili();
- caves();
- //GetTesting().ExportProxyData( "2250000 0 7500", 2250000 ); //Center of map, radius of how far to go out and find buildings.
- //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 )
- {
- int rndHlt = Math.RandomInt(55,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)
- {
- EntityAI itemTop;
- EntityAI itemEnt;
- ItemBase itemBs;
- float rand;
- itemTop = player.FindAttachmentBySlotName("Body");
- if ( itemTop )
- {
- itemEnt = itemTop.GetInventory().CreateInInventory("Rag");
- if ( Class.CastTo(itemBs, itemEnt ) )
- itemBs.SetQuantity(4);
- SetRandomHealth(itemEnt);
- itemEnt = itemTop.GetInventory().CreateInInventory("flashlight");
- SetRandomHealth(itemEnt);
- itemEnt = itemTop.GetInventory().CreateInInventory("Battery9V");
- SetRandomHealth(itemEnt);
- itemEnt = itemTop.GetInventory().CreateInInventory("WaterBottle");
- SetRandomHealth(itemEnt);
- itemEnt = itemTop.GetInventory().CreateInInventory("MoneyRuble100");
- SetRandomHealth(itemEnt);
- itemEnt = itemTop.GetInventory().CreateInInventory("KitchenKnife");
- SetRandomHealth(itemEnt);
- rand = Math.RandomFloatInclusive(0.0, 1.0);
- if ( rand < 0.35 )
- itemEnt = player.GetInventory().CreateInInventory("rice");
- else if ( rand > 0.65 )
- itemEnt = player.GetInventory().CreateInInventory("Pear");
- SetRandomHealth(itemEnt);
- }
- }
- };
- Mission CreateCustomMission(string path)
- {
- return new CustomMission();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement