649 lines
15 KiB
Plaintext
649 lines
15 KiB
Plaintext
//
|
|
// NWN Dark Sun Random Armor Include
|
|
// DS_RND_ARMOR_INC
|
|
//
|
|
// By: Jaysyn
|
|
//
|
|
|
|
|
|
void EquipVAGuard(object oNPC)
|
|
{
|
|
int nRandom = Random(7);
|
|
object oItem;
|
|
switch(nRandom)
|
|
{
|
|
case 0:
|
|
oItem = CreateItemOnObject("ar_apltsl_dearth",oNPC);
|
|
break;
|
|
case 1:
|
|
oItem = CreateItemOnObject("ar_apltsl_dfire",oNPC);
|
|
break;
|
|
case 2:
|
|
oItem = CreateItemOnObject("ar_apltsl_dmagma",oNPC);
|
|
break;
|
|
case 3:
|
|
oItem = CreateItemOnObject("ar_apltsl_drain",oNPC);
|
|
break;
|
|
case 4:
|
|
oItem = CreateItemOnObject("ar_apltsl_dsilt",oNPC);
|
|
break;
|
|
case 5:
|
|
oItem = CreateItemOnObject("ar_apltsl_dwater",oNPC);
|
|
break;
|
|
case 6:
|
|
oItem = CreateItemOnObject("ar_apltsl_braxat",oNPC);
|
|
break;
|
|
}
|
|
AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
//return oItem;
|
|
}
|
|
|
|
void RndVAWizArmor(object oNPC)
|
|
{
|
|
int nRandom = Random(7);
|
|
object oItem;
|
|
switch(nRandom)
|
|
{
|
|
case 0:
|
|
oItem = CreateItemOnObject("ar_apclrb_essenc",oNPC);
|
|
break;
|
|
case 1:
|
|
oItem = CreateItemOnObject("ar_amclrb_advent",oNPC);
|
|
break;
|
|
case 2:
|
|
oItem = CreateItemOnObject("ar_amclrb_wizbat",oNPC);
|
|
break;
|
|
case 3:
|
|
oItem = CreateItemOnObject("ar_amclrb_mystic",oNPC);
|
|
break;
|
|
case 4:
|
|
oItem = CreateItemOnObject("ar_amclrb_enligh",oNPC);
|
|
break;
|
|
case 5:
|
|
oItem = CreateItemOnObject("ar_apcltg_dsilt",oNPC);
|
|
break;
|
|
case 6:
|
|
oItem = CreateItemOnObject("ar_amclrb_veiled",oNPC);
|
|
break;
|
|
}
|
|
AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
//return oItem;
|
|
|
|
|
|
/* //Randomizes Armor
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "AR_APCLRB_ESSENC";
|
|
}
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "AR_AMCLRB_ADVENT";
|
|
}
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "AR_AMCLRB_WIZBAT";
|
|
}
|
|
else if(nResult == 4)
|
|
{
|
|
sItem = "AR_AMCLRB_MYSTIC";
|
|
}
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "AR_AMCLRB_ENLIGH";
|
|
}
|
|
else
|
|
sItem = "AR_APCLTG_DSILT";
|
|
|
|
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));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
} */
|
|
|
|
}
|
|
|
|
void RndPirateArmor(object oNPC)
|
|
{
|
|
//Randomizes Armor
|
|
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "DS_ALTSL_PIRATE1";
|
|
}
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "DS_ALTSL_PIRATE2";
|
|
}
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "DS_ALTSL_PIRATE3";
|
|
}
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "DS_ALTSL_PIRATE4";
|
|
}
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "DS_ALTSL_PIRATE5";
|
|
}
|
|
else
|
|
sItem = "AR_ACLCL_HARNESS";
|
|
|
|
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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
|
|
}
|
|
|
|
void RndBanditArmor(object oNPC)
|
|
{
|
|
//:: Randomizes Armor
|
|
int nResult = d8(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1) { sItem = "NW_AARCL009"; } //:: Padded Armor (NWN)
|
|
else if(nResult == 2) { sItem = "AR_ALTSL_BONE01"; } //:: Bone-studded Leather Armor
|
|
else if(nResult == 3) { sItem = "AR_ALTLT_CATSUIT"; } //:: Cat Suit (Leather)
|
|
else if(nResult == 4) { sItem = "AR_ACLCL_HARNESS"; } //:: Harness (Padded)
|
|
else if(nResult == 5) { sItem = "AR_ALTLT_LEATHER"; } //:: Leather Armor
|
|
else if(nResult == 6) { sItem = "DS_ALTLT_BANDIT1"; } //:: Bandit Armor (Padded)
|
|
else if(nResult == 7) { sItem = "DS_ALTLT_BANDIT2"; } //:: Bandit Armor (Leather)
|
|
else sItem = "AR_ALTPD_CLOTH01"; //:: Padded Armor
|
|
|
|
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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
|
|
}
|
|
|
|
void RndRobes(object oNPC)
|
|
{
|
|
// Makes sure any original armor isn't dropped as loot.
|
|
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF), 0);
|
|
|
|
//Randomizes Armor
|
|
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
object oArmor;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "cloth007";
|
|
}
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "cloth012";
|
|
}
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "cloth016";
|
|
}
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "cloth025";
|
|
}
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "ar_aclgb_common";
|
|
}
|
|
else
|
|
sItem = "zep_wizrobes";
|
|
|
|
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);
|
|
}
|
|
|
|
}
|
|
|
|
void RndLightArmor(object oNPC)
|
|
{
|
|
//Randomizes Armor
|
|
|
|
int nResult = d8(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
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, 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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
}
|
|
|
|
void RndMediumArmor(object oNPC)
|
|
{
|
|
// Makes sure any original armor isn't dropped as loot.
|
|
SetDroppableFlag(GetItemInSlot(INVENTORY_SLOT_CHEST, OBJECT_SELF), 0);
|
|
|
|
//Randomizes Armor
|
|
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
object oArmor;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "ar_amdsc_mekilot";
|
|
}
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "ar_amdhd_hide01";
|
|
}
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "aarcl009";
|
|
}
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "aarcl011";
|
|
}
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "ar_amdsc_bone01";
|
|
}
|
|
else
|
|
sItem = "ar_amdsc_erdlu";
|
|
|
|
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);
|
|
}
|
|
|
|
}
|
|
|
|
void RndDwarfGuardArmor(object oNPC)
|
|
{
|
|
|
|
//Randomizes Armor
|
|
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "AR_ALTSL_BONE01";
|
|
}
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "AR_ALTSL_IVORY";
|
|
}
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "DS_AMDBP_KLED001";
|
|
}
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "AR_ALTLT_MEKILOT";
|
|
}
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "DS_AMDBP_KLED002";
|
|
}
|
|
else
|
|
sItem = "DS_AMDBP_KLED003";
|
|
|
|
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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
}
|
|
|
|
void RndGuardArmor(object oNPC)
|
|
{
|
|
//Randomizes Armor
|
|
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
string sItem;
|
|
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "AR_ALTSL_BONE01";
|
|
}
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "AR_ALTSL_IVORY";
|
|
}
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "AR_ALTLT_LEATHER";
|
|
}
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "AR_ALTLT_MEKILOT";
|
|
}
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "AR_ALTPD_CLOTH01";
|
|
}
|
|
else
|
|
sItem = "AR_ACLCL_HARNESS";
|
|
|
|
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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
}
|
|
|
|
void RndFighterArmor(object oNPC)
|
|
{
|
|
|
|
//Randomizes Armor
|
|
|
|
int nResult = d10(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
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, 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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
}
|
|
|
|
void RndEscortClothes(object oNPC)
|
|
{
|
|
|
|
//:: Randomizes "sexy" clothing for escorts
|
|
|
|
int nGender = GetGender(oNPC);
|
|
int nResult = d6(1);
|
|
int nStackSize = 1; // Create 1 items;
|
|
|
|
string sItem;
|
|
|
|
if(nGender > 0)
|
|
{
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "ds_aclcl_xotic01";
|
|
}
|
|
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "ds_aclcl_xotic02";
|
|
}
|
|
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "ds_aclcl_xotic03";
|
|
}
|
|
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "ds_aclcl_xotic04";
|
|
}
|
|
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "ds_aclcl_xotic05";
|
|
}
|
|
|
|
else sItem = "ds_aclcl_xotic06";
|
|
}
|
|
|
|
if(nGender < 1)
|
|
{
|
|
if (nResult == 1)
|
|
{
|
|
sItem = "ds_aclcl_xotic07";
|
|
}
|
|
|
|
else if(nResult == 2)
|
|
{
|
|
sItem = "ds_aclcl_xotic08";
|
|
}
|
|
|
|
else if(nResult == 3)
|
|
{
|
|
sItem = "ds_aclcl_xotic09";
|
|
}
|
|
|
|
else if(nResult ==4)
|
|
{
|
|
sItem = "ds_aclcl_xotic10";
|
|
}
|
|
|
|
else if(nResult == 5)
|
|
{
|
|
sItem = "ds_aclcl_xotic11";
|
|
}
|
|
|
|
else sItem = "ds_aclcl_xotic12";
|
|
}
|
|
|
|
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, AssignCommand(oNPC, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST)));
|
|
//DelayCommand(0.1f, ActionEquipItem(oItem, INVENTORY_SLOT_CHEST));
|
|
DelayCommand(0.2f, SetDroppableFlag(oItem, FALSE));
|
|
return;
|
|
}
|
|
|
|
oItem = GetNextItemInInventory(oNPC);
|
|
}
|
|
}
|
|
|
|
//:: void main (){} |