Jump to content
Sign in to follow this  
ffur2007slx2_5

Suicide bomb script V1.3

Recommended Posts

Hi, I've written a suicide bomb script. Copy the two files below into your mission folder, then go to edit mode, insert a suicider (can be both infantry unit or vehicle, but don't group the suicider) and a victim. (Can be infantry unit or vehicle, but not aircraft) After finishing that, write [suicider,victim,250(it is the attacking range of a suicider, can't be less than 35m, it means when the victim is in the circle, suicider will move to the victim and explode)] exec "WCRffsx_SuicideBomb.sqs" in init bar everywhere else.

V1.3Changelogs:

Suicider will choose the group leader as the bombing target if there are more than 5 people in a victim group.

Vehicle bombing is more powerful than suicide bombing but easy to be detected.

WCRffsx_suicidebomb.sqs

;////Purpose of this script: Create suicide bomb effect \\\\
;////Author: WCR_ffsx     Script Version:V1.3            \\\\
;////How to use it: [suicider,vitim,Suicider attacking r- \\\\
;////ange (Number: Must more than 35 meters)] exec "WCRff- \\\\
;////sx_SuicideBomb.sqs" Suicider can't be in an aircraft or\\\\
;////grouped, meanwhile, the victim should not be in a vehi- \\\\
;////cle as well. If you've any questions, please visit http: \\\\
;//////blog.163.com/evbs_1/ for more info or ask me directly   \\\\
;////through ffur2007slx2_5@126.com                             \\\\
;////============================================================\\\\
private ["_WCRffsx_bomber","_WCRffsx_Victim","_WCRffsx_VictimGroup","_WCRffsx_Arrary","_WCRffsx_Num","_WCRffsx_bomberGroup","_WCRffsx_ArraryB","_WCRffsx_NumB","_WCRffsx_Meters"]
_WCRffsx_bomber=_this select 0
_WCRffsx_Victim=_this select 1
_WCRffsx_VictimGroup=group _WCRffsx_Victim
_WCRffsx_Arrary=units _WCRffsx_VictimGroup
_WCRffsx_Num=count _WCRffsx_Arrary
_WCRffsx_bomberGroup=group _WCRffsx_bomber
_WCRffsx_ArraryB=units _WCRffsx_bomberGroup
_WCRffsx_NumB=count _WCRffsx_ArraryB
_WCRffsx_Meters=_this select 2
?((isNull _WCRffsx_bomber) || (isNull _WCRffsx_Victim)):{hintSilent "If this script can not run properly in MP, please check whether you have disabled AI"; goto "exit"}
?(Vehicle _WCRffsx_bomber isKindOf "MotorCycle"):{hintSilent "Motorcycle Suicide is not available in this version."; goto "exit"}
if (local player && (alive _WCRffsx_Victim) && (canMove vehicle _WCRffsx_bomber) && ((vehicle _WCRffsx_bomber) isKindOf "Car") && (alive _WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {goto "VehicleAttack"} else {}
if (local player && (alive Leader _WCRffsx_VictimGroup) && (alive _WCRffsx_bomber) && (vehicle (Leader _WCRffsx_VictimGroup)==Leader _WCRffsx_VictimGroup) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_Num>5) && (canStand _WCRffsx_bomber) && _WCRffsx_Meters>35) then {goto "GroupAttack"} else {}
if (local player && (alive _WCRffsx_Victim) && (alive _WCRffsx_bomber) && (vehicle _WCRffsx_Victim==_WCRffsx_Victim) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1) && (canStand _WCRffsx_bomber) && _WCRffsx_Meters>35) then {goto "start"} else {hintSilent "Suicide Bomb is not available at present, there're several reason caused that problem. \n1.you must set the suicide bomber attack range more than 35 meters!\n2.You can not group the suicider before or when the script is running.\n3.You must be a infantry unit, not being protected by any vehicle.\n4. This is a suicide bomb, not a vehicle suicide bomb, so do not put the suicider in a vehicle.";goto "exit"}
#start
if ((alive _WCRffsx_Victim) && (canStand _WCRffsx_bomber) && (vehicle _WCRffsx_Victim==_WCRffsx_Victim) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {_WCRffsx_bomber disableAI "AUTOTARGET"; _WCRffsx_bomber disableAI "TARGET"; removeallweapons _WCRffsx_bomber; _WCRffsx_bomber setbehaviour "CARELESS"; _WCRffsx_bomber addBackPack "TK_ALICE_Pack_EP1"; goto "Waiting"} else {goto "exit"}
#Waiting
~1
if ((alive _WCRffsx_Victim) && (canStand _WCRffsx_bomber) && (vehicle _WCRffsx_Victim==_WCRffsx_Victim) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_bomber distance _WCRffsx_Victim <= _WCRffsx_Meters) && (_WCRffsx_NumB==1)) then {goto "Moving"} else {}
goto "Waiting"
#Moving
~1
if ((alive _WCRffsx_Victim) && (alive _WCRffsx_bomber) && (vehicle _WCRffsx_Victim==_WCRffsx_Victim) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {} else {goto "exit"}
_WCRffsx_bomber move getpos _WCRffsx_Victim
if (_WCRffsx_bomber distance _WCRffsx_Victim <=35) then {goto "Bad"} else {}
goto "Moving"
#Bad
_WCRffsx_bomber addRating -5000
#BadMoving
~1
if ((alive _WCRffsx_Victim) && (alive _WCRffsx_bomber) && (vehicle _WCRffsx_Victim==_WCRffsx_Victim) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {} else {goto "exit"}
_WCRffsx_bomber move getpos _WCRffsx_Victim
?(!alive _WCRffsx_bomber):{IED="R_Hydra_HE" createVehicle getpos _WCRffsx_bomber; goto "Delete"}
if ((_WCRffsx_bomber distance _WCRffsx_Victim <=7.5)&&(alive _WCRffsx_bomber)) then {IED="R_Hydra_HE" createVehicle getpos _WCRffsx_bomber; goto "Delete"} else {}
goto "BadMoving"
#exit
exit
#Delete
~0.5
DeleteVehicle _WCRffsx_bomber
goto "exit"
#GroupAttack
if ((alive (Leader _WCRffsx_VictimGroup)) && ((Vehicle (Leader _WCRffsx_VictimGroup)) isKindOf "Man") && (canStand _WCRffsx_bomber) && (vehicle (Leader _WCRffsx_VictimGroup)==(Leader _WCRffsx_VictimGroup)) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {_WCRffsx_bomber disableAI "AUTOTARGET"; _WCRffsx_bomber disableAI "TARGET"; removeallweapons _WCRffsx_bomber; _WCRffsx_bomber setbehaviour "CARELESS"; _WCRffsx_bomber addBackPack "TK_ALICE_Pack_EP1"; goto "WaitingGroup"} else {goto "exit"}
#WaitingGroup
~1
if ((alive (Leader _WCRffsx_VictimGroup)) && (canStand _WCRffsx_bomber) && (vehicle (Leader _WCRffsx_VictimGroup)==(Leader _WCRffsx_VictimGroup)) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_bomber distance (Leader _WCRffsx_VictimGroup) <= _WCRffsx_Meters) && (_WCRffsx_NumB==1)) then {goto "MovingGroup"} else {}
goto "WaitingGroup"
#MovingGroup
~1
if ((alive (Leader _WCRffsx_VictimGroup)) && (alive _WCRffsx_bomber) && (vehicle (Leader _WCRffsx_VictimGroup)==(Leader _WCRffsx_VictimGroup)) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {} else {goto "exit"}
_WCRffsx_bomber move getpos (Leader _WCRffsx_VictimGroup)
if (_WCRffsx_bomber distance (Leader _WCRffsx_VictimGroup) <=35) then {goto "BadGroup"} else {}
goto "MovingGroup"
#BadGroup
_WCRffsx_bomber addRating -5000
#BadMovingGroup
~1
if ((alive (Leader _WCRffsx_VictimGroup)) && (alive _WCRffsx_bomber) && (vehicle (Leader _WCRffsx_VictimGroup)==(Leader _WCRffsx_VictimGroup)) && (vehicle _WCRffsx_bomber==_WCRffsx_bomber) && (_WCRffsx_NumB==1)) then {} else {goto "exit"}
_WCRffsx_bomber move getpos (Leader _WCRffsx_VictimGroup)
?(!alive _WCRffsx_bomber):{IED="R_Hydra_HE" createVehicle getpos _WCRffsx_bomber; goto "Delete"}
if ((_WCRffsx_bomber distance (Leader _WCRffsx_VictimGroup) <=7.5) && (alive _WCRffsx_bomber)) then {IED="R_Hydra_HE" createVehicle getpos _WCRffsx_bomber; goto "Delete"} else {}
goto "BadMovingGroup"
#VehicleAttack
if ((alive _WCRffsx_Victim) && (CanMove Vehicle _WCRffsx_bomber) && (alive _WCRffsx_bomber) && (_WCRffsx_NumB==1) && ((vehicle _WCRffsx_bomber) isKindOf "Car") && (((Vehicle _WCRffsx_Victim) isKindOf "LandVehicle")||((Vehicle _WCRffsx_Victim) isKindOf "Man"))) then {_WCRffsx_bomber disableAI "AUTOTARGET"; _WCRffsx_bomber disableAI "TARGET"; removeallweapons _WCRffsx_bomber; _WCRffsx_bomber setbehaviour "CARELESS"; _WCRffsx_bomber addBackPack "TK_ALICE_Pack_EP1"; goto "VehicleWaiting"} else {hintSilent "You've activated Vehicle Suicide Bombing mod, Suicide vehicle will attack only Land vehicle and infantry target but not Air or ship targets etc.If you can not run this script in MP, please check whether you've disabled AI. Be notice that never group the suicider into team at anytime when this script is running."; goto "exit"}
#VehicleWaiting
~1
if ((alive _WCRffsx_Victim) && (CanMove Vehicle _WCRffsx_bomber) && (alive _WCRffsx_bomber) && (_WCRffsx_NumB==1) && ((vehicle _WCRffsx_bomber) isKindOf "Car") && (((Vehicle _WCRffsx_Victim) isKindOf "LandVehicle")||((Vehicle _WCRffsx_Victim) isKindOf "Man")) && ((Vehicle _WCRffsx_bomber) distance (Vehicle _WCRffsx_Victim) <= _WCRffsx_Meters) && (_WCRffsx_NumB==1)) then {goto "VehicleMoving"} else {}
goto "VehicleWaiting"
#VehicleMoving
~5
if ((alive _WCRffsx_Victim) && (CanMove Vehicle _WCRffsx_bomber) && (alive _WCRffsx_bomber) && (_WCRffsx_NumB==1) && ((vehicle _WCRffsx_bomber) isKindOf "Car") && (((Vehicle _WCRffsx_Victim) isKindOf "LandVehicle")||((Vehicle _WCRffsx_Victim) isKindOf "Man")) && (_WCRffsx_NumB==1)) then {} else {goto "exit"}
_WCRffsx_bomber move getpos _WCRffsx_Victim
if (_WCRffsx_bomber distance _WCRffsx_Victim <=35) then {goto "VehicleBad"} else {}
goto "VehicleMoving"
#VehicleBad
_WCRffsx_bomber addRating -5000
(Vehicle _WCRffsx_bomber) addeventHandler ["init",{_WCRffsx_bomber exec "WCRffsx_SBCheck.sqs"}]
#VehicleBadMoving
~1
if ((alive _WCRffsx_Victim) && (CanMove Vehicle _WCRffsx_bomber) && (alive _WCRffsx_bomber) && (_WCRffsx_NumB==1) && ((vehicle _WCRffsx_bomber) isKindOf "Car") && (((Vehicle _WCRffsx_Victim) isKindOf "LandVehicle")||((Vehicle _WCRffsx_Victim) isKindOf "Man")) && (_WCRffsx_NumB==1)) then {} else {goto "exit"}
_WCRffsx_bomber move getpos _WCRffsx_Victim
?((!CanMove (Vehicle _WCRffsx_bomber))||(Vehicle _WCRffsx_bomber != _WCRffsx_bomber)):{IED="Bo_Mk82" createVehicle getpos _WCRffsx_bomber; goto "exit"}
if ((_WCRffsx_bomber distance _WCRffsx_Victim <=15)) then {IED="Bo_Mk82" createVehicle getpos _WCRffsx_bomber; goto "exit"} else {}
goto "VehicleBadMoving"

WCRffsx_SBCheck.sqs

;////Author:WCRffsx
;////Creating date: 13Dec2010
Private ["_WCRffsx_bomber"]
_WCRffsx_bomber=_this select 0
#Check
~0.1
?(damage _WCRffsx_bomber >=0.05):{IED="Bo_Mk82" createVehicle getpos _WCRffsx_bomber; goto "exit"}
goto "Check"
#exit
exit

Share this post


Link to post
Share on other sites

Nice feature ! Not tested but the concept is good ;)

Why don't you make it as sqf ?

Share this post


Link to post
Share on other sites
Nice feature ! Not tested but the concept is good ;)

Why don't you make it as sqf ?

Okay, I'll take your advice and release sqf scripts in coming days.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×