RE: my custom zone music setup found
here.
The principle behind this script is that it uses a sub EVENT_ENTERZONE function in the templates\player.pl to access a cmd line that runs a vbs script which in turn launches a batch file which in turn plays music for the zone in which it is triggered. Here's a short sample of the flow:
Code:
my $zone_music_w = 'C:\EQEmu\quests\music\runw.vbs'; # 92 - frontiermtns
my $zone_music_ww = 'C:\EQEmu\quests\music\runww.vbs'; # randomize
my $zone_music_www = 'C:\EQEmu\quests\music\runwww.vbs'; # randomize
my @random_music_w = (
"$zone_music_w",
"$zone_music_ww",
"$zone_music_www"
);
my $random_music_w = quest::ChooseRandom(@random_music_w);
if($zoneid == 92)
{
system("$random_music_w");
}
Runw.vbs launches runw.bat which in turn launches zonew.wav. The problem is (and has been) that since the "system" command is an external one, it launches the event indiscriminately on the server side each time a client enters the zone. I would like to limit the launch of the vb script to the specific client that triggers the event (i.e., enters the zone). Is there a way to define the client up front and include it within the if statement? For instance,
my $music_client = $client;
if($zoneid == 92 && $music_client eq ???)
{
system("$random_music_w");
}
I'm not sure how this should read, or even if it can be done. Can someone give me some guidance on this?