Jump to content

Unlimited use of some items in battle


asmrar

Recommended Posts

Hi,
I'm very beginner in modding, i found a way to use some items infinitely in battle :smile:
items = (FragGrenades - AlienGrenades - MediKit - ShredderRockets - Rockets - GhostCharges - ArcThrower - SmokeGrenade - BattleScanner - MimicBeacon - GasGrenades - GhostGrenades - FlashBangs - NeedleGrenades - ProximityMines - Flamethrower)

i did it by change the action cost from 1 to 0 in each line like (kAbility.m_kUnit.Set"item Name"(kAbility.m_kUnit."item Name"() - 1 to 0)

(XComGame.upk - XGAbilityTree - ApplyActionCost.function)


function ApplyActionCost(XGAbility_Targeted kAbility)
{
local int iCost;

// End:0x1378
if((kAbility.HasProperty(1) || kAbility.GetType() == 28) || kAbility.GetType() == 87)
{
// End:0x229
if(kAbility.m_kWeapon != none)
{
iCost = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.GetAmmoCost(kAbility.m_kWeapon.GameplayType(), kAbility.GetType(), kAbility.m_kUnit.GetCharacter().m_kChar.aUpgrades[113] > 0, kAbility.m_kUnit.GetCharacter().m_kChar, kAbility.m_bReactionFire);
}
// End:0x2F6
if(kAbility.GetType() == 16)
{
// End:0x2F3
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetFragGrenades(kAbility.m_kUnit.GetFragGrenades() - 0);
}
}
// End:0x7F9
else
{
// End:0x3C3
if(kAbility.GetType() == 18)
{
// End:0x3C0
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetAlienGrenades(kAbility.m_kUnit.GetAlienGrenades() - 0);
}
}
// End:0x7F9
else
{
// End:0x4FB
if(kAbility.GetType() == 86)
{
// End:0x4F8
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetFragGrenades(kAbility.m_kUnit.GetFragGrenades() - 0);
kAbility.m_kUnit.SetAlienGrenades(kAbility.m_kUnit.GetAlienGrenades() - 0);
}
}
// End:0x7F9
else
{
// End:0x640
if((((kAbility.GetType() == 29) || kAbility.GetType() == 26) || kAbility.GetType() == 25) || kAbility.GetType() == 87)
{
// End:0x63D
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetMediKitCharges(kAbility.m_kUnit.GetMediKitCharges() - 0);
}
}
// End:0x7F9
else
{
// End:0x6D4
if(kAbility.GetType() == 52)
{
kAbility.m_kUnit.SetShredderRockets(kAbility.m_kUnit.GetShredderRockets() - 0);
}
// End:0x7F9
else
{
// End:0x768
if(kAbility.GetType() == 19)
{
kAbility.m_kUnit.SetRockets(kAbility.m_kUnit.GetRockets() - 0);
}
// End:0x7F9
else
{
// End:0x7F9
if(kAbility.GetType() == 28)
{
kAbility.m_kUnit.SetGhostCharges(kAbility.m_kUnit.GetGhostCharges() - 0);
}
}
}
}
}
}
}
// End:0x8C2
if((kAbility.m_kWeapon != none) && kAbility.m_kWeapon.IsA('XGWeapon_ArcThrower'))
{
kAbility.m_kUnit.SetArcThrowerCharges(kAbility.m_kUnit.GetArcThrowerCharges() - 0);
}
// End:0x98F
if(kAbility.GetType() == 17)
{
// End:0x98C
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetSmokeGrenadeCharges(kAbility.m_kUnit.GetSmokeGrenadeCharges() - 0);
}
}
// End:0xFF4
else
{
// End:0xA5C
if(kAbility.GetType() == 56)
{
// End:0xA59
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetBattleScannerCharges(kAbility.m_kUnit.GetBattleScannerCharges() - 0);
}
}
// End:0xFF4
else
{
// End:0xB29
if(kAbility.GetType() == 75)
{
// End:0xB26
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetMimicBeaconCharges(kAbility.m_kUnit.GetMimicBeaconCharges() - 0);
}
}
// End:0xFF4
else
{
// End:0xBF6
if(kAbility.GetType() == 76)
{
// End:0xBF3
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetGasGrenades(kAbility.m_kUnit.GetGasGrenades() - 0);
}
}
// End:0xFF4
else
{
// End:0xCC3
if(kAbility.GetType() == 77)
{
// End:0xCC0
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetGhostGrenades(kAbility.m_kUnit.GetGhostGrenades() - 0);
}
}
// End:0xFF4
else
{
// End:0xD90
if(kAbility.GetType() == 15)
{
// End:0xD8D
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetFlashBangs(kAbility.m_kUnit.GetFlashBangs() - 0);
}
}
// End:0xFF4
else
{
// End:0xE5D
if(kAbility.GetType() == 79)
{
// End:0xE5A
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetNeedleGrenades(kAbility.m_kUnit.GetNeedleGrenades() - 0);
}
}
// End:0xFF4
else
{
// End:0xF2A
if(kAbility.GetType() == 82)
{
// End:0xF27
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetProximityMines(kAbility.m_kUnit.GetProximityMines() - 0);
}
}
// End:0xFF4
else
{
// End:0xFF4
if(kAbility.GetType() == 80)
{
// End:0xFF4
if(!kAbility.m_kUnit.m_bInfiniteGrenades)
{
kAbility.m_kUnit.SetFlamethrowerCharges(kAbility.m_kUnit.GetFlamethrowerCharges() - 0);
}
}
}
}
}
}
}
}
}
}
// End:0x1378
if(kAbility.m_kWeapon != none)
{
kAbility.m_kWeapon.ApplyAmmoCost(iCost);
iCost = XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.GetOverheatIncrement(kAbility.m_kUnit, kAbility.m_kWeapon.GameplayType(), kAbility.GetType(), kAbility.m_kUnit.GetCharacter().m_kChar, kAbility.m_bReactionFire);
kAbility.m_kWeapon.ApplyOverheatIncrement(kAbility.m_kUnit, iCost);
// End:0x1378
if(XComTacticalGRI(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kBattle.m_kDesc.m_bIsTutorial && kAbility.m_kUnit.IsMine())
{
// End:0x1378
if(kAbility.m_kWeapon.GetRemainingAmmo() < iCost)
{
// End:0x1378
if((kAbility.GetType() != 16) && kAbility.GetType() != 19)
{
TriggerGlobalEventClass(class'SeqEvent_OnUsedAmmo', kAbility.m_kUnit, 0);
}
}
}
}
}
//return;
}

i searched for abilities [cooldown, duration, charges] value especially for Psi with no success :ermm:
, please help..

Link to comment
Share on other sites

@op

 

Congrats on getting a change working!

 

 

Perks are passive, abilities are actives. Certain things, like squadsight, have both a passive and an active ability (increased range [passive] and shot with no crit possibility [active]) so they have both a perk and an ability.

 

This isn't quite how I'd put it.

 

Internally, perks are game elements that are directly attached to soldiers in the strategy game and pawns in the tactical game and grant some exception to the game's internal rules. The internal code often refers to them as "upgrades."

 

Mostly, these manifest (externally, that is, in view of the player) as what is labeled as, and thus the player thinks of as, "perks" -- the stuff you pick on level-up, like Head Shot or In the Zone or Resilience. But aliens are granted some perks, and certain game events also grant perks -- like being poisoned by a Thin Man grants a rather unfortunate perk.

 

Some perks are indeed passive in nature; that is, the bending of the rules isn't something the player needs to choose to activate, but they are permanently in effect, like Squadsight, or conditionally triggered without being actively selected, like In The Zone.

 

Abilities are a distinct game element. Abilities are things that exist solely in the tactical game. In general, the player (or alien AI) must choose to activate them, although there are some exceptions in alien abilities (like Muton Intimidate.)

 

Some perks grant abilities, like Head Shot. Armors and items can grant abilities, and some abilities are innate to a given pawn; all soldiers have the Hunker Down ability, for example.

Edited by johnnylump
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...