Go Back   EQEmulator Home > EQEmulator Forums > Support > Support::Linux Servers

Support::Linux Servers Support forum for Linux EQEMu users.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-12-2010, 04:46 PM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default Guide to creating instanced zones?

Where can I find some kind of a guide for creating / working with zone instances? I can't seem to find anything about that :(

Thanks
Reply With Quote
  #2  
Old 11-14-2010, 12:46 AM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default

Found out basic instancing techniques.. here's how I'm doing it:
Code:
my $instanceID = quest::CreateInstance("freportn", $charid, 6400);
quest::AssignToInstance($instanceID);
quest::MovePCInstance(8, $instanceID, 277, -162, 18);
However it seems that the zone that my character enters has no NPCs spawned and any buffs I cast only last 3 minutes.. seems buggy.. not sure what's going on ;\
Reply With Quote
  #3  
Old 11-14-2010, 01:38 AM
songie
Sarnak
 
Join Date: Dec 2009
Posts: 43
Default

This is more or less what we use on EQ-Heroes for our instancing, i deleted some parts that use custom code that you can't use but it should show a bit how they work, it should also just work fine but havent tested it in this format. It also uses a credit system, feel free to to use it, i know i had to look around for it and reverse engineer some scripts to get one to work a while ago GL

Code:
# Instance NPC

sub EVENT_SPAWN
{
	### DATA ###
	$NPCName 		= $npc->GetCleanName();
	############
}

sub EVENT_SAY
{
	my $answer1 = quest::saylink("Create your instance", 1); #Multiple Choice Answer 1 go in here
	my $answer3 = quest::saylink("Purchase more instance credits", 1); #Multiple Choice Answer 3 go in here
	my $answer6 = quest::saylink("Destroy my previous instance", 1);
	
	### Instances ###
	my @SoloZonelist = 
				(
					"Befallen", 
					"Crushbone",
					"Runnyeye Citadel", 
					"Najena", 
					"Upperguk", 
					"Estate of Unrest", 
					"Solusek A", 
					"Solusek B", 
					"The Hole", 
					"Castle Mistmoore",
					"Permafrost Caverns",
					"Cazic Thule"
				);
	
	if ($text =~/hail/i)
	{
		if (defined($globals{"Instance_CR"}) && $globals{"Instance_CR"} == 0)	
		{	
			if(!defined($qglobals{"Daily_Credit"}))
			{
				quest::setglobal("Instance_CR","3","5","F");	
				quest::setglobal("Daily_Credit","1","5","H24");
			}
		}
	
		if (!defined($qglobals{"Instance_CR"}))	{	quest::setglobal("Instance_CR","30","5", "F");	}
		my $Instance_cr = $qglobals{"Instance_CR"};		#Player total instance Credit
		$client->Message(7, "-----------");
		$client->Message(14,"$NPCName says: Hi there friend, You wish to construct another instance for training purposes? I can help! Let me see...");
		$client->Message(15,"--Choices--");
		$client->Message(14,"$name says: $answer1 ");
		$client->Message(14,"$name says: $answer3 ");
		$client->Message(7, "-----------");
		$client->Message(14,"$name says: $answer6 ");
		$client->Message(14,"Info: You have currently have $Instance_cr Credits, please note that you recieve 3 instance credits daily for free if you happen to have 0 credit!.");
		$client->Message(7, "-----------");
	}
	
	if ($text =~/\bdestroy my previous instance\b/i) #is used to destroy a solo or group instance
	{
		quest::delglobal("Instance_Number");
		my $QGlobalValue = undef;
		my $instanceID = undef;
		$client->Message(14,"Done!");
	}
	
	elsif($text=~/\bCreate your instance\b/i)	
	{
		my $count = 1;
		my $n = 0;

		while ($SoloZonelist[$n])
		{
			if ($SoloZonelist[$n])
			{
				my $ZoneName = quest::saylink($SoloZonelist[$n]);
				$client->Message(315, "$NPCName says: Go to $ZoneName");
			}
			$n++;
			$count++;
		}
	}
	
	elsif($text=~/\bPurchase more instance credits\b/i)	
	{
		$client->Message(14,"For 100pp i will give you 10 Instance Credits.");
	}
	
	elsif ($text=~/\bBefallen\b/i)				{	@Data = undef;	@Data = ("befallen", 36, 35.22, -75.27, 2.19);		GoToInstance();	}
	elsif ($text=~/\bCrushbone\b/i)				{	@Data = undef;	@Data = ("crushbone", 58, 158, -644, 4);			GoToInstance();	}
	elsif ($text=~/\bRunnyeye Citadel\b/i)		{	@Data = undef;	@Data = ("runnyeye", 11, -21.85, -108.88, 3.75);	GoToInstance();	}
	elsif ($text=~/\bNajena\b/i)				{	@Data = undef;	@Data = ("najena", 44, -22.6, 229.1, -41.8);		GoToInstance();	}
	elsif ($text=~/\bUpperguk\b/i)				{	@Data = undef;	@Data = ("guktop", 65, 7, -36, 4);					GoToInstance();	}
	elsif ($text=~/\bEstate of Unrest\b/i)		{	@Data = undef;	@Data = ("unrest", 63, 52, -38, 3.75);				GoToInstance();	}
	elsif ($text=~/\bSolusek A\b/i)				{	@Data = undef;	@Data = ("soldunga", 31, -485.77, -476.04, 73.72);	GoToInstance();	}
	elsif ($text=~/\bSolusek B\b/i)				{	@Data = undef;	@Data = ("soldungb", 32, -262.7, -423.99, -108.22);	GoToInstance();	}
	elsif ($text=~/\bThe Hole\b/i)				{	@Data = undef;	@Data = ("hole", 39, -1049.98, 640.04, -77.22);		GoToInstance();	}
	elsif ($text=~/\bCastle Mistmoore\b/i)		{	@Data = undef;	@Data = ("mistmoore", 59, 123, -295, -177);			GoToInstance();	}
	elsif ($text=~/\bPermafrost Caverns\b/i)	{	@Data = undef;	@Data = ("permafrost", 73, 0, 0, 3.75);				GoToInstance();	}
	elsif ($text=~/\bCazic Thule\b/i)			{	@Data = undef;	@Data = ("cazicthule", 48, -80, 80, 5.5);			GoToInstance();	}
}

sub GoToInstance
{
	my $limit = $qglobals{"Instance_CR"};

	if ($limit)
	{
		if ($limit > 0)
		{
			if (defined($qglobals{"Instance_Number"}))
			{
				quest::say("Instance found now moving you to the instance!");
				my $instanceID = $qglobals{"Instance_Number"};
				quest::AssignToInstance($instanceID);
				quest::MovePCInstance($Data[1], $instanceID, $Data[2],$Data[3],$Data[4]);
			}
			else
			{
				$client->Message(14,"No instance existed, so creating one");
				quest::setglobal("Instance_CR", $qglobals{"Instance_CR"}-1, 5,"F");
				my $instanceID = quest::CreateInstance($Data[0], 0, -1);
				quest::setglobal("Instance_Number",$instanceID,5,"H20");
				quest::AssignToInstance($instanceID);
				quest::MovePCInstance($Data[1], $instanceID, $Data[2],$Data[3],$Data[4]);
			}
		}
		else
		{
			$client->Message(14, "You have no more credit in your account!");
		}	
	}
}

sub EVENT_ITEM
{
	if($platinum == 100)
	{
		my $Instance_cr = $qglobals{"Instance_CR"};
		quest::setglobal("Instance_CR", $qglobals{"Instance_CR"}+10, 5, "F");
		$client->Message(14,"$NPCName says: 10 instance credits have been added to your account.");
		$client->Message(14,"Info: You have currently have $Instance_cr Credits.");
		quest::write("$NPCName.txt","Playername: $name , has payed 100pp for 10 Credits");	}
	}
}
__________________
--You start casting "Extra Content"--
--You Hit your database for 9.999 Damage, you have slain your Server--
--Please wait reinstalling!--/Sigh
Reply With Quote
  #4  
Old 11-14-2010, 11:01 AM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default

Cool. Thank you

I still can't seem to find out why my instance has no NPCs and buffs that last only 3 minutes .. perhaps I need to find some kind of a database update...
Reply With Quote
  #5  
Old 11-14-2010, 12:23 PM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default

..... Went and got pretty much every database update and now I can't login to my server anymore =\\\ ....

starting from scratch again ..... =\

Still would like to get this instance bug resolved (without my attempts that cause my server to crash) =\
Reply With Quote
  #6  
Old 11-14-2010, 02:56 PM
Templus
Sarnak
 
Join Date: Oct 2010
Location: NYC
Posts: 39
Default

Ok I see now.. I fixed the issue with there being no spawns.. (basically I figured out what that variable meant in createzone)

here's the new code:
Code:
my $instanceID = quest::CreateInstance("freportn", 0, 6400);
quest::AssignToInstance($instanceID);
quest::MovePCInstance(8, $instanceID, 277, -162, 18);
I'm still however having problems with buffs that I cast only lasting 3 minutes ...
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 12:53 PM.


 

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