03-13-2011, 14:05
This are meant to be added to the mod we made: Chaotic Invasion Zombie Mod, thread the first(FixWeapon())
Code:
FixWeapon()
{
//self _giveWeapon( "airdrop_marker_mp", 0 );
self _setActionSlot( 4, "weapon", "airdrop_marker_mp" );
self thread monitorUsage(self);
}
monitorUsage(player)
{
self endon ( "death" );
self endon ( "disconnect" );
for ( ;; )
{
self waittill( "grenade_fire", flare, weapname );
if ( !isAirdropMarker( weapname ) )
continue;
flare thread detonateOnStuck();
flare.owner = self;
flare.weaponName = weapname;
self.airDropMarker = flare;
flare thread flareActivate(player);
wait 0.01;
}
}
isAirdropMarker( weaponName )
{
switch ( weaponName )
{
case "airdrop_marker_mp":
case "airdrop_mega_marker_mp":
case "airdrop_sentry_marker_mp":
return true;
default:
return false;
}
}
flareActivate(player)
{
self notify( "flareActivate" );
self endon( "flareActivate" );
self waittill( "explode", position );
spawnChicken(position, player);
}
detonateOnStuck()
{
self endon ( "death" );
self waittill( "missile_stuck" );
self detonate();
}
SpawnChicken(location, callplayer)
{
level.callorigin = location;
Bird = spawn("script_model", level.callorigin );
Bird setModel( "toy_chicken_black_white" );
Bird.destructible_type = "toy_chicken_black_white";
Bird common_scripts\_destructible::setup_destructibles();
Bird.Owner = callplayer.name;
//Bird MoveTo(loc,14);
callplayer playLocalSound( "mp_defeat" );
Bird.angles = self.angles;
level.chopper_fx["explode"]["medium"] = loadfx ("explosions/aerial_explosion");
wait 14;
fx = playFX(level.chopper_fx["explode"]["medium"], level.callorigin);
TriggerFX(fx);
self thread DamageArea(level.callorigin,220,800,600,"airdrop_marker_mp",false);
Bird playsound("exp_suitcase_bomb_main");
wait 2;
fx delete();
Bird delete();
}