Hello tout le monde! J’aimerais savoir comment faire en sorte qu’il n’y ait aucun loot aléatoire sur les cadavres des gens. Quand on tue des machins de haut niveau, des objets commencent à apparaître que je n’avais pas programmés dans leur inventaire… Comment enlever ça?
Hello everyone! I would like to know how to ensure that there is no random loot on the corpses of people. When you kill high level stuff, things start to appear that I did not have programmed in their inventory… How to remove that?
have a look at the creatures’ OnSpawn handler (script)
the default script ( nw_c2_default9 ) has a section that looks like this:
//* Create a small amount of treasure on the creature
if (GetLocalInt(GetModule(), "X2_L_NOTREASURE") == FALSE
&& GetLocalInt(OBJECT_SELF, "X2_L_NOTREASURE") == FALSE
&& GetRacialType(OBJECT_SELF) != RACIAL_TYPE_ANIMAL
&& GetRacialType(OBJECT_SELF) != RACIAL_TYPE_BEAST
&& GetRacialType(OBJECT_SELF) != RACIAL_TYPE_CONSTRUCT
&& GetRacialType(OBJECT_SELF) != RACIAL_TYPE_ELEMENTAL
&& GetRacialType(OBJECT_SELF) != RACIAL_TYPE_VERMIN)
{
if (GetChallengeRating(OBJECT_SELF) <= 5.0)
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_LOW, OBJECT_SELF);
}
else if (GetChallengeRating(OBJECT_SELF) >5.0 && GetChallengeRating(OBJECT_SELF) <=10.0)
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_MED, OBJECT_SELF);
}
else
{
CTG_GenerateNPCTreasure(TREASURE_TYPE_HIGH, OBJECT_SELF);
}
}
eg. Copy nw_c2_default9 to your module’s Campaign folder (or to your module if it’s not a campaign) and delete or comment-out that codeblock … compile and test what happens,
There are other ways to drop loot, but that’s the primary one for random treasure.
If you want to remove the random loot completely for all creatures in your campaign, set a local integer ''X2_L_NOTREASURE" in the module properties to TRUE on all the modules in your campaign. If you want to remove the random loot just for specific creatures, set this variable to TRUE on these creatures.