( using https://smaugmuds.afkmods.com/files/smaugfuss-193-500/ )
Quote:
i cant understand this type of lines.
*gsn_ptr = gsn_pugilism;
That line in weapon_prof_bonus_check in fight.c means that if you are over level 5 and your weapon does DAM_HIT, DAM_SUCTION, DAM_BITE, or DAM_BLAST damage, then you will get a weapon skill proficiency bonus from your pugilism skill. And then elsewhere in the one_hit function, it will also cause you to improve that skill from success or failure (prof_gsn after the call to weapon_prof_bonus_check).
Quote:
if add a skill named: two-handed axe how i add it there?
It looks like the code is based on damage types and each damage type can only use one proficiency skill. So inside those `case` statements in weapon_prof_bonus_check you'd have to choose which damage type to assign the new proficiency to and add something like
*gsn_ptr = gsn_two_handed_axe;
break;
and then if any of the preceding case statements don't have anything in them you'd have to reorder or set them appropriately unless you want them to also be two-handed axe damage types.
Let's say for example that you want to add your new skill to DAM_BITE (just an example) but you still want DAM_HIT and DAM_SUCTION to be pugilism types.
Then you'd want to reorder them like this
case DAM_BITE:
*gsn_ptr = gsn_two_handed_axe;
break;
case DAM_HIT:
case DAM_SUCTION:
case DAM_BLAST:
*gsn_ptr = gsn_pugilism;
break;
If you want to make your own new damage type for two handed axes, like for instance DAM_CLEAVE, then you'd have to define that in mud.h and assign it as the damage type for various two-handed axe weapons in your game and then optionally check it for resistances in the damage function in fight.c where it says "Check damage types for RIS"
Quote:
Need to make changes to an other file too?
You'll need to define gsn_two_handed_axe where the other gsn proficiency skill variables are defined in mud.h and db.c. I would look for where gsn_pugilism is done in those files and just mimic that.