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 { |
Doesn't really work, something to do with the way instances are created IDK.
Code:
sub EVENT_SAY |
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 EDIT: I think I may have left some code in there that doesnt need to be, blah it's getting late |
That's pretty sweet. With some custom zones and some more code, I think we could get player housing going.
|
Quote:
|
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.
|
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? |
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. |
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.
|
I dont suppose there is a way, to assign the id of the instance when created?
|
Quote:
|
I was just looking at that in the quest tutorial, seems questglobals are character based, not sure if that would work
|
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. |
Here is a working script for doing this.
Code:
sub EVENT_SAY { |
Was about to do it myself but you beat me to the punch, Thank you Trevius
|
Well there again I went speaking before confirming, using globals does appear to work with this, it seems it's ignoring the fact that the global exists cause it's still creating new instances.
|
Make sure that the npc you're using the script with has qglobals enabled in the database (set qglobal to 1 in the npc_types table).
|
Also keep in mind that the script I posted is a complete script for making the guild hall function exactly the way that it should. It is just an example of how to handle creating guild instances in the first place. It would definitely require more work to make it function perfectly in all scenarios. For example; with that script, if you do a server restart, the global will still exist, but the instance will not as far as I know. So, you would need a way to remove the qglobal when the server is restarted or when no one is in the zone anymore.
It wouldn't be too hard to achieve that by using the player.pl to count all players in the zone when they zone out (EVENT_ZONE) and if none are left, have it delete the qglobal. Then, you would just need to also have a way to delete the qglobal after a server restart. You could do that by having a static zone on your server and having one of the spawns in there delete the qglobal in an EVENT_SPAWN. Or, you could just use durations on the qglobals or something like that. I think probably the easier way would be to add a couple more quest commands for instances such as: quest::AssignGuildToInstance(instanceid) Assigns a guild to an instance. quest::IsInstance("zonename", instanceid) Boolean to check if a certain instance exists for a certain zone. Also, it might not be bad to have an array list of all instances for any particular zone. Even better, might be just to have a way to create instanceIDs as whatever number you want. Then, you could just assign your guild to instanceID of $uguild_id, and then use quest::IsInstance to check if it exists before sending them there or creating a new one. |
On this script as soon as you hail him he transferes you. I added a little bit to the top just so that it wouldnt instantly transfer if you accidentally hail him/her.
Code:
sub EVENT_SAY { |
This will make the doors in the Guild Lobby and Guild Hall functional. The global and instance are set for 18 hours.
\quests\guildlobby\player.pl Code:
sub EVENT_CLICKDOOR { Code:
sub EVENT_CLICKDOOR { |
While were talking about Guild Hall Instances and Guild Lobby zone doors,how about the recruitment boards and the non-fading buffs in guildlobby. I haven't been there in awhile but last time I went it seemed that when you clicked on one of the recruitment boards it would LD you. And Buffs wore off,in Live they actually have the same time the whole time you are in the zone. If you enter with 2 minutes and 5 seconds on a buff,the timer will not start decreasing until after you leave zone. And Ive seen people get the old message boards working on Original EQ projects,so I imagine it won't be to bad to get the recruitment boards workin. Anyone know if these things are still broken? If not I'll shut up lol.
|
Quote:
|
non-fading buffs is probably easiest done with a source modification when it does tic update event, have a condition to check for the zone and don't decrease timers if the zone matches. There are some spells that were excempt from this status though, would likely need a list of those.
I know, so helpful, I was going to look but busy with some other stuff. :) |
Removing Tic calculation based on the zone ID under a table would be definitely cool, especially for those who'd like them in their own hub zones.
|
All times are GMT -4. The time now is 07:23 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.