Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-06-2011, 01:26 PM
louis1016
Hill Giant
 
Join Date: Dec 2009
Posts: 157
Default perl script

Ok, heres a perl script I set up for weather for an invisible mob. Everything seems to run fine when I #repop the zone. The initial weather change can occur and the timer starts which repeats a random weather change. However, for some reason, whenever I first enter a zone (dynamic zones) and everything pops for the first time, it always starts raining. Since #repop works and reads the script correctly I cant understand what the problem is. Can anyone help? Heres the code:

Code:
sub EVENT_SPAWN {
	my $quickchange = int(rand(7));
	my $quickrain = 1;
	my $quicksnow = 2;
	if ($quickchange == $quickrain) {
		quest::rain(0);
		quest::snow(0);
		quest::rain("int(rand(80))"+1);
		quest::settimer("weatherchange",int(rand(3000))+100);
			 }
	elsif ($quickchange == $quicksnow) {
		quest::rain(0);
		quest::snow(0);
		quest::snow("int(rand(60))"+1);
		quest::settimer("weatherchange",int(rand(3000))+100); }
	else {
		quest::rain(0);
		quest::snow(0);
		quest::settimer("weatherchange",int(rand(3000))+100); 
}
}

sub EVENT_TIMER {
	if ($timer eq "weatherchange") {
		my $weather = int(rand(7));
		my $rain = 1;
		my $snow = 2;
		if ($weather == $rain){
			quest::rain(0);
			quest::snow(0);
			quest::rain("rand(int(80))"+1); }
		elsif ($weather == $snow) {
			quest::snow(0);
			quest::rain(0);
			quest::snow("rand(int(60))"+1); }
		else {
			quest::snow(0);
			quest::rain(0);
			}
		}
		}
Reply With Quote
 

Thread Tools
Display Modes

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 03:11 PM.


 

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