Zell Posted May 16, 2018 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 412 Reputation: 266 Joined: 04/25/12 Last Seen: Yesterday at 01:17 AM Share Posted May 16, 2018 View File DuplicateCreate and DuplicateRemove command Apply the patch manually These commands allow you to create duplicates at run time. duplicatecreate("sourcename", "targetnameshown", "targetnamehidden", "targetmap", targetx, targety, targetdir{, targetspriteid{, targetxs, targetys}}); duplicateremove("npcname"); Submitter Zell Submitted 05/13/2018 Category Source Modifications Video Content Author Zell 1 1 Quote Link to comment Share on other sites More sharing options...
1 Zell Posted May 28, 2018 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 412 Reputation: 266 Joined: 04/25/12 Last Seen: Yesterday at 01:17 AM Author Share Posted May 28, 2018 2 hours ago, Feilor said: I tried to use this, but it isn't working, when we try to use your diff, the compiler give error with function npc_event_export_2 was not declared in this scope, after add it in npc.hpp the compiler give the same error in function npc_timerevent_export My Mistake. Add in npc.h after void npc_event_do_oninit(void); //Zell Duplicate int npc_event_export_2(struct npc_data *nd, int i); void npc_duplicate_2(struct npc_data *nd); int npc_timerevent_export(struct npc_data *nd, int i); 1 1 Quote Link to comment Share on other sites More sharing options...
0 Feilor Posted May 28, 2018 Group: Members Topic Count: 37 Topics Per Day: 0.01 Content Count: 135 Reputation: 17 Joined: 12/31/11 Last Seen: January 11 Share Posted May 28, 2018 I tried to use this, but it isn't working, when we try to use your diff, the compiler give error with function npc_event_export_2 was not declared in this scope, after add it in npc.hpp the compiler give the same error in function npc_timerevent_export Quote Link to comment Share on other sites More sharing options...
0 SyncMaster Posted August 23, 2018 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 123 Reputation: 38 Joined: 07/15/13 Last Seen: April 16 Share Posted August 23, 2018 I'm still new at editing the source files, but when I tried to add this command, I had the following error at visual studio. I would like to know if anyone have a better idea of what is causing this. Quote Link to comment Share on other sites More sharing options...
0 Ninja Posted August 24, 2018 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Share Posted August 24, 2018 (edited) 5 hours ago, SyncMaster said: I'm still new at editing the source files, but when I tried to add this command, I had the following error at visual studio. I would like to know if anyone have a better idea of what is causing this. As I can see above, you are still using ".c" which means a much older version as we are already into using c++. I think, the best thing to do is update your server to the latest rAthena and try to diff it again. Edited August 24, 2018 by Ninja Quote Link to comment Share on other sites More sharing options...
0 Haziel Posted August 24, 2018 Group: Content Moderator Topic Count: 22 Topics Per Day: 0.00 Content Count: 639 Reputation: 609 Joined: 11/25/11 Last Seen: March 7 Share Posted August 24, 2018 Thread merged with the original support thread.@SyncMaster Please refrain from creating separate threads when there's a support topic already created for that specific purpose, which you included the link on your own post. Quote Link to comment Share on other sites More sharing options...
0 SyncMaster Posted August 25, 2018 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 123 Reputation: 38 Joined: 07/15/13 Last Seen: April 16 Share Posted August 25, 2018 8 hours ago, Haziel said: Thread merged with the original support thread.@SyncMaster Please refrain from creating separate threads when there's a support topic already created for that specific purpose, which you included the link on your own post. Sorry, I thought it was just a "release topic" 22 hours ago, Ninja said: As I can see above, you are still using ".c" which means a much older version as we are already into using c++. I think, the best thing to do is update your server to the latest rAthena and try to diff it again. I can't because of many other custom changes that I made in the source that i'm not yet able to convert them to C+. :x Quote Link to comment Share on other sites More sharing options...
0 Ninja Posted August 25, 2018 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 513 Reputation: 84 Joined: 08/11/12 Last Seen: July 4, 2024 Share Posted August 25, 2018 6 minutes ago, SyncMaster said: Sorry, I thought it was just a "release topic" I can't because of many other custom changes that I made in the source that i'm not yet able to convert them to C+. :x Then that would be a huge problem as the release is made specifically for c++ releases. You might wanna ask the mod creator to port it to older versions of rA. Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted November 13, 2019 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted November 13, 2019 This is a handy script to have! @Zell Would it be possible though to specify 0,0 as target coordinates to create the duplicate NPC on any random walkable cell on the map? I've tried to have a go myself using similar logic to how rAthena handles the spawning of mobs on cells but my efforts in the /src/ folder have shown me I have much room for improvement.. due to failure! Quote Link to comment Share on other sites More sharing options...
0 Zell Posted November 13, 2019 Group: Members Topic Count: 53 Topics Per Day: 0.01 Content Count: 412 Reputation: 266 Joined: 04/25/12 Last Seen: Yesterday at 01:17 AM Author Share Posted November 13, 2019 (edited) 13 hours ago, Akkarin said: This is a handy script to have! @Zell Would it be possible though to specify 0,0 as target coordinates to create the duplicate NPC on any random walkable cell on the map? I've tried to have a go myself using similar logic to how rAthena handles the spawning of mobs on cells but my efforts in the /src/ folder have shown me I have much room for improvement.. due to failure! After if (dupmapid < 0) { ShowError("duplicatecreate: Map not found. (%s)\n", mapa); script_pushint(st, 0); return 0; } Add: struct map_data *mapdata = map_getmapdata(dupmapid); int tries = 0; if(x <= 0 || y <= 0) { do { x = rnd()%(mapdata->xs-2)+1; y = rnd()%(mapdata->ys-2)+1; } while(map_getcell(dupmapid,x,y,CELL_CHKNOPASS) || (tries++) < 1000); } if (tries > 1000) { ShowError("duplicatecreate: Impossible to find a valid spot in (%s)\n", mapa); return SCRIPT_CMD_FAILURE; } Didn't test it but should work Edited November 13, 2019 by Zell 1 Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted November 13, 2019 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted November 13, 2019 I've given it a test but it's always hitting the invalid spot error. Tested on 5 regular maps with a simple npc script. Quote Link to comment Share on other sites More sharing options...
0 nitrous Posted November 13, 2019 Group: Developer Topic Count: 4 Topics Per Day: 0.00 Content Count: 141 Reputation: 46 Joined: 08/14/12 Last Seen: April 5 Share Posted November 13, 2019 Change the or to an and in the while condition. 1 Quote Link to comment Share on other sites More sharing options...
0 Akkarin Posted November 14, 2019 Group: Forum Manager Topic Count: 282 Topics Per Day: 0.06 Content Count: 3144 Reputation: 1632 Joined: 03/26/12 Last Seen: April 15 Share Posted November 14, 2019 && fixed it, thank you both! Quote Link to comment Share on other sites More sharing options...
0 Bringer Posted July 22, 2023 Group: Members Topic Count: 162 Topics Per Day: 0.04 Content Count: 748 Reputation: 47 Joined: 03/12/14 Last Seen: Yesterday at 08:53 AM Share Posted July 22, 2023 @Zell Hello is this same on this command? https://board.herc.ws/topic/8216-duplicate-npc-commands/ Quote Link to comment Share on other sites More sharing options...
Question
Zell
View File
DuplicateCreate and DuplicateRemove command
Apply the patch manually
These commands allow you to create duplicates at run time.
duplicatecreate("sourcename", "targetnameshown", "targetnamehidden", "targetmap", targetx, targety, targetdir{, targetspriteid{, targetxs, targetys}});
duplicateremove("npcname");
Link to comment
Share on other sites
13 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.