Jump to content
  • 0

Change Text when Variable is Equal to X


Strand

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Hello community,

I'm creating a NPC that is able to detect a variable from a player but I want it to be able to show through a text and color whenever the player has completed a certain quest through detecting the number of the variable, for example:

image.png.e09b1c08421bb5ced00dd0a3c559cb67.png

If the player has concluded satisfactorily the Attitude to the New World, for example: if ( newworld == 40 ) the text should be "Complete" and the color "Green" if not, it should remain Incomplete and color red.

How can this be possible in a simple way?

Thank you very much.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Like this?

prontera,100,100,4	Quest Checker	100,{

	setarray .@color$[0],"^009900Complete","^990000Incomplete";

	// Put here the quest ids. Find them on the scripts or quest_db
	setarray .@quest_id[0],2157,2094,17017;

	// Names here.
	setarray .@quest$[0],"Attitude to the New World","Cursed Spirit","Nameless Island Entrance";

	for(.@size = getarraysize(.@quest_id);.@i < .@size;.@i++) {
		.@status = checkquest(.@quest_id[.@i]) != 2;
		mes .@quest$[.@i]+" - "+.@color$[.@status]+"^000000";
	}

	close;

}

 

Edited by n0tttt
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Hello @n0tttt this just works perfectly fine!

Just one last question: How did you find out which quest corresponds to those I just named before? Because there are a lot of quest ids that corresponds to the same quest. I just want to make sure that I'm putting the right Quest ID so it can be detected as finished.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

For those I checked the scripts. First I look on the Internet for some guide, then look up the name of some NPC of that guide in the npc folder. After that you have to look for the final part. A lot of times that part has a "getexp" condition. Or sometimes some items. It depends, but the guide can help you find that.

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