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.