Jump to content
  • 0
GM.PiXeL

Soul Link Modification

Question

HI Hercules,

I want to add an extra effect on Soul Link skill.

This is the effects i want to add:

 

• Alchemist

 - Increase Acid Demonstration Skill by 15%.

• Knight

 - Enable to use Parrying with one hand sword.

• Super Novice

 - Boosts Bash by 50%.

• Blacksmith

 - Enable to use LVL 1 Charge Attack.

• Bard / Dancer

 - Increase arrow vulcan skill by 15%.

• Monk

 - Increase Finger Offensive skill by 15%.

 

Thanks In Advance.

(PS: You can post the src mod one by one.)

 

Status:

• Alchemist - Done

• Super Novice - Done

• Blacksmith - Done

• Bard / Dancer - Done

• Monk - Done

• Knight - Done

Edited by GM.PiXeL

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Everything is working now, I corrected my other post as well adding those changes in the knight snippet, the first one was very poorly coded, I did it in a hurry...

Open src/map/skill.c and find:

Search for:

 	if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) { 		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0); 		return 0; 	}
Replace it with:
	// If linked, knights are able to use parrying with one handed swords (type 2)	if( require.weapon && !pc_check_weapontype(sd,require.weapon) && 	  ( skill_id == LK_PARRYING && !sd->sc.data[SC_SOULLINK] && !pc_check_weapontype(sd,2) ))	{		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);		return 0;	}
Find (again):
	if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) {		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);		return 0;	}
Replace with:
	if( require.weapon && !pc_check_weapontype(sd,require.weapon) && 	  ( skill_id == LK_PARRYING && !sd->sc.data[SC_SOULLINK] && !pc_check_weapontype(sd,2) ))	{		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);		return 0;	}
Open src/map/pc.c and search for:
	for (i = 0; i < ARRAYLENGTH(scw_list); i++) {		// Skills requiring specific weapon types		if( scw_list[i] == SC_DANCING && !battle_config.dancing_weaponswitch_fix )			continue;
Add below:
		// If linked, knights are able to use parrying with one handed swords (type 2)		if( scw_list[i] == SC_PARRYING && sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_KNIGHT			&& (!pc_check_weapontype(sd,skill->get_weapontype(status->sc2skill(scw_list[i]))) &&				!pc_check_weapontype(sd,2) )				)		{			status_change_end(&sd->bl, scw_list[i], INVALID_TIMER);			continue; // We don't want to fall under the next check		}

 

 

Regards

Share this post


Link to post
Share on other sites
  • 0

Haven't tested those mods, but they built without any errors.

Regarding adding one soul skill to blacksmiths you can only mod your databases and it should work, but of course KN_CHARGEATK will stop being a quest skill and'll only work when a character is linked even when he is a knight... I've tried making some changes in the source-code to bypass this issue, but it seems that if the skill is not sent to the client with 0x8 as info it won't be activated when someone is linked. So I bypassed using a quite "unorthodox" way, it's not neat code as I don't like to force the client to do anything, but it works. I think the other modifications worked as they are fairly simple to make, so I haven't tested them in-game just the one that's complex.

Open src/map/status.c and find:

			case SC_RAISINGDRAGON:				sce->val2 = st->max_hp / 100;// Officially tested its 1%hp drain. [Jobbie]			break;
Add below:
			case SC_SOULLINK:				// This is _not_ the best way to do that ):				if( (sd->class_&MAPID_UPPERMASK) == MAPID_BLACKSMITH )					pc->skill(sd, KN_CHARGEATK, 1, 0);				break;
Find:
			case ITEMID_ORC_LOAD_CARD:				clif->sc_end(&sd->bl, sd->bl.id, SELF, SI_MVPCARD_ORCLORD);				break;			}		}		break;
Add below:
		case SC_SOULLINK:			// This is _not_ the best way to do that ):			if(/* pc->checkskill(sd, KN_CHARGEATK) && */(sd->class_&MAPID_UPPERMASK) == MAPID_BLACKSMITH)				pc->skill(sd, KN_CHARGEATK, 0, 0);			break;
Open src/map/skill.c and find:

Search for:

 	if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) { 		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0); 		return 0; 	}
Replace it with:
	// If linked, knights are able to use parrying with one handed swords (type 2)	if( require.weapon && !pc_check_weapontype(sd,require.weapon) && 	  !( skill_id == LK_PARRYING && sd->sc.data[SC_SOULLINK] && pc_check_weapontype(sd,1<<2) ))	{		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);		return 0;	}
Find (again):
	if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) {		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);		return 0;	}
Replace with:
	if( require.weapon && !pc_check_weapontype(sd,require.weapon) && 	  !( skill_id == LK_PARRYING && sd->sc.data[SC_SOULLINK] && pc_check_weapontype(sd,1<<2) ))	{		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);		return 0;	}
Open src/map/battle.c and search for:
 				case SM_BASH: 				case MS_BASH: 					skillratio += 30 * skill_lv;
Add below:
					// If linked, super novices will have SM_BASH's ratio increased by 50%					if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_SUPERNOVICE )						skillratio += 50;
Search for:
 				case MO_FINGEROFFENSIVE: 					skillratio+= 50 * skill_lv;
Add below:
					// If linked, monks will have MO_FINGEROFFENSIVE's ratio increased by 15%					if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_MONK )						skillratio += 15;
Search for:
 				case CG_ARROWVULCAN: 					skillratio += 100 + 100 * skill_lv;
Add below:
					// If linked, bards/dancers will have CG_ARROWVULCAN's damage increased by 15%					if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_BARDDANCER )						skillratio += 15;
Finally find:
 		if (md.damage < 0 || md.damage > INT_MAX>>1) 	  	//Overflow prevention, will anyone whine if I cap it to a few billion? 		//Not capped to INT_MAX to give some room for further damage increase.
Add above:
		// If linked, alchemists will have 15% increase in CR_ACIDDEMONSTRATION's damage		if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_ALCHEMIST )			md.damage += md.damage*15/100;
Open src/map/pc.c and search for:
	for (i = 0; i < ARRAYLENGTH(scw_list); i++) {		// Skills requiring specific weapon types		if( scw_list[i] == SC_DANCING && !battle_config.dancing_weaponswitch_fix )			continue;
Add below:
		// If linked, knights are able to use parrying with one handed swords (type 2)		if( scw_list[i] == SC_PARRYING && sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_KNIGHT			&& (!pc_check_weapontype(sd,skill->get_weapontype(status->sc2skill(scw_list[i]))) &&				!pc_check_weapontype(sd,2) )				)		{			status_change_end(&sd->bl, scw_list[i], INVALID_TIMER);			continue; // We don't want to fall under the next check		}
Save all files and build your map-server, test in-game and if you're having any trouble just post and I'll try to answer as quickly as possible c:

 

Regards.

 

EDIT:

Corrected mistake in knight related snippet

 

EDIT2:

Corrected error as reported in: http://herc.ws/board/topic/4360-custom-link-mods/

Edited by pan

Share this post


Link to post
Share on other sites
  • 0

 

Haven't tested those mods, but they built without any errors.

Regarding adding one soul skill to blacksmiths you can only mod your databases and it should work, but of course KN_CHARGEATK will stop being a quest skill and'll only work when a character is linked even when he is a knight... I've tried making some changes in the source-code to bypass this issue, but it seems that if the skill is not sent to the client with 0x8 as info it won't be activated when someone is linked. So I bypassed using a quite "unorthodox" way, it's not neat code as I don't like to force the client to do anything, but it works. I think the other modifications worked as they are fairly simple to make, so I haven't tested them in-game just the one that's complex.

Open src/map/status.c and find:

			case SC_RAISINGDRAGON:				sce->val2 = st->max_hp / 100;// Officially tested its 1%hp drain. [Jobbie]			break;
Add below:
			case SC_SOULLINK:				// This is _not_ the best way to do that ):				if( (sd->class_&MAPID_UPPERMASK) == MAPID_BLACKSMITH )					pc->skill(sd, KN_CHARGEATK, 1, 0);				break;
Find:
			case ITEMID_ORC_LOAD_CARD:				clif->sc_end(&sd->bl, sd->bl.id, SELF, SI_MVPCARD_ORCLORD);				break;			}		}		break;
Add below:
		case SC_SOULLINK:			// This is _not_ the best way to do that ):			if(/* pc->checkskill(sd, KN_CHARGEATK) && */(sd->class_&MAPID_UPPERMASK) == MAPID_BLACKSMITH)				pc->skill(sd, KN_CHARGEATK, 0, 0);			break;
Search for:
 	if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) { 		clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0); 		return 0; 	}
Replace it with:
	if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) {		// If linked, knights are able to use parrying with one handed swords (type 2)		if( !pc_check_weapontype(sd, 2) &&			!sd->sc.data[SC_SOULLINK] &&			!sd->sc.data[SC_SOULLINK]->val2 == SL_KNIGHT )		{			clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);			return 0;		}	}
Open src/map/battle.c and search for:
 				case SM_BASH: 				case MS_BASH: 					skillratio += 30 * skill_lv;
Add below:
					// If linked, super novices will have SM_BASH's ratio increased by 50%					if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_SUPERNOVICE )						skillratio += 50;
Search for:
 				case MO_FINGEROFFENSIVE: 					skillratio+= 50 * skill_lv;
Add below:
					// If linked, monks will have MO_FINGEROFFENSIVE's ratio increased by 15%					if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_MONK )						skillratio += 15;
Search for:
 				case CG_ARROWVULCAN: 					skillratio += 100 + 100 * skill_lv;
Add below:
					// If linked, bards/dancers will have CG_ARROWVULCAN's damage increased by 15%					if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_BARDDANCER )						skillratio += 15;
Finally find:
 		if (md.damage < 0 || md.damage > INT_MAX>>1) 	  	//Overflow prevention, will anyone whine if I cap it to a few billion? 		//Not capped to INT_MAX to give some room for further damage increase.
Add above:
		// If linked, alchemists will have 15% increase in CR_ACIDDEMONSTRATION's damage		if( sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_ALCHEMIST )			md.damage += md.damage*15/100;
Open src/map/pc.c and search for:
	for (i = 0; i < ARRAYLENGTH(scw_list); i++) {		// Skills requiring specific weapon types		if( scw_list[i] == SC_DANCING && !battle_config.dancing_weaponswitch_fix )			continue;
Add below:
		// If linked, knights are able to use parrying with one handed swords (type 2)		if( scw_list[i] == SC_PARRYING && sd->sc.data[SC_SOULLINK] && sd->sc.data[SC_SOULLINK]->val2 == SL_KNIGHT			&& (!pc_check_weapontype(sd,skill->get_weapontype(status->sc2skill(scw_list[i]))) &&				!pc_check_weapontype(sd,2) )				)		{			status_change_end(&sd->bl, scw_list[i], INVALID_TIMER);			continue; // We don't want to fall under the next check		}
Save all files and build your map-server, test in-game and if you're having any trouble just post and I'll try to answer as quickly as possible c:

 

Regards.

Correction:

  if( require.weapon && !pc_check_weapontype(sd,require.weapon) ) {

clif->skill_fail(sd,skill_id,USESKILL_FAIL_THIS_WEAPON,0);

return 0;

}

 

This is in src/map/skill.c

 

Errors: All works fine except for the Knight/LK parrying skill using one hand sword.

I still can't use parrying with one hand sword.

 

• Alchemist - Done

• Super Novice - Done

• Blacksmith - Done

• Bard / Dancer - Done

• Monk - Done

• Knight - Not Yet Done.

Edited by GM.PiXeL

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.