Jump to content

Autoguard, Reflect Shield, Deffender, being remove when switching shield.


rizsu0107

Recommended Posts


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  39
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

Hi I was trying to figure this out, but it is so hard XD. Please help me.

src/map/pc.cpp 

if(pos & EQP_HAND_L) {
        if (sd->status.shield && battle_getcurrentskill(&sd->bl) == LG_SHIELDSPELL)
            unit_skillcastcancel(&sd->bl, 0); // Cancel Shield Spell if player swaps shields.                                       << if I put " // " on this part it is working. but there is a bug on it, even without shield it can still use the skills.

        sd->status.shield = sd->weapontype2 = W_FIST;
        pc_calcweapontype(sd);
        clif_changelook(&sd->bl,LOOK_SHIELD,sd->status.shield);
    }
 

But the behavior of Shrink(Skill Id: 1002) skill is normal. here's  a sample video for a clear explanation.

 

 

Edited by rizsu0107
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  39
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

please help ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  103
  • Reputation:   14
  • Joined:  04/18/15
  • Last Seen:  

I hope they help you. I had this same problem and I had to pay to have it fixed

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

try check this

on latest rathena 
https://github.com/rathena/rathena/blob/master/src/map/pc.cpp#L7289
 

/**
 * Check if we still have the correct weapon to continue the skill (actually status)
 * If not ending it
 * @param sd
 * @return 0:error, 1:check done
 */
static void pc_checkallowskill(struct map_session_data *sd)
{
	const enum sc_type scw_list[] = {
		SC_TWOHANDQUICKEN,
		SC_ONEHAND,
		SC_AURABLADE,
		SC_PARRYING,
		SC_SPEARQUICKEN,
		SC_ADRENALINE,
		SC_ADRENALINE2,
		SC_DANCING,
		SC_GATLINGFEVER,
	};
	uint8 i;
	nullpo_retv(sd);

	if(!sd->sc.count)
		return;

	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;
		if(sd->sc.data[scw_list[i]] &&
			!pc_check_weapontype(sd,skill_get_weapontype(status_sc2skill(scw_list[i]))))
			status_change_end(&sd->bl, scw_list[i], INVALID_TIMER);
	}

	if(sd->sc.data[SC_SPURT] && sd->status.weapon)
		// Spurt requires bare hands (feet, in fact xD)
		status_change_end(&sd->bl, SC_SPURT, INVALID_TIMER);

	if(sd->status.shield <= 0) { // Skills requiring a shield
		const enum sc_type scs_list[] = {
			SC_AUTOGUARD,
			SC_DEFENDER,
			SC_REFLECTSHIELD,
			SC_REFLECTDAMAGE
		};
		for (i = 0; i < ARRAYLENGTH(scs_list); i++)
			if(sd->sc.data[scs_list[i]])
				status_change_end(&sd->bl, scs_list[i], INVALID_TIMER);
	}
}

 

Edited by Bringer
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.02
  • Content Count:  39
  • Reputation:   1
  • Joined:  06/24/22
  • Last Seen:  

6 hours ago, Bringer said:

try check this

on latest rathena 
https://github.com/rathena/rathena/blob/master/src/map/pc.cpp#L7289
 

/**
 * Check if we still have the correct weapon to continue the skill (actually status)
 * If not ending it
 * @param sd
 * @return 0:error, 1:check done
 */
static void pc_checkallowskill(struct map_session_data *sd)
{
	const enum sc_type scw_list[] = {
		SC_TWOHANDQUICKEN,
		SC_ONEHAND,
		SC_AURABLADE,
		SC_PARRYING,
		SC_SPEARQUICKEN,
		SC_ADRENALINE,
		SC_ADRENALINE2,
		SC_DANCING,
		SC_GATLINGFEVER,
	};
	uint8 i;
	nullpo_retv(sd);

	if(!sd->sc.count)
		return;

	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;
		if(sd->sc.data[scw_list[i]] &&
			!pc_check_weapontype(sd,skill_get_weapontype(status_sc2skill(scw_list[i]))))
			status_change_end(&sd->bl, scw_list[i], INVALID_TIMER);
	}

	if(sd->sc.data[SC_SPURT] && sd->status.weapon)
		// Spurt requires bare hands (feet, in fact xD)
		status_change_end(&sd->bl, SC_SPURT, INVALID_TIMER);

	if(sd->status.shield <= 0) { // Skills requiring a shield
		const enum sc_type scs_list[] = {
			SC_AUTOGUARD,
			SC_DEFENDER,
			SC_REFLECTSHIELD,
			SC_REFLECTDAMAGE
		};
		for (i = 0; i < ARRAYLENGTH(scs_list); i++)
			if(sd->sc.data[scs_list[i]])
				status_change_end(&sd->bl, scs_list[i], INVALID_TIMER);
	}
}

 

 

Got errors, I actually solve it by paying someone. Thanks for the response.
image.png.c2fe8d19f29364e53694076abf904591.png

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
Reply to this topic...

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