View previous topic :: View next topic |
Author |
Message |
Ordoran
Joined: 10 Sep 2016 Posts: 2
|
Posted: Wed Sep 14, 2016 14:54 Post subject: How to Get ItemProperty String Description |
|
|
Hi all,
For a first post on this forum, I have a simple question:
Is it possible to get a full item property description, without registering back all property cases (ie Alignement, damage type etc....)?
Currently, I can easily get the "first" part of the property description, using property const int, 2da file, and dialog.tlk text string.
But, for subtypes (specific damage for exemple), it start to be harder, as no 2da file exist (native file), or i missed something.
Final purpose of this is a auction house for players, with both IG/Forum interface, allowing multilingual (based on dialog.tlk).
Il will appreciate any idea, |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Wed Sep 14, 2016 17:15 Post subject: |
|
|
Code: | string GetItemPropertyString( itemproperty IP ){
int nType = GetItemPropertyType( IP );
string sName = GetStringByStrRef( StringToInt( Get2DAString( "ItemPropDef", "Name", nType ) ), GENDER_BOTH );
string sSub = Get2DAString( "ItemPropDef", "SubTypeResRef", nType );
int nData;
string sSep = ": ";
if( sSub != "" ){
nData = StringToInt( Get2DAString( sSub, "Name", GetItemPropertySubType( IP ) ) );
if( nData > 0 ){
sName = sName + sSep + GetStringByStrRef( nData, GENDER_BOTH );
sSep = " ";
}
}
sSub = Get2DAString( "iprp_costtable", "Name", GetItemPropertyCostTable( IP ) );
if( sSub != "" ){
nData = StringToInt( Get2DAString( sSub, "Name", GetItemPropertyCostTableValue( IP ) ) );
if( nData > 0 )
sName = sName + sSep + GetStringByStrRef( nData, GENDER_BOTH );
}
int nParm = GetItemPropertyParam1( IP );
if( nParm < 0 ){
sSub = Get2DAString( "ItemPropDef", "Param1ResRef", nType );
if( sSub != "" )
nParm = StringToInt( sSub );
else
nParm = StringToInt( Get2DAString( Get2DAString( "ItemPropDef", "SubTypeResRef", nType ), "Param1ResRef", GetItemPropertySubType( IP ) ) );
}
sSub = Get2DAString( "iprp_paramtable", "TableResRef", nParm );
if( sSub != "" ){
nData = StringToInt( Get2DAString( sSub, "Name", GetItemPropertyParam1Value( IP ) ) );
if( nData > 0 )
sName = sName + sSep + GetStringByStrRef( nData, GENDER_BOTH );
}
return sName;
} |
_________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
Ordoran
Joined: 10 Sep 2016 Posts: 2
|
Posted: Wed Sep 14, 2016 17:24 Post subject: |
|
|
Thanks for the script, that save me some hours.
After investigation, I was missing a few 2da files..
I've find them on the neverwintervault.org.
Thanks again |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|