Jump to content
  • 0

back stab all directions


Notorius

Question


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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;

 

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   2
  • Joined:  02/25/19
  • Last Seen:  

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?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   2
  • Joined:  02/25/19
  • Last Seen:  

You dont have to be behind to use it..

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

1 hour ago, LadyNanuia said:

You dont have to be behind to use it..

I think if it should be behind the target or in the case of my emulator if it should be behind I don't know how to edit it so that it works from any direction

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.01
  • Content Count:  90
  • Reputation:   2
  • Joined:  02/25/19
  • Last Seen:  

Update your rA to the latest one.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   40
  • Joined:  03/26/12
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   40
  • Joined:  03/26/12
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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 ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   40
  • Joined:  03/26/12
  • Last Seen:  

in your skill.cpp search all the "case RG_BACKSTAP:" copy it all until the "break;" and paste all the codes here, maybe it's checking the direction somewhere else.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  64
  • Reputation:   40
  • Joined:  03/26/12
  • Last Seen:  

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;

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.02
  • Content Count:  106
  • Reputation:   1
  • Joined:  09/24/19
  • Last Seen:  

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  ?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  12/11/14
  • Last Seen:  

i got you.

image.thumb.png.25a23c0d8838d3a7d58f9546c03fa00f.png

 

image.thumb.png.e61aa8622439359aa3d573559e0369bb.png

 

goes without saying, but you have to compile after making these changes

Edited by blinzer
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  2
  • Reputation:   0
  • Joined:  08/19/23
  • Last Seen:  

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

 

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