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? |
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 { |
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? |
according to this, this should be working but its not the shout works but the port does nothing
Code:
|
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); Code:
my $clientgroup = $client_search->GetGroup(); Code:
my $clientgroup = $client_search->GetGroup(); Code:
my $gotclient = $client_search->CastToClient(); |
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:
|
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 8) face |
Couldnt you just have the script have the group member cast a custom group teleport spell with a huge AE range?
|
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 { 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 |
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. |
if ($text =~/port/i)
{ $client->MovePC(3,-4.8,8.4,0.9); } does nothing that really sucks |
sad day even
Code:
if ($text =~/port/i) |
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. |
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.
|
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.
|
All times are GMT -4. The time now is 10:44 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.