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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 11-15-2014, 02:41 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

I have done a few source code edits of my own, so that would need to be done (the merging) anyhow, when the time comes to upgrade the server source.

I was myself puzzling over how to implement a "live" time change switch, like you mentioned, instead of just triggering on zoning.


Incidentally, I have managed to break this script again, by trying to reverse what we coded and cancel out the night time buff when it's day time. I will highlight the area I think caused the problem, and explain why I think it happened.

Code:
sub EVENT_TIMER {
	if ($timer eq "Zoned") {
		quest::stoptimer("Zoned");
		if ($zonesn=~/Nexus/i && !defined $qglobals{"NexusBind"}) {
			quest::selfcast(35);
			quest::setglobal("NexusBind", 1, 5, "F");
		}
	if ($zonetime > 599 && $zonetime < 1900) { #it is day time
	if($client->FindBuff(346)){ #find night buff
		    $client->Message(12, "The darkness wanes.");
                    $client->BuffFadeBySpellID(346); #cancel night buff
        $client->Message(12, "The sun's rays beam down.");
        quest::selfcast(992); #cast day buff
		} else { #does not have night buff
		quest::selfcast(992);
    } else { #it is night time
        $client->Message(12, "It's very dark outside.");
		if($client->FindBuff(992)){ #find day buff
		    $client->Message(12, "The sunlight fades.");
                    $client->BuffFadeBySpellID(992); #cancel day buff
					quest::selfcast(346); #cast night buff
                } else { #does not have the day buff
					quest::selfcast(346); #cast night buff
                }
    }
}
}
}

I believe this happened because we've kept the night check as just an "else" statement and not actually coded in the times that it considers to be night, so when I added another "else" in there, it's getting confused about what's actually going on. This is why I thought we needed to actually designate the specific times of night, instead of just going by "else" --- does that make sense, and am I correct in thinking this is what caused the problem?
Reply With Quote
  #2  
Old 11-15-2014, 03:39 PM
rencro
Hill Giant
 
Join Date: Sep 2008
Location: So. California
Posts: 219
Default

Here is your script edited for Arias, I have used spellid 11 as the day buff. Putting this back into .pl will be almost identical.

Code:
	if ($text=~/timebuff/i) {
		if ($zonetime > 599 && $zonetime < 1900) { #it is day time
			if($client->FindBuff(346)){ #find night buff
				$client->Message(12, "The darkness wanes.");
                                $client->BuffFadeBySpellID(346); #cancel night buff
		        }
                $client->Message(12, "The sun's rays beam down.");
                quest::selfcast(11); #cast day buff
		} else { #it is night time
			$client->Message(12, "It's very dark outside.");
			if($client->FindBuff(11)){ #find day buff
				$client->Message(12, "The sunlight fades.");
                                $client->BuffFadeBySpellID(11); #cancel day buff
                        } 
                 quest::selfcast(346); #cast night buff
                }
	}
The extra else statements were an issue as well placement of some commands. The casting of the nightime buff at night only needs to be processed once, outside of the "check for daytime buff IF" and vice versa. Does that make sense? For instance we are doing
quest::selfcast(346); #cast night buff
but we are still in the "else" day/night check, but are outside of the "if has daytime buff check, which is also part of the else daytime/nightime check"

Sorry, i suck at explaining things.

Also, in this case you will get a message that it is dark, then a message that the sun fades, so if you would want this switched then just move the its very dark outside messaage to after the check for daytime buff and vice versa.
Reply With Quote
Reply

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:01 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