Jump to content
  • 0

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


Question

Posted

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

2 answers to this question

Recommended Posts

  • 0
Posted (edited)
-	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
  • 0
Posted
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 ?

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