I have a weapon package what I want to replace with the weapons (UT2K4 Weapons)
I try it alone, maybe I can do it but when I taked a look for the scripts only thats what I found
WORMReplacer:
Code: Select all
class WormMutator expands WormyReplacer;
var bool bInitialised;
var int loopA, loopB, loopC;
var string myammostring;
var name myitemname;
function ModifyPlayer(Pawn Other)
{
local inventory Inv, newInv;
local Weapon weap;
GetTheCrapINeed();
for ( inv=Other.inventory; inv!=None; inv=inv.inventory )
{
if (inv.isA('weapon')) weap = Weapon(inv);
if (weap.isA('enforcer')) weap.destroy();
if (weap.isA('impacthammer')) weap.destroy();
}
GiveWeapon(Other, WeaponString[0]);
GiveWeapon(Other, WeaponString[1]);
If (class'WormOtherConfig'.Default.bLastManStanding)
{
for (LoopA=2; LoopA<10; LoopA++) GiveWeapon(Other, WeaponString[LoopA]);
NewInv = Spawn(class'Armor2');
if( NewInv != None )
{
NewInv.bHeldItem = true;
NewInv.RespawnTime = 0.0;
NewInv.GiveTo(Other);
}
for ( inv=Other.inventory; inv!=None; inv=inv.inventory )
{
weap = Weapon(inv);
if ( (weap != None) && (weap.AmmoType != None) )
weap.AmmoType.AmmoAmount = weap.AmmoType.MaxAmmo;
}
}
Super.ModifyPlayer(Other);
if ( NextMutator != None )
NextMutator.ModifyPlayer(Other);
}
function PreBeginPlay()
{
if ( bInitialised )
return;
GetTheCrapINeed();
//wormDefaultWeap1 = class<weapon>(DynamicLoadObject(weaponstring[0], class'class'));
defaultweapon = NONE; //make default weapon nothing for now.
bInitialised = TRUE;
}
function GetTheCrapINeed()
{
for (LoopA=0; LoopA<11; LoopA++)
{
WeaponString[LoopA] = class'WormWeapConfig'.Default.WeaponString[LoopA];
WeaponName[LoopA] = GetTheName(weaponstring[LoopA]);
AmmoString[LoopA] = GetTheAmmo(WeaponString[LoopA]);
AmmoName[LoopA] = GetTheName(AmmoString[LoopA]);
}
If (class'WormAmmoConfig'.Default.bManualAmmoOverride)
{
for (LoopA=0; LoopA<11; LoopA++)
{
AmmoString[LoopA] = class'WormAmmoConfig'.Default.AmmoString[LoopA];
AmmoName[LoopA] = GetTheName(AmmoString[LoopA]);
}
}
bAmmo1 = class'WormAmmoConfig'.Default.bIncludeAmmo1;
bAmmo2 = class'WormAmmoConfig'.Default.bIncludeAmmo2;
bAmmo3 = class'WormAmmoConfig'.Default.bIncludeAmmo3;
bAmmo4 = class'WormAmmoConfig'.Default.bIncludeAmmo4;
bAmmo5 = class'WormAmmoConfig'.Default.bIncludeAmmo5;
bAmmo6 = class'WormAmmoConfig'.Default.bIncludeAmmo6;
bAmmo7 = class'WormAmmoConfig'.Default.bIncludeAmmo7;
bAmmo8 = class'WormAmmoConfig'.Default.bIncludeAmmo8;
bAmmo9 = class'WormAmmoConfig'.Default.bIncludeAmmo9;
for (LoopA=0; LoopA<9; LoopA++)
{
PickupString[LoopA] = class'WormPickupConfig'.Default.PickupString[LoopA];
PickupName[LoopA] = GetTheName(PickupString[LoopA]);
}
}
function string GetTheAmmo( string myweaponstring )
{
local class<weapon> myweaponclass;
myweaponclass = class<weapon>(DynamicLoadObject(myweaponstring, class'class'));
//Specific Support for the strangelove 2, so it spawns fuel cores rather than invisible rockets.
if(myweaponstring ~= "slv2.konglauncher") return("slv2.fuelcore");
myammostring = string(myweaponclass.default.ammoname);
return(myammostring);
}
function name GetTheName( string myitemstring )
{
local class<inventory> myitemclass;
myitemclass = class<inventory>(DynamicLoadObject(myitemstring, class'class'));
myitemname = myitemclass.name;
return(myitemname);
}
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 )
{
// If (newWeapon.AmmoName != 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;
/* }
Else
{
newWeapon.Instigator = PlayerPawn;
newWeapon.BecomeItem();
PlayerPawn.AddInventory(newWeapon);
newWeapon.GiveAmmo(PlayerPawn);
newWeapon.SetSwitchPriority(PlayerPawn);
newWeapon.WeaponSet(PlayerPawn);
}
*/
}
}
999 Ammo:
Code: Select all
class UnlimitedAmmo expands Mutator;
var bool Initialized;
var(UnlimitedAmmo) globalconfig bool RedeemerUnlimited;
event PreBeginPlay()
{
Super.PreBeginPlay();
if (Initialized)
return;
Initialized = true;
Spawn(class'UnlimitedAmmoSpawnNotify', self);
SetTimer(Level.TimeDilation, true);
}
function Timer()
{
// Top it up every second
local Ammo A;
ForEach AllActors(class'Ammo', A)
{
if (!RedeemerUnlimited && A.IsA('WarheadAmmo'))
continue;
A.AmmoAmount = 999;
A.MaxAmmo = 999;
}
}