EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Say Links (https://www.eqemulator.org/forums/showthread.php?t=27873)

Shendare 06-11-2009 05:27 PM

I like the idea of having the option for silent as well as visible saylink responses.

If one is not using silent saylinks, I also like the idea of being able to specify the text being said by the player when they click on the link, instead of making it always the text of the link itself.

"Hail, Player! Would you be interested in helping me with this [task]?"

*click [task]* "What task is that?"

...as opposed to:

*click [task]* "task"

- Shendare

trevius 06-11-2009 06:30 PM

Sion already mentioned a way to do that with Perl, but I do agree that it would be nice to have the option to do it directly with the command.

The only reason to have a table for saylinks is so the server knows what phrase to associate with whichever saylink is being clicked. So, basically whatever gets put into that table is what the server will use to parse (or have the client /say) when the link is clicked.

This means that we should be able to set a second argument for the command that is optional. If the second argument is set, then that second phrase/argument would be the one that appears in the actual link in the text of the NPC. I am not that great with coding optional arguments for quest commands yet, but I can maybe try to add that in as well at some point. Again, most of the code needed for this to work should already be there. Basically, the saylink() command would just need to check for a second argument and if one exists, it uses that argument for creating the actual itemlink, but it still does the query of the saylink table based on the first argument.

If this functionality was added, it should work something like this:
Code:

sub EVENT_SAY {

my $test = quest::saylink(""Yes, I would like to test a saylink","test a saylink");
my $click = quest::saylink("I need to click something?","click");
my $say = quest::saylink("say");

  if($text=~/hail/i)
  {
    quest::say("Hello, $name.  Would you like to [$test]? If so, simply [$click] on the pink text and wait for my response.  You may also simply /$say the message like normal if you prefer that method instead.");
  }

  if($text=~/test a saylink/i)
  {
    quest::say("The test was a huge success!  Well done :P");
  }

  if($text=~/click/i)
  {
    quest::say("Yes, click the pink text exactly like you just did!");
  }

  if($text=~/^say$/i)
  {
    quest::say("Saying or clicking the text is the same thing to me!");
  }

}

Where the values put into the saylink table (as well as what the character would appear to say when clicking the link) would be the first argument and the values in the second argument would be only for the text that shows up in the link itself when the NPC says it.

trevius 07-19-2009 06:53 AM

I added a new bool option for the saylink command to allow them to be silent. More info can be found on the wiki page here about it:

http://www.eqemulator.net/wiki/wikka.php?wakka=SayLink

trevius 07-21-2009 09:28 AM

Quote:

Originally Posted by Shendare (Post 171942)
I like the idea of having the option for silent as well as visible saylink responses.

If one is not using silent saylinks, I also like the idea of being able to specify the text being said by the player when they click on the link, instead of making it always the text of the link itself.

"Hail, Player! Would you be interested in helping me with this [task]?"

*click [task]* "What task is that?"

...as opposed to:

*click [task]* "task"

- Shendare

I updated Saylinks again so this is now an option. If you wanted to set a saylink to do what Shendare is showing in this quote, you would do this:

Code:

my $task = quest::saylink("What task is that?", 0, "task");

quest::say("Hail, $name! Would you be interested in helping me with this [$task]?");

The 0 in the middle is the bool for being silent or not, so when making different responses from what the link shows, it only makes sense to set it as 0 so the player says the message.


All times are GMT -4. The time now is 06:16 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.