Updated Giant Wasp Hive
Updated Giant Wasp Hive. Got the Outcasts spawning with clothes on. Full compile.
This commit is contained in:
32
_module/nss/ra_antinude.nss
Normal file
32
_module/nss/ra_antinude.nss
Normal file
@@ -0,0 +1,32 @@
|
||||
// This method does not use ActionEquipMostEffectiveArmor() and is a workaround
|
||||
// to allow equipping clothing. It will equip any armor in the entering object's
|
||||
// inventory. It can easily be modified to be used on a NPC's spawn script, but
|
||||
// this is a good thing to have on a trigger around the module spawn point for
|
||||
// PCs. Thanks to georage.
|
||||
void main()
|
||||
{
|
||||
// Get the entering object
|
||||
object oNPC = GetEnteringObject();
|
||||
string sLocal = "DO_ONCE" + ObjectToString(OBJECT_SELF);
|
||||
|
||||
// Only do this once, and only to NPCs
|
||||
if(GetLocalInt(oNPC, sLocal) || GetIsPC(oNPC)) return;
|
||||
|
||||
// Set to not do it again
|
||||
SetLocalInt(oNPC, sLocal, TRUE);
|
||||
|
||||
// Loop the object's inventory and equip the first
|
||||
object oItem = GetFirstItemInInventory(oNPC);
|
||||
while(GetIsObjectValid(oItem))
|
||||
{
|
||||
// Check if armor, of course
|
||||
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
|
||||
{
|
||||
// Equip it and stop the script
|
||||
AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
||||
return;
|
||||
}
|
||||
|
||||
oItem = GetNextItemInInventory(oNPC);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user