Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Karel Moricky
- Modified by Shpook.
- Description:
- Destroys everything in given area.
- Parameter(s):
- _this select 0: OBJECT - Destruction center
- _this select 1 (Optional): NUMBER - Destruction area diameter
- _this select 2 (Optional): NUMBER - Random seed
- */
- if (!isserver) exitwith {};
- private ["_center","_areaSize","_seed","_blacklist","_buildings","_pos","_posX","_posY","_posTotal","_seedLocal","_fire","_explo"];
- _center = _this select 0;
- _areaSize = if (count _this > 1) then {_this select 1} else {1000};
- _seed = if (count _this > 2) then {_this select 2} else {1138};
- _blacklist = if (count _this > 3) then {_this select 3} else {[]};
- if (typename _center == typename "") then {_center = markerpos _center};
- if (typename _center == typename objnull) then {_center = position _center};
- if (_areaSize < 0) then {_areaSize = 100;};
- if (_seed < 0) then {_seed = 1138;};
- _seed = round(_seed % 42);
- if (_seed == 0) then {_seed = 42;};
- // Use this for destruction of houses and house objects only.
- //_buildings = _center nearobjects ["house",_areaSize];
- // Use this for destruction of everything.
- _buildings = nearestObjects [_center, [], _areaSize];
- _buildings = _buildings - _blacklist;
- {
- _pos = position _x;
- _posX = _pos select 0;
- _posY = _pos select 1;
- _posTotal = _posX + _posY;
- _seedLocal = (_posTotal % _seed) / _seed;
- if (_seedLocal > 0.99) then { // Change this value to change how much smoke is spawned. Lower number = more smoke
- _fire = createvehicle ["test_EmptyObjectForFireBig",position _x,[],0,"none"];
- };
- _x setdamage 1;
- } foreach _buildings;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement