View Single Post
  #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