EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Instanced Zone question (https://www.eqemulator.org/forums/showthread.php?t=30638)

Randymarsh9 02-21-2010 02:39 PM

Instanced Zone question
 
I want to try something where there will be an instanced zone that people with a certain qglobal can get into and otherwise would go to the regular zone. Do you think I could do something where an NPC creates an instance when it spawns and then everyone who asks to be sent to the instanced zone will all go to the exact same zone? I know how I could set it up so everyone goes to their own individual instance, but I want them to actually be in the exact same one like they would in a regular zone.

Congdar 02-21-2010 07:26 PM

There was a discussion doing this for guild halls in pok. see if the instance code looks similar to what you want to do.
http://www.eqemulator.org/forums/showthread.php?t=29359

Randymarsh9 02-21-2010 07:44 PM

That kind of seems like what I am trying to do, but not quite. Is there a way to create an instance with a set ID each time? If so, then I think I can get it to work. Like I want to create an instance for one zone with id 1, then another with ID 2 and so on.

Congdar 02-22-2010 02:30 AM

I haven't used any of the quest:: instance commands myself, but I think you can achieve what you want without worrying about what the instance id's are. The perl can save the id of each instance it creates and then you can assign a player to whatever instance based on the qglobl flag you've given them.
Code:

// instance_spawner
my $zoneA = 0;
my $zoneB = 0;
my $zoneC = 0;

sub EVENT_SPAWN {
  $zoneA = quest::CreateInstance("freportw", 0, 3000);
  $zoneB = quest::CreateInstance("freportw", 1, 3000);
  $zoneC = quest::CreateInstance("freportw", 2, 3000);
}

sub EVENT_SAY {
  if($text=~/Hail/i) {
    if(defined($qglobals{instance_flag_a}) {
      quest::AssignToInstance($zoneA);
    }
    if(defined($qglobals{instance_flag_b}) {
      quest::AssignToInstance($zoneB);
    }
    if(defined($qglobals{instance_flag_c}) {
      quest::AssignToInstance($zoneC);
    }
  }
}


Randymarsh9 02-28-2010 03:00 PM

I tried to use this quest on the NPC, but it is only sending my characters to the regular arena despite their qglobal. It will say the message that it is assigning them to the correct instance, but then it will zone them into the original zone.

Code:

my $zoneB = 0;
my $zoneC = 0;

sub EVENT_SPAWN {
  $zoneB = quest::CreateInstance("arena", 1, 3000);
  $zoneC = quest::CreateInstance("arena", 2, 3000);
}

sub EVENT_SAY {
  if($text=~/Hail/i) {
    if($qglobals{arena1} == 1) {
      quest::AssignToInstance($zoneB);
        $client->Message(3,"Assigning to Arena1");
        quest::MovePCInstance(77, $zoneB, -41, 131, -0.5);
    }
    elsif($qglobals{arena1} == 2) {
      quest::AssignToInstance($zoneC);
      $client->Message(3,"Assigning to Arena2");
        quest::MovePCInstance(77, $zoneC, -41, 131, -0.5);
    }
    else{
        $client->Message(3,"Sending to regular arena");
        quest::zone(arena);
}
  }
 if ($text =~/arena1/i){
  $client->Message(3,"Would you like me to enable ArenaA or ArenaB?");
 }
 if ($text =~/arenaA/i){
 quest::setglobal("arena1", 1, 5, "F");
 $client->Message(3,"Global arena1 set to 1");
 }
 if ($text =~/arenaB/i){
 quest::setglobal("arena1", 2, 5, "F");
 $client->Message(3,"Global arena1 set to 2");
 }
}



All times are GMT -4. The time now is 02:45 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.