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 12-07-2013, 10:29 PM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default Instancing Woes

Hey guys.

I'm trying to make an NPC teleport you to a guild instanced South Qeynos (Version 1). I seem to be having an issue where when you click yes to the popup it teleports you to Qeynos, but when you're done zoning you're right back where you started and you have no instances under #instance list.

I've never done anything like this, so if anyone could tell me where I'm going wrong that would be appreciated!

Code:
sub EVENT_SAY {
    if($text =~/hail/i) {
	    if($ulevel < 50) {
    quest::say("Are you lost? I wouldn’t recommend going to the South part of town.");
    }
        elsif($ulevel => 50) {
    quest::say("You have grown quite popular around here for your adventures, $name. Perhaps now you'd like to hear a story?");
    }
 }
    if($text =~/story/i) {
	    if($ulevel => 50) { 
	quest::say("I spoke of the Revolution before.. Perhaps I should tell you everything.. Up until a short time ago Qeynos was ruled by King Midon. At first the people adored him and all of his decisions were for the good of the city. As he grew older something changed within him. All the power and riches he collected started to become an obsession. He started to rule the people through fear and violence. He imposed a tax that was impossible for much of the townsfolk to pay.. when you didn't pay his militia would beat you in the streets like a dog.");
	quest::emote("pauses for a short moment.");
    quest::settimer("pausetext",5);
	}
}
  if(($text =~/flashback/i) && ($ulevel >= 50)) {  
   quest::stoptimer("pausetext"); 
   quest::popup("Flashback", "$Logo
				<c \"#00FFFF\"> The old worker is going through a flashback of the Rebellion.. Would you like to join him? </c>", 50, 1);
  }
#########################################
###From this point down is for <50 text##
#########################################
    if($text =~/South/i) {
	    if($ulevel < 50) {
	quest::emote("groans.");
	quest::say("How do you not know? Can’t you smell it in the air? It’s been months since the Revolution, but it’ll take the rest of the year to clean all the blood off the streets. ");
    }
 }
    if($text =~/Revolution/i) {
	    if($ulevel < 50) {
	quest::say("You’re not the brightest torch out there, are ya kid... I’ll try and simplify this for you. The [Township] was a colony populated by only those with the skilled hands or muscle to build it. We citizens were forgiven of all wrong doings we committed, or were convicted, when we signed on to take the voyage here. It shouldn’t have come as a surprise to the old world that someday we’d claim this land as our own, and forcibly take our independence. ");
    }
 }
    if($text =~/Township/i) {
	    if($ulevel < 50) {
	quest::say("That’s the name we kept to call ourselves. Although we’re composed of artisans and laborers here, we have recently seen some Township citizens become adventurers. This would never have been possible without our skilled craftsman creating charms that allowed humble citizens to better focus on this foreign way of life…Now you’ve wasted enough of my time; I have to get back to work, so just take this last piece of advice.");
    }
 }
    if($text =~/Advice/i) {
	    if($ulevel < 50) {
	quest::say("We learned the hard way that things have trouble staying dead in this world. If it wasn’t for the sewers we had built, we’d still be over-run with the bodies of those that fell in the Revolution. You might find some useful equipment for your adventures down there, although I’d avoid it until you get your bearings here, or make a few friends.");
    }
 }
}

sub EVENT_SPAWN	{ 
  quest::set_proximity($x - 15,$x + 10,$y - 10,$y + 10,$z - 10,$z + 10);
}
	
sub EVENT_ENTER {
    if($ulevel < 50) {  
	  $client->Message(0,"An Old Worker says 'Are you lost? I wouldn’t recommend going to the South part of town.'");
    }
	elsif($ulevel => 50) {
	  $client->Message(0,"An Old Worker says 'You have earned my respect, $name. I've heard stories of your travels from the townsfolk. Please... come and speak with me.'");
	}	
}

sub EVENT_TIMER {  
  if($timer == "pausetext") {
     quest::emote("appears to be having a [flashback]");
     quest::stoptimer("pausetext");
  }
}

sub EVENT_POPUPRESPONSE {
if($uguild_id > 0) {
	if(($popupid == 50) && (defined($qglobals{"GuildInstance_$uguild_id"}))) {
				my $QGlobalValue = $qglobals{"GuildInstance_$uguild_id"};
				quest::AssignToInstance($qglobals{"GuildInstance_$uguild_id"});
				quest::MovePCInstance(1, $QGlobalValue, 0, 0, 0);
	}
	else {
				my $instanceID = quest::CreateInstance("qeynos", 1, -1);
				quest::AssignToInstance($instanceID); 
				quest::setglobal("GuildInstance_$uguild_id",$instanceID,7,"M60");
				quest::MovePCInstance(1, $instanceID, 0, 0, 0);
		}
    }	
}
Reply With Quote
  #2  
Old 12-07-2013, 10:36 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

This should help:

http://www.eqemulator.org/forums/showthread.php?t=32609
Reply With Quote
  #3  
Old 12-07-2013, 10:43 PM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Thanks for that Akka.. I've been googling "eqemu instancing" and that didn't come up. I guess I should've used the actual forum search.
Reply With Quote
  #4  
Old 12-07-2013, 10:59 PM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

This is what I have now and it seems to actually teleport me, but then once again I spawn right back on top of the NPC with no instance attached.

Code:
sub EVENT_POPUPRESPONSE {
if($uguild_id > 0) {
	if(($popupid == 50) && (defined($qglobals{"$uguild_id$space$instguild$space$zonesn"}))) {
	                my $guildinstanceglobal = "$uguild_id$space$instguild$space$zonesn";
               		my $instid = $qglobals->{$guildinstanceglobal};
					quest::AssignToInstance($instid);
					quest::MovePCInstance(qeynos, $instid, 0, 0, 0);
	}
	else {
				plugin::SendToInstance("guild", "qeynos", 1, 0, 0, 0, "guild", 604800);
		}
    }	
}
Reply With Quote
  #5  
Old 12-07-2013, 11:02 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Make sure you have qglobals enabled on the NPC.

Also you shouldn't need to use all of that other code. The plugin handles the instance tracking, if the instance doesn't exists it creates it. If there is already an instance based on the criterion it should direct you back to the appropriate one.
Reply With Quote
  #6  
Old 12-07-2013, 11:14 PM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

The NPC I'm applying this code to is in qeynos2 NOT qeynos. Would that be why this isn't working?

I created an NPC right next to him with the below and he works perfectly.

Code:
sub EVENT_SAY {
    if($text =~/hail/i) {
      plugin::SendToInstance("guild", "$zonesn", 0, 0, 0, 0, guild, 259200);
    }
}
Reply With Quote
  #7  
Old 12-07-2013, 11:26 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Did you read the thread I posted? The 2nd argument is the destination zone short name.

Code:
sub EVENT_SAY{
	if($text=~/test/i){
		plugin::SendToInstance("guild", "qeynos", 1, 0, 0, 0, "QeynosGuildInst", 604800);
	}
}

Last edited by Akkadius; 12-07-2013 at 11:34 PM..
Reply With Quote
  #8  
Old 12-08-2013, 01:09 AM
Township EQ
Hill Giant
 
Join Date: Sep 2013
Posts: 118
Default

Yes, I did read your post.. It confused me because when I did it with $zonesn it worked for some reason, and when I was trying to make it go to qeynos from qeynos2 it wasn't. It seems that changing the identifier from "guild" to "QeynosGuildInst" is what's fixed it. Sorry if I annoyed you or anything.
Reply With Quote
  #9  
Old 12-24-2013, 05:11 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by Township EQ View Post
Yes, I did read your post.. It confused me because when I did it with $zonesn it worked for some reason, and when I was trying to make it go to qeynos from qeynos2 it wasn't. It seems that changing the identifier from "guild" to "QeynosGuildInst" is what's fixed it. Sorry if I annoyed you or anything.
No you're fine.
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 11:51 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