Jump to content
  • 0

Dual Wielding for all Jobs


Defect

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  08/31/14
  • Last Seen:  

Let me start by saying I have 0 background in coding, but have spent the past couple days digging through the source files in map folder.

 

I cannot find a way to allow/give left hand damage via dual wielding to other classes other than the assassin tree.

 
In battle.c I've edited (to include thief skills for knight and ninja skills for rogue):

		else if(is_attack_right_handed(src, skill_id) && is_attack_left_handed(src, skill_id)) {	//Dual-wield
			if (wd.damage) {
				if( (sd->class_&MAPID_BASEMASK) == MAPID_THIEF || (sd->class_&MAPID_UPPERMASK) == MAPID_KNIGHT ) {
					skill = pc_checkskill(sd,AS_RIGHT);
					ATK_RATER(wd.damage, 50 + (skill * 10))
				}
				else if(sd->class_ == MAPID_KAGEROUOBORO || (sd->class_&MAPID_UPPERMASK) == MAPID_ROGUE) {
					skill = pc_checkskill(sd,KO_RIGHT);
					ATK_RATER(wd.damage, 70 + (skill * 10))

in pc.c I've edited (to include Knight and Rogue's ability to equip weapon in left hand):

	ep = sd->inventory_data[n]->equip;
	if(sd->inventory_data[n]->look == W_DAGGER	||
		sd->inventory_data[n]->look == W_1HSWORD ||
		sd->inventory_data[n]->look == W_1HAXE) {
		if(ep == EQP_HAND_R && (pc_checkskill(sd,AS_LEFT) > 0 || (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN || (sd->class_&MAPID_UPPERMASK) == MAPID_KNIGHT || (sd->class_&MAPID_UPPERMASK) == MAPID_ROGUE ||
			(sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech]
			return EQP_ARMS;

I also checked status.c but it only has aspd calculations:

#ifdef RENEWAL_ASPD
	short mod = -1;

	switch( sd->weapontype2 ) { // Adjustment for dual weilding
		case W_DAGGER:	mod = 0;	break; // 0, 1, 1
		case W_1HSWORD:
		case W_1HAXE:	mod = 1;
			if( (sd->class_&MAPID_THIRDMASK) == MAPID_GUILLOTINE_CROSS ) // 0, 2, 3
				mod = sd->weapontype2 / W_1HSWORD + W_1HSWORD / sd->weapontype2 ;
	}

	amotion = ( sd->status.weapon < MAX_WEAPON_TYPE && mod < 0 )
			? (job_info[classidx].aspd_base[sd->status.weapon]) // Single weapon
			: ((job_info[classidx].aspd_base[sd->weapontype2] // Dual-wield
			+ job_info[classidx].aspd_base[sd->weapontype2]) * 6 / 10 + 10 * mod
			- job_info[classidx].aspd_base[sd->weapontype2]
			+ job_info[classidx].aspd_base[sd->weapontype1]);

	if ( sd->status.shield )
			amotion += ( 2000 - job_info[classidx].aspd_base[W_FIST] ) +
					( job_info[classidx].aspd_base[MAX_WEAPON_TYPE] - 2000 );

#else
	// Base weapon delay
	amotion = (sd->status.weapon < MAX_WEAPON_TYPE)
	 ? (job_info[classidx].aspd_base[sd->status.weapon]) // Single weapon
	 : (job_info[classidx].aspd_base[sd->weapontype1] + job_info[classidx].aspd_base[sd->weapontype2])*7/10; // Dual-wield

After chaning all this, if I equip a sword in my left and right hand for knight it still only does 1 hit with the slowed aspd.  I am trying to get 2 hits, even if the sprite still only has 1 swing and 1 sword.

 

 

Any help is appreciated.  Thank you in advance.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.01
  • Content Count:  38
  • Reputation:   1
  • Joined:  01/09/17
  • Last Seen:  

For the second part of the code your wrote out, you have to add in the right hand check to the next class as well. It should look something like this for each class:

 

if((ep == EQP_HAND_R && (pc_checkskill(sd,AS_LEFT) > 0)) && (sd->class_&MAPID_UPPERMASK) == MAPID_ASSASSIN || 
            (ep == EQP_HAND_R && (pc_checkskill(sd, AS_LEFT) > 0)) && (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO ||
            (ep == EQP_HAND_R && (pc_checkskill(sd, AS_LEFT) > 0)) && (sd->class_&MAPID_THIRDMASK) == MAPID_KNIGHT ||
            (ep == EQP_HAND_R && (pc_checkskill(sd, AS_LEFT) > 0)) && (sd->class_&MAPID_THIRDMASK) == MAPID_ROGUE ||


 

Also, if you're going to do it that way they have to have the skill added to their skill tree and have at least a point into it, which involves editing the skill trees in the other text files. To my knowledge, nothing you've added there would add the skill. So, you could either remove the skill check and class checks from the equation, which would basically allow any class to dual wield at any time, or you could add it in like above for every class, but remove the skill check portion.

That's how it worked for me at least. I think the main point is the ep == EQP_HAND_R part. That's what seems to check that a weapons already in the right hand and moves on to equipping one in the left hand. 

 

It still hits for two, but as far as I can tell the third chunk of code staggers the second hit. So you do still hit twice, it might just look like it's not. Try attacking something when you're aspd is really low and see if it's just overlapping very close.

Edited by Synel
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...