47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
|
void IdentifyAll(object oItem, object oPC);
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
object oPC = GetPCSpeaker();
|
||
|
object oItem = GetNextItemInInventory(oPC);
|
||
|
|
||
|
if (GetGold(oPC) >= 2000)
|
||
|
{
|
||
|
AssignCommand(oPC, TakeGoldFromCreature(2000, oPC, TRUE));
|
||
|
|
||
|
IdentifyAll(oPC, oPC);
|
||
|
IdentifyAll(OBJECT_SELF, oPC);
|
||
|
}
|
||
|
|
||
|
else
|
||
|
{
|
||
|
SendMessageToPC(oPC, "You don't have enough gold to identify all of the items!");
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
void IdentifyAll(object oObject, object oPC)
|
||
|
{
|
||
|
|
||
|
object oItem = GetFirstItemInInventory(oPC);
|
||
|
while(oItem != OBJECT_INVALID)
|
||
|
{
|
||
|
if(!GetIdentified(oItem))
|
||
|
{
|
||
|
/*
|
||
|
SetIdentified(oItem, TRUE); // setting TRUE to get the true value of the item
|
||
|
nItemValue = GetGoldPieceValue(oItem);
|
||
|
SetIdentified(oItem, FALSE); // back to FALSE
|
||
|
if(nMaxValue >= nItemValue)
|
||
|
{
|
||
|
SetIdentified(oItem, TRUE);
|
||
|
SendMessageToPC(oPC, GetName(OBJECT_SELF) + " " + GetStringByStrRef(75930) + " " + GetName(oItem));
|
||
|
}
|
||
|
*/
|
||
|
SetIdentified(oItem, TRUE);
|
||
|
}
|
||
|
oItem = GetNextItemInInventory(oObject);
|
||
|
}
|
||
|
}
|
||
|
|