The issue that remains (other than the creature's death scream, which is unresolvable >:|) is loot – obviously, a creature ejected to some other plane shouldn't leave any loot behind. For this I've resorted to just looping through the target's items (after checking that it's not a party member) and destroying everything without a plot flag, but I don't like it; mostly due to unsureness on my part that I've adequately checked for party-member-ness, but also because I'm not sure if this will run before or after random treasure is generated, and because it's, well... rather destructive.
Here's the relevant excerpt from my script in progress:
/*
int nSoundSet = GetSoundSet(oTarget); // WTF FUNCTION DOESN'T EXIST
SetSoundSet(oTarget, 448); // set sound set to (none) so there's no death scream ++ No way to set it back if death effect doesn't work >:|
*/
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(FALSE, FALSE, TRUE), oTarget); // no feedback, ignore immunity
if (GetIsDead(oTarget, TRUE)) // death effect worked
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, EffectNWN2SpecialEffectFile("total_invisibility"), oTarget, 6.0); // makes oTarget *completely* invisible
if (!(GetIsOwnedByPlayer(oTarget) || GetIsRosterMember(oTarget) || GetCommandable(oTarget))) // if not a party member
{ // Destroy non-plot items on oTarget, since the banished creature's inventory would have been banished with it
object oItem = GetFirstItemInInventory(oTarget);
while (GetIsObjectValid(oItem))
{
if (!GetPlotFlag(oItem)) // don't destroy if plot item
DestroyObject(oItem);
GetNextItemInInventory(oTarget);
}
}
AssignCommand(oTarget, SetIsDestroyable(TRUE, FALSE, FALSE)); // don't leave a corpse
}
/*else // give up
{
SetSoundSet(oTarget, nSoundSet);
}*/
If anyone can think of a better way, or address my concerns regarding party members and random treasure, it would be muchly appreciated.





Retour en haut







