Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 01-14-2009, 03:47 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default target random player and port there group?

i need to target a random player in the zone and port here group out to anther zone. how would i do this? i cant get any of the quest objects for group working. i does not matter what player it ports i just need to find a player in the zone and port there whole group out because the zone can only have 1 group at a time anyways.

any ideas?
Reply With Quote
  #2  
Old 01-14-2009, 05:58 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

The only way I have found to be able to check all clients in the zone is using a script that checks all entities in the whole zone and checks if they are clients or not. The custom script I posted for my Thanksgiving event would work just fine for this if you can figure out how to use it. Here is a quick edit that would find each client:

Code:
sub EVENT_SPAWN {

  quest::settimer("runaway",5);

}


sub EVENT_TIMER {

  if ($timer eq "runaway") {
    quest::stoptimer("runaway");
        
    my $list_check = 0;

    #Variable to check if more than 1 player is in zone
    my $multiple_clients = undef;

    #You may need to increase 2000 below if you have alot of mobs in the zone
    for ($list_check = 0; $list_check < 2000; $list_check++) { 

      $client_search = $entity_list->GetClientByID($list_check);
     
      if ($client_search) {
#        quest::say("I found client $client_search");
          $multiple_clients = $multiple_clients + 1;

            if($multiple_clients <= 6) { #Full group or less in the zone
               quest::settimer("runaway",60); #run this check every minute
            }

            if($multiple_clients > 6) { #more than a full group
              #Run this check every 5 seconds until someone is picked
               
              my $clientpick = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10);
              if($clientpick == 1) { #we got a winner!
                quest::settimer("runaway",60);
                $client->MoveGroup(152,0,0,-31)
              }
              if($clientpick > 1) {
                #More than 6 players are in zone.  Need to keep running this check until a player is picked and removed
                quest::settimer("runaway",5);
              }
            }

      }
    }

  }
}
I haven't tested this yet, but it should be close to something that would do what you are wanting to do.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 01-14-2009, 07:29 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

ok i have it telling me it found me as a client in shout.. but its not porting.

i looked up on the quest objects list and there is no $client->MoveGroup or anything MoveGroup so i looked around and there is a MovePC so i tried that and still nothing so i look and there is nothing assigned to client so it don't know who to port.. i tried setting it to $list_check-> bu thats not doing anything either any suggestions?
Reply With Quote
  #4  
Old 01-14-2009, 08:21 PM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

according to this, this should be working but its not the shout works but the port does nothing

Code:
    my $list_check = 0;
    #You may need to increase 2000 below if you have alot of mobs in the zone
    for ($list_check = 0; $list_check < 2000; $list_check++) 
	{ 
      $client_search = $entity_list->GetClientByID($list_check);
     if ($client_search) 
	 {
       quest::say("I found client $client_search");
          $client_search->MoveGroup(152,0,0,-31);

	 }

   }
Reply With Quote
  #5  
Old 01-14-2009, 08:45 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

LOL, apparently I was making the MoveGroup quest object up. I don't see it in the list of quest objects. Try MovePC(152,0,0,-31) and verify that it works to move single characters with that script.

I thought that there was a quest object to move groups, but it looks like there are only normal quest:: commands for it. You could try quest::movegrp(152,0,0,-31), but I am not sure that will work if you are using quest objects to get the client. Worth a shot though.

Edit: After looking at the quest objects some more, maybe this one will work:

Code:
$client_search->TeleportGroup($npc, 152, 0, 0, -31);
I haven't messed with the group quest objects much, so you probably need to get the client's group first. If so, maybe something like this would work:

Code:
my $clientgroup = $client_search->GetGroup();
quest::say("I found that client $client_search is in group $clientgroup");
$clientgroup->TeleportGroup($npc, 152, 0, 0, -31);
If that works, let me know, because I have been wanting to figure out how to do that group stuff for a while lol. I just haven't had much time to look into it and didn't really think about doing it this way before. If the above doesn't work for players who aren't in a group, maybe you could do something like this:

Code:
my $clientgroup = $client_search->GetGroup();
if($clientgroup) {
  quest::say("I found that client $client_search is in group $clientgroup");
  $clientgroup->TeleportGroup($npc, 152, 0, 0, -31);
}
else {
  quest::say("I found client $client_search, but they are not grouped");
  $client_search->MovePC(152,0,0,-31);
}
And, if none of the above works, you may need to cast it to client first. So, maybe something like this would work:

Code:
my $gotclient = $client_search->CastToClient();
quest::say("I found client $client_search and cast them to client, which outputs this: $gotclient");

my $clientgroup = $gotclient->GetGroup();
if($clientgroup) {
  quest::say("I found that client $client_search is in group $clientgroup");
  $clientgroup->TeleportGroup($npc, 152, 0, 0, -31);
}
else {
  quest::say("I found client $client_search, but they are not grouped");
  $gotclient->MovePC(152,0,0,-31);
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 01-15-2009 at 05:03 AM..
Reply With Quote
  #6  
Old 01-14-2009, 08:55 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

I'm not sure MoveGroup is an actual function in the Client class. However, there is a TeleportGroup function in the Group class. I would think you could do something like this:

Code:
	my $list_check = 0;
	#You may need to increase 2000 below if you have alot of mobs in the zone
	for ($list_check = 0; $list_check < 2000; $list_check++) 
	{ 
		$client_search = $entity_list->GetClientByID($list_check);
		if ($client_search) 
		{
			quest::say("I found client $client_search");
			$client_search->GetGroup()->TeleportGroup($mob,152,0,0,-31);
		}
	}
Hope this helps.
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #7  
Old 01-15-2009, 12:38 AM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

ok this really sucks none of the above worked

i found client Client=SCALAR(0x4ac3008 ) and cast them to client, witch outputs this: Client=SCALAR(0x4ac2ce4)

i found client Client=SCALAR(0x4ac3008 ), but he are not grouped.

that's what he said from the last one in Tevs post.. all of them said something close to that but none moved me.

space after 8 ) o keep from face
Reply With Quote
  #8  
Old 01-15-2009, 12:57 AM
MNWatchdog
Hill Giant
 
Join Date: Feb 2006
Posts: 179
Default

Couldnt you just have the script have the group member cast a custom group teleport spell with a huge AE range?
Reply With Quote
  #9  
Old 01-15-2009, 01:00 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Well, I use a similar script for one of my events, but it didn't actually do anything with the character, it just got information about them (locs). I don't see why it wouldn't work to move them though, unless MovePC is broken. To verify, you should be able to try something like this:

Code:
sub EVENT_SAY {

  if ($text =~/hail/i) {
    quest::say("I am going to try to move you to Nexus with MovePC.");
    $client->MovePC(152, 0, 0, -31);
  }

}
If that doesn't work, then MovePC is the issue. If it does work, then I don't understand why it isn't working in the other script. It obviously has the client already, so it should be able to do stuff to them.

Also, just to mention it, we have some similar stuff setup on Storm Haven already. It is a bit tricky, but we do it using qglobals. You just set a time length for each member of the group via a qglobal with an expire time on it. Then, you have an NPC that runs the client check above and have it check their qglobals to see if they still have the global. If not, it just does a $client_search->Gate(); and sends them home :P
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 01-15-2009 at 09:06 AM..
Reply With Quote
  #10  
Old 01-15-2009, 01:14 AM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

prob with that is gae would keep them in the zone.. here going to be bound there so if they die the will not leave the zone.. so i have to send them back and rebind them in the right place.

let me try just moving npc and see if that works.
Reply With Quote
  #11  
Old 01-15-2009, 01:25 AM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

if ($text =~/port/i)
{
$client->MovePC(3,-4.8,8.4,0.9);
}

does nothing that really sucks
Reply With Quote
  #12  
Old 01-15-2009, 01:29 AM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

sad day even
Code:
if ($text =~/port/i)
{
$client->GetGroup()->TeleportGroup($mob,3,-4.8,8.4,0.9);
}
does nothing
Reply With Quote
  #13  
Old 01-15-2009, 01:39 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

It wouldn't hurt to try these in the script:

quest::movepc(zoneid,x,y,z) - Moves the user that triggered the Event to the provided zone and loc.
quest::movegrp(zoneid,x,y,z) - Moves the user's Group that triggered the Event to the provided zone and loc.

I don't know if they can work right from quest objects getting the client, but it may be worth a shot just to see.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #14  
Old 01-15-2009, 02:07 AM
spider661
Discordant
 
Join Date: Oct 2005
Location: michigain
Posts: 260
Default

ya i already tryed them i cant get them though a client object like that but jsut tested making the player cast a spell does work so im just going to make a custom port spell instant cast and then let it go.
Reply With Quote
  #15  
Old 01-22-2009, 10:50 PM
VallonTallonZek
Sarnak
 
Join Date: May 2008
Location: Halas
Posts: 42
Default

I wrote a function that returns a random client in a radius around another client, but it would need to be added to the Perl interface to solve your problem. If someone wants to make them accessible to Perl I can post it here when I get home.
Reply With Quote
Reply


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:55 PM.


 

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