View Single Post
  #15  
Old 08-17-2008, 12:21 AM
Neiv
Hill Giant
 
Join Date: May 2008
Location: Colorado
Posts: 238
Default

Quote:
Originally Posted by Striat View Post
easiest way is probably to use player quest and a spell. For example, call if blessing of the kings with the stat buff. then, have it check for faction and/or global. With a global of "FactionA" (triggered with the turn in), but also the option of having FactionB and FactionC(not triggered), let the spell = 9000 in this example and faction_id = 600, 601, and 602 respectively:

player.pl in template folder

Code:
sub EVENT_ENTERZONE {
	quest::settimer("check",1);
	}

sub EVENT_TIMER {
	my $factioncheck = undef;
	if ($qglobals{kingdomfaction} ) {	#global is defined
	if ($qglobals{kingdomfaction} eq "FactionA") {	#FactionA has control
	$factioncheck = $client->GetCharacterFaction(600);
	if ($factioncheck >= 850) {	#FactionA and character faction over 850
	if (!$client->FindBuff(9000)) {	#No Buff?  Then cast
	quest::selfcast(9000);
	}
	}
	else {
	if ($client->FindBuff(9000)) {	#Has buff but not enough faction.  Fade buff
	$client->BuffFadeBySpellID(9000);
	}
	}
	}
	elsif ($qglobals{kingdomfaction} eq "FactionB") {
	$factioncheck = $client->GetCharacterFaction(601);
	if ($factioncheck >= 850) {	#FactionB and character faction over 850
	if (!$client->FindBuff(9000)) {	#No Buff?  Then cast
	quest::selfcast(9000);
	}
	}
	else {
	if ($client->FindBuff(9000)) {	#Has buff but not enough faction.  Fade buff
	$client->BuffFadeBySpellID(9000);
	}
	}
	}
	elsif($qglobals{kingdomfaction} eq "FactionC") {
	$factioncheck = $client->GetCharacterFaction(602);
	if ($factioncheck >= 850) {	#FactionA and character faction over 850
	if (!$client->FindBuff(9000)) {	#No Buff?  Then cast
	quest::selfcast(9000);
	}
	}
	else {
	if ($client->FindBuff(9000)) {	#Has buff but not enough faction.  Fade buff
	$client->BuffFadeBySpellID(9000);
	}
	}
	}
	}
	else {
	if ($client->FindBuff(9000)) {	#Global not set but has buff
	$client->BuffFadeBySpellID(9000);
	}
	}
}
I'm just now starting to experiment with this. Is the settimer function even necessary in this? Can't I just put the script that appears under the TIMER event under the ENTERZONE event instead? I don't even see an "if($timername eq "check")" statement that would trigger the timer. Or am I just missing something?
Reply With Quote