Advertisement
Tani82

init.c

Nov 9th, 2019
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 16.41 KB | None | 0 0
  1. /
  2. //Spawn helper function
  3. void SpawnObject( string type, vector position, vector orientation )
  4. {
  5.  auto obj = GetGame().CreateObject( type, position );
  6.  obj.SetPosition( position );
  7.  obj.SetOrientation( orientation );
  8.  obj.SetOrientation( obj.GetOrientation() ); //Collision fix
  9.  obj.Update();
  10.  obj.SetAffectPathgraph( true, false );
  11.  if( obj.CanAffectPathgraph() ) GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, obj );
  12. }
  13. void main()
  14. {
  15.     //INIT WEATHER BEFORE ECONOMY INIT------------------------
  16.     Weather weather = g_Game.GetWeather();
  17.  
  18.     weather.MissionWeather(false);    // false = use weather controller from Weather.c
  19.  
  20.     weather.GetOvercast().Set( Math.RandomFloatInclusive(0.4, 0.6), 1, 0);
  21.     weather.GetRain().Set( 0, 0, 1);
  22.     weather.GetFog().Set( Math.RandomFloatInclusive(0.05, 0.1), 1, 0);
  23.  
  24.     //INIT ECONOMY--------------------------------------
  25.     Hive ce = CreateHive();
  26.     if ( ce )
  27.         ce.InitOffline();
  28.    
  29.     //Your custom spawned objects
  30.       SpawnObject("DC_BankingATM", "3706.7 402.012 5984.86", "90 0 0"); //Green ATM
  31.       SpawnObject("DC_BankingATM", "3704.7 402.332 6003.1", "275 0 0"); //Green ATM
  32.       SpawnObject("DC_BankingATM", "8360.15 292.054 5994.15", "325 0 0"); //Kumyrna ATM
  33.       SpawnObject("DC_BankingATM", "8350.7 292.011 5978.3", "235 0 0"); //Kumyrna ATM
  34.       SpawnObject("DC_BankingATM", "8780.619141 221.009995 11631.502930", "4.000000 0.000000 -1.000000"); //Gvodzno ATM
  35.       SpawnObject("DC_BankingATM", "14576.046875 154.533432 14440.675781", "54.999992 0.000000 0.000000"); //Blackmarket ATM
  36.      
  37.     //GvozdnoTrader
  38.       SpawnObject( "Land_Mil_Guardhouse2", "8790.570313 223.223007 11609.599609", "-89.000000 0.000000 0.000000" );     //CarTrader
  39.  
  40.       SpawnObject( "Land_Village_store", "8784.879883 224.097000 11636.200195", "96.000092 2.000000 0.000000" );        //HealthTrader
  41.  
  42.       SpawnObject( "MSFC_MapObject_WeaponTrader_Tent", "8805.799805 223.265457 11635.091797", "-172.999390 2.000000 0.000000" );    //WeaponTrader
  43.  
  44.       SpawnObject( "FP4_GunShop", "8800.319336 222.910934 11635.454102", "97.000137 0.000000 0.000000" );       //AttachTrader
  45.  
  46.       SpawnObject( "MSFC_MapObject_WeaponWorkBench", "8793.513672 223.251602 11635.920898", "-85.000137 0.000000 0.000000" );       //ToolsTrader
  47.       SpawnObject( "Chainsaw", "8793.349609 222.598740 11634.210938", "-53.401123 -36.816494 -3.965740" );
  48.  
  49.       SpawnObject( "bldr_conference_table_a", "8788.858398 222.362152 11632.909180", "-175.000000 0.000000 2.000000" );     //ClothTrader
  50.       SpawnObject( "bldr_cashier", "8789.099609 222.716232 11632.875000", "6.000007 0.000000 -1.000000" );
  51.      
  52.     //Blackmarket Trader  
  53.       SpawnObject( "bldr_mil_camonet_tent2", "14570.7 156.053 14446.3", "8.009.11 -2.000 -5.99999" );
  54.       SpawnObject( "Land_Dead_MassGrave", "14570.00 153.56 14437.10", "0.000000 15.000000 -4.000000" );
  55.      
  56.     //DATE RESET AFTER ECONOMY INIT-------------------------
  57.     int year, month, day, hour, minute;
  58.     int reset_month = 9, reset_day = 20;
  59.     GetGame().GetWorld().GetDate(year, month, day, hour, minute);
  60.  
  61.     if ((month == reset_month) && (day < reset_day))
  62.     {
  63.         GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  64.     }
  65.     else
  66.     {
  67.         if ((month == reset_month + 1) && (day > reset_day))
  68.         {
  69.             GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  70.         }
  71.         else
  72.         {
  73.             if ((month < reset_month) || (month > reset_month + 1))
  74.             {
  75.                 GetGame().GetWorld().SetDate(year, reset_month, reset_day, hour, minute);
  76.             }
  77.         }
  78.     }
  79. }
  80.  
  81. class CustomMission: MissionServer
  82. {
  83.     void SetRandomHealth(EntityAI itemEnt)
  84.     {
  85.         if ( itemEnt )
  86.         {
  87.             int rndHlt = Math.RandomInt(55,100);
  88.             itemEnt.SetHealth("","",rndHlt);
  89.         }
  90.     }
  91.  
  92.     override PlayerBase CreateCharacter(PlayerIdentity identity, vector pos, ParamsReadContext ctx, string characterName)
  93.     {
  94.         Entity playerEnt;
  95.         playerEnt = GetGame().CreatePlayer(identity, characterName, pos, 0, "NONE");//Creates random player
  96.         Class.CastTo(m_player, playerEnt);
  97.  
  98.         GetGame().SelectPlayer(identity, m_player);
  99.  
  100.         return m_player;
  101.     }
  102.  
  103.     override void StartingEquipSetup(PlayerBase player, bool clothesChosen)
  104. {
  105.     PlayerIdentity ident = PlayerIdentity.Cast(player.GetIdentity());
  106.     int h= m_humanity.GetHumanity(ident.GetPlainId());
  107.     {
  108.         case -4:
  109.             // Bandit LvL 4
  110.             player.GetInventory().CreateInInventory("BalaclavaMask_BlackSkull");
  111.             player.GetInventory().CreateInInventory("FP4_PPSH");
  112.             player.GetInventory().CreateInInventory("MilitaryBoots_Redpunk");
  113.             player.GetInventory().CreateInInventory("MSFCSTALKERBanditPants");
  114.             player.GetInventory().CreateInInventory("RidersJacket_Black");
  115.             player.GetInventory().CreateInInventory("Mag_PPSH_50Rnd");
  116.             player.GetInventory().CreateInInventory("Mag_PPSH_50Rnd");
  117.             player.GetInventory().CreateInInventory("TAGn_CherRIp");
  118.             player.GetInventory().CreateInInventory("AssaultBag_Black");
  119.             player.GetInventory().CreateInInventory("Canteen");
  120.             player.GetInventory().CreateInInventory("CombatKnife");
  121.             player.GetInventory().CreateInInventory("Rag");
  122.             player.GetInventory().CreateInInventory("Rag");
  123.             player.GetInventory().CreateInInventory("Rag");
  124.             player.GetInventory().CreateInInventory("PeachesCan");
  125.             break;
  126.         case -3:  
  127.             // Bandit LvL 3
  128.             player.GetInventory().CreateInInventory("Balaclava3Holes_Black");
  129.             player.GetInventory().CreateInInventory("STG_44");
  130.             player.GetInventory().CreateInInventory("MilitaryBoots_Redpunk");
  131.             player.GetInventory().CreateInInventory("MSFCSTALKERBanditPants");
  132.             player.GetInventory().CreateInInventory("RidersJacket_Black");
  133.             player.GetInventory().CreateInInventory("Mag_STG44_30Rnd");
  134.             player.GetInventory().CreateInInventory("Mag_STG44_30Rnd");
  135.             player.GetInventory().CreateInInventory("Mag_STG44_30Rnd");
  136.             player.GetInventory().CreateInInventory("TAGn_CherRIp");
  137.             player.GetInventory().CreateInInventory("AssaultBag_Black");
  138.             player.GetInventory().CreateInInventory("Canteen");
  139.             player.GetInventory().CreateInInventory("CombatKnife");
  140.             player.GetInventory().CreateInInventory("Rag");
  141.             player.GetInventory().CreateInInventory("Rag");
  142.             player.GetInventory().CreateInInventory("Rag");
  143.             player.GetInventory().CreateInInventory("PeachesCan");
  144.             break;
  145.         case -2:
  146.             // Bandit LvL 2
  147.             player.GetInventory().CreateInInventory("Balaclava3Holes_Black");
  148.             player.GetInventory().CreateInInventory("Mac10");
  149.             player.GetInventory().CreateInInventory("MilitaryBoots_Redpunk");
  150.             player.GetInventory().CreateInInventory("MSFCSTALKERBanditPants");
  151.             player.GetInventory().CreateInInventory("RidersJacket_Black");
  152.             player.GetInventory().CreateInInventory("Mag_Mac10_30Rnd");
  153.             player.GetInventory().CreateInInventory("Mag_Mac10_30Rnd");
  154.             player.GetInventory().CreateInInventory("Mag_Mac10_30Rnd");
  155.             player.GetInventory().CreateInInventory("TAGn_CherRIp");
  156.             player.GetInventory().CreateInInventory("AssaultBag_Black");
  157.             player.GetInventory().CreateInInventory("Canteen");
  158.             player.GetInventory().CreateInInventory("CombatKnife");
  159.             player.GetInventory().CreateInInventory("Rag");
  160.             player.GetInventory().CreateInInventory("Rag");
  161.             player.GetInventory().CreateInInventory("Rag");
  162.             player.GetInventory().CreateInInventory("PeachesCan");
  163.             break;
  164.         case -1:
  165.             // Bandit LvL 1
  166.             player.GetInventory().CreateInInventory("Balaclava3Holes_Black");
  167.             player.GetInventory().CreateInInventory("M9_Berreta");
  168.             player.GetInventory().CreateInInventory("MilitaryBoots_Redpunk");
  169.             player.GetInventory().CreateInInventory("MSFCSTALKERBanditPants");
  170.             player.GetInventory().CreateInInventory("RidersJacket_Black");
  171.             player.GetInventory().CreateInInventory("Mag_m9_15Rnd");
  172.             player.GetInventory().CreateInInventory("Mag_m9_15Rnd");
  173.             player.GetInventory().CreateInInventory("Mag_m9_15Rnd");
  174.             player.GetInventory().CreateInInventory("TAGn_CherRIp");
  175.             player.GetInventory().CreateInInventory("AssaultBag_Black");;
  176.             player.GetInventory().CreateInInventory("Canteen");
  177.             player.GetInventory().CreateInInventory("CombatKnife");
  178.             player.GetInventory().CreateInInventory("Rag");
  179.             player.GetInventory().CreateInInventory("Rag");
  180.             player.GetInventory().CreateInInventory("Rag");
  181.             player.GetInventory().CreateInInventory("PeachesCan");
  182.             break;
  183.         case 0:
  184.             // Bambi
  185.             player.GetInventory().CreateInInventory("FNX45");
  186.             player.GetInventory().CreateInInventory("CombatBoots_Black");
  187.             player.GetInventory().CreateInInventory("CargoPants_Black");
  188.             player.GetInventory().CreateInInventory("M65Jacket_Black");
  189.             player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
  190.             player.GetInventory().CreateInInventory("Mag_FNX45_15Rnd");
  191.             player.GetInventory().CreateInInventory("Reflexvest");
  192.             player.GetInventory().CreateInInventory("DryBag_Black");
  193.             player.GetInventory().CreateInInventory("Compass");
  194.             player.GetInventory().CreateInInventory("Canteen");
  195.             player.GetInventory().CreateInInventory("CombatKnife");
  196.             player.GetInventory().CreateInInventory("Flashlight");
  197.             player.GetInventory().CreateInInventory("Rag");
  198.             player.GetInventory().CreateInInventory("Rag");
  199.             player.GetInventory().CreateInInventory("Rag");
  200.             player.GetInventory().CreateInInventory("PeachesCan");
  201.             break;
  202.         case 1:
  203.             // Hero LvL 1
  204.             EntityAI gun = player.GetHumanInventory().CreateInHands("GP_Colt1911");
  205.             gun.GetInventory().CreateAttachment("Tundra_Suppressor");
  206.             gun.GetInventory().CreateAttachment("TLRLight");
  207.             player.GetInventory().CreateInInventory("MSFCBlackCamoBoots");
  208.             player.GetInventory().CreateInInventory("BoonieHat_Olive");
  209.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryJacket");
  210.             player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
  211.             player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
  212.             player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
  213.             player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
  214.             player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
  215.             player.GetInventory().CreateInInventory("Mag_1911_7Rnd");
  216.             player.GetInventory().CreateInInventory("Battery9v");
  217.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryPants");
  218.             player.GetInventory().CreateInInventory("TAG_Rang1");
  219.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryBag");
  220.             player.GetInventory().CreateInInventory("Compass");
  221.             player.GetInventory().CreateInInventory("Canteen");
  222.             player.GetInventory().CreateInInventory("CombatKnife");
  223.             player.GetInventory().CreateInInventory("Rag");
  224.             player.GetInventory().CreateInInventory("Rag");
  225.             player.GetInventory().CreateInInventory("Rag");
  226.             player.GetInventory().CreateInInventory("PeachesCan");
  227.             break;
  228.         case 2:
  229.             // Hero LvL 2
  230.             EntityAI gun = player.GetHumanInventory().CreateInHands("MP5K");
  231.             gun.GetInventory().CreateAttachment("mp5k_RailHndgrd");
  232.             gun.GetInventory().CreateAttachment("mp5k_stockbttstck");
  233.             gun.GetInventory().CreateAttachment("Tundra_Suppressor");
  234.             gun.GetInventory().CreateAttachment("Universallight");
  235.             player.GetInventory().CreateInInventory("MSFCBlackCamoBoots");
  236.             player.GetInventory().CreateInInventory("BoonieHat_Olive");
  237.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryJacket");
  238.             player.GetInventory().CreateInInventory("Mag_mp5_30Rnd");
  239.             player.GetInventory().CreateInInventory("Mag_mp5_30Rnd");
  240.             player.GetInventory().CreateInInventory("Mag_mp5_30Rnd");
  241.             player.GetInventory().CreateInInventory("Battery9v");
  242.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryPants");
  243.             player.GetInventory().CreateInInventory("TAG_Rang2");
  244.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryBag");
  245.             player.GetInventory().CreateInInventory("Compass");
  246.             player.GetInventory().CreateInInventory("Canteen");
  247.             player.GetInventory().CreateInInventory("CombatKnife");
  248.             player.GetInventory().CreateInInventory("Rag");
  249.             player.GetInventory().CreateInInventory("Rag");
  250.             player.GetInventory().CreateInInventory("Rag");
  251.             player.GetInventory().CreateInInventory("PeachesCan");
  252.             break;
  253.         case 3:
  254.             // Hero LvL 3
  255.             EntityAI gun = player.GetHumanInventory().CreateInHands("MSFC_AK74_Redux_Dark");
  256.             gun.GetInventory().CreateAttachment("MSFC_AK_RailHndgrd_DARK");
  257.             gun.GetInventory().CreateAttachment("MSFC_AK_Tactical_Buttstck");
  258.             gun.GetInventory().CreateAttachment("Hx762_suppressor");
  259.             gun.GetInventory().CreateAttachment("Universallight");
  260.             player.GetInventory().CreateInInventory("MSFCBlackCamoBoots");
  261.             player.GetInventory().CreateInInventory("BoonieHat_Olive");
  262.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryJacket");
  263.             player.GetInventory().CreateInInventory("Mag_AK74_30Rnd_Black");
  264.             player.GetInventory().CreateInInventory("Mag_AK74_30Rnd_Black");
  265.             player.GetInventory().CreateInInventory("Mag_AK74_30Rnd_Black");
  266.             player.GetInventory().CreateInInventory("Battery9v");
  267.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryPants");
  268.             player.GetInventory().CreateInInventory("TAG_Rang3");
  269.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryBag");
  270.             player.GetInventory().CreateInInventory("Compass");
  271.             player.GetInventory().CreateInInventory("Canteen");
  272.             player.GetInventory().CreateInInventory("CombatKnife");
  273.             player.GetInventory().CreateInInventory("Rag");
  274.             player.GetInventory().CreateInInventory("Rag");
  275.             player.GetInventory().CreateInInventory("Rag");
  276.             player.GetInventory().CreateInInventory("PeachesCan");
  277.             break;
  278.         case 4:
  279.             // Hero LvL 4
  280.             EntityAI gun = player.GetHumanInventory().CreateInHands("MSFC_AK74_Redux_Dark");
  281.             gun.GetInventory().CreateAttachment("MSFC_AK_RailHndgrd_DARK");
  282.             gun.GetInventory().CreateAttachment("MSFC_AK_Tactical_Buttstck");
  283.             gun.GetInventory().CreateAttachment("Hx762_suppressor");
  284.             gun.GetInventory().CreateAttachment("Universallight");
  285.             player.GetInventory().CreateInInventory("MSFCBlackCamoBoots");
  286.             player.GetInventory().CreateInInventory("BoonieHat_Olive");
  287.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryJacket");
  288.             player.GetInventory().CreateInInventory("Mag_AK74_30Rnd_Black");
  289.             player.GetInventory().CreateInInventory("Mag_AK74_30Rnd_Black");
  290.             player.GetInventory().CreateInInventory("Mag_AK74_30Rnd_Black");
  291.             player.GetInventory().CreateInInventory("Battery9v");
  292.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryPants");
  293.             player.GetInventory().CreateInInventory("TAG_Rang3");
  294.             player.GetInventory().CreateInInventory("MSFCSTALKERMilitaryBag");
  295.             player.GetInventory().CreateInInventory("Compass");
  296.             player.GetInventory().CreateInInventory("Canteen");
  297.             player.GetInventory().CreateInInventory("CombatKnife");
  298.             player.GetInventory().CreateInInventory("Rag");
  299.             player.GetInventory().CreateInInventory("Rag");
  300.             player.GetInventory().CreateInInventory("Rag");
  301.             player.GetInventory().CreateInInventory("PeachesCan");
  302.             break;
  303.         default:
  304.             break;
  305.     }
  306. }
  307.  
  308. Mission CreateCustomMission(string path)
  309. {
  310.  return new CustomMission();
  311. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement