1st I just want to say that this wasn't really an attempt at creating a real CiG mod, it was moreless a hack job until i could create a better version. This mod currently DOES work with Pure ergo should work with GlobalU as well. I looked around after I got online and found another version almost identical to mine, Rookie_ZP_ComboInstagib or something like that. There's not much difference between the two mods other than i am extending the Arena class "abstract" (which is what allowed me to get the bUseTranslocator hack
) .. Actually I'm going to stop right there. That is where I exploit the xloc feature but if you were to just create a new class ' class ComboShock extends ShockRifle; ' you can get this one mod to be zp compatable.
Here:
Code:
// ============================================================================
// ComboInsta Mutator
// ============================================================================
class ComboInstaDM extends Mutator;
var bool bInitialized, postInit;
var name WeaponName, AmmoName;
var string WeaponString, AmmoString;
var config bool bNoSelfDamage, bNoSelfBoost, bNoTeamBoost;
var config float FireRateScale, AltFireRateScale, MinSecondsBetweenBalls;
var Projectile LastBall[64];
var float LastBallTime[64];
function AddMutator(Mutator M)
{
if ( M.IsA('Arena') )
{
log(M$" not allowed (already have an Arena mutator)");
return; //only allow one arena mutator
}
Super.AddMutator(M);
}
function PreBeginPlay()
{
if (bInitialized)
return;
bInitialized = True;
Super.PreBeginPlay();
Log("ComboInsta v2.0 mutator loaded.");
}
function PostBeginPlay()
{
local Inventory AUX;
if (postInit)
return;
Enable('Tick');
postInit = True;
Level.Game.RegisterDamageMutator(Self);
ForEach Level.AllActors(Class'Inventory',AUX) {
if(AUX.isA('Ammo') && !AUX.bHeldItem || AUX.isA('Weapon') && !AUX.bHeldItem) {
AUX.Destroy();
continue; }
}
}
event Tick(float DeltaTime)
{
local Ammo AUX;
local Actor A;
local int pid;
local Pawn O;
ForEach Level.AllActors(Class'Ammo',AUX) {
AUX.AmmoAmount = 50; // Max Ammo
}
ForEach AllActors(class'Actor',A)
{
if (InStr(CAPS(String(A)),"SHOCKPROJ")>=0)
{
// Log("[ReduceBalls@"$Level.TimeSeconds$"] Checking projectile "$A$" with Owner="$A.Owner$" and Instigator="$A.Instigator);
O = A.Instigator;
if (O != None)
{
pid = O.PlayerReplicationInfo.PlayerID % 64;
if (Projectile(A) != LastBall[pid])
{
if (Level.TimeSeconds < LastBallTime[pid] + MinSecondsBetweenBalls) {
Projectile(A).Destroy(); }
else {
LastBallTime[pid] = Level.TimeSeconds;
LastBall[pid] = Projectile(A); }
}
}
}
}
}
function MutatorTakeDamage( out int ActualDamage, Pawn Victim, Pawn InstigatedBy,
out Vector HitLocation, out Vector Momentum, name DamageType)
{
if(Victim == None || InstigatedBy == None) return;
if(ActualDamage>5000) return; //For maps that force the player to take damage itself (space in dm-hyperblast)
if (InstigatedBy.IsA('TournamentPlayer') && Victim==InstigatedBy && bNoSelfDamage ||
InstigatedBy.IsA('Bot') && Victim==InstigatedBy && bNoSelfDamage) {
ActualDamage = 0;
if (bNoSelfBoost) {
Momentum = Vect(0,0,0); }
}
else if(InstigatedBy.IsA('TournamentPlayer') || InstigatedBy.IsA('Bot') && Victim.IsA('TournamentPlayer') || Victim.IsA('Bot')) {
ActualDamage = 1000; //hackish instagib!
if(Level.Game.bTeamGame && InstigatedBy.PlayerReplicationInfo.Team==Victim.PlayerReplicationInfo.Team &&
TeamGamePlus(Level.Game).FriendlyFireScale==0) {
ActualDamage = 0;
if (bNoTeamBoost) {
Momentum = Vect(0,0,0); }
}
}
if ( NextDamageMutator != None )
NextDamageMutator.MutatorTakeDamage(ActualDamage, Victim, InstigatedBy,
HitLocation, Momentum, DamageType);
}
function ModifyPlayer(Pawn Other)
{
GiveWeapon( Other, "ComboInsta.ComboShock" );
if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
}
function GiveWeapon(Pawn PlayerPawn, string aClassName )
{
local class<Weapon> WeaponClass;
local Weapon NewWeapon;
WeaponClass = class<Weapon>(DynamicLoadObject(aClassName, class'Class'));
if( PlayerPawn.FindInventoryType(WeaponClass) != None )
return;
newWeapon = Spawn(WeaponClass);
if( newWeapon != None )
{
newWeapon.RespawnTime = 0.0;
newWeapon.GiveTo(PlayerPawn);
newWeapon.bHeldItem = true;
newWeapon.GiveAmmo(PlayerPawn);
newWeapon.SetSwitchPriority(PlayerPawn);
newWeapon.WeaponSet(PlayerPawn);
newWeapon.AmbientGlow = 0;
if ( PlayerPawn.IsA('PlayerPawn') )
newWeapon.SetHand(PlayerPawn(PlayerPawn).Handedness);
else
newWeapon.GotoState('Idle');
PlayerPawn.Weapon.GotoState('DownWeapon');
PlayerPawn.PendingWeapon = None;
PlayerPawn.Weapon = newWeapon;
}
}
function bool AlwaysKeep(Actor Other)
{
local bool bTemp;
// This allows the grappling hook to be loaded during a Shock arena.
if (InStr(Caps(Other.Class.Name),"GRAP")>=0)
return true;
if (InStr(Caps(Other.Class.Name),"SHOCK")>=0)
return true;
if ( NextMutator != None )
return ( NextMutator.AlwaysKeep(Other) );
return false;
}
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
if ( Other.IsA('Pickup') && !Other.IsA('UT_Jumpboots') ) {
return false; }
if ( Other.IsA('Weapon') && !Other.IsA(WeaponName) ) {
return false; }
if ( Other.IsA('Translocator') )
return true;
return Super.CheckReplacement( Other, bSuperRelevant );
return true;
}
defaultproperties {
WeaponName=ComboShock
AmmoName=ShockCore
WeaponString="ComboInsta.ComboShock"
AmmoString="Botpack.ShockCore"
DefaultWeapon=class'ComboInsta.ComboShock'
bNoSelfBoost=False
bNoSelfDamage=True
bNoTeamBoost=False
FireRateScale=1.00
AltFireRateScale=0.50
MinSecondsBetweenBalls=0.1
}
and ..
Code:
//
// ============================================================================
// ComboShock
// ============================================================================
class ComboShock extends ShockRifle;
defaultproperties {
ItemName="ComboShock"
DeathMessage="%k electrified %o with the %w."
// This is redundent since you wont be picking any up ..
PickupMessage="You got the ComboShock."
}
That right there exactly will 1.) ComboInsta Arena and 2.) zpComboInsta (you will need ZPPure, ZPP103, whatever zp shockarena as a base for zp) As far as the anti spamballz feature, yes there are a few ways to do this and I need to experiment. Try setting the MinSecondsBetweenBalls to what I have there, 0.1, as I'm told it's a nice feel. Also the ini included in this zip is no good. You need to add the setting's into the server ini.
[ComboInsta.ComboInstaDM]
bNoSelfBoost=False
bNoSelfDamage=True
bNoTeamBoost=False
FireRateScale=1.00
AltFireRateScale=0.50
MinSecondsBetweenBalls=0.1