If GetLastWeaponUsed returns OBJECT_INVALID, get inventory slot item gloves. My code below wont be exact, as I don't know how you are getting/recording who oKiller is. So I'm assuming oKiller is already defined. Potential problem: Gloves and bracers both go in INVENTORY_SLOT_ARMS. Filter by base item type?
This code filters by base item type, if you need to differentiate between bracers and gloves.
Code: Select all
object oWeapon = GetLastWeaponUsed(oKiller);
if(!GetIsObjectValid(oWeapon))
{
//Object was, indeed, invalid. Check for gloves.
object oGloves = GetItemInSlot(INVENTORY_SLOT_ARMS, oKiller);
if(!GetIsObjectValid(oGloves))
{
//oKiller used bare hands, no gloves.
}
else
{
//oKiller was wearing gloves or bracers
if(GetBaseItemType(oGloves) == BASE_ITEM_BRACER)
{
//Item was a set of bracers, not gloves. Run whatever code here.
}
else
{
//string sGloveID = X;
//Replace X above with either GetTag(oGloves) or some other
//function to get the desired identifier from the glvoes and then
//uncomment that line.
}
}
}
else
{
//Object was a weapon. Run whatever code here.
}
This code does not differentiate between gloves and bracers.
Code: Select all
object oWeapon = GetLastWeaponUsed(oKiller);
if(!GetIsObjectValid(oWeapon))
{
//Object was, indeed, invalid. Check for gloves.
object oGloves = GetItemInSlot(INVENTORY_SLOT_ARMS, oKiller);
if(!GetIsObjectValid(oGloves))
{
//oKiller used bare hands, no gloves.
}
else
{
//oKiller was wearing gloves or bracers
//string sGloveID = X;
//Replace X above with either GetTag(oGloves) or some other
//function to get the desired identifier from the glvoes and then
//uncomment that line.
}
}
else
{
//Object was a weapon. Run whatever code here.
}
A wise man does not dwell on his past. He learns from it, he grows from it, and then moves ahead into his future.
And some wise words from a wise man.
Orleron wrote:You have to excuse Themi. Tact, diplomacy, and softness are not his best traits, but he does not mean anything by his writing. He's a nice guy. You just get used to it after a while because he doesn't seem to learn.
