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 07-20-2009, 09:56 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default Require expert qglobal Help

I need a bit of help with understanding why a certain part of my qglobal is not working properly. I'm posting (below) the entire quest script (player.pl in the C:\EQEmu\quests\templates folder) just in case it's need. You can scroll past the sub EVENT_ENTERZONE section to the sub EVENT_TIMER--and in particular to the "if ($qglobals{kingdomfaction} == 1)" section under that EVENT--which is where the issue is.

Every "positive" action in that section works as it should: i.e., (1) it checks the faction of the player and sets a global flag for them that casts the correct level buff to members of the faction who hold the ring, and it changes the flag and stops casting buffs to the members of the faction that lost the ring; (2) it simultaneously confers guild membership ("quest::setguild(1,1);") to those of the right faction.

However, for some reason it doesn't perform the corresponding "negative" actions that follow loss of the ring, such as fading the buff of those who are now of the wrong faction ("$client->BuffFadeBySpellID();"), or changing their guild membership to the designated guild ("quest::setguild(0,1);").

Any help would be most appreciated.

Code:
sub EVENT_ENTERZONE 
	{
	my $zone_music_end = 'cscript.exe /nologo C:\EQEmu\quests\music\stop.vbs';
	system("$zone_music_end");

	$client->Message(15, "You have entered $zoneln.");
	if(plugin::check_hasitem($client, 13732))
		{
		my $wraith_music = 'C:\EQEmu\quests\music\runwraith.vbs';
		
		system("$wraith_music");
		$client->SetPVP(1);
		quest::signal(999281,0);
		
		quest::settimer("aggro",20);
		$client->Message(257, (quest::ChooseRandom("A mysterious voice whispers to you, 'I SEEEE YOOUUU!' ","A mysterious voice whispers to you, 'YOU CANNOT HIDE!' ","A mysterious voice whispers to you, 'I'M COMING FOR YOOUUU!' ")));

		quest::we(15, "You sense the ring has been found. It is now in the vicinity of $zoneln.");
		}

	else
		{
		quest::settimer("check",1);
		
		my $zone_music_a = 'C:\EQEmu\quests\music\runa.vbs';    # 11 - runnyeye
		my $zone_music_b = 

'C:\EQEmu\quests\music\runb.vbs';   	# 117 - cobaltscar
		my $zone_music_c = 'C:\EQEmu\quests\music\runc.vbs';    # 3 - surefall
		my $zone_music_d = 'C:\EQEmu\quests\music\rund.vbs';    # 16 - beholder
		my $zone_music_e = 'C:\EQEmu\quests\music\rune.vbs';    # 15 - eastkarana
		my $zone_music_f = 'C:\EQEmu\quests\music\runf.vbs';  	# 14 - southkarana
		my $zone_music_g = 'C:\EQEmu\quests\music\rung.vbs';    # 4 - qeytoqrg
		my $zone_music_h = 'C:\EQEmu\quests\music\runh.vbs';   	# 181 - jaggedpine
		my $zone_music_i = 'C:\EQEmu\quests\music\runi.vbs';  	# 87 - burningwood
		my $zone_music_j = 'C:\EQEmu\quests\music\runj.vbs';    # 93 - overthere
		my $zone_music_k = 'C:\EQEmu\quests\music\runk.vbs';    # 12 - qey2hh1
		my $zone_music_l = 'C:\EQEmu\quests\music\runl.vbs';    # 2 - qeynos2
		my $zone_music_m = 'C:\EQEmu\quests\music\runm.vbs';    # 1 - qeynos
		my $zone_music_n = 'C:\EQEmu\quests\music\runn.vbs';    # 45 - qcat
		my $zone_music_o = 

'C:\EQEmu\quests\music\runo.vbs';    # 347 - illsalin
		my $zone_music_p = 'C:\EQEmu\quests\music\runp.vbs';    # 50 - rathemtn
		my $zone_music_q = 'C:\EQEmu\quests\music\runq.vbs';  	# 17 - blackburrow
		my $zone_music_r = 'C:\EQEmu\quests\music\runr.vbs'; 	# 79 - warslikswood
		my $zone_music_rr = 'C:\EQEmu\quests\music\runrr.vbs'; 	# randomize
		my $zone_music_rrr = 'C:\EQEmu\quests\music\runrrr.vbs'; # randomize
		my $zone_music_s = 'C:\EQEmu\quests\music\runs.vbs';    # 183 - tutorial
		my $zone_music_t = 'C:\EQEmu\quests\music\runt.vbs';    # 25 - nektulos
		my $zone_music_u = 'C:\EQEmu\quests\music\runu.vbs';    # 263 - mmcg
		my $zone_music_v = 'C:\EQEmu\quests\music\runv.vbs';  	# 13 - northkarana
		my $zone_music_vv = 'C:\EQEmu\quests\music\runvv.vbs';  # randomize
		my $zone_music_w = 'C:\EQEmu\quests\music\runw.vbs'; 	# 92 - frontiermtns
		my $zone_music_ww = 'C:\EQEmu\quests\music\runww.vbs'; 	# randomize
		my $zone_music_www = 'C:\EQEmu\quests\music\runwww.vbs'; # randomize
		my $zone_music_x = 'C:\EQEmu\quests\music\runx.vbs'; 	# 182 - Nedaria
		my $zone_music_y = 'C:\EQEmu\quests\music\runy.vbs'; 	# 54 - Gfay
		my $zone_music_z = 'C:\EQEmu\quests\music\runz.vbs'; 	# 57 - Gfay
		my $zone_music_a1 = 'C:\EQEmu\quests\music\runa1.vbs'; 	# 100 - Stonebrunt

		my @random_music_a = (
			"$zone_music_a"
			);				
		my @random_music_b = (
			"$zone_music_b",
			"$zone_music_vv"
			);
		my @random_music_c = (
			"$zone_music_c"
			);
		my @random_music_d = (
			"$zone_music_d"
			);
		my @random_music_e = (
			"$zone_music_e"
			);
		my @random_music_f = (
			"$zone_music_f"
			);
		my @random_music_g = (
			"$zone_music_g"
			);
		my @random_music_h = (
			"$zone_music_h"
			);
		my @random_music_i = (
			"$zone_music_i"
			);
		my @random_music_j = (
			"$zone_music_j"
			);
		my @random_music_k = (
			"$zone_music_k"
			);
		my @random_music_l = (
			"$zone_music_l"
			);
		my @random_music_m = (
			"$zone_music_m"
			);
		my @random_music_n = (
			"$zone_music_n"
			);
		my @random_music_o = (
			"$zone_music_o"
			);
		my @random_music_p = (
			"$zone_music_p"
			);
		my @random_music_q = (
			"$zone_music_q"
			);
		my @random_music_r = (
			"$zone_music_r",
			"$zone_music_rr",
			"$zone_music_rrr"
			);
		my @random_music_s = (
			"$zone_music_s"
			);
		my @random_music_t = (
			"$zone_music_t"
			);
		my @random_music_u = (
			"$zone_music_u"
			);
		my @random_music_v = (
			"$zone_music_v",
			"$zone_music_vv"
			);								
		my @random_music_w = (
			"$zone_music_w",
			"$zone_music_ww",
			"$zone_music_www"
			);		
		my @random_music_x = (
			"$zone_music_x"
			);		
		my @random_music_y = (
			"$zone_music_y"
			);
		my @random_music_z = (
			"$zone_music_z"
			);
		my @random_music_a1 = (
			"$zone_music_a1"
			);

		my $random_music_a = quest::ChooseRandom(@random_music_a);
		my $random_music_b = quest::ChooseRandom(@random_music_b);
		my $random_music_c = quest::ChooseRandom(@random_music_c);
		my $random_music_d = quest::ChooseRandom(@random_music_d);
		my $random_music_e = quest::ChooseRandom(@random_music_e);
		my $random_music_f = quest::ChooseRandom(@random_music_f);
		my $random_music_g = quest::ChooseRandom(@random_music_g);
		my $random_music_h = quest::ChooseRandom(@random_music_h);
		my $random_music_i = quest::ChooseRandom(@random_music_i);
		my $random_music_j = quest::ChooseRandom(@random_music_j);
		my $random_music_k = quest::ChooseRandom(@random_music_k);
		my $random_music_l = quest::ChooseRandom(@random_music_l);
		my $random_music_m = quest::ChooseRandom(@random_music_m);
		my $random_music_n = quest::ChooseRandom(@random_music_n);
		my $random_music_o = quest::ChooseRandom(@random_music_o);
		my $random_music_p = quest::ChooseRandom(@random_music_p);
		my $random_music_q = quest::ChooseRandom(@random_music_q);
		my $random_music_r = quest::ChooseRandom(@random_music_r);
		my $random_music_s = quest::ChooseRandom(@random_music_s);
		my $random_music_t = quest::ChooseRandom(@random_music_t);
		my $random_music_u = quest::ChooseRandom(@random_music_u);
		my $random_music_v = quest::ChooseRandom(@random_music_v);
		my $random_music_w = quest::ChooseRandom(@random_music_w);
		my $random_music_x = quest::ChooseRandom(@random_music_x);
		my $random_music_y = quest::ChooseRandom(@random_music_y);
		my $random_music_z = quest::ChooseRandom(@random_music_z);
		my $random_music_a1 = quest::ChooseRandom(@random_music_a1);

		if($zoneid == 11)
			{
			system("$random_music_a");
			}
		elsif($zoneid == 117)
			{
			system("$random_music_b");
			}
		elsif($zoneid == 3)
			{
			system("$random_music_c");
			}
		elsif($zoneid == 16)
			{
			system("$random_music_d");
			}
		elsif($zoneid == 15)
			{
			system("$random_music_e");
			}
		elsif($zoneid == 14)
			{
			system("$random_music_f");
			}
		elsif($zoneid == 4)
			{
			system("$random_music_g");
			}
		elsif($zoneid == 181)
			{
			system("$random_music_h");
			}
		elsif($zoneid == 87)
			{
			system("$random_music_i");
			}
		elsif($zoneid == 93)
			{
			system("$random_music_j");
			}
		elsif($zoneid == 12)
			{
			system("$random_music_k");
			}
#		elsif($zoneid == 2)
#			{
#			system("$random_music_l");
#			}
#		elsif($zoneid == 1)
#			{
#			system("$random_music_m");
#			}
#		elsif($zoneid == 45)
#			{
#			system("$random_music_n");
#			}
#		elsif($zoneid == 347)
#			{
#			system("$random_music_o");
#			}
		elsif($zoneid == 50)
			{
			system("$random_music_p");
			}
#		elsif($zoneid == 17)
#			{
#			system("$random_music_q");
#			}
		elsif($zoneid == 79)
			{
			system("$random_music_r");
			}
#		elsif($zoneid == 183)
#			{
#			system("$random_music_s");
#			}
#		elsif($zoneid == 25)
#			{
#			system("$random_music_t");
#			}
#		elsif($zoneid == 263)
#			{
#			system("$random_music_u");
#			}
		elsif($zoneid == 13)
			{
			system("$random_music_v");
			}			
		elsif($zoneid == 92)
			{
			system("$random_music_w");
			}
		elsif($zoneid == 182)
			{
			system("$random_music_x");
			}
		elsif($zoneid == 54)
			{
			system("$random_music_y");
			}
		elsif($zoneid == 57)
			{
			system("$random_music_z");
			}
		elsif($zoneid == 100)
			{
			system("$random_music_a1");
			}
		}
	}


sub EVENT_TIMER 
	{
	if($timer eq "aggro")
		{
		my $guard_one = $entity_list->GetMobByNpcTypeID(999243);
	
		if ($guard_one) 
			{
			my $hate_guard_one = $guard_one->CastToNPC();
			$hate_guard_one->AddToHateList($client, 1);
			}
		quest::stoptimer("aggro");
		}
	elsif($timer eq "check")
		
{
		my $factioncheck = undef;
		if (defined($qglobals{kingdomfaction}))
			{	
			if ($qglobals{kingdomfaction} == 1) 
				{	
				$factioncheck = $client->GetCharacterFactionLevel(484);
					{
					if ($factioncheck >= 850 && $ulevel >= 60)
						{
						quest::setguild(1,1);
						if (!$client->FindBuff(5257)) #kingdom blessing V  

							{
							quest::selfcast(5257);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 50) 
						{
						quest::setguild(1,1);
						if (!$client->FindBuff(3467)) 
#kingdom blessing IV
							{
							quest::selfcast(3467);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 35) 
						{
						quest::setguild(1,1);
						if (!$client->FindBuff(1447)) 
#kingdom blessing III
							{
							quest::selfcast(1447);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 20) 
						{
						quest::setguild(1,1);
						if (!$client->FindBuff(3692)) 
#kingdom blessing II
							{
							quest::selfcast(3692);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 1) 
						{
						quest::setguild(1,1);
						if (!$client->FindBuff(312)) 
#kingdom blessing I
							{
							quest::selfcast(312);
							}
						}
					
					elsif ($client->FindBuff(5257) || $client->FindBuff(3467) || $client->FindBuff(1447) || $client->FindBuff(3692) || $client->FindBuff(312)) 
						{
						$client->BuffFadeBySpellID(5257);
						$client->BuffFadeBySpellID(3467);
						$client->BuffFadeBySpellID(1447);
						$client->BuffFadeBySpellID(3692);
						$client->BuffFadeBySpellID(312);
						quest::setguild(0,1);		
						}
					}
				}
			
			if ($qglobals{kingdomfaction} == 2) 
				{	
				$factioncheck = $client->GetCharacterFactionLevel(485);
					{
					if ($factioncheck >= 850 && $ulevel >= 60)
						{
						if (!$client->FindBuff(5257)) #kingdom blessing V  

							{
							quest::selfcast(5257);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 50) 
						{
						if (!$client->FindBuff(3467)) 
#kingdom blessing IV
							{
							quest::selfcast(3467);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 35) 
						{
						if (!$client->FindBuff(1447)) 
#kingdom blessing III
							{
							quest::selfcast(1447);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 20) 
						{
						if (!$client->FindBuff(3692)) 
#kingdom blessing II
							{
							quest::selfcast(3692);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 1) 
						{
						if (!$client->FindBuff(312)) 
#kingdom blessing I
							{
							quest::selfcast(312);
							}
						}
					
					elsif ($client->FindBuff(5257) || $client->FindBuff(3467) || $client->FindBuff(1447) || $client->FindBuff(3692) || $client->FindBuff(312)) 
						{
						$client->BuffFadeBySpellID(5257);
						$client->BuffFadeBySpellID(3467);
						$client->BuffFadeBySpellID(1447);
						$client->BuffFadeBySpellID(3692);
						$client->BuffFadeBySpellID(312);		
						}
					}
				}

			if ($qglobals{kingdomfaction} == 3) 
				{	
				$factioncheck = $client->GetCharacterFactionLevel(487);
					{
					if ($factioncheck >= 850 && $ulevel >= 60)
						{
						if (!$client->FindBuff(5257)) #kingdom blessing V  

							{
							quest::selfcast(5257);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 50) 
						{
						if (!$client->FindBuff(3467)) 
#kingdom blessing IV
							{
							quest::selfcast(3467);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 35) 
						{
						if (!$client->FindBuff(1447)) 
#kingdom blessing III
							{
							quest::selfcast(1447);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 20) 
						{
						if (!$client->FindBuff(3692)) 
#kingdom blessing II
							{
							quest::selfcast(3692);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 1) 
						{
						if (!$client->FindBuff(312)) 
#kingdom blessing I
							{
							quest::selfcast(312);
							}
						}
					
					elsif ($client->FindBuff(5257) || $client->FindBuff(3467) || $client->FindBuff(1447) || $client->FindBuff(3692) || $client->FindBuff(312)) 
						{
						$client->BuffFadeBySpellID(5257);
						$client->BuffFadeBySpellID(3467);
						$client->BuffFadeBySpellID(1447);
						$client->BuffFadeBySpellID(3692);
						$client->BuffFadeBySpellID(312);		
						}
					}
				}
		
			if ($qglobals{kingdomfaction} == 4) 
				{	
				$factioncheck = $client->GetCharacterFactionLevel(488);
					{
					if ($factioncheck >= 850 && $ulevel >= 60)
						{
						if (!$client->FindBuff(5257)) #kingdom blessing V  

							{
							quest::selfcast(5257);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 50) 
						{
						if (!$client->FindBuff(3467)) 
#kingdom blessing IV
							{
							quest::selfcast(3467);
							}
						}

					elsif ($factioncheck >= 850 && $ulevel >= 35) 
						{
						if (!$client->FindBuff(1447)) 
#kingdom blessing III
							{
							quest::selfcast(1447);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 20) 
						{
						if (!$client->FindBuff(3692)) 
#kingdom blessing II
							{
							quest::selfcast(3692);
							}
						}
					elsif ($factioncheck >= 850 && $ulevel >= 1) 
						{
						if (!$client->FindBuff(312)) 
#kingdom blessing I
							{
							quest::selfcast(312);
							}
						}
					
					elsif ($client->FindBuff(5257) || $client->FindBuff(3467) || $client->FindBuff(1447) || $client->FindBuff(3692) || $client->FindBuff(312)) 
						{
						$client->BuffFadeBySpellID(5257);
						$client->BuffFadeBySpellID(3467);
						$client->BuffFadeBySpellID(1447);
						$client->BuffFadeBySpellID(3692);
						$client->BuffFadeBySpellID(312);		
						}
					}
				}
			}
		}
	}
Reply With Quote
  #2  
Old 07-21-2009, 04:56 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Normally when I debug a quest script to see what went wrong, I will just put a say message for each part of the script leading up to what I think is the problem area. Then, I just watch to see how far the say messages get and work on the part right after it stops sending the say messages. In the case of player.pl, you can't use the say messages, but you can use quest::ze() to do zone emotes for debugging your player.pl. I would recommend adding in zone emotes for each of your elsifs around your problem areas and see if it gets to that point. If it isn't making it that far even, maybe you need to try placing a few other zone emotes until you can find it. This technique actually works really well for script troubleshooting, since the script will run all of the way up to the breaking point.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 07-21-2009, 05:25 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

Using an IDE with code highlighting might help too, in case you're not. Could tell you if you're missing any brackets as well.
Reply With Quote
  #4  
Old 07-22-2009, 12:11 AM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

I don't think there's any question about just where it's failing. It performs every function up to (but not including) the following "elsif" section. Nothing in this section is working:
Code:
					elsif ($client->FindBuff(5257) || $client->FindBuff(3467) || $client->FindBuff(1447) || $client->FindBuff(3692) || $client->FindBuff(312)) 
						{
						$client->BuffFadeBySpellID(5257);
						$client->BuffFadeBySpellID(3467);
						$client->BuffFadeBySpellID(1447);
						$client->BuffFadeBySpellID(3692);
						$client->BuffFadeBySpellID(312);
						quest::setguild(0,1);		
						}
Anything apparently wrong with these quest objects?
Reply With Quote
  #5  
Old 07-22-2009, 12:41 AM
Capheus
Hill Giant
 
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
Default

I've never had much confidence in elsif statements, thats just me. I'll normally use if statements and/or contradicting if statements to make it work. Not sure how true this is, never tested it, but I found this on one of the quest wiki things.

Quote:
Also, when using elsif statements, you must end with an else statement. Not sure 100% why, but if you have a sequence of if and elsif statements and no else statement at the end, the quest will not function properly.
I also don't see where it checks for loss of the ring, where I see ("$client->BuffFadeBySpellID();"), or changing their guild membership to the designated guild ("quest::setguild(0,1);"). It isn't checking for anything but for buffs.

I could be wrong but I see this as:

Player zones in and it checks for item 13732
If player has item 13732 he/she gets aggro from a mob every 20 seconds until they leave the zone.
If they delete/lose item 13732 they still get aggro cause it only checks for the item when they zone in.
This timer repeats every 20 seconds

If player doesn't have item 13732 when they zone in
If checks for the global set by some other npc or script not listed here.
I'd use quest::setglobal("kingdomfaction", 1, 5, "F"); for this one (All zones, All NPC, This player only)
Depending on the value of the global it checks for factionlevel and player level
So to make it simple a player will get a different buff depending on the qglobal/faction>850/playerlevel
If the player's factionlevel is less than 850 it checks to see if they have the buff depending on qglobal setting
If the player has the buff it debuffs them and changes their guild only if the qglobal was set at 1
If the player doesn't have the buff it does nothing.
This timer repeats every one second
Reply With Quote
  #6  
Old 07-22-2009, 10:13 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Thanks Capheus, I'll try the final "elsif" as an "else" instead, just as soon as I can get my global watchers in place again (deleted in my recent code update).
Quote:
I also don't see where it checks for loss of the ring, where I see ("$client->BuffFadeBySpellID();"), or changing their guild membership to the designated guild ("quest::setguild(0,1);"). It isn't checking for anything but for buffs.
Technically correct. To clarify, the script is looking for a change in the global flag called "kingdomfaction," which I referred to colloquially (in the language of the story line) as a "loss of the ring." The "ring" is item 13732, which when turned in to the "king" of a different faction changes the faction that receives the kingdom buffs. The kingdom buffs are continuous (they automatically rebuff when the buff fades) so long as that player's faction retains the "kingdomfaction" flag. When a specific kingdom faction becomes the recipient of the "kingdom blessing" buffs, they are also automatically placed into the "ring bearer" guild.

Once that faction is displaced by another faction in the global flag, the first faction should be removed from the guild and placed in a different guild (that's one of the parts not currently working). Simultaneously, the script should fade the buff found on any player of the first faction (again, this is one of the parts not currently working). Instead, the buff stays until it fades due to expired buff duration.

Quote:
Player zones in and it checks for item 13732
If player has item 13732 he/she gets aggro from a mob every 20 seconds until they leave the zone.
If they delete/lose item 13732 they still get aggro cause it only checks for the item when they zone in.
This timer repeats every 20 seconds
Correct. When a player obtains the ring (item 13732)--either by taking it from the reigning king after defeating him in battle, or by finding it after it becomes "lost"--the script tells the Ringwraiths in each zone to pursue him upon entry into that zone as he attempts to get the ring into the hands of his King. He will get aggro as long as he is alive and retains the ring. If a Wraith finds him, he will kill him (wraiths are very high level). Upon his death, the Ringwraith script nukes the ring from his inventory and sets the new qglobal. Since the player no long has the ring when he zones to his bind point, the Ringwraiths stop pursuing him.
Quote:
If player doesn't have item 13732 when they zone in it checks for the global set by some other npc or script not listed here.
Correct; the global is set by another script--either by the Ringwraiths or by the king he turns the ring into.
Quote:
I'd use quest::setglobal("kingdomfaction", 1, 5, "F"); for this one (All zones, All NPC, This player only)
Currently the function is quest::setglobal("kingdomfaction", 1, 7, "F"); . I think I must have used this based on a global quest I saw in another example. What would be the outcome of using 7 here instead of 5?
Quote:
Depending on the value of the global it checks for factionlevel and player level
So to make it simple a player will get a different buff depending on the qglobal/faction>850/playerlevel
Correct. The more faction a player has toward the reigning kindgom, the greater the blessing.
Quote:
If the player's factionlevel is less than 850 it checks to see if they have the buff depending on qglobal setting
If the player has the buff it debuffs them and changes their guild only if the qglobal was set at 1
Correct in its current form. There are three other kingdomfaction global options without the corresponding quest::setguild function. They will eventually be added, but I am waiting till I can get the first one to work correctly. Currently, neither the debuff object nor the setguild function is working.
Quote:
If the player doesn't have the buff it does nothing.
This timer repeats every one second
Correct.
Reply With Quote
  #7  
Old 07-23-2009, 08:21 AM
Capheus
Hill Giant
 
Join Date: Apr 2008
Location: Milwaukee
Posts: 141
Default

Ok good that clarified a few things. And yes try to work out the if,elsif,else thing. If it were me I would just stick with if and get rid of the elsif and else statements. Now for the global.

With quest::setglobal("kingdomfaction", 1, 5, "F"); Its all zones, all npc and this player only

With quest::setglobal("kingdomfaction", 1, 7, "F"); Its all zones, all npc and all players

If you have several players each with this global, it could possibly confuse itself between players. Or another way of looking at it, it might not be able to tell which player should have what global setting, it is calling all the players the same person (if that remotely makes sense).

A global setting of 5 instead of 7 will give each person their own global setting/designation.
Reply With Quote
  #8  
Old 07-26-2009, 07:53 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Okay, after hours of testing I found the problem. In the original, the final "elsif" looked like this:
Code:
elsif ($client->FindBuff(5257) || $client->FindBuff(3467) || $client->FindBuff(1447) || $client->FindBuff(3692) || $client->FindBuff(312)) 
	{
	$client->BuffFadeBySpellID(5257);
	$client->BuffFadeBySpellID(3467);
	$client->BuffFadeBySpellID(1447);
	$client->BuffFadeBySpellID(3692);
	$client->BuffFadeBySpellID(312);
	quest::setguild(0,1);		
	}
It needs to look like this instead:
Code:
elsif ($client->FindBuff(5257 || 3467 || 1447 || 3692 || 312))
	{
	$client->BuffFadeBySpellID(5257);
	$client->BuffFadeBySpellID(3467);
	$client->BuffFadeBySpellID(1447);
	$client->BuffFadeBySpellID(3692);
	$client->BuffFadeBySpellID(312);
	quest::setguild(0,1);
	}
Reply With Quote
  #9  
Old 07-26-2009, 08:09 PM
neiv2
Hill Giant
 
Join Date: Mar 2009
Location: CO
Posts: 183
Default

Scratch that last post--the original was right after all. It's just that the condition (if ($qglobals{kingdomfaction} == 1)) had not been met when I was testing it. Once I met the condition, and tested it with a character whose faction level was below acceptable, it worked like a charm.
Reply With Quote
Reply


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:34 AM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3