View Single Post
  #11  
Old 11-15-2014, 12:46 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

This is my first attempt at trying to cancel the daytime buff if the player zones and it is nighttime. Seems to have broken the entire script. Continuing to try and solve this...

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);
    }
}

sub EVENT_DISCOVER_ITEM {
	quest::gmsay("$name has discovered the item " . quest::varlink($itemid) . ".", 335, 1, 0, 0);
}
 
sub EVENT_COMBINE_SUCCESS {
	if (!defined $qglobals{$recipe_name}) {
		quest::gmsay("$name has discovered the recipe for '$recipe_name'.", 335, 1, 0, 0);
		quest::setglobal($recipe_name, 1, 7, "F");
	}
}

sub EVENT_ENTERZONE {
	if (!defined $qglobals{$zonesn}) {
		quest::gmsay("$name has discovered the zone $zoneln.", 335, 1, 0, 0);
		quest::setglobal($zonesn, 1, 7, "F");
	}
	quest::settimer("Zoned", 5);
}

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) {
			$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);
		}
	}
}

Attempt 2

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);
    } elsif ($zonetime < 599 && $zonetime > 1900) {
        $client->Message(13, "It's very dark outside.");
		if($client->FindBuff(992));
		$client->BuffFadeBySpellID(992);
    }
}

Attempt 3... if someone could gently nudge me in the right direction (or crudely beat me over the head with it) that would be awesome..

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) { #between 6am and 7pm
			$client->Message(12, "The sun's rays beam down");
			quest::selfcast(992);
			}
	 if ($zonetime < 599 && $zonetime > 1900) { #between 7pm and 6am
			$client->Message(13, "It's very dark outside.");
		}
	}
}

I should note that in this last attempt I am simply trying to change the night time message to trigger in a different fashion so I can then insert the buff removal code once I see that it's checking a specific time and not just going by an else statement
Reply With Quote