Randomized Henchmen

Randomized Henchmen
This commit is contained in:
Jaysyn904
2021-10-10 23:01:07 -04:00
parent 79303e9f79
commit 68de4c6610
29 changed files with 31455 additions and 4417 deletions

View File

@@ -1,5 +1,5 @@
//
// Bandit Random Armor Include
// Randomized Armor Include
// RA_RND_ARMOR_INC
//
// By: Jaysyn
@@ -63,3 +63,67 @@ void RndBanditArmor(object oNPC)
}
}
void RndLightArmor(object oNPC)
{
// Makes sure any original armor isn't dropped as loot.
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF), 0);
//Randomizes Armor
int nResult = d8(1);
int nStackSize = 1; // Create 1 items;
object oArmor;
string sItem;
if (nResult == 1)
{
sItem = "aarcl002";
}
else if(nResult == 2)
{
sItem = "baleas_cloth019";
}
else if(nResult == 3)
{
sItem = "aarcl004";
}
else if(nResult ==4)
{
sItem = "zep_studdedleath";
}
else if(nResult == 5)
{
sItem = "aarcl004";
}
else if(nResult == 6)
{
sItem = "nw_aarcl001";
}
else if(nResult == 7)
{
sItem = "nw_aarcl002";
}
else
sItem = "nw_aarcl009";
CreateItemOnObject(sItem, OBJECT_SELF, nStackSize);
// Loop the object's inventory and equip the first
object oItem = GetFirstItemInInventory(OBJECT_SELF);
while(GetIsObjectValid(oItem))
{
// Check if armor, of course
if(GetBaseItemType(oItem) == BASE_ITEM_ARMOR)
{
// Equip it and stop the script
DelayCommand(1.0f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
return;
}
oItem = GetNextItemInInventory(OBJECT_SELF);
}
}