Changed folder name.
Changed folder name.
This commit is contained in:
46
_module/nss/idallitemsofpc.nss
Normal file
46
_module/nss/idallitemsofpc.nss
Normal file
@@ -0,0 +1,46 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user