View Single Post
  #18  
Old 08-31-2009, 11:29 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

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.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote