Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void SpawnObject(string type, vector position, vector orientation)
- {
- auto obj = GetGame().CreateObjectEx(type, position, ECE_SETUP | ECE_UPDATEPATHGRAPH | ECE_CREATEPHYSICS);
- obj.SetPosition(position);
- obj.SetOrientation(orientation);
- obj.SetOrientation(obj.GetOrientation());
- obj.SetFlags(EntityFlags.STATIC, false);
- obj.Update();
- obj.SetAffectPathgraph(true, false);
- if (obj.CanAffectPathgraph()) GetGame().GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(GetGame().UpdatePathgraphRegionByObject, 100, false, obj);
- }
- void main()
- {
- //ATMS
- SpawnObject("DC_BankingATM", "7246.01 238.252 7038.83", "-8.999998 0.000000 0.000000"); //Safe Trader
- // Tara Trader
- SpawnObject("bldr_hbarrier_round", "7243.262695 239.141342 7025.149902", "12.691935 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_round", "7238.111328 239.141342 7027.649414", "52.748150 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_round", "7236.049805 239.188004 7032.890137", "100.096275 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_round", "7238.111328 239.159866 7038.243164", "137.243286 0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_round", "7248.669922 239.141342 7026.606934", "-27.000010 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_round", "7243.145020 239.185364 7040.863281", "-179.999939 0.000000 -0.000000");
- SpawnObject("Land_Mil_GuardShed", "7247.792480 238.784241 7027.925781", "143.999969 0.000000 -0.000000");
- SpawnObject("Land_Mil_GuardShed", "7243.382813 238.783585 7026.812500", "-171.000031 0.000000 -0.000000");
- SpawnObject("Land_Mil_GuardShed", "7239.398926 238.799194 7028.716797", "-131.963409 0.000000 -0.000000");
- SpawnObject("Land_Mil_GuardShed", "7237.911133 238.850739 7032.817383", "-89.999977 0.000000 0.000000");
- SpawnObject("bldr_mil_guardshed", "7239.458008 238.817307 7037.260742", "-45.000000 0.000000 0.000000");
- SpawnObject("Land_Mil_GuardShed", "7243.605957 238.813538 7039.163086", "-8.999998 0.000000 0.000000");
- SpawnObject("Land_Mil_CamoNet_Roof_east", "7240.221680 239.751160 7030.966309", "63.000000 0.000000 0.000000");
- SpawnObject("ExpansionSign_Trader_Consumables", "7247.086426 237.862427 7028.767090", "143.999969 0.000000 -0.000000");
- SpawnObject("ExpansionSign_Trader_Weapons", "7240.293945 237.813080 7029.533691", "-130.691055 -0.000000 -0.000000");
- SpawnObject("ExpansionSign_Trader_Attachments", "7239.104492 237.853302 7032.863770", "-90.000038 0.000000 -0.000000");
- SpawnObject("ExpansionSign_Trader_Clothing", "7240.227539 237.828583 7036.509277", "-45.000053 0.000000 0.000000");
- SpawnObject("ExpansionSign_Trader_Vehicles", "7243.856934 237.835800 7038.103516", "-9.000000 0.000000 0.000000");
- SpawnObject("ExpansionSign_Trader_Accessoires", "7243.508789 237.807877 7027.983887", "-174.044357 -0.000000 -0.000000");
- // Namalsk Airbase
- SpawnObject("Land_Mil_ATC_Small", "6281.133301 31.865360 9282.232422", "91.889534 -0.000000 -0.000000");
- SpawnObject("Land_Mil_Barracks_Round", "6280.693848 22.596621 9263.980469", "-90.000038 0.000000 -0.000000");
- SpawnObject("Land_Mil_Barracks_Round", "6280.700684 22.664263 9252.673828", "-89.999939 0.000000 0.000000");
- SpawnObject("Land_Mil_Fortified_Nest_Watchtower", "6279.749023 24.025724 9226.510742", "-99.000031 0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6287.216309 23.174833 9233.403320", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6286.763672 23.183363 9241.871094", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6269.817871 22.619736 9244.187500", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6270.167480 22.670408 9235.803711", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6270.730469 22.571636 9226.550781", "57.371552 0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6287.065430 22.821747 9226.770508", "125.999992 0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6289.298340 22.863621 9231.716797", "89.999992 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6289.281738 22.929468 9237.715820", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6288.877441 22.843649 9243.665039", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6268.033203 22.564787 9234.409180", "85.486847 0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6267.479004 22.544670 9240.354492", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6267.382813 22.481789 9246.212891", "89.999977 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6269.370605 22.547380 9252.622070", "87.807930 0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6268.859863 22.512800 9260.830078", "90.000000 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6272.515625 22.480555 9268.350586", "144.000015 0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6272.454590 22.814432 9227.299805", "-116.688370 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6275.693848 22.717571 9222.161133", "0.000000 -0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6282.227051 22.814552 9222.840820", "-9.000000 0.000000 0.000000");
- SpawnObject("bldr_misc_barbedwire", "6267.173340 22.394402 9252.347656", "87.240891 0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6266.903809 22.334454 9258.768555", "87.240891 0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6266.928711 22.287111 9265.083008", "-89.999977 0.000000 0.000000");
- SpawnObject("bldr_misc_barbedwire", "6269.881836 22.309063 9269.069336", "143.999969 0.000000 -0.000000");
- SpawnObject("bldr_misc_barbedwire", "6273.580566 22.369129 9273.416016", "116.999977 0.000000 -0.000000");
- SpawnObject("Land_Mil_Tent_Big4", "6279.250000 23.151300 9237.089844", "-9.000000 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_4m", "6284.228027 22.367245 9258.145508", "89.999977 -0.000000 -0.000000");
- SpawnObject("Land_Mil_Barracks1", "6320.133301 23.475285 9269.735352", "179.999954 0.000000 -0.000000");
- SpawnObject("Land_Mil_Barracks1", "6320.266602 23.573318 9255.591797", "179.999939 0.000000 -0.000000");
- SpawnObject("Land_Mil_GuardTower", "6325.685059 26.760927 9238.028320", "-89.999977 0.000000 0.000000");
- SpawnObject("Land_Mil_GuardTower", "6327.812988 25.006784 9092.879883", "-98.999977 0.000000 -0.000000");
- SpawnObject("Land_Mil_GuardTower", "6257.613770 25.448290 8960.162109", "-17.999996 0.000000 0.000000");
- SpawnObject("Land_Mil_GuardTower", "6329.575684 29.713659 9004.066406", "-71.999985 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6276.449707 21.917517 9077.341797", "-0.000008 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6285.197266 22.035852 9077.485352", "0.000002 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6293.953125 22.168051 9077.587891", "0.000000 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6302.728027 22.292084 9078.088867", "0.000000 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6273.649902 21.561537 9040.920898", "-0.000008 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6282.397461 21.561537 9041.064453", "0.000002 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6291.153320 21.561537 9041.166992", "0.000000 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6299.928223 21.561537 9041.667969", "0.000000 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6308.722656 21.912901 9043.640625", "-26.938005 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6309.056641 22.313852 9075.514648", "-98.999977 0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6311.491699 22.256893 9066.794922", "-105.328285 0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6313.578613 21.820284 9058.493164", "80.999985 -0.000000 -0.000000");
- SpawnObject("bldr_hbarrier_big", "6313.987305 21.833496 9049.569336", "-84.721085 0.000000 -0.000000");
- SpawnObject("Land_Mil_Barracks1", "6296.698242 23.200768 9068.442383", "179.326889 0.000000 -0.000000");
- SpawnObject("Land_Mil_Barracks4", "6297.799805 22.248055 9056.009766", "179.781006 0.000000 0.000000");
- SpawnObject("Land_Mil_Barracks2", "6280.520996 22.228298 9060.294922", "-89.999992 0.000000 0.000000");
- SpawnObject("Land_Mil_Fortified_Nest_Watchtower", "6267.571289 22.429617 9046.764648", "-5.399975 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6271.077637 21.647242 9054.224609", "-89.999977 0.000000 0.000000");
- SpawnObject("bldr_hbarrier_big", "6270.740234 21.651587 9063.049805", "-90.000000 0.000000 0.000000");
- /*
- [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.10, 0.30 );
- weather.GetRain().SetLimits( 0.0, 0.0 );
- weather.GetFog().SetLimits( 0.0, 0.0 );
- weather.GetOvercast().SetForecastChangeLimits( 0.1, 0.3 );
- weather.GetOvercast().SetForecastTimeLimits( 1600, 2100 );
- weather.GetOvercast().Set( Math.RandomFloatInclusive( 0.1, 0.2 ), 0, 0 ); // ignored if storage is present
- weather.GetRain().Set( 0, 0, 0 ); // ignored if storage is present
- weather.GetFog().Set( 0, 0, 0 ); // ignored if storage is present
- weather.SetWindMaximumSpeed( 30 );
- weather.SetWindFunctionParams( 0.1, 1.0, 42 );
- weather.SetStorm( 0, 1, 1 );
- weather.SetRainThresholds( 0.0, 1.0, 0 );
- /*
- [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( "RoadFlare" );
- SetRandomHealth( itemEnt );
- itemEnt = itemClothing.GetInventory().CreateInInventory( "RoadFlare" );
- SetRandomHealth( itemEnt );
- player.SetQuickBarEntityShortcut( itemEnt, 1 );
- }
- // 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" );
- player.SetQuickBarEntityShortcut( itemEnt, 2 );
- }
- // 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();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement