2021-09-07 22:44:00 -04:00
|
|
|
//
|
2021-10-10 23:01:07 -04:00
|
|
|
// Randomized Armor Include
|
2021-09-07 22:44:00 -04:00
|
|
|
// RA_RND_ARMOR_INC
|
|
|
|
//
|
|
|
|
// By: Jaysyn
|
|
|
|
//
|
|
|
|
|
|
|
|
// Test VOID
|
|
|
|
//void main(){}
|
|
|
|
|
|
|
|
void RndBanditArmor(object oNPC)
|
|
|
|
{
|
2021-09-25 14:13:00 -04:00
|
|
|
// Makes sure any original armor isn't dropped as loot.
|
|
|
|
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF), 0);
|
|
|
|
|
|
|
|
//Randomizes Armor
|
2021-09-07 22:44:00 -04:00
|
|
|
|
|
|
|
int nResult = d6(1);
|
2021-09-25 14:13:00 -04:00
|
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
|
2021-09-07 22:44:00 -04:00
|
|
|
object oArmor;
|
2021-09-25 14:13:00 -04:00
|
|
|
|
2021-09-07 22:44:00 -04:00
|
|
|
string sItem;
|
2021-09-25 14:13:00 -04:00
|
|
|
|
2021-09-07 22:44:00 -04:00
|
|
|
if (nResult == 1)
|
|
|
|
{
|
|
|
|
sItem = "NW_AARCL001";
|
|
|
|
}
|
|
|
|
else if(nResult == 2)
|
|
|
|
{
|
|
|
|
sItem = "NW_AARCL009";
|
|
|
|
}
|
|
|
|
else if(nResult == 3)
|
|
|
|
{
|
|
|
|
sItem = "NW_AARCL002";
|
|
|
|
}
|
|
|
|
else if(nResult ==4)
|
|
|
|
{
|
2021-09-25 14:13:00 -04:00
|
|
|
sItem = "NW_AARCL008";
|
2021-09-07 22:44:00 -04:00
|
|
|
}
|
|
|
|
else if(nResult == 5)
|
|
|
|
{
|
2021-09-25 14:13:00 -04:00
|
|
|
sItem = "NW_AARCL002";
|
2021-09-07 22:44:00 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
sItem = "NW_AARCL008";
|
|
|
|
|
2021-09-25 14:13:00 -04:00
|
|
|
CreateItemOnObject(sItem, OBJECT_SELF, nStackSize);
|
2021-09-07 22:44:00 -04:00
|
|
|
|
2021-09-25 14:13:00 -04:00
|
|
|
// 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2021-10-10 23:01:07 -04:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
2021-10-12 23:34:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void RndFighterArmor(object oNPC)
|
|
|
|
{
|
|
|
|
// Makes sure any original armor isn't dropped as loot.
|
|
|
|
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF), 0);
|
|
|
|
|
|
|
|
//Randomizes Armor
|
|
|
|
|
|
|
|
int nResult = d10(1);
|
|
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
|
|
|
|
object oArmor;
|
|
|
|
|
|
|
|
string sItem;
|
|
|
|
|
|
|
|
if (nResult == 1)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl011";
|
|
|
|
}
|
|
|
|
else if(nResult == 2)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl006";
|
|
|
|
}
|
|
|
|
else if(nResult == 3)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl005";
|
|
|
|
}
|
|
|
|
else if(nResult ==4)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl010";
|
|
|
|
}
|
|
|
|
else if(nResult == 5)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl004";
|
|
|
|
}
|
|
|
|
else if(nResult == 6)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl003";
|
|
|
|
}
|
|
|
|
else if(nResult == 7)
|
|
|
|
{
|
|
|
|
sItem = "nw_aarcl012";
|
|
|
|
}
|
|
|
|
else if(nResult == 8)
|
|
|
|
{
|
|
|
|
sItem = "chainmail_st";
|
|
|
|
}
|
|
|
|
else if(nResult == 9)
|
|
|
|
{
|
|
|
|
sItem = "scale_st";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sItem = "aarcl007";
|
|
|
|
|
|
|
|
CreateItemOnObject(sItem, OBJECT_SELF, nStackSize);
|
2021-10-10 23:01:07 -04:00
|
|
|
|
2021-10-12 23:34:41 -04:00
|
|
|
// 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);
|
|
|
|
}
|
2021-10-10 23:01:07 -04:00
|
|
|
}
|
2022-11-16 08:10:27 -05:00
|
|
|
|
|
|
|
void RndPirateArmor(object oNPC)
|
|
|
|
{
|
|
|
|
//Randomizes Armor
|
|
|
|
|
|
|
|
int nResult = d6(1);
|
|
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
|
|
|
|
string sItem;
|
|
|
|
|
|
|
|
if (nResult == 1)
|
|
|
|
{
|
|
|
|
sItem = "RA_ALTSL_PIRATE1";
|
|
|
|
}
|
|
|
|
else if(nResult == 2)
|
|
|
|
{
|
|
|
|
sItem = "RA_ALTSL_PIRATE2";
|
|
|
|
}
|
|
|
|
else if(nResult == 3)
|
|
|
|
{
|
|
|
|
sItem = "RA_ALTSL_PIRATE3";
|
|
|
|
}
|
|
|
|
else if(nResult == 4)
|
|
|
|
{
|
|
|
|
sItem = "RA_ALTSL_PIRATE4";
|
|
|
|
}
|
|
|
|
else if(nResult == 5)
|
|
|
|
{
|
|
|
|
sItem = "RA_ALTSL_PIRATE5";
|
|
|
|
}
|
|
|
|
else if(nResult == 6)
|
|
|
|
{
|
|
|
|
sItem = "RA_ALTSL_PIRATE5";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
sItem = "RA_ALTSL_PIRATE6";
|
|
|
|
|
|
|
|
CreateItemOnObject(sItem, oNPC, nStackSize);
|
|
|
|
|
|
|
|
// 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
|
|
|
|
DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|