Jump to content
  • 0

Dual Gun Wield for Gunslingers problem


Scylla

Question


  • Group:  Members
  • Topic Count:  47
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   46
  • Joined:  03/27/13
  • Last Seen:  

I've made my Gunslinger to dual wield revolvers but there's just alot of problems in here.

 

So to proceed with my steps here's what i did:

 

Step 1:

 

On pc.h

I added W_DOUBLE_GU for a new dual-wield constant.

    // dual-wield constants
    W_DOUBLE_DD, // 2 daggers
    W_DOUBLE_SS, // 2 swords
    W_DOUBLE_AA, // 2 axes
    W_DOUBLE_DS, // dagger + sword
    W_DOUBLE_DA, // dagger + axe
    W_DOUBLE_SA, // sword + axe
    W_DOUBLE_GU, // Dual guns

Step2:

 

On pc.c

I added a new line, W_REVOLVER for dual-wield revolver in here.

    // dual-wield
    sd->status.weapon = 0;
    switch (sd->weapontype1){
    case W_DAGGER:
        switch (sd->weapontype2) {
        case W_DAGGER: sd->status.weapon = W_DOUBLE_DD; break;
        case W_1HSWORD: sd->status.weapon = W_DOUBLE_DS; break;
        case W_1HAXE: sd->status.weapon = W_DOUBLE_DA; break;
        }
        break;
    case W_1HSWORD:
        switch (sd->weapontype2) {
        case W_DAGGER: sd->status.weapon = W_DOUBLE_DS; break;
        case W_1HSWORD: sd->status.weapon = W_DOUBLE_SS; break;
        case W_1HAXE: sd->status.weapon = W_DOUBLE_SA; break;
        }
        break;
    case W_REVOLVER:
        switch (sd->weapontype2) {
        case W_REVOLVER: sd->status.weapon = W_DOUBLE_GU; break;
        }
        break;
    case W_1HAXE:
        switch (sd->weapontype2) {
        case W_DAGGER: sd->status.weapon = W_DOUBLE_DA; break;
        case W_1HSWORD: sd->status.weapon = W_DOUBLE_SA; break;
        case W_1HAXE: sd->status.weapon = W_DOUBLE_AA; break;
        }
    } 

Step 3:

 

On pc.c again,
I also added a new line in here to enable them to wield 2 guns:

    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_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech]
            return EQP_ARMS;
    } else if(sd->inventory_data[n]->look == W_REVOLVER) {
        if(ep == EQP_HAND_R && (pc_checkskill(sd,GS_CHAINACTION) > 0 || (sd->class_&MAPID_BASEMASK) == MAPID_GUNSLINGER))
            return EQP_ARMS;
    } 

Now for the Problems

  1. When i equip 2 revolver-type guns (even with just one in any hand), it doesn't require a bullet for you to attack.
  2. Your damage will be based to STR if you've equipped a 2nd revolver wherein it should be DEX.
  3. Range will be limited to like 4 - 5 cells even with Snake's eye maxed out.

The ' troubleshoots ' i made for the problems:

 

So for problem #1, to make it require a bullet, I tried putting my custom dual-wield mask on this line at battle.c and as far as i understand, if it detects that you're equipping 2 revolvers (Which is the constant W_DOUBLE_GU as stated on step 1 and 2), it should require a bullet else it won't attack.

EDIT: But it still doesn't work.

                    case W_REVOLVER:
                    case W_RIFLE:
                    case W_GATLING:
                    case W_SHOTGUN:
                    case W_DOUBLE_GU:
                        if (sd->inventory_data[index]->look != A_BULLET) {
                            clif_skill_fail(sd,0,USESKILL_FAIL_NEED_MORE_BULLET,0);
                            return ATK_NONE;
                        } 

For the other problems, i still have yet to try stuffs.

 

Now for my question:

  • What's actually the purpose of those dual-wield constants as stated on Step #1? I searched the git if they have any other value other than the one at Step #2 but so far i didn't find anything so what are they for?

 

If anyone could give me a clue that'll be very helpful! :D

Edited by Scylla
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

Hello Scylla, I'm interested on this topic so I'll be accompany you with this issue :)

For the Range problem, have you tried adding a line to this section of pc.c ?

case SP_ATTACKRANGE:
			switch (sd->state.lr_flag) {
			case 2:
				switch (sd->status.weapon) {
					case W_BOW:
					case W_REVOLVER:
					case W_RIFLE:
					case W_GATLING:
					case W_SHOTGUN:
					case W_GRENADE:
						status->rhw.range += val;

I'll let you know when I get to something. Cheers!

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

I think I found where to place the code to increase its range if it's a dual weapon (new).

In status.c:

// ----- HIT CALCULATION -----

	// Absolute modifiers from passive skills
#ifndef RENEWAL
	if((skill=pc_checkskill(sd,BS_WEAPONRESEARCH))>0)
		base_status->hit += skill*2;
#endif
	if((skill=pc_checkskill(sd,AC_VULTURE))>0) {
#ifndef RENEWAL
		base_status->hit += skill;
#endif
		if(sd->status.weapon == W_BOW)
			base_status->rhw.range += skill;
	}
	if(sd->status.weapon >= W_REVOLVER && sd->status.weapon <= W_GRENADE) {
		if((skill=pc_checkskill(sd,GS_SINGLEACTION))>0)
			base_status->hit += 2*skill;
		if((skill=pc_checkskill(sd,GS_SNAKEEYE))>0) {
			base_status->hit += skill;
			base_status->rhw.range += skill;
		}
	}

 

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...