Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 08-27-2009, 03:07 PM
bergalas
Banned
 
Join Date: Aug 2009
Location: look behind you
Posts: 30
Default Guild Hall instance quest

I have no idea if this will work or not i have not tested it as of yet, if anyone sees problems or what not please feel free to post fixes, I am not that great with perl. Anyway without further adeu here is the script basicly an npc translocation type deal

Code:
sub EVENT_SAY {
if ($text =~/Hail/i && $uguild_id > 0){
quest::say ("Good day to you, $name. Are you [ready] to enter your guild hall?"); }
if ($text =~/ready/i){
quest::say ("Excellent");
$inst1 = quest::GetInstanceID("guildhall", $uguild_id);
if( $inst1 < 1){
quest::CreateInstance("guildhall", $uguild_id, -1);
}
$inst2 = quest::GetInstanceID("guildhall", $uguild_id)
quest::AssignToInstance($inst2)
quest::MovePCInstance(345, $inst2, 0, 0, 0);
}
}
Reply With Quote
  #2  
Old 08-28-2009, 10:15 PM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Default

Doesn't really work, something to do with the way instances are created IDK.

Code:
sub EVENT_SAY 
{
	if (($text =~/Guild/i) && ($uguild_id > 0))
	{
		quest::say("Just a moment...");
		$instGuild = quest::GetInstanceID("guildhall", $uguild_id);
		if($instGuild < 1)
		{
			quest::say("creating instance and sending you");
			$instGuild = quest::CreateInstance("guildhall", $uguild_id, -1);
			quest::AssignToInstance($instGuild);
			quest::MovePCInstance(345, $instGuild, 0, 0, 0);			
		}
		else
		{
			quest::say("sending to existing instance");
			quest::AssignToInstance($instGuild);
			quest::MovePCInstance(345, $instGuild, 0, 0, 0);
		}
	}
		
}
Redid it a little, it only allows the first player to get in. After that I don't know why but it ignores the check to see if the instance already exists and creates a second one anyways. Really frustrating....
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
Reply With Quote
  #3  
Old 08-30-2009, 07:23 AM
chroniclesofnorrath
Banned
 
Join Date: Aug 2009
Location: infront of my monitor typin way
Posts: 8
Default

I messed around with this script for a little while this evening and came up with a version, that I think will work, seems to atleast.

Give this a try:

Code:
sub EVENT_SAY 
{
	if (($text =~/Guild/i) && ($uguild_id > 0))
	{
		quest::say("Just a moment...");
		quest::say(quest::GetInstanceID("guildhall", $uguild_id));
		if($uguild_id > 0)
		{
			$instid = quest::GetInstanceID("guildhall", $uguild_id);
            if($instid > 0){  
	        quest::say("sending to existing instance");
			quest::AssignToInstance($instid);
			quest::MovePCInstance(345, $instid, 0, 0, 0);
		}			
            elsif($instid < 1){
	        quest::say("sending to New instance");
	        quest::CreateInstance("guildhall", $uguild_id, 300);
	        $instid1 = quest::GetInstanceID("guildhall", $uguild_id);
	        quest::AssignToInstance($instid1);
			quest::MovePCInstance(345, $instid1, 0, 0, 0); 
        	}
		}
		if($uguild_id < 1)
		{
			quest::say("I am sorry but you are not part of a guild");
		}
	}
		
}
Hope this helps. It should be noted that in testing I found that the instances were empty meaning each will have to be spawned manually for each guild. Perhaps one of the developers will come up with a way to spawn the instances from the main spawn table without having them "Versioned" like they are now?

EDIT: I think I may have left some code in there that doesnt need to be, blah it's getting late
Reply With Quote
  #4  
Old 08-30-2009, 02:22 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

That's pretty sweet. With some custom zones and some more code, I think we could get player housing going.
Reply With Quote
  #5  
Old 08-30-2009, 10:23 PM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Default

Quote:
Originally Posted by chroniclesofnorrath View Post
I messed around with this script for a little while this evening and came up with a version, that I think will work, seems to atleast.

Hope this helps. It should be noted that in testing I found that the instances were empty meaning each will have to be spawned manually for each guild. Perhaps one of the developers will come up with a way to spawn the instances from the main spawn table without having them "Versioned" like they are now?

EDIT: I think I may have left some code in there that doesnt need to be, blah it's getting late
Nope still has the same issues as mine, still trys a new instance.
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
Reply With Quote
  #6  
Old 08-30-2009, 10:35 PM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Default

Sorry to double post but I ran out of time to edit. To me it seems that logically my revision of bergalas' code should work fine but perhaps we are not understanding the way these functions or the instances themselves are supposed to work. If any of the developers could elaborate on this it would be greatly appreciated.
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
Reply With Quote
  #7  
Old 08-30-2009, 11:55 PM
chroniclesofnorrath
Banned
 
Join Date: Aug 2009
Location: infront of my monitor typin way
Posts: 8
Default

I dunno bh I got it leting two players of the same guild into the same instance, it seems to be a bit of a headache. I saw other instancing infomation posted about using the insttype field in the zone table, but that had 0 effect. Was there another instancing system in place at one time? If so can both be enabled at once or is it an either or kind of situation?

What appears to be occuring here is that its not seeing the guild id or something to that effect atleast in the version bit for the zone. Ontop of that it would seem kind of a pain to have to go through and respawn each version of an instance especially for one like the gh? Can we work on a way to have them spawn based on the normal DB Spawns?
Reply With Quote
  #8  
Old 08-30-2009, 11:58 PM
realityincarnate
Developer
 
Join Date: Dec 2007
Posts: 122
Default

I haven't done a lot of work with instances, but I can see two issues with the way these scripts are working that are stopping them from giving the desired result.

1.) When you call quest::GetInstanceID, it looks for an instance that matches the zonename, version, and character id of the client. This is why it's making a new instance every time: the instance gets created when the first character uses the script, but since that instance isn't assigned to the second character, quest::GetInstanceID doesn't find it and a new one gets created.

2.) It looks like there's a bit of confusion between instance id and version. Versions are designed for use with things like LDoN level variations and monster missions, where the same zone is populated in multiple different ways. What you want to do is create a new instance of the same version of the zone for each guild, not different versions.

Whenever you call quest::CreateInstance, it returns the instance id of the newly created instance. My recommendation would be to track each new id and the guild it was created for through variables in perl. Then, when a player activates the quest, check to see if an id matches his guild. If it does, add the player to that instance id. If it doesn't, create a new one and add that id and guild to the list.
Reply With Quote
  #9  
Old 08-31-2009, 12:04 AM
chroniclesofnorrath
Banned
 
Join Date: Aug 2009
Location: infront of my monitor typin way
Posts: 8
Default

That seems a bit beyond my skill level and very complicated for something as simple as an instance based on what guild your in. Could you show how to track them? thus far i have yet to see any kind of loggin or so forth for it. I Was going to do db checks for the instances but i dont grasp how it stores the instance information serverside, or how to check it as you described.
Reply With Quote
  #10  
Old 08-31-2009, 12:07 AM
chroniclesofnorrath
Banned
 
Join Date: Aug 2009
Location: infront of my monitor typin way
Posts: 8
Default

I dont suppose there is a way, to assign the id of the instance when created?
Reply With Quote
  #11  
Old 08-31-2009, 12:15 AM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Default

Quote:
Originally Posted by realityincarnate View Post
I haven't done a lot of work with instances, but I can see two issues with the way these scripts are working that are stopping them from giving the desired result.

1.) When you call quest::GetInstanceID, it looks for an instance that matches the zonename, version, and character id of the client. This is why it's making a new instance every time: the instance gets created when the first character uses the script, but since that instance isn't assigned to the second character, quest::GetInstanceID doesn't find it and a new one gets created.

2.) It looks like there's a bit of confusion between instance id and version. Versions are designed for use with things like LDoN level variations and monster missions, where the same zone is populated in multiple different ways. What you want to do is create a new instance of the same version of the zone for each guild, not different versions.

Whenever you call quest::CreateInstance, it returns the instance id of the newly created instance. My recommendation would be to track each new id and the guild it was created for through variables in perl. Then, when a player activates the quest, check to see if an id matches his guild. If it does, add the player to that instance id. If it doesn't, create a new one and add that id and guild to the list.
Ok so basically a qglobal with the guilds id as it's name and it's instance id be the way to go?
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
Reply With Quote
  #12  
Old 08-31-2009, 12:19 AM
chroniclesofnorrath
Banned
 
Join Date: Aug 2009
Location: infront of my monitor typin way
Posts: 8
Default

I was just looking at that in the quest tutorial, seems questglobals are character based, not sure if that would work
Reply With Quote
  #13  
Old 08-31-2009, 03:07 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

qglobals are not necessarily character based. They are pretty generic so you can do much with them. In this case you would simply check when a character clicks the door to the guild hall if an instance exists for their guild. If not, create an instance then populate a qglobal with the zone instanceID in a variable with the guild name as the var name and off you go.

NOTE: You might have to mess with the guild name if the guild name has special characters in it like '. SQL will let you put most stuff in but sometimes you might have to escape it.

I haven't tried this but it shouldn't be too tough.
Reply With Quote
  #14  
Old 08-31-2009, 06:00 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Here is a working script for doing this.

Code:
sub EVENT_SAY {

	if ($text =~/hail/i) 
	{
		quest::say("Let me see...");
		if($uguild_id > 0)
		{
			if (defined($qglobals{"GuildInstance_$uguild_id"}))
			{
				my $QGlobalValue = $qglobals{"GuildInstance_$uguild_id"};
				quest::AssignToInstance($qglobals{"GuildInstance_$uguild_id"});
				quest::MovePCInstance(345, $QGlobalValue, 0, 0, 0);
				quest::say("Moving you to the instance now");
			}
			else
			{
				quest::say("No instance existed, so creating one");
				my $instanceID = quest::CreateInstance("guildhall", 0, -1);
				quest::AssignToInstance($instanceID); 
				quest::setglobal("GuildInstance_$uguild_id",$instanceID,7,"M60");
				quest::MovePCInstance(345, $instanceID, 0, 0, 0);
				quest::say("Moving you to the instance now");
			}
		}
		else
		{
			quest::say("I am sorry but you are not part of a guild");
		}
	}

		
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #15  
Old 08-31-2009, 10:01 PM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Thumbs up

Was about to do it myself but you beat me to the punch, Thank you Trevius
__________________
How about the power to kill a yak from 200 yards away...WITH MIND BULLETS! thats telekinesis kyle.
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:03 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