Initial Commit
Initial Commit [v1.32PRC8]
This commit is contained in:
105
_module/nss/prc_pwonspawn.nss
Normal file
105
_module/nss/prc_pwonspawn.nss
Normal file
@@ -0,0 +1,105 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: prc_pwonspawn
|
||||
/*
|
||||
* Fire onSpawn stuff not already in the PRC's
|
||||
* nw_c2_default9 script.
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "ms_name_inc"
|
||||
|
||||
void NoDropGear(object oNPC)
|
||||
{
|
||||
// List of all possible equipped item slots
|
||||
int SLOT_MIN = INVENTORY_SLOT_HEAD;
|
||||
int SLOT_MAX = INVENTORY_SLOT_BOLTS;
|
||||
|
||||
// Variable to iterate through slots
|
||||
int i;
|
||||
|
||||
// Iterate through each slot and unset the droppable flag if there's an item equipped
|
||||
for (i = SLOT_MIN; i <= SLOT_MAX; i++)
|
||||
{
|
||||
object oItem = GetItemInSlot(i, oNPC);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
SetDroppableFlag(oItem, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* void DropAllGear(object oNPC);
|
||||
void DropArmor(object oNPC);
|
||||
void DropHeldItems(object oNPC);
|
||||
|
||||
void DropAllGear(object oNPC)
|
||||
{
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
|
||||
while (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (!GetItemCursedFlag(oItem))
|
||||
{
|
||||
SetItemCursedFlag(oItem, FALSE);
|
||||
SetDroppableFlag(oItem, TRUE);
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
||||
|
||||
void DropArmor(object oNPC)
|
||||
{
|
||||
//:: Armor slot
|
||||
object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST, oNPC);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (!GetItemCursedFlag(oItem))
|
||||
{
|
||||
SetItemCursedFlag(oItem, FALSE);
|
||||
SetDroppableFlag(oItem, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DropHeldItems(object oNPC)
|
||||
{
|
||||
//:: Left hand slot
|
||||
object oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oNPC);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (!GetItemCursedFlag(oItem))
|
||||
{
|
||||
SetItemCursedFlag(oItem, FALSE);
|
||||
SetDroppableFlag(oItem, TRUE);
|
||||
}
|
||||
}
|
||||
//:: Right hand slot
|
||||
oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oNPC);
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
if (!GetItemCursedFlag(oItem))
|
||||
{
|
||||
SetItemCursedFlag(oItem, FALSE);
|
||||
SetDroppableFlag(oItem, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
void main()
|
||||
{
|
||||
object oNPC = OBJECT_SELF;
|
||||
|
||||
//:: Sets all worn gear to undroppable.
|
||||
NoDropGear(oNPC);
|
||||
|
||||
/* DelayCommand(0.0f, DropArmor(oNPC));
|
||||
DelayCommand(0.0f, DropHeldItems(oNPC)); */
|
||||
|
||||
|
||||
//:: Markshire Nomeclature
|
||||
ms_Nomenclature(oNPC);
|
||||
}
|
||||
Reference in New Issue
Block a user