KillAndReplaceLootable(object, int, int)

Kill and leave a lootable corpse.

void KillAndReplaceLootable(
    object oVictim,
    int bDecay = TRUE,
    int bDropWielded = TRUE
);

Parameters

oVictim

The object to slaughter.

bDecay

Will the corpse decay to a bag? TRUE or FALSE. (Default: TRUE)

bDropWielded

Determines where to put the weapons in oVictim's right and left hands. (Default: TRUE)


Description

Kill and leave a lootable corpse.

Despite the name, can be used in an OnDeath script; it won't kill the victim twice.

If bDropWielded is TRUE, the corpse will drop its right and left hand items to either side (making the body more decorative, but the items harder to see).



Remarks

Creates a lootable corpse object (x0_plc_corpse) where oVictim was standing and uses LootInventory and LootInventorySlots to move the lootable items from oVictim to the corpse object. Only valid, droppable items are moved to the corpse object.

bDecay is used for several different tasks.
 - If it is TRUE, then KillAndReplaceDecay. If it is set to FALSE then KillAndReplaceDecorative is called instead. This handles what kind of corpse object is made.
 - bDecay is also sent to LootInventorySlots as the third parameter. Which handles how oVictim's chest armor is destroyed.
 - Lastly, if set to TRUE it controls the final destruction of the corpse object.


Requirements

#include "x0_i0_corpses"


Version

???

See Also

functions:  KillAndExplode | KillAndReplaceDecay | KillAndReplaceDecorative | KillAndReplaceRaiseable | KillAndReplaceSelectable
categories:  Action on Object Functions


author: Mistress, editor: Kolyana