Jump to content
  • 0

Adding MATK bonus to skill


Moooooon-Aisha

Question


  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  116
  • Reputation:   18
  • Joined:  09/08/17
  • Last Seen:  

So I've been snooping around the source code for skill modification, and so far I've successfully identified where to change some stuff.

The only thing that's left on my list not ticked off is where I can find the place to increase magic attack based on skill level. I tried basing it off of Dragonology but it seems that it has a different way of calculating the bonus magic attack provided by the skill as shown below

	if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0) {
#ifdef RENEWAL
		skill = skill * 2;
#else
		skill = skill * 4;
#endif
		sd->right_weapon.addrace[RC_DRAGON]+=skill;
		sd->left_weapon.addrace[RC_DRAGON]+=skill;
		sd->magic_addrace[RC_DRAGON]+=skill;
		sd->subrace[RC_DRAGON]+=skill;
	}

I am not sure if there is a way to increase magic attack normally like how you do with attack (I've managed to do this already), maybe I have not looked that much yet or maybe I have missed it? Would appreciate a point to the right direction with this, thank you!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

7 minutes ago, OppaiDragon said:

Testing it now, but kinda sure it would error out since it uses sd, and sd is not declared on that section. Well hopefully it does work. Will edit if anything happens.

EDIT:
 

Yup, error'd out. I'll probably have to do it just how they did with Dragonology.

I found something..

Add this : 

		base_status->matk_max += base_status->matk_max * skill / 100;
		base_status->matk_min += base_status->matk_min * skill / 100;

here:

	if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0) {
#ifdef RENEWAL
		skill = skill * 2;
#else
		skill = skill * 4;
#endif
		sd->right_weapon.addrace[RC_DRAGON]+=skill;
		sd->left_weapon.addrace[RC_DRAGON]+=skill;
		sd->magic_addrace[RC_DRAGON]+=skill;
		sd->subrace[RC_DRAGON]+=skill;

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

2 hours ago, OppaiDragon said:

So I've been snooping around the source code for skill modification, and so far I've successfully identified where to change some stuff.

The only thing that's left on my list not ticked off is where I can find the place to increase magic attack based on skill level. I tried basing it off of Dragonology but it seems that it has a different way of calculating the bonus magic attack provided by the skill as shown below


	if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0) {
#ifdef RENEWAL
		skill = skill * 2;
#else
		skill = skill * 4;
#endif
		sd->right_weapon.addrace[RC_DRAGON]+=skill;
		sd->left_weapon.addrace[RC_DRAGON]+=skill;
		sd->magic_addrace[RC_DRAGON]+=skill;
		sd->subrace[RC_DRAGON]+=skill;
	}

I am not sure if there is a way to increase magic attack normally like how you do with attack (I've managed to do this already), maybe I have not looked that much yet or maybe I have missed it? Would appreciate a point to the right direction with this, thank you!

Try looking at this part at status.cpp : (Im not sure where to put it)

	// Absolute modifiers from passive skills

Try adding this:

	if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0) 
		matk += matk * skill / 100; // adds 1% MATK per skill level

Not quite sure but i hope it would help.

Edited by Mabuhay
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  116
  • Reputation:   18
  • Joined:  09/08/17
  • Last Seen:  

11 minutes ago, Mabuhay said:

Try looking at this part at status.cpp :


	// Absolute modifiers from passive skills

Try adding this:


	if((skill=pc_checkskill(sd,SA_DRAGONOLOGY))>0) 
		matk += matk * skill / 100; // adds 1% MATK per skill level

Not quite sure but i hope it would help.

Returns an error saying that matk was not declared.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

6 minutes ago, OppaiDragon said:

Returns an error saying that matk was not declared.

/**
 * Adds magic attack modifications based on status changes
 * @param bl: Object to change matk [PC|MOB|HOM|MER|ELEM]
 * @param sc: Object's status change information
 * @param matk: Initial matk
 * @return modified matk with cap_value(matk,0,USHRT_MAX)
 */

try putting it here.. im in doubt since it says status changes tho.

Edited by Mabuhay
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  116
  • Reputation:   18
  • Joined:  09/08/17
  • Last Seen:  

On 11/13/2019 at 11:33 AM, Mabuhay said:

/**
 * Adds magic attack modifications based on status changes
 * @param bl: Object to change matk [PC|MOB|HOM|MER|ELEM]
 * @param sc: Object's status change information
 * @param matk: Initial matk
 * @return modified matk with cap_value(matk,0,USHRT_MAX)
 */

try putting it here.. im in doubt since it says status changes tho.

Testing it now, but kinda sure it would error out since it uses sd, and sd is not declared on that section. Well hopefully it does work. Will edit if anything happens.

 

EDIT:

Yup, error'd out. I'll probably have to do it just how they did with Dragonology.

Will test it now, just got my server up and running. Will edit for results.

Added it successfully, but it does not increase magic damage at all.

 

EDIT #2:

Testing it using Dragonology's formula. Hopefully it works, will update when done.

Edited by OppaiDragon
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

45 minutes ago, OppaiDragon said:

Will test it now, just got my server up and running. Will edit for results.

Added it successfully, but it does not increase magic damage at all.

eh, try checking this part: in status.cpp

		/**
		 * RE MATK Formula (from irowiki:http:// irowiki.org/wiki/MATK)
		 * MATK = (sMATK + wMATK + eMATK) * Multiplicative Modifiers
		 **/
		int lv = status_get_lv(bl);
		status->matk_min = status_base_matk_min(bl, status, lv);
		status->matk_max = status_base_matk_max(bl, status, lv);

		switch( bl->type ) {
			case BL_PC: {
				int wMatk = 0;
				int variance = 0;

				// Any +MATK you get from skills and cards, including cards in weapon, is added here.
				if (sd) {
					if (sd->bonus.ematk > 0)
						status->matk_min += sd->bonus.ematk;
					if (pc_checkskill(sd, SU_POWEROFLAND) > 0) {
						if ((pc_checkskill(sd, SU_SV_STEMSPEAR) + pc_checkskill(sd, SU_CN_POWDERING) + pc_checkskill(sd, SU_CN_METEOR) + pc_checkskill(sd, SU_SV_ROOTTWIST) +
						pc_checkskill(sd, SU_CHATTERING) + pc_checkskill(sd, SU_MEOWMEOW) + pc_checkskill(sd, SU_NYANGGRASS)) > 19)
							status->matk_min += status->matk_min * 20 / 100;
					}
				}

edit this part :

 

				if (sd) {
					if (sd->bonus.ematk > 0)
						status->matk_min += sd->bonus.ematk;
					if (pc_checkskill(sd, SU_POWEROFLAND) > 0) {
						if ((pc_checkskill(sd, SU_SV_STEMSPEAR) + pc_checkskill(sd, SU_CN_POWDERING) + pc_checkskill(sd, SU_CN_METEOR) + pc_checkskill(sd, SU_SV_ROOTTWIST) +
						pc_checkskill(sd, SU_CHATTERING) + pc_checkskill(sd, SU_MEOWMEOW) + pc_checkskill(sd, SU_NYANGGRASS)) > 19)
							status->matk_min += status->matk_min * 20 / 100;
					}
                  
					if (skill=pc_checkskill(sd, SA_DRAGONOLOGY) > 0) // custom MAtk Bonus
						status->matk_min += status->matk_min * skill / 100; // adds 1% MATK per skill level
                  
				}

However, I presume this will work on renewal only.

 

NVM, this will only work on SCB_MATK.. haha sorry for blindly checking the code.

 

Maybe you can just add custom status effect on Dragonology like in Mindbreaker skill??

Edited by Mabuhay
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  23
  • Topics Per Day:  0.01
  • Content Count:  116
  • Reputation:   18
  • Joined:  09/08/17
  • Last Seen:  

15 minutes ago, Mabuhay said:

eh, try checking this part: in status.cpp


		/**
		 * RE MATK Formula (from irowiki:http:// irowiki.org/wiki/MATK)
		 * MATK = (sMATK + wMATK + eMATK) * Multiplicative Modifiers
		 **/
		int lv = status_get_lv(bl);
		status->matk_min = status_base_matk_min(bl, status, lv);
		status->matk_max = status_base_matk_max(bl, status, lv);

		switch( bl->type ) {
			case BL_PC: {
				int wMatk = 0;
				int variance = 0;

				// Any +MATK you get from skills and cards, including cards in weapon, is added here.
				if (sd) {
					if (sd->bonus.ematk > 0)
						status->matk_min += sd->bonus.ematk;
					if (pc_checkskill(sd, SU_POWEROFLAND) > 0) {
						if ((pc_checkskill(sd, SU_SV_STEMSPEAR) + pc_checkskill(sd, SU_CN_POWDERING) + pc_checkskill(sd, SU_CN_METEOR) + pc_checkskill(sd, SU_SV_ROOTTWIST) +
						pc_checkskill(sd, SU_CHATTERING) + pc_checkskill(sd, SU_MEOWMEOW) + pc_checkskill(sd, SU_NYANGGRASS)) > 19)
							status->matk_min += status->matk_min * 20 / 100;
					}
				}

 

Thanks! I've actually managed to make it work, just based it off Dragonology. Works perfectly now, really appreciate your help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...