Skip to content

Seeing Quality or Material on an item?

DJ_WoWDJ_WoW Member Posts: 51
edited April 2020 in Builders - Scripting
Gooday all,

Trying to find out if there is a way to determine what the Quality or Material of an item is. Assuming that the item has one or both of these item properties. I am currently looping thru the Item Properties of an item and I am able to determine that there is Quality or Material. I just can't see a way to determine which Quality or Material is being detected.


Thank you for your time,

DJ-WoW
Post edited by DJ_WoW on

Comments

  • ProlericProleric Member Posts: 1,316
    IIRC GetItemPropertySubType() returns values for, say, Quality, identified by IP_CONST_QUALITY_* constants in the toolset.

    GetItemPropertyType will establish whether it's ITEM_PROPERTY_QUALITY in the first place.

    Likewise Material.

    As I'm sure you know, standard items don't have Quality or Material properties - they are just included for use by builders.
  • DJ_WoWDJ_WoW Member Posts: 51
    Gooday to ya,

    Thanks for the info. I was looping thru the properties and I am able to filter the ITEM_PROPERTY_QUALITY,
    however, when I use the GetItemPropertySubType() all I get is (0) no matter the Quality of the Item.

    ipLoop = GetNextItemProperty(oItem);}
    int iLevel;
    ipLoop = GetFirstItemProperty(oItem);
    while (GetIsItemPropertyValid(ipLoop))
    {if (GetItemPropertyType(ipLoop) == ITEM_PROPERTY_QUALITY )
    {iLevel = GetItemPropertySubType(ipLoop);
    SpeakString("DEBUG: " + IntToString(iLevel), TALKVOLUME_SHOUT);}
    ipLoop = GetNextItemProperty(oItem);}

    Thanks for your time,

    DJ-WoW


  • ShadowMShadowM Member Posts: 573
    DJ_WoW wrote: »
    Gooday to ya,

    Thanks for the info. I was looping thru the properties and I am able to filter the ITEM_PROPERTY_QUALITY,
    however, when I use the GetItemPropertySubType() all I get is (0) no matter the Quality of the Item.

    ipLoop = GetNextItemProperty(oItem);}
    int iLevel;
    ipLoop = GetFirstItemProperty(oItem);
    while (GetIsItemPropertyValid(ipLoop))
    {if (GetItemPropertyType(ipLoop) == ITEM_PROPERTY_QUALITY )
    {iLevel = GetItemPropertySubType(ipLoop);
    SpeakString("DEBUG: " + IntToString(iLevel), TALKVOLUME_SHOUT);}
    ipLoop = GetNextItemProperty(oItem);}

    Thanks for your time,

    DJ-WoW


    That because he gave you the wrong sub type. It GetItemPropertyCostTableValue
    Custom function sample below.
    //Get the Quality in INT form from 2da.
    int HR_GetQuality(object oItem);
    int HR_GetQuality(object oItem)
    {
    int iQuality;
    
    itemproperty ipLoop1=GetFirstItemProperty(oItem);
    
    while(GetIsItemPropertyValid(ipLoop1))
    {
    if(GetItemPropertyType(ipLoop1)== ITEM_PROPERTY_QUALITY)
    {
    int iSubType =GetItemPropertyCostTableValue(ipLoop1);
    iQuality=iSubType;
    }
    ipLoop1=GetNextItemProperty(oItem);
    }
    return iQuality;
    }
    
    
  • DJ_WoWDJ_WoW Member Posts: 51
    Gooday again,

    Thank you ShadowM. That worked. I am now able to see the Quality I set on the Item via script.

    DJ-WoW
  • ProlericProleric Member Posts: 1,316
    My bad, sorry.
Sign In or Register to comment.