Log in

View Full Version : Incorrect Spawns in Instance


Randymarsh9
09-04-2012, 04:38 PM
I have a quest where I am using different versions of the arena. It let's you fight in different tiers of the arena, and each tier has its own version. Now, the quest seems to be working properly, as in, I can do #instance list Pelican and it will tell me that I am in the correct instance; however, the monsters that spawn are wrong.

There is a general monster called "The_Audience" with 9 versions of itself so nine different IDs. Each ID is set to spawn in each version. Like 1257 spawns in V1, 1258 spawns in V2, etc.. I have confirmed that they're correct in the database in spawns2 also.

What is happening though, is I will do a fight in version 1 of the zone and it will work fine. When I leave the arena, it is supposed to destroy the instance with
sub EVENT_ZONE{
quest::DestroyInstance($qglobals{"InstID"});
quest::delglobal("InstID");
}
and the global being set at
elsif(defined($qglobals{gladiator})){
if ($qglobals{levelonekills} >=0){
my $i_id = quest::CreateInstance("arena", 1, 600);
quest::AssignToInstance($i_id);
quest::MovePCInstance(77, $i_id, -41, 131, -0.5);
quest::setglobal("InstID", $i_id, 5, "F");
$Group->DisbandGroup();
}
When I do #instance list Pelican, it says I am not assigned to any instances. If I go into a different version the arena though, the Audience monster from version one is still there. Instead of 1258 being spawned, 1257 will still be there as will any monsters that were in version one when I left. If I do the instance list command though, it says I am in the correct version, it's just spawning the previous version's NPCS.

sorvani
09-04-2012, 05:03 PM
in the zone table does your arena has an extended shutdown time? that is pretty much the only thing that causes instances to cross. because even if you have destroyed the instance, when you go in again you will be in the original one because the server will resuse the instance ID since the prior instance was destroyed. but nothing in the DestroyInstance code will tell an instance to shutdown early.

edit: it was a really pronounced problem on PEQ when Vxed and Tipt were set to 15 minute shutdowns. Player A would destroy their Tipt instance while Player B was requesting an LDoN and the LDoN player would get stuck under the world in Tipt because the instance ID was still active.

Randymarsh9
09-04-2012, 06:57 PM
Is the shut down delay determined by the table in the database or by the rule autoshutdowndelay?

Randymarsh9
09-04-2012, 10:27 PM
I set the zoneshutdowndelay to 1 in the zone table and in the rules value, but it still takes too long for it to shut down to work correctly. As a (hopefully) temporary work-around, I just set a one-minute lockout timer every time someone leaves the zone. That should keep someone from mistakenly zoning into the wrong instance.

sorvani
09-05-2012, 12:42 AM
select shutdowndelay from zone where short_name = 'arena'; the value is in milliseconds.
default is 5000 = 5 seconds