Jump to content
  • 0

how to make a npc invisible to a character that has complete it


mirabell

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

Hello, i want to be able to make a npc invisible so they cant see it once they  complete the quest. 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   7
  • Joined:  07/17/18
  • Last Seen:  

Maybe you can use OnTouch, whenever the player is close it changes the sprite.

Quote

prontera,150,150,5    script    classchange    HIDDEN_WARP_NPC,14,14,{
OnTouch:
    if ( playervar == 1)
        classchange NPCSPRITE, 0, getcharid(0);
    end;
}

That way its always invisible unless the player has a variable, didn't test it tho.

Edited by Tomahawk
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

Moved to the right section

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  22
  • Reputation:   5
  • Joined:  06/19/18
  • Last Seen:  

You can add a pj variable when they finish a quest like this or if you are using quest_db you can verify the progress of the quest.

prontera,156,167,4	script	QuestNpc#1	854,3,3,{
	end;
	OnTouch:
      if(Quest_Custom < 10 ){
		hideoffnpc "QuestNpc#1";
              switch(Quest_Custom){
                  case 0:
                      //do something for beginning questers
                      close2;
                      set Quest_Custom, 1;
                      end;
                  break;
                  case 1:
                  	//do something else
                    close2;
                    set Quest_Custom, 2;
                    end;
                  break;
                  .
                  .
                  .
                  default:
                  	//do something when this npc does not have an option for the level of quest the user has.
                  break;
              }
      } else {
        npctalk "Looks like you've finished all the quest, congratulations "+strcharinfo(0);
      }
	end;
	OnInit:
		hideonnpc "QuestNpc#1";
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

55 minutes ago, sader1992 said:

Moved to the right section

how is this a source mod when im asking how to do it script wise? there is hide npc commands. IM asking how to be able to hide a npc from a player when quest complete.

 

Edited by mirabell
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

28 minutes ago, mirabell said:

how is this a source mod when im asking how to do it script wise? there is hide npc commands. IM asking how to be able to hide a npc from a player when quest complete.

 

image.thumb.png.c4c8beabd5c8d9df2982ff4262566b42.png
it's impossible script wise as far as i know

so in this section , you might find the answer you seek

unless you mean something else

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   7
  • Joined:  07/17/18
  • Last Seen:  

Isn't it possible through classchange?

classchange HIDDEN_WARP_NPC, strnpcinfo(0), bc_self;

Edit: Btw I got this code from AnnieRuru's blog.

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

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

20 minutes ago, Tomahawk said:

Isn't it possible through classchange?


classchange HIDDEN_WARP_NPC, strnpcinfo(0), bc_self;

 

that will do

ok than , my bad , moved it back to the script section.

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

1 hour ago, sader1992 said:

that will do

ok than , my bad , moved it back to the script section.

thanks, i basically wanted a way that didnt require crazy src edit, i should have mentions it my bad .

1 hour ago, Tomahawk said:

Isn't it possible through classchange?


classchange HIDDEN_WARP_NPC, strnpcinfo(0), bc_self;

Edit: Btw I got this code from AnnieRuru's blog.

now this one i haven't seen before. lets say i wanted to use that. is there a onlogon event i can use to make the npc hidden to a player with a variable or quest complete?

 thanks

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  197
  • Reputation:   19
  • Joined:  11/20/11
  • Last Seen:  

thank i will try this

 

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