Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Item Property Value

Hello,

I'm trying to build a "Corruption Vat" that reverses the value of "ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP"

I cannot, for the life of me, figure out how to identify the "alignment group" and the "enchantment bonus" attributed to this particular item property. Does anyone have a script that is able to do this? I know it has something to do with SubType value... but I can't dig it up.

Thanks in advance! Will plus up for help! :smiley:

Comments

  • CalgacusCalgacus Member Posts: 171
    edited February 11
    Try something like this?
    itemproperty ip = GetFirstItemProperty(oItem);
     
    while (GetIsItemPropertyValid(ip)) // valid ip?
    {
      // right property type?
      if ((GetItemPropertyType(ip) == ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP))
      {
        SpeakString("has sub-property == "+ IntToString(GetItemPropertySubType(ip)));
        if (GetItemPropertySubType(ip) ==  IP_CONST_ALIGNMENTGROUP_GOOD   ){
          /// do custom  stuff
        }
      }
      // get next ip ...
      ip = GetNextItemProperty(oItem);
    }//end loop
    

    Post edited by Calgacus on
    antirelic
  • antirelicantirelic Member Posts: 20
    Calgacus wrote: »
    Try something like this?
    itemproperty ip = GetFirstItemProperty(oItem);
     
    while (GetIsItemPropertyValid(ip)) // valid ip?
    {
      // right property type?
      if ((GetItemPropertyType(ip) == ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP))
      {
        SpeakString("has sub-property == "+ IntToString(GetItemPropertySubType(ip)));
        if (GetItemPropertySubType(ip) ==  IP_CONST_ALIGNMENTGROUP_GOOD   ){
          /// do custom  stuff
        }
      }
      // get next ip ...
      ip = GetNextItemProperty(oItem);
    }//end loop
    

    How to get the enchantment bonus number?

    Thank you for this much!

  • CalgacusCalgacus Member Posts: 171
    edited February 11
    not sure... thought I had it but no... let me see...

    how about IPGetWeaponEnhancementBonus

    eg
    int bonus = IPGetWeaponEnhancementBonus(
         oItem,
         ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP 
    );
    

    Assuming you only have one "ITEM_PROPERTY_ENHANCEMENT_BONUS_VS_ALIGNMENT_GROUP" property per item, that should do. Not sure how to differentiate between them if you have multiple.

    antirelic
  • antirelicantirelic Member Posts: 20
    Great. I think that might do it

  • antirelicantirelic Member Posts: 20
    Yes. That did it. Thank you Calgacus.

Sign In or Register to comment.