Here is the code I have.
function burstcannonImage::onMount(%this,%obj,%slot)
{
parent::onMount(%this,%obj,%slot);
if(%obj.getMountedImage(0).getName() $= "rocketlauncherImage") { %obj.unMountImage(0); } //burstcannonNullImage
}
function burstcannonImage::onUnMount(%this,%obj,%slot)
{
// parent::onUnMount(%this,%obj,%slot);
// %obj.unMountImage(1);
%obj.mountImage(rocketlauncherImage,0);
}
package burstcannonPackage
{
function servercmdDropTool(%this,%slot)
{
if(isobject(%this.player.tool[%slot]) && %this.player.tool[%slot].getname() $= "burstcannonImage")
{
parent::servercmdDropTool(%this,%slot);
if(isobject(%this.player.getmountedimage(0)) && %this.player.getmountedimage(0).getname() $= "rocketlauncherImage")
{
%this.player.schedule(5,unmountimage,0);
}
return;
}
parent::servercmdDropTool(%this,%slot);
}
};
activatepackage(burstcannonPackage);
I'll try to hunt out any logic errors, but I would appreciate if you happen to find any issues as well.
Note: The rocket launcher image is a test image for the secondary image.