darking123 Posted April 24, 2020 Group: Members Topic Count: 318 Topics Per Day: 0.07 Content Count: 931 Reputation: 13 Joined: 12/20/11 Last Seen: November 21, 2020 Share Posted April 24, 2020 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! Quote Link to comment Share on other sites More sharing options...
1 Haruka Mayumi Posted April 24, 2020 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 485 Reputation: 271 Joined: 06/13/17 Last Seen: April 14 Share Posted April 24, 2020 (edited) 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 April 24, 2020 by Haruka Mayumi 2 Quote Link to comment Share on other sites More sharing options...
0 darking123 Posted April 24, 2020 Group: Members Topic Count: 318 Topics Per Day: 0.07 Content Count: 931 Reputation: 13 Joined: 12/20/11 Last Seen: November 21, 2020 Author Share Posted April 24, 2020 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? Quote Link to comment Share on other sites More sharing options...
0 xJhay Posted July 19, 2020 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 38 Reputation: 0 Joined: 11/22/16 Last Seen: May 1, 2021 Share Posted July 19, 2020 Is this available for herc svn? Quote Link to comment Share on other sites More sharing options...
Question
darking123
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!
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.