;// SDP EH script for fully working cannons 2009-06-16

_u = _this select 0;
_ammo = _u ammo (_this select 1);
_b = nearestObject [_u, _this select 4];
_wd = _u weaponDirection (_this select 1);
_bv = velocity _b;
_weh = 0.25;
_life= 0.4;

hint format ["%1", (_ammo+2) mod 6];

if ((((_ammo+2) mod 12) > 5) and (_b isKindOf "B_762x51_3RndBurst")) then 
{
_npos = _u modeltoworld [0.965625, 1.51875, -1.28125];
_b setpos _npos;
_b setvelocity _bv;

drop [["\ca\Data\ParticleEffects\Universal\Universal",16,12,8], "", 
"Billboard", 1, _life, [0, 0, 0], [0, 5 + random 4, 0], 0,  _weh, 0.08, 0.2,
[1.5, 5 + random 3], [[0.7, 0.7, 0.7, 0.2 + random 0.1], [0.8, 0.8, 0.8, 0]], 
[1/_life], 1, 0, "", "", _b,random 360];

};
exit;
