Jump to content

Notice: The only official communication channel with IGC-Network Staff is this Support Center. Please be aware of active scammers, using Skype and other IMs, who pretend to be IGC-Network Staff.
IGC Forum uses cookies. Read the Privacy Policy for more info. To remove this message, please click the button to the right:    I accept the use of cookies
  •      Sign In   
  • Create Account

Sign In or Register to gain full access to our forums. By registering with us, you'll be able to discuss, share and private message with other members of our community.





Photo
- - - - -

Developer Tip :: Changes in Excellent Option Management in Season X and later

Posted by Wizzy , 04 October 2016 · 2,022 views

Documentation by @Bigman

 

The documentation is directed to Website developers to help adjusting their scripts to changes of excellent options management system introduced in Season X. It purpose is not to explain detailed way of handling item binary data, just to explain the change in general.

 

The entire new Excellent Option management system is mostly based on two XML files - IGC_ExcellentOptions.xml(1) and IGC_ItemList.xml(2)

 

STEP 1 - Determining Item Kind

 

Determine Kind of an item by reading data from file (2) - check KindA value, in below example it is KindA="3"

 

Example: Dragon Helm (Group 7, index 1)

<Item Index="1" Name="Dragon Helm" Slot="2" SkillIndex="0" Width="2" Height="2" Serial="1" Option="1" Drop="1" DropLevel="57" Defense="24" MagicDefense="0" Durability="68" ReqLevel="0" ReqStrength="120" ReqDexterity="30" ReqEnergy="0" ReqVitality="0" ReqCommand="0" SetAttrib="4" DarkWizard="0" DarkKnight="1" FairyElf="0" MagicGladiator="0" DarkLord="0" Summoner="0" RageFighter="0" GrowLancer="0" Type="1" Dump="1" Transaction="1" PersonalStore="1" StoreWarehouse="1" SellToNPC="1" Repair="1" KindA="3" KindB="16" Overlap="0" ModelPath="Data\Item\" ModelFile="HelmMale02.bmd" />

 

STEP 2 - Find out which excellent options the specified item may have

 

Now find all options in IGC_ExcellentOptions.xml file that have ItemKindA_1 = "3" or ItemKindA_2 = "3" or ItemKindA_3 = "3"

 

Relevant options:

		<Option ID="8" 	Number="0" Operator="2"   Value="4"  FormulaID="-1" ItemKindA_1="3" ItemKindA_2="4"  ItemKindA_3="-1" Rate="5000" Name="Increase Maximum Life by %d%%" />
		<Option ID="9" 	Number="1" Operator="2"   Value="4"  FormulaID="-1" ItemKindA_1="3" ItemKindA_2="4"  ItemKindA_3="-1" Rate="5000" Name="Increase Maximum Mana by %d%%" />
		<Option ID="10" Number="2" Operator="2"   Value="4"  FormulaID="-1" ItemKindA_1="3" ItemKindA_2="4"  ItemKindA_3="-1" Rate="5000" Name="Decreases Damage by %d%%" />
		<Option ID="11" Number="3" Operator="2"   Value="5"  FormulaID="-1" ItemKindA_1="3" ItemKindA_2="4"  ItemKindA_3="15" Rate="5000" Name="Reflect Damage increase by %d%%" />
		<Option ID="12" Number="4" Operator="2"   Value="10" FormulaID="-1" ItemKindA_1="3" ItemKindA_2="4"  ItemKindA_3="15" Rate="5000" Name="Increases Defense Success Rate by %d%%" />
		<Option ID="13" Number="5" Operator="2"   Value="30" FormulaID="-1" ItemKindA_1="3" ItemKindA_2="4"  ItemKindA_3="-1" Rate="5000" Name="Increases the amount of Zen acquired for hunting monsters by %d%%" />

 

STEP 3 - Using Data of Excellent option to add
After determining options for specified item take value of Number attribute of each Excellent option to add and use it to define specified option

 

Example: To add option "Increase Maximum Life by %d%%" to Dragon Helm, use value 0 (Number="0")

 

 

STEP 4 - Adding option to item

  • if Number < 6, add the Excellent option normally to the item like in previous system
excOpt |= (1 << (5 - Number)
  • if Number > 5, add the option in the first free Socket slot:
                if (item[Socket1] == 255)
                    item[Socket1] = Number;
                else if (item[Socket2] == 255)
                    item[Socket2] = Number;
                else if (item[Socket3] == 255)
                    item[Socket3] = Number;
                else if (item[Socket4] == 255)
                    item[Socket4] = Number;
                else if (item[Socket5] == 255)
                    item[Socket5] = Number;

 

STEP 5 - Checking if option already exist for an item
To check if item has Excellent option activated use below code sample:

foreach (var excOpt in AvailableExcOptsForThisItem)
{
   if (excOpt.Number < 6)
   {
       bool active = ((item.ExcOpt & (1 << (5 - excOpt.Number))) == (1 << (5 - excOpt.Number)));
   }
   else // number > 5
   {
       bool active = (item.Socket1 == excOpt.Number) || (item.Socket2 == excOpt.Number) || (item.Socket3 == excOpt.Number) || (item.Socket4 == excOpt.Number) || (item.Socket5 == excOpt.Number));
   }
}

Attached Files



  • Rainmaker likes this