Body decay and/or persistent corpses
Jidokwon
Member Posts: 405
Good day! If it's not overly complicated and something that I can easily toggle on my end, can anyone, please, tell me how I might adjust these factors with the toolset? To be more clear, I'm hoping that it might be reasonably feasible on my end to have a more consistent looting experience, as I adventure through a wide variety of custom modules. I can understand how creators are attempting to make things more immersive, but I'm finding it extremely difficult to loot in custom modules that have added persistent corpses. For my personal use and convenience, is there a simple toggle that might restore the loot system back to NWNEE's default settings here? Where the NPCs' bodies decay reasonably quickly and leave behind loot bags? Or is there a lot more to this that I'm likely not considering. Would doing this make plot items nearly impossible to find?
0
Comments
//:://////////////////////////////////////////////////
//:: NW_C2_DEFAULT7
/*
Default OnDeath event handler for NPCs.
Adjusts killer's alignment if appropriate and
alerts allies to our death.
*/
//:://////////////////////////////////////////////////
//:: Copyright (c) 2002 Floodgate Entertainment
//:: Created By: Naomi Novik
//:: Created On: 12/22/2002
//:://////////////////////////////////////////////////
//:://////////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: April 1st, 2008
//:: Added Support for Dying Wile Mounted
//:://///////////////////////////////////////////////
#include "x2_inc_compon"
#include "x0_i0_spawncond"
#include "x3_inc_horse"
void main()
{
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
object oKiller = GetLastKiller();
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsObjectValid(GetMaster(OBJECT_SELF))) SetLocalInt(GetMaster(OBJECT_SELF),"bX3_STORE_MOUNT_INFO",TRUE);
// If we're a good/neutral commoner,
// adjust the killer's alignment evil
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
{
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
}
// Call to allies to let them know we're dead
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
//Shout Attack my target, only works with the On Spawn In setup
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
// NOTE: the OnDeath user-defined event does not
// trigger reliably and should probably be removed
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
{
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
}
craft_drop_items(oKiller);
}
This is the script in question that *not* having anything relating towards it in my override file or a modified version of this script within a module seems to have reverted the looting system back to normal on my end. Again, I haven't fully tested this, nor do I claim to remotely understand how any of it works. In my case, though, deleting the modified versions of the script did remove the bodies persisting after death and spawned in loot bags with any loot that might have dropped.
If you want to create "loot" on the NPC to be dropped for players to pick up after death, it's important to remember that anything which the NPC either has in the blueprint or has created by the on-spawn script can be used by the NPC if it has the appropriate feat (or the item doesn't require a feat to use). If you don't want to unexpectedly increase the difficulty of the NPC (and reduce the loot which will be available to the PC), then you need to instead generate the droppable loot on-death.
You can instead use another setting under the Advanced tab to stop the body from decaying, which means that the body itself becomes the "body bag" instead of vanishing and leaving "Remains" behind. Check "Leaves Lootable Corpse" if this is what you want.
There's an alternative which is scripted into some servers. Instead of the loot being created on the dead NPC, the OnDeath script creates a container (perhaps looking like a blood stain on the floor) which then receives the loot. This allows the NPC body to remain on-map but not be selectable. This may help with separating loot piles when there are a lot of dead NPCs, but so would just allowing the NPCs to create their default Remains when the body vanishes.
It seems like the module which you've been playing does this alternative. It also seems to create loot before death since you're still getting loot after deleting the on-death script, except that it's now in Remains instead of in a "body".
HOWEVER if the script which you deleted is the above, then the on-death scripting MUST be inside the OnUserDefined event script instead, since there is no processing for loot or bodies in the on-death script.
OnUserDefined must be looking for event number 1007 and then taking special action to either create the loot or create a body and transfer the loot to the body.
If the OnUserDefined script isn't too long, perhaps you could post it here so we can see what it does.
Regarding looting scripts, in the past I've created an auto-loot script which was triggered by an item.
The idea is that when the item is activated, a visual effect is created at the target location (I used the Implode effect) and then a search is made within a radius (I chose something like 10 feet, making 20 feet diameter) for either remains or anything else which might contain loot drops, then the items inside the remains are copied across to the PC (including variables on the items) followed by the originals being deleted. All of this is done by scripting commands added inside the OnActivateItem scripting.