Kindbud
02-07-2009, 02:23 AM
hey guys long time.. saw all the badass custom stuff in your servers a while back, and im hoping you can help me out here... i have this code i found and i'd like to modify it to spawn a random item from an array of items when the fly is killed. can anyone help me out plz plz plz lol
class flybonus expands Mutator;
var bool Initialized;
function PostBeginPlay()
{
//
// Install only once
//
if (Initialized)
return;
Initialized = True;
Level.Game.RegisterDamageMutator( Self );
}
function MutatorTakeDamage(
out int ActualDamage,
Pawn Victim,
Pawn InstigatedBy,
out Vector HitLocation,
out Vector Momentum,
name DamageType
)
{
local Shockwave explosion;
if (Victim.Health <= ActualDamage)
{
if (Victim.IsA('Fly'))
{
Spawn(class 'UnrealI.purplelight',,,Victim.Location);
Spawn(class 'UnrealI.respawn',,,Victim.Location);
// **SPAWN CODE FOR RANDOM DROP HERE**
}
}
//
// Pass on the event to the next handler
//
if ( NextDamageMutator != None )
NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, DamageType );
}
defaultproperties
{
}
class flybonus expands Mutator;
var bool Initialized;
function PostBeginPlay()
{
//
// Install only once
//
if (Initialized)
return;
Initialized = True;
Level.Game.RegisterDamageMutator( Self );
}
function MutatorTakeDamage(
out int ActualDamage,
Pawn Victim,
Pawn InstigatedBy,
out Vector HitLocation,
out Vector Momentum,
name DamageType
)
{
local Shockwave explosion;
if (Victim.Health <= ActualDamage)
{
if (Victim.IsA('Fly'))
{
Spawn(class 'UnrealI.purplelight',,,Victim.Location);
Spawn(class 'UnrealI.respawn',,,Victim.Location);
// **SPAWN CODE FOR RANDOM DROP HERE**
}
}
//
// Pass on the event to the next handler
//
if ( NextDamageMutator != None )
NextDamageMutator.MutatorTakeDamage( ActualDamage, Victim, InstigatedBy, HitLocation, Momentum, DamageType );
}
defaultproperties
{
}