Jump to content
  • 0
darking123

Disable warping directly to npc using @warp

Question

Is there a source release to disable directly warping to an NPC? you may enter the exact coordinates when using @warp, however you will be warped beside it, not merging into it. Thank you!

image.png.c15933560ae8253136e73acab5f264b7.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
			warp_get_suggestions(sd, map_name);

		return -1;
	}

-	if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
-	{	//This is to prevent the pc_setpos call from printing an error.
-		clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell.
-		if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
-			x = y = 0; //Invalid cell, use random spot.
-	}
+	if (x || y) { //This is to prevent the pc_setpos call from printing an error.
+		if(map_getcell(m, x, y, CELL_CHKNOPASS)){
+			clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell.
+			if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
+				x = y = 0; //Invalid cell, use random spot.
+		} else {
+			struct map_data *mapdata = map_getmapdata(m);
+			for (int i = 0; i < mapdata->npc_num; i++)
+				if( x == mapdata->npc[i]->bl.x && y == mapdata->npc[i]->bl.y ){
+					if (!map_search_freecell(NULL, m, &x, &y, 1, 1, 1))
+						x = y = 0;
+				break;
+				}
+		}
+	}

 

Edited by Haruka Mayumi
  • Upvote 1
Link to comment
Share on other sites

  • 0
28 minutes ago, Haruka Mayumi said:
	if (m < 0) { // m < 0 means on different server! [Kevin]
		clif_displaymessage(fd, msg_txt(sd,1)); // Map not found.

		if (battle_config.warp_suggestions_enabled)
			warp_get_suggestions(sd, map_name);

		return -1;
	}

+	if ((x || y) && map_getcell(m, x, y, CELL_CHKNPC))
+	{	// Disable NPC Warping
+		clif_displaymessage(fd,"NPC location warping is disabled.");
+		return 1-;
+	}
	
	if ((x || y) && map_getcell(m, x, y, CELL_CHKNOPASS))
	{	//This is to prevent the pc_setpos call from printing an error.
		clif_displaymessage(fd, msg_txt(sd,2)); // Invalid coordinates, using random target cell.
		if (!map_search_freecell(NULL, m, &x, &y, 10, 10, 1))
			x = y = 0; //Invalid cell, use random spot.
	}

I'm too lazy to add warp beside it. so just disabling the direct npc warp will do.. 

thank you for this. however I am requesting that if ever I enter the exact coordinates of the NPC via @warp. it won't directly warp me to the NPC, but beside only the NPC. any location will do but it must be beside the NPC. 

maybe a 1-3 cell apart from the NPC?

 

 

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

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.