Jump to content

How To Link your Constants.cpp to your Item_Attr


Recommended Posts

  • Premium

Hello guys, today im gonna show you a simple trick that lets you use what you have in your Srcs/server/constants.cpp

What are those constants? They simply are the defined skills with they're index number.
You ever asked yourself how to implement on items some bonuses like RESIST CLAW or RESIST ICE or DEFENCE POINTS and stuff like that?
Well in constants.cpp you will face what are the bonus you got in your source (this is not how to implement new bonus, you will use the existent one)

The part we are interested in is:

const TApplyInfo aApplyInfo[MAX_APPLY_NUM] =

And below you got all the things you need like

    // Point Type
    { POINT_NONE,            },   // APPLY_NONE,        INDEX=0
    { POINT_MAX_HP,                },   // APPLY_MAX_HP,        INDEX=1
    { POINT_MAX_SP,                },   // APPLY_MAX_SP,        INDEX=2
    { POINT_HT,                    },   // APPLY_CON,        INDEX=3
    { POINT_IQ,                    },   // APPLY_INT,        INDEX=4

So what does this mean?
You just have to see this strings like this

    { POINT_MAX_HP,                },   // APPLY_MAX_HP,        1
    ITS EQUAL TO MAX_HP BONUS INDEX 1


What is this "INDEX" ? Well index is just a counter for your list of bonus, so you will start from 0 and get to xx
Why dont i have the INDEX in my source? Well i just added them to make you understand what is in a simple way.


So to be short you got your bonus identified with POINT_*
Of course if it says MAX_HP that should be it right? Right!

Now, lets say we have the CLAW RESISTANCE implemented in our source but when we change bonus on armors it doesnt appears even if we have insert it in the item_attr
This is because you have to follow the INDEX !

So lets get back to business, implementing the resist claw on armors n stuff
in the source, you will have something like this:

    { POINT_RESIST_CLAW,            },    // APPLY_RESIST_CLAW,    INDEX=96
    or
    { POINT_RESIST_CLAW,            },    // APPLY_RESIST_CLAW,            96 CLAW¿¡°Ô ÀúÇ×


Wich are equal, or you can just count from the MAX_HP wich is 1 to RESIST_CLAW line wich will be X

so if we have

    { POINT_RESIST_SHIT,            },    // This will be index 0
    { POINT_MAX_HP,            },    // This will be index 1
    { POINT_RESIST_WTF,            },    // This will be index 2
    { POINT_RESIST_ZOZO,            },    // This will be index 3
    { POINT_RESIST_XXX,            },    // This will be index 4
    { POINT_RESIST_CLAW,            },    // This will be index 5

In default i think its 96 the resist_claw but you should check your source.

 

-------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Now we got our bonus index, how do we set that on item_attr?
Simply, we go to navicat (or whatever)
Right Click on "item_attr"
Select "Design Table"
You will have something like this

6f769403_o.jpeg

Now go on the ... button near "Values:"
You will have this:

d42f7925_o.jpeg

What do i do now? Its simple but you have to read carefully what im typing.

This list respects a rule, this rule is the INDEX.
As you can see it starts from MAX_HP that have an index equal to 1.
If you want to add the bonus resist claw that in our case is 96 you have to reach this INDEX.
How do i do that?
Simple, you will have a " + " to add VALUES.
Count how many values you have there, if you have 80 values then your index is until 80, you have to add other 16 values there
to reach the "96".

So to make it short again, count how many values you have and add how many you need to reach your desired index bonus.
Like this:

c0ba4d94_o.jpeg

I called them with numbers because i prefer them like that but you can name them as you want, if you want to rename 96 with "RESIST_CLAW" is the same.
Now you have to add this bonus in your item_attr.
Like this:

b9c4e34b_o.jpeg

Where prob = probability to get this bonus on your item lv1 to lv5 are the variables for this bonus,
with weapon,body,wrist,foots,neck,head,shield,ear you select the % of successfully obtain that bonus on the select part of equipment.

I think thats all, changing your bonus ingame will show you the results.

And if you have any translation problem n stuff, you have to edit your locale_game.txt in your locale folder.

Thanks, if you want to share please keep credits.
Sorry if this kind of guide does exists, i dont want to make something that has been already made with proper instructions, if so delete this.

If you have any questions feel free to ask

Edited by Metin2 Dev
Core X - External 2 Internal
  • Love 1
Link to comment
Share on other sites

  • Premium
5 hours ago, 127.0.0.1 said:

You forgot to tell about lenght.h / item_data.h  / PythonItemModule.cpp / locale_game.txt / uitooltip.py

To be helpful to someone, do it completely.

Oh i typed this is no bonus adding process, this is to link your existent bonus index to your item_attr since a lot of people cant do this properly.
Thanks tho i can do another tut including all the stuff :)
I mentioned the locale_game in the end
This is just and understand on what you got implemented and how you can use that since a lot of sub-type resistances are used only on alchemy or 6-7 bonus 

  • Love 1
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.