Added Skullkeep's dynamic loot generation system
Added Skullkeep's PRC8 compatible dynamic loot generation system. Full compile. Updated release archive.
This commit is contained in:
39
_module/nss/sd_destroy_lbag.nss
Normal file
39
_module/nss/sd_destroy_lbag.nss
Normal file
@@ -0,0 +1,39 @@
|
||||
#include "prc_inc_racial"
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLastClosedBy();
|
||||
object oItem;
|
||||
object oCorpse = GetLocalObject(OBJECT_SELF, "oHostBody");
|
||||
object oBlood = GetLocalObject(OBJECT_SELF, "oBlood");
|
||||
object oBones;
|
||||
location lLoc = GetLocation(oCorpse);
|
||||
int iCount;
|
||||
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
|
||||
oItem = GetFirstItemInInventory(OBJECT_SELF);
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
++iCount;
|
||||
oItem = GetNextItemInInventory(OBJECT_SELF);
|
||||
}
|
||||
if (iCount==0){
|
||||
AssignCommand(oCorpse, SetIsDestroyable(TRUE, FALSE, FALSE));
|
||||
DestroyObject(oBlood);
|
||||
DestroyObject(oCorpse);
|
||||
if ((MyPRCGetRacialType(oCorpse) != RACIAL_TYPE_CONSTRUCT) &&
|
||||
(MyPRCGetRacialType(oCorpse) != RACIAL_TYPE_ELEMENTAL)&&
|
||||
(MyPRCGetRacialType(oCorpse) != RACIAL_TYPE_DRAGON)&&
|
||||
(MyPRCGetRacialType(oCorpse) != RACIAL_TYPE_ANIMAL))
|
||||
|
||||
{
|
||||
oBones = CreateObject(OBJECT_TYPE_PLACEABLE,
|
||||
"plc_bones",
|
||||
lLoc, FALSE);
|
||||
ExecuteScript("sd_destroyself", oBones);
|
||||
}
|
||||
DestroyObject(OBJECT_SELF, 0.2f);
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user