2025-08-05 18:58:54 -04:00
|
|
|
void DestroyAllInventory(object oCreature)
|
|
|
|
{
|
|
|
|
object oItem = GetFirstItemInInventory(oCreature);
|
|
|
|
while (GetIsObjectValid(oItem))
|
|
|
|
{
|
|
|
|
DestroyObject(oItem);
|
|
|
|
oItem = GetNextItemInInventory(oCreature);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-11 14:01:05 -05:00
|
|
|
void main()
|
|
|
|
{
|
2025-08-05 18:58:54 -04:00
|
|
|
object oDead = OBJECT_SELF;
|
|
|
|
object oMaster = GetMaster(oDead);
|
|
|
|
|
|
|
|
// Only destroy inventory if this creature is summoned
|
|
|
|
if (GetIsObjectValid(oMaster))
|
|
|
|
{
|
|
|
|
int nType = GetAssociateType(oDead);
|
|
|
|
|
|
|
|
if (nType == ASSOCIATE_TYPE_SUMMONED)
|
|
|
|
{
|
|
|
|
DestroyAllInventory(oDead);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ExecuteScript("prc_npc_death", OBJECT_SELF);
|
2024-02-11 14:01:05 -05:00
|
|
|
ExecuteScript("nw_ch_ac7", OBJECT_SELF);
|
|
|
|
}
|