Lucinoxth Posted May 18, 2021 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 06/17/18 Last Seen: December 24, 2021 Share Posted May 18, 2021 Hi guys, Anyone knows how to summon a NPC next to my character which only me can see it (just a Dummy NPC) and destroy it after a certain dialog and script? Thanks in advance, Quote Link to comment Share on other sites More sharing options...
0 mihaamiharu Posted May 22, 2021 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 24 Reputation: 0 Joined: 07/29/19 Last Seen: July 1, 2021 Share Posted May 22, 2021 You can use classchange, annieruru ever post it in her blog. Like this prontera,158,186,5 script asfsfd HIDDEN_WARP_NPC,14,14,{ if ( strcharinfo(PC_NAME) != "AnnieRuru" ) end; // double protection mes "hi"; close; OnTouch: if ( strcharinfo(PC_NAME) == "AnnieRuru" ) classchange 1_F_MARIA, 0, getcharid(CHAR_ID_CHAR); // end; } You can chane strcharinfo PC name with your character name. Also you can change strcharinfo(PC_Name) parameters to Account id / etc, (like using getcharid) Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted May 23, 2021 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted May 23, 2021 depend on what you're doing with the NPC to hide/unhide and only visible to your char, you can use this command. *cloakonnpc "<NPC object name>"{,<character ID>}; *cloakoffnpc "<NPC object name>"{,<character ID>}; These commands will make the NPC object specified display as cloaked/uncloaked, even though not actually disabled. The player can interact with a NPC cloaked (via NPC click, monster event..) but the NPC trigger area is disabled. If <character ID> is given then the NPC will only display to the specified player until he/she leaves the map, logs out, or the npc option is changed. If no <character ID> is specified it will display to the area. Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted May 23, 2021 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 12 hours ago Share Posted May 23, 2021 do you want make NPC like this? Quote Link to comment Share on other sites More sharing options...
0 Lucinoxth Posted May 24, 2021 Group: Members Topic Count: 4 Topics Per Day: 0.00 Content Count: 7 Reputation: 0 Joined: 06/17/18 Last Seen: December 24, 2021 Author Share Posted May 24, 2021 (edited) On 5/23/2021 at 12:46 PM, LearningRO said: do you want make NPC like this? yes exactly like that..like i can summon it where ever I am...same the booster NPC On 5/23/2021 at 9:32 AM, Emistry said: depend on what you're doing with the NPC to hide/unhide and only visible to your char, you can use this command. *cloakonnpc "<NPC object name>"{,<character ID>}; *cloakoffnpc "<NPC object name>"{,<character ID>}; These commands will make the NPC object specified display as cloaked/uncloaked, even though not actually disabled. The player can interact with a NPC cloaked (via NPC click, monster event..) but the NPC trigger area is disabled. If <character ID> is given then the NPC will only display to the specified player until he/she leaves the map, logs out, or the npc option is changed. If no <character ID> is specified it will display to the area. dunno bro, but is this is for fixed location NPC, right? Edited May 24, 2021 by Lucinoxth sample correction Quote Link to comment Share on other sites More sharing options...
0 LearningRO Posted May 24, 2021 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 12 hours ago Share Posted May 24, 2021 7 hours ago, Lucinoxth said: yes exactly like that..like i can summon it where ever I am...same the booster NPC dunno bro, but is this is for fixed location NPC, right? maybe you must combine with getmapxy and then use *movenpc "<NPC name>",<x>,<y>{,<dir>}; Quote Link to comment Share on other sites More sharing options...
0 zDUREXz Posted August 1, 2021 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 4 Reputation: 0 Joined: 05/04/17 Last Seen: June 5, 2023 Share Posted August 1, 2021 On 5/24/2021 at 8:18 PM, LearningRO said: maybe you must combine with getmapxy and then use *movenpc "<NPC name>",<x>,<y>{,<dir>}; how to write it. Quote Link to comment Share on other sites More sharing options...
0 Skorm Posted August 2, 2021 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted August 2, 2021 9 hours ago, zDUREXz said: how to write it. So as far as I know NPCs cannot travel between maps which means there would need to be a duplicate of that hidden npc on every map that you wanted this to work on. With that said there are other ways that this could work with a monster spawning instead but that's not what I've created... I made three versions that work slightly different and have their own unique drawbacks. // This one will throw a Error/Debug if you're on a map where the npc does not exist. prontera,0,0,5 script Hidden NPC#prontera HIDDEN_WARP_NPC,{ if ( strcharinfo(0) == .character$ ) { mes "Blah"; close2; movenpc strnpcinfo(0),0,0; setnpcdisplay(strnpcinfo(0), HIDDEN_WARP_NPC); } end; OnMoveNPC: .character$ = strcharinfo(0); getmapxy(.@map$,.@x,.@y); setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),.@x,.@y; } geffen,0,0,0 duplicate(Hidden NPC#prontera) Hidden NPC#geffen HIDDEN_WARP_NPC Item Script: doevent "Hidden NPC#"+strcharinfo(3)+"::OnMoveNPC"; ---------------------------- // This one will not but is hardcoded specific to the character. prontera,0,0,5 script Hidden NPC#1 HIDDEN_WARP_NPC,{ if ( strcharinfo(0) == "AnnieRuru" ) { mes "Blah"; close2; movenpc strnpcinfo(0),0,0; setnpcdisplay(strnpcinfo(0), HIDDEN_WARP_NPC); } end; OnMoveSpecialNPC: getmapxy(.@map$,.@x,.@y,BL_PC,"AnnieRuru"); if( .@map$ == strnpcinfo(4) ) { setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),.@x,.@y; } } geffen,0,0,0 duplicate(Hidden NPC#1) Hidden NPC#2 HIDDEN_WARP_NPC Item Script: donpcevent "::OnMoveSpecialNPC"; --------------------------- // This one might not work from an item I've had problems with functions in items before. // But if it does work should fail silently. prontera,0,0,5 script Hidden NPC#prontera HIDDEN_WARP_NPC,{ if ( strcharinfo(0) == .character$ ) { mes "Blah"; close2; movenpc strnpcinfo(0),0,0; setnpcdisplay(strnpcinfo(0), HIDDEN_WARP_NPC); } end; OnMoveNPC: .character$ = strcharinfo(0); getmapxy(.@map$,.@x,.@y); setnpcdisplay(strnpcinfo(0), 4_TREASURE_BOX); movenpc strnpcinfo(0),.@x,.@y; } function script Hidden NPC Func { if(getnpcid(0,"Hidden NPC#"+strcharinfo(3))) { doevent "Hidden NPC#"+strcharinfo(3)+"::OnMoveNPC"; } } geffen,0,0,0 duplicate(Hidden NPC#1) Hidden NPC#geffen HIDDEN_WARP_NPC Item Script: callfunc "Hidden NPC Func"; I think @mihaamiharu was really close in sharing @AnnieRuru's original script. Just wish they had done so with code brackets. Quote Link to comment Share on other sites More sharing options...
0 Emistry Posted August 20, 2021 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted August 20, 2021 On 8/2/2021 at 3:42 PM, Skorm said: So as far as I know NPCs cannot travel between maps actually can, using the unitwarp(...) script command, but it create unnecessary error when you do reloadscript back to the topics, this NPC script cant be done without the create/duplicate/clone NPC. The NPC need to be allow to support concurrent triggered by users. There could be more than one players use the item to generate the NPC which only they can see it. If you use only one or specific few NPC, it cant support the demand. it need to clone the NPC then do cloakon to display the NPC, then delete the NPC upon done. Quote Link to comment Share on other sites More sharing options...
0 Skorm Posted August 24, 2021 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted August 24, 2021 On 8/20/2021 at 11:59 AM, Emistry said: actually can, using the unitwarp(...) script command, but it create unnecessary error when you do reloadscript back to the topics, this NPC script cant be done without the create/duplicate/clone NPC. The NPC need to be allow to support concurrent triggered by users. There could be more than one players use the item to generate the NPC which only they can see it. If you use only one or specific few NPC, it cant support the demand. it need to clone the NPC then do cloakon to display the NPC, then delete the NPC upon done. Exactly that's why I mentioned doing it instead with a stationary monster something that could just be spawned on demand then do the checks on the mobs death. Also I didn't know that about unitwarp makes sense though since NPCs and Mobs are very similar and the latter can move between maps. Quote Link to comment Share on other sites More sharing options...
0 Dimas_shotta93 Posted August 15, 2022 Group: Members Topic Count: 9 Topics Per Day: 0.01 Content Count: 32 Reputation: 17 Joined: 05/18/20 Last Seen: Saturday at 07:51 PM Share Posted August 15, 2022 I think that is a dynamic NPC, it's implemented already in Hercules.. Quote Link to comment Share on other sites More sharing options...
Question
Lucinoxth
Hi guys,
Anyone knows how to summon a NPC next to my character which only me can see it (just a Dummy NPC) and destroy it after a certain dialog and script?
Thanks in advance,
Link to comment
Share on other sites
10 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.