Jump to content
  • 0

Different mes for duplicate from same npc.


bearnope246

Question


  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

The title said it. Is this possible? 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

If Statements

if(strcharinfo(3) == "payon"){
	do payon stuff
}
else if(strcharinfo(3) == "prontera"){
	do prontera stuff
}
else if(strcharinfo(3) == "alberta"){
	do alberta stuff
}

IF + Switch Statements

if(strcharinfo(3) == "payon"){ set .@town,1; }
if(strcharinfo(3) == "prontera"){ set .@town,2; }
if(strcharinfo(3) == "alberta"){ set .@town,3; }

switch(.@town){
	
	case 1:
		payon here
	case 2:
		prontera here
	case 3:
		alberta here
}

Just do which ever will look cleaner and easier to follow, I'd pick the combo with switch if it was me though

Edited by Hijirikawa
Link to comment
Share on other sites

  • 0

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

yes, ... depend on how you want to do it.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.01
  • Content Count:  193
  • Reputation:   41
  • Joined:  07/21/16
  • Last Seen:  

Yup, you can do some if statements to check where the npc or player using the script is.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

yes, ... depend on how you want to do it.

 

 

Yup, you can do some if statements to check where the npc or player using the script is.

 

Could i know how?

example:

Just the same NPC, duplicated it in different Town, it said different dialog.? Thanks

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  41
  • Topics Per Day:  0.01
  • Content Count:  94
  • Reputation:   5
  • Joined:  06/30/16
  • Last Seen:  

If Statements

if(strcharinfo(3) == "payon"){
	do payon stuff
}
else if(strcharinfo(3) == "prontera"){
	do prontera stuff
}
else if(strcharinfo(3) == "alberta"){
	do alberta stuff
}

IF + Switch Statements

if(strcharinfo(3) == "payon"){ set .@town,1; }
if(strcharinfo(3) == "prontera"){ set .@town,2; }
if(strcharinfo(3) == "alberta"){ set .@town,3; }

switch(.@town){
	
	case 1:
		payon here
	case 2:
		prontera here
	case 3:
		alberta here
}

Just do which ever will look cleaner and easier to follow, I'd pick the combo with switch if it was me though

That solved a lot of things for me.

Thanks.

How to switch with NPC id?

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