Hi all!
Is there a way to get via NWScript if the last projectile of a stack has been fired?
I.E: *Last arrow is fired.*
*Script returns that it no longer exists, or better yet, returns the name or tag of the last projectile fired.*
Using GetItemStackSize only seems to work if there is only one projectile left. I assume this is ironically, because the projectile no longer exists, and thus the stacksize can't be 'got'.
Methods I've tried:
int bIsAmmoOrThrowing = GetBaseItemType(oItem) == BASE_ITEM_ARROW ||
GetBaseItemType(oItem) == BASE_ITEM_BOLT ||
GetBaseItemType(oItem) == BASE_ITEM_BULLET ||
GetBaseItemType(oItem) == BASE_ITEM_DART ||
GetBaseItemType(oItem) == BASE_ITEM_SHURIKEN ||
GetBaseItemType(oItem) == BASE_ITEM_THROWINGAXE;
if (!bIsAmmoOrThrowing) return; //Check nBaseItemType to see if it's a projectile
{
if(oItem == OBJECT_INVALID)
{
SendMessageToPC(oPC, "Arrows no longer exist");
if(jmtFindMatchingNameTypeAndEquip(oPC, oItem) != TRUE)
{
SendMessageToPC(oPC, "Same Item/Name Not Found!");
jmtFindMatchingTypeAndEquip(oPC, oItem);
}
}
}
}
if (!bIsAmmoOrThrowing) return; //Check nBaseItemType to see if it's a projectile
{
if(GetItemStackSize(oItem) > 1)
{
SendMessageToPC(oPC, "Arrows no longer exist");
if(jmtFindMatchingNameTypeAndEquip(oPC, oItem) != TRUE)
{
SendMessageToPC(oPC, "Same Item/Name Not Found!");
jmtFindMatchingTypeAndEquip(oPC, oItem);
}
}
}
}