Jump to content
  • 0

back stab all directions


Question

Posted

Hello Rathena, I have a question, how do I change the direction of the skill back stab? to work in all directions

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (!map_check_dir(dir, t_dir) || bl->type == BL_SKILL) {
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

 

15 answers to this question

Recommended Posts

  • 0
Posted

Can you elaborate what you mean? right now you use the skill and it puts you behind the target no matter where you started as far as i know, what exactly is it that you want it to do?

  • 0
Posted
5 hours ago, LadyNanuia said:

Can you elaborate what you mean? right now you use the skill and it puts you behind the target no matter where you started as far as i know, what exactly is it that you want it to do?

I want the backstab skill to work from all directions without having to be behind its target

  • 0
Posted

Your server setting might be in Renewal, it's like that by default. If you want to change it

Find:

				case RG_BACKSTAP:
						{
#ifndef RENEWAL
								uint8 dir = map_calc_dir(src,target->x,target->y), t_dir = unit_getdir(target);

								if (map_check_dir(dir, t_dir))
									return USESKILL_FAIL_MAX;
#endif

								if (check_distance_bl(src, target, 0))
									return USESKILL_FAIL_MAX;
						}
						break;

Change to:

				case RG_BACKSTAP:
						{
								if (check_distance_bl(src, target, 0))
									return USESKILL_FAIL_MAX;
						}
						break;

 

  • 0
Posted
6 hours ago, joecalis said:

Your server setting might be in Renewal, it's like that by default. If you want to change it

Find:

				case RG_BACKSTAP:
						{
#ifndef RENEWAL
								uint8 dir = map_calc_dir(src,target->x,target->y), t_dir = unit_getdir(target);

								if (map_check_dir(dir, t_dir))
									return USESKILL_FAIL_MAX;
#endif

								if (check_distance_bl(src, target, 0))
									return USESKILL_FAIL_MAX;
						}
						break;

Change to:

				case RG_BACKSTAP:
						{
								if (check_distance_bl(src, target, 0))
									return USESKILL_FAIL_MAX;
						}
						break;

 

Hello, my server is pre-renewal and this is the only line that I can find the change for the second one that you sent me?

 

 

 

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (!map_check_dir(dir, t_dir) || bl->type == BL_SKILL) {
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

 

  • 0
Posted

Try this:

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (bl->type == BL_SKILL) { // Changed Here (Removed Direction Check)
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

 

  • 0
Posted
9 hours ago, joecalis said:

Try this:

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (bl->type == BL_SKILL) { // Changed Here (Removed Direction Check)
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

 

it didn't work ?

  • 0
Posted
5 minutes ago, joecalis said:

en tu skill.cpp busca todo el " case RG_BACKSTAP : " copia todo hasta el " break ; " y pega todos los códigos aquí, tal vez esté revisando la dirección en otro lugar.

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (bl->type == BL_SKILL) { // Changed Here (Removed Direction Check)
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

 

This is the one that changed but the skill stopped working so I returned it to how it is, that is, like this

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (!map_check_dir(dir, t_dir) || bl->type == BL_SKILL) {
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

and I have the other one like this but that one did not change anything, it was the first one to change

 

		case RG_BACKSTAP:
			{
				if (check_distance_bl(src, target, 0))
					return USESKILL_FAIL_MAX;
			}
			break;

 

  • 0
Posted
8 minutes ago, Notorius said:

 

This is the one that changed but the skill stopped working so I returned it to how it is, that is, like this

	case RG_BACKSTAP:
		{
			if (!check_distance_bl(src, bl, 0)) {
#ifdef RENEWAL
				uint8 dir = map_calc_dir(src, bl->x, bl->y);
				short x, y;

				if (dir > 0 && dir < 4)
					x = -1;
				else if (dir > 4)
					x = 1;
				else
					x = 0;

				if (dir > 2 && dir < 6)
					y = -1;
				else if (dir == 7 || dir < 2)
					y = 1;
				else
					y = 0;

				if (battle_check_target(src, bl, BCT_ENEMY) > 0 && unit_movepos(src, bl->x + x, bl->y + y, 2, true)) { // Display movement + animation.
#else
				uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

				if (!map_check_dir(dir, t_dir) || bl->type == BL_SKILL) {
#endif
					status_change_end(src, SC_HIDING, INVALID_TIMER);
					dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
					unit_setdir(bl,dir);
#ifdef RENEWAL
					clif_blown(src);
#endif
					skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
				}
				else if (sd)
					clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
			}
		}
		break;

The one I quoted, replace all of that with this:
 

	case RG_BACKSTAP:
		{
			uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

			if (!check_distance_bl(src, bl, 0) || bl->type == BL_SKILL) {
				status_change_end(src, SC_HIDING, INVALID_TIMER);
				dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
				unit_setdir(bl,dir);
				skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
			}
			else if (sd)
				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
		}
		break;

 

  • 0
Posted
On 5/1/2023 at 3:57 PM, joecalis said:

The one I quoted, replace all of that with this:
 

	case RG_BACKSTAP:
		{
			uint8 dir = map_calc_dir(src, bl->x, bl->y), t_dir = unit_getdir(bl);

			if (!check_distance_bl(src, bl, 0) || bl->type == BL_SKILL) {
				status_change_end(src, SC_HIDING, INVALID_TIMER);
				dir = dir < 4 ? dir+4 : dir-4; // change direction [Celest]
				unit_setdir(bl,dir);
				skill_attack(BF_WEAPON, src, src, bl, skill_id, skill_lv, tick, flag);
			}
			else if (sd)
				clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
		}
		break;

 

still not working  ?

  • 0
Posted

Hello @Notorius.

Did you get this to work? I have the same issue.

Tried to change the code to what @blinzer posted but no luck... Backstab can only be casted behind the target... I even tried using the renewal code on my pre-renewal setup, but no luck. Nothing let's me backstab from the front.

 

If anyone can help would be really happy.

I am using the latest build as per today (27.08.23)

Thank you!!

 

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