Item Property Removal and price comparison
DJ_WoW
Member Posts: 51
Gooday all,
I am working on a crafting system and I need to loop through the Item Properties and remove a specified Item Property before adding the new Item Property with value. This is what I have. When I compare the two Values in iStartCost and iEndCost it is clear that the Item Property has not been remove. Am I missing a step here?
Thank you for your time,
DJ-WoW
I am working on a crafting system and I need to loop through the Item Properties and remove a specified Item Property before adding the new Item Property with value. This is what I have. When I compare the two Values in iStartCost and iEndCost it is clear that the Item Property has not been remove. Am I missing a step here?
int iStartCost = GetGoldPieceValue(oCopy);
itemproperty ipLoop, ipType;
ipLoop = GetFirstItemProperty(oCopy);
while (GetIsItemPropertyValid(ipLoop))
{if GetItemPropertyType(ipLoop)==ITEM_PROPERTY_ENHANCEMENT_BONUS)
{RemoveItemProperty(oCopy, ipLoop);}
ipLoop = GetNextItemProperty(oCopy);
}
REM: I add new Item Property to oCopy and compare prices.
int iEndCost = GetGoldPieceValue(oCopy);
DJ-WoW
0
Comments
{if GetItemPropertyType(ipLoop)==ITEM_PROPERTY_ENHANCEMENT_BONUS)
should be:
{if (GetItemPropertyType(ipLoop)==ITEM_PROPERTY_ENHANCEMENT_BONUS)
A workaround I frequently use is to call an ExecuteScript from the script which needs to modify an object. The property, in your case, will get removed at the end of the ExecuteScript and you now deal with the object accordingly in your first script.
Wanted to thank you for your informative reply. I figured it might work like destroying an object which occurs at the end of a script also.
Greatly appreciated,
DJ-Wow