View Single Post
  #13  
Old 11-15-2014, 01:58 PM
rencro
Hill Giant
 
Join Date: Sep 2008
Location: So. California
Posts: 219
Default

You shoulnd't need to do another time compare because if its not daytime, then an else means its gotta be dark

On attempt two, there is an error with the if statement

Code:
sub EVENT_CONNECT {
	quest::setlanguage(0, 100);
	quest::setskill(40, 200);
	if ($zonetime > 599 && $zonetime < 1900) {
        $client->Message(12, "The sun's rays beam down.");
        quest::selfcast(992);
    } else {
        $client->Message(13, "It's very dark outside.");
		if($client->FindBuff(992));
		$client->BuffFadeBySpellID(992);
    }
}
Need the { } brackets to process this if statement

Code:
sub EVENT_CONNECT {
	quest::setlanguage(0, 100);
	quest::setskill(40, 200);
	if ($zonetime > 599 && $zonetime < 1900) {
        $client->Message(12, "The sun's rays beam down.");
        quest::selfcast(992);
    } else {
        $client->Message(13, "It's very dark outside.");
		if($client->FindBuff(992)){
		    $client->Message(13, "Its dark and you have the daytime buff, so nighty night buff");
                    $client->BuffFadeBySpellID(992);
                } else {
                    $client->Message(13, "Its night, but you dont have the daytime buff");
                }
    }
}
Something like that, didnt actually test this in player.pl but on arias, but should be ok as long as I got all the brackets right/ Also you can ignore the messages or remove them I just use them for troubleshooting

Last edited by rencro; 11-15-2014 at 02:01 PM.. Reason: Ugg my formatiing is ugg but ugg too lazy to make it look good
Reply With Quote