Jump to content
  • 0

how to use ground skill from mob A to mob B (1 time per cells)


MyNoobScriptz

Question


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

how to use ground skill from mob A to mob B (1 time per cells)

EX : mob A position 100,100 and mob B position 105,105, I need to use ground skill (something like Thunder storm) from 100,100 -> 101,101 -> 102,102 -> 103,103 -> 104,104 -> 105,105

if mob B change position 95,95 skill calculate to coordinates 95,95

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  232
  • Reputation:   86
  • Joined:  06/30/18
  • Last Seen:  

-	script	SKILL_DEMO	FAKE_NPC,{
	OnInit:
		monster("prontera", 150, 170, "Helper A", 1002, 1);
		.@mob_a = $@mobid[0];
		unitblockmove(.@mob_a, 1);

		getunitdata(.@mob_a, .@mob_a_data);
		.@pos_x = .@mob_a_data[UMOB_X];
		.@pos_y = .@mob_a_data[UMOB_Y];

		monster("prontera", 140, 160, "Helper B", 1002, 1);
		.@mob_b = $@mobid[0];

		while(.@pos_x != .@target_x || .@pos_y != .@target_y) {
			getunitdata(.@mob_b, .@mob_b_data);
			.@target_x = .@mob_b_data[UMOB_X];
			.@target_y = .@mob_b_data[UMOB_Y];

			if(.@pos_x != .@target_x) .@pos_x += (.@pos_x < .@target_x) ? 1 : -1;
			if(.@pos_y != .@target_y) .@pos_y += (.@pos_y < .@target_y) ? 1 : -1;

			unitskillusepos(.@mob_a, "MG_THUNDERSTORM", 10, .@pos_x, .@pos_y, -5, false, 0, true);
			sleep(1000);
		}
}

 

Edited by Winterfox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  75
  • Reputation:   3
  • Joined:  05/01/15
  • Last Seen:  

On 9/7/2023 at 6:08 PM, Winterfox said:
-	script	SKILL_DEMO	FAKE_NPC,{
	OnInit:
		monster("prontera", 150, 170, "Helper A", 1002, 1);
		.@mob_a = $@mobid[0];
		unitblockmove(.@mob_a, 1);

		getunitdata(.@mob_a, .@mob_a_data);
		.@pos_x = .@mob_a_data[UMOB_X];
		.@pos_y = .@mob_a_data[UMOB_Y];

		monster("prontera", 140, 160, "Helper B", 1002, 1);
		.@mob_b = $@mobid[0];

		while(.@pos_x != .@target_x || .@pos_y != .@target_y) {
			getunitdata(.@mob_b, .@mob_b_data);
			.@target_x = .@mob_b_data[UMOB_X];
			.@target_y = .@mob_b_data[UMOB_Y];

			if(.@pos_x != .@target_x) .@pos_x += (.@pos_x < .@target_x) ? 1 : -1;
			if(.@pos_y != .@target_y) .@pos_y += (.@pos_y < .@target_y) ? 1 : -1;

			unitskillusepos(.@mob_a, "MG_THUNDERSTORM", 10, .@pos_x, .@pos_y, -5, false, 0, true);
			sleep(1000);
		}
}

 

Thx it's work!! , if i need to increase 1 cell per skill to 2 cell or 5 cell how i do this ?

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