Here is what is done so far.
server.cs
exec("./voices.cs");
%error = forceRequiredAddOn("Sound_Skycaptain");
if(%error == $Error::AddOn_NotFound)
{
error("ERROR: Sound_Skycaptain - required add-on Sound_Skycaptain not found");
}
datablock PlayerData(Skycaptain : PlayerStandardArmor)
{
runForce = 10 * 90;
runEnergyDrain = 0;
minRunEnergy = 0;
maxForwardSpeed = 20;
maxBackwardSpeed = 10;
maxSideSpeed = 10;
maxForwardCrouchSpeed = 7;
maxBackwardCrouchSpeed = 7;
maxSideCrouchSpeed = 7;
maxdamage = 100;
jumpForce = 12 * 120; //8.3 * 90;
jumpEnergyDrain = 0;
minJumpEnergy = 0;
jumpDelay = 0;
minJetEnergy = 1;
jetEnergyDrain = 3;
canJet = 1;
uiName = "Sky Captain";
showEnergyBar = true;
runSurfaceAngle = 20;
jumpSurfaceAngle = 10;
};
package skyCaptainentrance
{
function Skycaptain::onNewDataBlock(%this,%obj)
{
if(!$SCschedule && !isObject($SCschedule))
{
ServerPlay2D(SC_Entrance1);
echo(Entrance1);
$SCSchedulevar = schedule(10000, 0, SCschedule, %obj);
}
parent::onNewDataBlock(%this,%obj);
}
};
activatepackage(skycaptainentrance);
package skycaptainondisabled
{
function Skycaptain::ondisabled(%dtb, %obj, %enabled)
{
cancel($SCSchedulevar);
echo("Schdule cancled!");
parent::ondisabled(%dtb, %obj, %enabled);
}
};
activatepackage(skycaptainondisabled);
voices.cs
function skycaptainkill(%client)
{
switch(getRandom(0, 3))
{
case 0:
ServerPlay2D(SC_kill1);
echo(Killsound1);
case 1:
ServerPlay2D(SC_kill2);
echo(Killsound2);
case 2:
ServerPlay2D(SC_kill3);
echo(killsound3);
case 3:
ServerPlay2D(SC_kill4);
echo(killsound4);
}
}
function SCschedule(%obj)
{
echo("Schdule loop");
%r=(getrandom(1, 5));
if(%r==1)
{
ServerPlay2D(SC_intimidation1);
Echo(intimidation1);
}
if(%r==2)
{
ServerPlay2D(SC_intimidation2);
Echo(intimidation2);
}
if(%r==3)
{
ServerPlay2D(SC_intimidation3);
Echo(intimidation3);
}
if(%r>3)
{
Echo("No sound effect (intimidation)");
}
if(%obj.getdamagelevel()>75)
{
%lh=(getRandom(0, 6));
if(%lh==0)
{
schedule(2000, 0, ServerPlay2D, SC_lowhealth1);
echo(lowhealth1);
}
if(%lh==1)
{
schedule(2000, 0, ServerPlay2D, SC_lowhealth2);
echo(lowhealth2);
}
if(%lh==2)
{
schedule(2000, 0, ServerPlay2D, SC_lowhealth3);
echo(lowhealth3);
}
if(%lh>2)
{
echo("No sound effect (lowhealth)");
}
}
}
I need some help making a few things.
1: I need a way to break the schedule for SCschedule when the boss dies
2: I need a way to detect when the boss makes a kill (This will be scripted into whatever weapon he uses)
3: I need to make some slayer-compatible stuff such as checking the number of lives of the player, and if the round ends in a certain manner.
I would appreciate any help in coding this.