Eternal Warrior Project
Henchman tries to identify all items in his and the player's inventory. Labels=0
Eternal Warrior Project
Henchman tries to identify all items in his and the player's inventory. Labels=0
Eternal Warrior Project
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Eternal Warrior Project

The Eternal Warrior Project Official Guild
 
HomeLatest imagesSearchRegisterLog in

 

 Henchman tries to identify all items in his and the player's inventory.

Go down 
AuthorMessage
rorqock
Guild Archon
Guild Archon
rorqock


Posts : 112
Join date : 2008-04-14
Age : 50
Location : France

Henchman tries to identify all items in his and the player's inventory. Empty
PostSubject: Henchman tries to identify all items in his and the player's inventory.   Henchman tries to identify all items in his and the player's inventory. Icon_minitimeFri Apr 18, 2008 1:25 pm

Code:
// Henchman tries to identify all items in his and the player's inventory.

void IdentifyAll(object oObject, object oMaster);

void main()
{
object oPC = GetMaster(OBJECT_SELF);
IdentifyAll(oPC, oPC);
IdentifyAll(OBJECT_SELF, oPC);
}

void IdentifyAll(object oObject, object oPC)
{

int nMyLore = GetSkillRank(SKILL_LORE, OBJECT_SELF); // henchman lore rank
int nItemValue; // gold value of item
string sMaxValue = Get2DAString("SkillVsItemCost", "DeviceCostMax", nMyLore); // max value that the henchman can id
int nMaxValue = StringToInt(sMaxValue);

// * Handle overflow (November 2003 - BK)
if (sMaxValue == "")
{
nMaxValue = 120000000;
}

object oItem = GetFirstItemInInventory(oObject);
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));
}
}
oItem = GetNextItemInInventory(oObject);
}
}
Code:
Back to top Go down
http://www.myspace.com/rorqock
 
Henchman tries to identify all items in his and the player's inventory.
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Eternal Warrior Project :: Neverwinter Nights Series :: Scripts :: Scripts ===> Non-player characters :: Henchmen-
Jump to: