generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
30
_module/nss/fv_vial_id_h.nss
Normal file
30
_module/nss/fv_vial_id_h.nss
Normal file
@@ -0,0 +1,30 @@
|
||||
//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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user