Jump to content
  • 0

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


Question

Posted (edited)

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

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

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
  • 0
Posted
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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...