Jump to content
  • 0

Summoning a Dummy NPC that my Character can only see


Lucinoxth

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  06/17/18
  • Last Seen:  

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

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.01
  • Content Count:  24
  • Reputation:   0
  • Joined:  07/29/19
  • Last Seen:  

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)

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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.

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

GIF%207-8-2020%2010-44-42%20AM.gif

do you want make NPC like this?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  06/17/18
  • Last Seen:  

On 5/23/2021 at 12:46 PM, LearningRO said:

GIF%207-8-2020%2010-44-42%20AM.gif

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 by Lucinoxth
sample correction
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

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>};

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  4
  • Reputation:   0
  • Joined:  05/04/17
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   381
  • Joined:  02/03/12
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.01
  • Content Count:  31
  • Reputation:   16
  • Joined:  05/18/20
  • Last Seen:  

I think that is a dynamic NPC, it's implemented already in Hercules.. 

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