I need a way to combine these into one so I can have both effects at the same time. Can anyone help me?
function ForceLightningImage::onFire(%this, %obj, %slot)
{
%nrg = %obj.getEnergyLevel();
if(50 <= %nrg) {
%obj.setEnergyLevel(%nrg - 50);
commandtoClient(%obj.client,'bottomprint',"<just:center> \c1 Force Power: [" @ mFloor(%obj.getEnergyLevel()) @ "/" @ %obj.getDataBlock().maxenergy @ "]",2);
}
else {
commandtoClient(%obj.client,'bottomprint',"<just:center> \c1[Not Enough Force Power - " @ mFloor(%nrg) @"/"@ %obj.getDataBlock().maxenergy @"]",2);
return;
}
%obj.playthread(2, armattack);
Parent::onFire(%this, %obj, %slot);
}
function ForceLightningImage::onFire(%this,%obj,%slot)
{
%obj.setVelocity(VectorAdd(%obj.getVelocity(),VectorScale(%obj.client.player.getEyeVector(),"0")));
%obj.playThread(2, shiftAway);
%projectile = %this.projectile;
%spread = 0.002;
%shellcount = 3;
for(%shell=0; %shell<%shellcount; %shell++)
{
%vector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%vector1 = VectorScale(%vector, %projectile.muzzleVelocity);
%vector2 = VectorScale(%objectVelocity, %projectile.velInheritFactor);
%velocity = VectorAdd(%vector1,%vector2);
%x = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%y = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%z = (getRandom() - 0.5) * 10 * 3.1415926 * %spread;
%mat = MatrixCreateFromEuler(%x @ " " @ %y @ " " @ %z);
%velocity = MatrixMulVector(%mat, %velocity);
%p = new (%this.projectileType)()
{
dataBlock = %projectile;
initialVelocity = %velocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
}
return %p;
}