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 02-22-2015, 11:17 AM
Nibiuno
Hill Giant
 
Join Date: Mar 2010
Posts: 101
Default Checking if a zone is an instance

How can I check if a zone is an instance version or not?

I did a check on quest::GetInstanceID in player.pl when a player enters the zone, but it doesnt work for 100% of cases. This works if the instance returned is greater than 0, but, the issue with that is if a player had an instance and left it, then enters the regular version of that zone before the instance expires, that check reports the instance number of the instance they left.

Is there an easy way to detect if a zone is an instance? I need to signal NPCs if it is, and dont want to if its the regular zone.
Reply With Quote
  #2  
Old 02-22-2015, 12:15 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Destroy the instance when they leave the instanced zone. Or is that not an option?

You may need to also utilize a means (qglobal, etc.) of tracking HOW they entered the zone in combination with the other tools (GetInstanceID), and/or the pre-parsed variables $instanceid / $instanceversion.
Reply With Quote
  #3  
Old 02-22-2015, 12:22 PM
Nibiuno
Hill Giant
 
Join Date: Mar 2010
Posts: 101
Default

Im not sure how to destroy the instance when they leave it, and differentiate between if they evacuated or got resurrected, or Id do that.

I guess I could set a quest global when the instance npc sends them to the instance thats destroyed when they enter, so its a one time flag to fire the script.

edit: Thank you for the idea - that worked.
Reply With Quote
  #4  
Old 03-08-2015, 08:24 PM
Asylum
Sarnak
 
Join Date: Jun 2013
Posts: 81
Default

Here is an instance generator/destroyer npc I use in gfaydark to generate level-appropriate instances of crushbone.

Code:
sub EVENT_SAY {
	my $EnterInst = quest::saylink("Enter the Instance", 2);
	my $Destroy = quest::saylink("destroy", 2);
    my $worse = quest::saylink("worse", 2);
	my $evil = quest::saylink("evil", 2);
	my $InstId = quest::GetInstanceID("crushbone", $version);

	if($text=~/hail/i){
		quest::say("Thank Tunare you're here, $name!  Something dreadful is taking place inside Crushbone.  Yes, yes, I realize that the whole place is dreadful to begin with.  But it's much [$worse] now.");
	}
	if($text=~/worse/i){
		quest::say("Some new evil has moved in and set up shop, destroying everything inside.  Where the Crushbone Orcs were destructive and chaotic, this new [$evil] is much more of a threat to all of Tunare's creatures.");
	}
	if($text=~/evil/i){
		quest::say("If you are willing to assist us, I will need to ensure your safe passage.  Just say when you are ready and I can open a portal enabling you to [$EnterInst].  Also, if you are done fighting, or wish to start over, I can [$Destroy] any old instances that may be lingering.");
	}
	if ($text =~/Enter the Instance/i) {
		my $j;
		for($j=2; $j<=4; $j++) {
			my $version = $j;
			my $InstId = quest::GetInstanceID("crushbone", $version);
			if ($InstId > 0) {
				quest::MovePCInstance(58, $InstId, 166, -586, 3.13);
			}
			elsif ((quest::GetInstanceID("crushbone", $ulevel + 1)) > 0) {
				quest::MovePCInstance(58, quest::GetInstanceID("crushbone", $ulevel + 1), 166, -586, 3.13);
			}
			elsif ((quest::GetInstanceID("crushbone", $ulevel - 1)) > 0) {
				quest::MovePCInstance(58, quest::GetInstanceID("crushbone", $ulevel - 1), 166, -586, 3.13);
			}
			elsif (($ulevel >= (($version * 10) - 9)) && ($ulevel <= ($version * 10))) {
				my $i_id = quest::CreateInstance("crushbone", $version, 21600);
				quest::AssignGroupToInstance($i_id);
				quest::AssignToInstance($i_id);
				quest::MovePCInstance(58, $i_id, 166, -586, 3.13);
			}
		}
	}
	if($text=~/destroy/i){
		my $i;
		for($i=0; $i<=6; $i++) {
			quest::DestroyInstance(quest::GetInstanceID("crushbone", $i));
		}
	}
	if ($text =~/Daria sent me/i) {
		my $InstId = quest::GetInstanceID("crushbone", $version);
		if ($InstId > 0) {
			quest::MovePCInstance(58, $InstId, 166, -586, 3.13);
		}
		elsif ($ulevel >= 50 && (plugin::check_hasitemoncursor($client, 4621))) {
			my $i_id = quest::CreateInstance("crushbone", 6, 21600);
			quest::AssignGroupToInstance($i_id);
			quest::AssignToInstance($i_id);
			quest::MovePCInstance(58, $i_id, 166, -586, 3.13);
		}
	}
}
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 02:05 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