laatClaymore.sqf 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. claymoreI={
  2. params["_vic"];
  3. //for Ai
  4. _vic limitSpeed 220;
  5. comment "data for weapons";
  6. comment"format of [weapon,weaponMagType,[[seat,ammoPerMag,MagCount],[seat,ammoPerMag,MagCount],......etc]]";
  7. weaponData=[
  8. ["Cannon_LAAT","1000Rnd_Laser_Cannon_LAAT",[[-1,1000,2]]],
  9. ["missiles_Jian","4Rnd_LG_Jian",[[-1,10,8],[0,4,1]]],
  10. ["weapon_rim116Launcher","magazine_Missile_rim116_x21",[[-1,8,1],[0,8,1]]],
  11. ["SmokeLauncher","SmokeLauncherMag",[[-1,2,20]]],
  12. ["CMFlareLauncher","300Rnd_CMFlare_Chaff_Magazine",[[-1,300,10]]],
  13. ["PomehiLauncherXT","400Rnd_Pomehi_Mag",[[-1,400,10]]],
  14. ["Cannon_TIE_FAST","10Rnd_FAST_Cannon_TIE",[[1,10,100],[2,10,100]]],
  15. ["Laserdesignator_pilotCamera","Laserbatteries",[[-1,1,1]]]
  16. ];
  17. /* comment "remove torpedos";
  18. for [{_i=0}, {_i<2}, {_i=_i+1}] do
  19. {
  20. _vic removeMagazineTurret ["laat_proton_torpedo" ,[-1]];
  21. _vic removeWeaponTurret["laat_proton_torpedo_launcher", [-1]];
  22. };*/
  23. comment "For each weapon";
  24. for [{_i=0}, {_i<(count weaponData)}, {_i=_i+1}] do
  25. {
  26. itemList=weaponData select _i;
  27. itemWeapon=itemList select 0;
  28. itemMagType=itemList select 1;
  29. itemSeats=itemList select 2;
  30. comment "for each seat";
  31. for [{_j=0}, {_j<(count itemSeats)}, {_j=_j+1}] do
  32. {
  33. seatData=itemSeats select _j;
  34. seatIndex=seatData select 0;
  35. seatAmmoPerMag=seatData select 1;
  36. seatMags=seatData select 2;
  37. _vic addWeaponTurret[itemWeapon, [seatIndex]];
  38. comment "adds mags";
  39. for [{_k=0}, {_k<(seatMags)}, {_k=_k+1}] do
  40. {
  41. _vic addMagazineTurret [itemMagType ,[seatIndex],seatAmmoPerMag];
  42. };
  43. };
  44. };//end weapon additon
  45. //removes torpedos
  46. //_vic removeWeaponTurret["laat_proton_torpedo_launcher", [-1]];
  47. // function as file add the wing tip smoke for laat
  48. _vic addAction ["<t color='#886688'>Smoker--------U13</t>",
  49. {[_this select 0] execVM "scripts\zeus3denScripts\vehicleBased\actionMenu\Smoke\LAAT\laatSmokeTip.sqf";}
  50. ,[1],0,false,true,"User13"," driver _target == _this"];
  51. comment "gets health";
  52. _vic addAction ["<t color='#00FF00'>Damage Report</t>",
  53. {
  54. hint parseText format["<t color='#0099FF'> Hull Integrity is :%1%2</t>",((1-(damage (_this select 0)))*100),"%"];
  55. },[1],0,false,true,""," driver _target == _this "];
  56. //by default boost is off
  57. _vic setvariable ["OPTRE_Thruster_EngagedStatus",false,true];
  58. //adds action to engage boost
  59. _vic addAction ["<t color='#00FF00'>Engage C.R.U.I.S.I.E Control System -------- U18</t>",
  60. {
  61. [_this select 0,620,10,25] execVM "scripts\zeus3denScripts\vehicleBased\actionMenu\Boost\boostStart.sqf";
  62. },[1],0,false,true,"User18"," driver _target == _this"];
  63. //adds action to disengage boost
  64. _vic addAction ["<t color='#FFA500'>Disengage C.R.U.I.S.I.E Control System -------- U19</t>",
  65. {
  66. [_this select 0,80,5] execVM "scripts\zeus3denScripts\vehicleBased\actionMenu\Boost\boostStop.sqf";
  67. },[1],0,false,true,"User19"," driver _target == _this"];
  68. _vic addEventHandler ["HandleDamage",
  69. {
  70. if(((_this select 0) getVariable["isCrashing",false]) || {(damage (_this select 0))>=.7}) then
  71. {
  72. _namResultingDmg=0;
  73. };
  74. _namUnit=_this select 0;
  75. _namDmg=_this select 2;
  76. _namCurrentDmg=damage _namUnit;//0 if health 1 if dead
  77. _namResultingDmg=_namDmg/2;
  78. if((_namCurrentDmg+_namDmg)>.7) then
  79. {
  80. _namUnit allowDamage false;
  81. _namUnit setFuel 0;
  82. _namUnit setDamage .7;
  83. _namUnit vehicleChat format["MAYDAY MAYDAY MAYDAY THIS IS %1 GOING DOWN OVER GRID %2 BRRRRRRR*****BRRRRR ****BRRRRR",(name (driver _namUnit)),(mapGridPosition _namUnit)];
  84. _namResultingDmg=0;
  85. _namIsCrashing=((_namUnit) getVariable["isCrashing",false]);
  86. if(!_namIsCrashing) then
  87. {
  88. _null = _this spawn
  89. {
  90. _namUnitSpawn=_this select 0;
  91. [west, "HQ"] sideChat format["fire made %1",time];
  92. _namLaatFirePosArray=[[6,-2.5,-1],[-6,-2.5,-1], [1.5,-5,2.5], [-1.5,-5,2.5],[0,3,0],[0,6,-.5],[0,0,-2]];
  93. _namLaatFireObj=[];
  94. for "_i" from 0 to 1 do
  95. {
  96. _fire = "test_EmptyObjectForFireBig" createVehicle position (_namUnitSpawn);
  97. _fire attachTo [_namUnitSpawn,(selectRandom _namLaatFirePosArray)];
  98. _namLaatFireObj=_namLaatFireObj+[_fire];
  99. };//makes two fires or watever much, and then stores them in the array while also randomly palcing on laat
  100. sleep 50;
  101. {
  102. deleteVehicle _x;
  103. _namLaatFireObj=[];
  104. } forEach _namLaatFireObj;//delets all of them
  105. };
  106. };
  107. _namUnit setVariable ["isCrashing", true,true];
  108. }
  109. else
  110. {
  111. _namResultingDmg=_namDmg/2;
  112. };
  113. }];
  114. };
  115. ["swop_LAAT", "init",claymoreI, true, [], true] call CBA_fnc_addClassEventHandler;