View Full Version : Agnarr port up not working
sorvani
05-07-2011, 09:59 AM
Ok, straight out of the quest SVN the port up to the Agnarr event does not work.
The player.pl does successfully build the array of players to port, but the port does not work.
I added some client messages to see what went wrong.
Adding: Varalla <- raid group 1
Adding: Koro <- raid group 1 and toon that clicked door
Adding: Crathe <- raid group 2
Adding: Symaray <- raid group 2
Porting: Varalla <- was not ported
This is locked...
You got it open!
Koro was ported up but Varalla wasn't even though it never said anything about Koro.
So I removed the player.pl entirely and it still ported Koro up so I looked int he code and the door click code is handling his port up. So I added an IF statement to exclude the clicker from the array incase that was causing some type of conflict and tried again.
Adding: Varalla <- raid group 1
Adding: Crathe <- raid group 2
Adding: Symaray <- raid group 2
Porting: Varalla <- was not ported
This is locked...
You got it open!
sub EVENT_CLICKDOOR {
if($doorid == 51) { # agnarr entrance
if($client->KeyRingCheck(9433) || ($status > 79)) {
quest::setglobal("agnarrkey",1,3,"M5"); # old method in case new method doesn't work
$raid = $entity_list->GetRaidByClient($client);
if ($raid) {
for ($count = 0; $count < $raid->RaidCount(); $count++) {
# added if to keep the clicker's name out of the array as the door code handles the clicker's port up.
if ($client->GetName() ne $raid->GetMember($count)->GetName()) {
push (@player_list, $raid->GetMember($count)->GetName());
$client->Message(1,"Adding: ".$raid->GetMember($count)->GetName());
}
}
foreach $player (@player_list) {
my $pc = $entity_list->GetClientByName($player);
$client->Message(1,"Porting: ".$player);
$pc->MovePC(209,-765,-1735,1270);
}
}
} else {
my $gargoyle_check = $entity_list->GetMobByNpcTypeID(209024);
if ($gargoyle_check) {
my $gargoyle = $gargoyle_check->CastToNPC();
$gargoyle->AddToHateList($client, 1);
}
}
}
#tower door code removed as not relevant to testing
}
sorvani
05-07-2011, 05:48 PM
Changed the movenpc line to
$client->quest::movepc(209,-765,-1735,1270);
and now it tells me invalid zone. for each of the 3 toons instead of crashing out after Varalla.
Am I using quest::movenpc wrong?
KingMort
05-07-2011, 06:04 PM
You don't have to put the zone id in front just the coords as I recall and it should work just fine.
sorvani
05-07-2011, 10:10 PM
You don't have to put the zone id in front just the coords as I recall and it should work just fine.
quest::gmmove does not take a zone, and I did try that in here but it did not do anything either.
quest::movepc works fine in a /hail response or something when used plain.
for example in one of Askr files when you have to hail to move up the tower
sub EVENT_SAY {
if($text=~/hail/i) {
$client->Message(9,"You are doing well... The Storm Lord does not stand a chance!");
quest::movepc(209,-371,-1680,2356);
}
}
but in this script we need to move a PC other than the one doing the clicking, hence foreach $player (@player_list) {
my $pc = $entity_list->GetClientByName($player);
$client->Message(1,"Porting: ".$player);
$pc->quest::movepc(209,-765,-1735,1270);
}
Will quest::movepc not support being activated on a client like this?
edit: this code will need some IsClient checks or whatever but I been skipping that until I get the thing to work. Because it will die during the build of the array if one toon is in the raid but offline.
sorvani
05-07-2011, 10:47 PM
Ok joligaro just posted in another post the answer to my question, don't use quest::
But MovePC causes the loop to die and GMMove causes the Client who clicked to see the others in the raid as if they moved, but the other clients didn'' move on their screens and as soon as something causes a position update to occur the ghosts that seem to have moved on the client screen disappear
joligario
05-07-2011, 11:05 PM
I don't remember off hand, but I don't think the . appendings work in eqemu text.
joligario
05-07-2011, 11:23 PM
That and you are missing some arguments. You need a heading in ->MovePC()
joligario
05-07-2011, 11:33 PM
There are 4 options for $client->MovePC(): (note, this is case sensitive)
Option 1: (5 arguments, using zone short name, not instanced)
$client->MovePC("zonename", x, y, z, h);
Option 2: (5 arguments, using zone id, not instanced)
$client->MovePC(zoneID, x, y, z, h);
Option 3: (4 arguments, using no zone info, not instanced)
$client->MovePC(x, y, z, h);
Option 4: (6 arguments, using zone id, instanced)
$client->MovePC(zoneID, instanceID, x, y, z, h);
joligario
05-07-2011, 11:37 PM
There is only 1 option for using quest::movepc(): (note, this is case sensitive)
quest::movepc(zone_id, x, y, z, h);
joligario
05-07-2011, 11:39 PM
There is only 1 option for using quest::gmmove(): (also case sensitive)
quest::gmmove(x, y, z);
joligario
05-07-2011, 11:41 PM
There is only 1 option for quest::movegrp(): (yes, this one too)
quest::movegrp(zoneid, x, y, z);
joligario
05-07-2011, 11:45 PM
That being said, I decided to look at code and did see some rewrite needed. I'll take care of it today.
joligario
05-08-2011, 08:45 AM
Pretty sure I got this working fine. If you want to try it out, clear out the destination info for door #51 and use the following in your player.pl:
sub EVENT_CLICKDOOR {
if($doorid == 51) { #Agnarr Tower
if($status > 79) { #GM status
$client->MovePC(209,-765,-1735,1270,0);
}
elsif($hasitem{9433}) { #Symbol of Torden
my $raid = $entity_list->GetRaidByClient($client);
my $group = $entity_list->GetGroupByClient($client);
if ($raid) { #Move raid
for ($count = 0; $count < $raid->RaidCount(); $count++) {
$pc = $raid->GetMember($count);
$pc->MovePC(209,-765,-1735,1270,0);
}
}
elsif ($group) { #Move group
for ($count = 0; $count < $group->GroupCount(); $count++) {
$pc = $group->GetMember($count);
$pc->MovePC(209,-765,-1735,1270,0);
}
}
else { #Move individual
$client->MovePC(209,-765,-1735,1270,0);
}
}
else { #Send gargoyles to attack
my @npc_list = $entity_list->GetNPCList();
foreach $npc (@npc_list) {
if($npc->GetNPCTypeID() == 209024) {
$npc->AddToHateList($client, 1);
}
}
}
}
if($doorid == 61) { # tower
if($client->KeyRingCheck(9425) || ($status > 79)) {
quest::movegrp(209, 85, 145, 635);
} elsif(plugin::check_hasitem($client, 9425)) {
$client->KeyRingAdd(9425);
quest::movegrp(209, 85, 145, 635);
}
}
if($doorid == 63) { # tower
if($client->KeyRingCheck(9425) || ($status > 79)) {
quest::movegrp(209, -830, -865, 1375);
} elsif(plugin::check_hasitem($client, 9425)) {
$client->KeyRingAdd(9425);
quest::movegrp(209, -830, -865, 1375);
}
}
if($doorid == 65) { # tower
if($client->KeyRingCheck(9425) || ($status > 79)) {
quest::movegrp(209, -350, -2200, 1955);
} elsif(plugin::check_hasitem($client, 9425)) {
$client->KeyRingAdd(9425);
quest::movegrp(209, -350, -2200, 1955);
}
}
if($doorid == 67) { # tower
if($client->KeyRingCheck(9425) || ($status > 79)) {
quest::movegrp(209, 150, -1220, 1120);
} elsif(plugin::check_hasitem($client, 9425)) {
$client->KeyRingAdd(9425);
quest::movegrp(209, 150, -1220, 1120);
}
}
}
Fun facts:
The check is for the symbol on the character (i.e. no keyring item)
Entire raid ports up (all members must be in zone, not zoning, for this to work)
Keyed player who clicks will be moved with highest element they are a member of (raid->group->individual)
Unkeyed players who click will get a surprise (like live)
sorvani
05-08-2011, 09:19 AM
So I am simply missing the heading for MovePC. Easy enough. You remove the keyring? I assume that is live then as I do not recall. I did think that all 4 gargoyles were supposed to attack not just 1. Also the 1 now is sometimes one from the towers takes that is not right. Finally should there not be a range check on the group and raid port up? These were things I was going to fix once I got the script working.
sorvani
05-08-2011, 11:02 AM
ok, i added the heading of 0 to my MovePC and my code works fine now.
I'll add in the checks I mentioned and repost once i'm done, because it will move anyone one in the raid and in the zone to the port spot when someone clicks on it. Also if someone is in the raid but offline or not in zone the array building dies silently at that person never getting to the MovePC command.
I'll incorporate your logic for picking up the group too. I think it would be better not to remove the door destination and simply exclude the person clicking from the array.
edit: just reread your gargoyle bit, so it sends in all 4 by the stone and the 2 at each tower door? better than the only 1 the original code was sending in. Is this how live did it?
edit2: once this is done i'll use your same logic to redo the tower doors to port up your group (only group) if your group happens to be in a raid, because I thought I read a bit about returning raid group # someplace.
thanks for your help.
joligario
05-08-2011, 02:16 PM
Oh, btw. I was mistaken in my post up above. There is only 1 of the 4 options for $client->MovePC() exported to perl_client.
$client->MovePC(zoneid,x,y,z,h);
sorvani
05-09-2011, 09:48 AM
Thanks for all your help. I learned some good information about the quest process here.
Here is the final solution I posted over on the PEQ forums.
bothunder/player.pl
sub EVENT_CLICKDOOR {
if ($status < 80) { # make sure not to excute if it is a GM clicking
my $count;
my $raid;
my $group;
if($doorid == 51) { #Agnarr Tower
if(plugin::check_hasitem($client, 9433) || $client->KeyRingCheck(9433)) { #Symbol of Torden
if (!$client->KeyRingCheck(9433)) {
$client->KeyRingAdd(9433);
}
$raid = $entity_list->GetRaidByClient($client);
$group = $entity_list->GetGroupByClient($client);
if ($raid) {
for ($count = 0; $count < $raid->RaidCount(); $count++) {
if ($client->GetName() ne $raid->GetMember($count)->GetName()) {
$pc = $raid->GetMember($count);
if ($pc->CalculateDistance(170.329,11.3461,-647.998) <= 100) { # only move players within 100 units of door
$pc->MovePC(209,-765,-1735,1270,128);
}
}
}
}
elsif ($group) {
for ($count = 0; $count < $group->GroupCount(); $count++) {
if ($client->GetName() ne $group->GetMember($count)->GetName()) {
$pc = $group->GetMember($count);
if ($pc->CalculateDistance(170.329,11.3461,-647.998) <= 100) { # only move players within 100 units of door
$pc->MovePC(209,-765,-1735,1270,128);
}
}
}
}
}
else { #Send gargoyles to attack
my @npc_list = $entity_list->GetNPCList();
foreach $npc (@npc_list) {
if($npc->GetNPCTypeID() == 209024 & $npc->CalculateDistance(170.329,11.3461,-647.998) <= 100) { # only send in the 4 close gargoyles
$npc->AddToHateList($client, 1);
}
}
}
} #end of agnarr tower
if($doorid == 61 || $doorid == 63 || $doorid == 65 || $doorid == 67) { #Tower Doors
if(plugin::check_hasitem($client, 9425) || $client->KeyRingCheck(9425)) { #Symbol of Torden
if (!$client->KeyRingCheck(9425)) {
$client->KeyRingAdd(9425);
}
$raid = $entity_list->GetRaidByClient($client);
$group = $entity_list->GetGroupByClient($client);
if ($raid) {
for ($count = 0; $count < $raid->RaidCount(); $count++) {
#do not port the cliker or someone not in the clicker's raid group.
if ($client->GetName() ne $raid->GetMember($count)->GetName() && $raid->GetGroup($client->GetName()) == $raid->GetGroup($raid->GetMember($count)->GetName())) {
$pc = $raid->GetMember($count);
if ($doorid == 61 && $pc->CalculateDistance(-169.512,-384.93,-639.696) <= 50) { # SE Tower only move players within 50 units of door
$pc->MovePC(209,85,145,635,128);
}
elsif ($doorid == 63 && $pc->CalculateDistance(562.407,-331.488,-639.291) <= 50) { # SW Tower only move players within 50 units of door
$pc->MovePC(209,-830,-865,1375,128);
}
elsif ($doorid == 65 && $pc->CalculateDistance(501.435,417.583,-638.755) <= 50) { # NW Tower only move players within 50 units of door
$pc->MovePC(209,-350,-2200,-1955,0);
}
elsif ($doorid == 67 && $pc->CalculateDistance(-230.36,355.3,-638.154) <= 50) { # NE Tower only move players within 50 units of door
$pc->MovePC(209,150,-1220,1120,128);
}
}
}
}
elsif ($group) {
for ($count = 0; $count < $group->GroupCount(); $count++) {
#do not port the cliker
if ($client->GetName() ne $group->GetMember($count)->GetName()) {
$pc = $group->GetMember($count);
if ($doorid == 61 && $pc->CalculateDistance(-169.512,-384.93,-639.696) <= 50) { # SE Tower only move players within 50 units of door
$pc->MovePC(209,85,145,635,128);
}
elsif ($doorid == 63 && $pc->CalculateDistance(562.407,-331.488,-639.291) <= 50) { # SW Tower only move players within 50 units of door
$pc->MovePC(209,-830,-865,1375,128);
}
elsif ($doorid == 65 && $pc->CalculateDistance(501.435,417.583,-638.755) <= 50) { # NW Tower only move players within 50 units of door
$pc->MovePC(209,-350,-2200,-1955,0);
}
elsif ($doorid == 67 && $pc->CalculateDistance(-230.36,355.3,-638.154) <= 50) { # NE Tower only move players within 50 units of door
$pc->MovePC(209,150,-1220,1120,128);
}
}
}
}
}
else { #Send gargoyles to attack
my @npc_list = $entity_list->GetNPCList();
foreach $npc (@npc_list) {
if ($doorid == 61) {
if($npc->GetNPCTypeID() == 209024 & $npc->CalculateDistance(-169.512,-384.93,-639.696) <= 150) { # only send in the 2 close gargoyles
$npc->AddToHateList($client, 1);
}
}
elsif ($doorid == 63) {
if($npc->GetNPCTypeID() == 209024 & $npc->CalculateDistance(562.407,-331.488,-639.291) <= 150) { # only send in the 2 close gargoyles
$npc->AddToHateList($client, 1);
}
}
elsif ($doorid == 65) {
if($npc->GetNPCTypeID() == 209024 & $npc->CalculateDistance(501.435,417.583,-638.755) <= 150) { # only send in the 2 close gargoyles
$npc->AddToHateList($client, 1);
}
}
elsif ($doorid == 67) {
if($npc->GetNPCTypeID() == 209024 & $npc->CalculateDistance(-230.36,355.3,-638.154) <= 150) { # only send in the 2 close gargoyles
$npc->AddToHateList($client, 1);
}
}
}
}
} #end 4 Towers
} #end GM check
}
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.