Jump to content
Sign in to follow this  
Norbak

Using Reezo's Loudspeaker Taunt Script

Recommended Posts

My problem is simple (or not). I'm using Reezo's Loudspeaker (Taunt version) Script and working fine with units spawned in editor, but not with units using an external script to spawn enemies (such as Xeno's Domination! map).

I can't find the wrong file to get it to work.

// INIT

private ["_object","_range","_caller","_id","_rnd","_influenceTaunt","_influenceEvacuate","_nearMen","_nearCars","_nearTanks","_enemyGroup","_name_evacuate","_name_taunt"];

_object = _this select 0;

_caller = _this select 1;

_id = _this select 2;

_range = (_this select 3) select 0;

_influenceTaunt = (_this select 3) select 1;

_influenceEvacuate = (_this select 3) select 2;

[Charlie_7,nil,rPlaysound,"loudspeaker_taunt02"] call RE;

sleep 0.2;

Hintsilent "Taunt in progress:\nMaybe the enemies around 500m are looking for you at this moment.";

_object removeaction _id;

_object removeaction (_id + 1);

reezo_loudspeaker_activateC7 = 1;

publicVariable "reezo_loudspeaker_activateC7";

reezo_loudspeaker_currentC7 = _object;

publicVariable "reezo_loudspeaker_currentC7";

sleep (random 10);

_rnd = random 100;

if (_rnd < _influenceTaunt) then {

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: TAUNT WORKED" };

_nearMen = (getPos _object) nearObjects ["Man",_range];

for [{_y = 0},{_y < (count _nearMen)},{_y = _y + 1}] do {

if (EAST getFriend WEST < 0.5 && side (_nearMen select _y) == EAST && (_nearMen select _y) == leader group (_nearMen select _y)) then {

_rnd = random 100;

if (_rnd < _influenceTaunt) then {

_enemyGroup = group (_nearMen select _y);

_enemyGroup addWaypoint [getPos _object, 0];

[_enemyGroup, 0] setWaypointType "SAD";

[_enemyGroup, 0] setWaypointBehaviour "COMBAT";

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: INCOMING EAST ENEMY MEN" };

};

};

if (RESISTANCE getFriend WEST < 0.5 && side (_nearMen select _y) == RESISTANCE && (_nearMen select _y) == leader group (_nearMen select _y)) then {

_rnd = random 100;

if (_rnd < _influencTaunt) then {

_enemyGroup = group (_nearMen select _y);

_enemyGroup addWaypoint [getPos _object, 0];

[_enemyGroup, 0] setWaypointType "SAD";

[_enemyGroup, 0] setWaypointBehaviour "COMBAT";

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: INCOMING GUERRILLA ENEMY MEN" };

};

};

};

_nearCars = (getPos _object) nearObjects ["Car",_range];

for [{_y = 0},{_y < (count _nearCars)},{_y = _y + 1}] do {

if (EAST getFriend WEST < 0.5 && side (_nearCars select _y) == EAST && (_nearCars select _y) == leader group (_nearCars select _y)) then {

_rnd = random 100;

if (_rnd < _influenceTaunt) then {

_enemyGroup = group (_nearCars select _y);

_enemyGroup addWaypoint [getPos _object, 0];

[_enemyGroup, 0] setWaypointType "SAD";

[_enemyGroup, 0] setWaypointBehaviour "COMBAT";

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: INCOMING EAST ENEMY CARS" };

};

};

if (RESISTANCE getFriend WEST < 0.5 && side (_nearCars select _y) == RESISTANCE && (_nearCars select _y) == leader group (_nearCars select _y)) then {

_rnd = random 100;

if (_rnd < _influenceTaunt) then {

_enemyGroup = group (_nearCars select _y);

_enemyGroup addWaypoint [getPos _object, 0];

[_enemyGroup, 0] setWaypointType "SAD";

[_enemyGroup, 0] setWaypointBehaviour "COMBAT";

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: INCOMING GUERRILLA ENEMY CARS" };

};

};

};

_nearTanks = (getPos _object) nearObjects ["Tank",_range];

for [{_y = 0},{_y < (count _nearTanks)},{_y = _y + 1}] do {

if (EAST getFriend WEST < 0.5 && side (_nearTanks select _y) == EAST && (_nearTanks select _y) == leader group (_nearTanks select _y)) then {

_rnd = random 100;

if (_rnd < _influenceTaunt) then {

_enemyGroup = group (_nearTanks select _y);

_enemyGroup addWaypoint [getPos _object, 0];

[_enemyGroup, 0] setWaypointType "SAD";

[_enemyGroup, 0] setWaypointBehaviour "COMBAT";

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: INCOMING EAST ENEMY TANKS" };

};

};

if (RESISTANCE getFriend WEST < 0.5 && side (_nearTanks select _y) == RESISTANCE && (_nearTanks select _y) == leader group (_nearTanks select _y)) then {

_rnd = random 100;

if (_rnd < _influenceTaunt) then {

_enemyGroup = group (_nearTanks select _y);

_enemyGroup addWaypoint [getPos _object, 0];

[_enemyGroup, 0] setWaypointType "SAD";

[_enemyGroup, 0] setWaypointBehaviour "COMBAT";

if (reezo_loudspeaker_debugC7) then { player globalChat "REEZO_loudspeaker DEBUG: INCOMING GUERRILLA ENEMY TANKS" };

};

};

};

};

//END

Edited by kyopower

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  

×