Rune_PRC8/_module/nss/fv_vial_id_h.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

31 lines
1004 B
Plaintext

//This will identify and label the blood in 'oPC's inventory. will return TRUE on
//complete sucess, FALSE on failure due to lack of funds.
int doIdentify(object oPC, int iCost = 50)
{
object oCheck = GetFirstItemInInventory(oPC);
string sResRef;
int iStack;
while(GetIsObjectValid(oCheck))
{
sResRef = GetResRef(oCheck);
if(sResRef == "blood" || sResRef == "bloodbad" || sResRef == "bloodchild"
|| sResRef == "bloodvirgin")
{
for(iStack = GetItemStackSize(oCheck) - 1; iStack > 0; iStack--)
{
if(GetGold(oPC) < iCost) return FALSE;
TakeGoldFromCreature(iCost, oPC, TRUE);
SetItemStackSize(oCheck, iStack);
CreateItemOnObject("g" + sResRef, oPC);
}
if(GetGold(oPC) < iCost) return FALSE;
TakeGoldFromCreature(iCost, oPC, TRUE);
DestroyObject(oCheck);
CreateItemOnObject("g" + sResRef, oPC);
}
oCheck = GetNextItemInInventory(oPC);
}
return TRUE;
}