EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Specifying a client (https://www.eqemulator.org/forums/showthread.php?t=27849)

neiv2 04-11-2009 01:28 PM

Specifying a client
 
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?


All times are GMT -4. The time now is 10:24 AM.

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