Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Windows Servers

Support::Windows Servers Support forum for Windows EQEMu users.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #15  
Old 04-03-2011, 01:46 AM
louis1016
Hill Giant
 
Join Date: Dec 2009
Posts: 157
Default

I have wrote a working random weather generator based on 3 levels of intensity based on the first code given to me above. I have tested it and it works and I'll post it here in case anyone else wants to use it. It has a chance of giving a low, medium, or high intensity rain/snowstorms. Change the values to whatever you see fit. Ignore the #comments.

sub EVENT_ENTERZONE {

# Set the type of weather desired here
my $weathertype = int(rand(15));
# Check if weather is not already set to the desired type
if ($zoneweather != $weathertype)
{
my $Rain = 1;
my $Snow = 2;
my $mrain = 3;
my $msnow = 4;
my $lrain = 5;
my $lsnow = 6;
if ($weathertype == $Rain)
{
# Turn off snow (if it is on) and turn on rain
quest::snow(0);
quest::rain(0);
quest::rain(20);
}
elsif ($weathertype == $Snow)
{
# Turn off rain (if it is on) and turn on snow
quest::rain(0);
quest::snow(0);
quest::snow(20);
}
elsif ($weathertype == $mrain)
{
quest::rain(0);
quest::snow(0);
quest::rain(10);
}
elsif ($weathertype == $msnow)
{
quest::rain(0);
quest::snow(0);
quest::snow(10);
}
elsif ($weathertype == $lrain)
{
quest::rain(0);
quest::snow(0);
quest::rain(1);
}
elsif ($weathertype == $lsnow)
{
quest::rain(0);
quest::snow(0);
quest::snow(1);
}
else
{
# Turn off both snow and rain
quest::rain(0);
quest::snow(0);
}
}
}

}
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:53 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3