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 05-07-2011, 01:03 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default Using group functions to get if player is in a group ect...

Can anyone explain to me how this can be done? Basically this is what I have now and it dont work.

Im looking to see if player is in a group, if he is, get the group members and put em each in a variable. Then for each member update a task at the same time.

Since the tasks system doesnt have a way to do that.


Code:
sub EVENT_SAY
{
	if($text=~/Hail/i) {
	$member1 = $group->GetMember(1);
	$member2 = $group->GetMember(2);
	$member3 = $group->GetMember(3);
	$member4 = $group->GetMember(4);
	$member5 = $group->GetMember(5);
	$member6 = $group->GetMember(6);
	quest::shout("$member1 $member2 $member3 $member4 $member5 $member6");
	}	
}
Reply With Quote
  #2  
Old 05-07-2011, 01:34 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Look at the bic quest in qinimi on PEQ. I got all the group/raid members and pushed their names to an array. Mainly this portion:

Code:
...
      $group = $entity_list->GetGroupByClient($client);
      if ($group) {
        for ($count = 0; $count < $group->GroupCount(); $count++) {
          push (@player_list, $group->GetMember($count)->GetName());
        }
...
Reply With Quote
  #3  
Old 05-07-2011, 02:14 AM
sorvani
Dragon
 
Join Date: May 2010
Posts: 966
Default

this will fail if the people are in a raid group. at least it did for me when I played with getting the agnarr port up to work.
Reply With Quote
  #4  
Old 05-07-2011, 04:25 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I haven't heard of this failing. Agnarr port works off of getraid.. but I use this in the qinimi bic raid and it works fine there:

Code:
...
        $raid = $entity_list->GetRaidByClient($client);
        if ($raid) {
          for ($count = 0; $count < $raid->RaidCount(); $count++) {
            push (@player_list, $raid->GetMember($count)->GetName());
          }
          foreach $player (@player_list) {
            $pc = $entity_list->GetClientByName($player);
            $pc->MovePC(281,-521,36,-8,166);
           }
...
Reply With Quote
  #5  
Old 05-07-2011, 05:17 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I will say that the group members must be in zone (not zoning) to catch each one.
Reply With Quote
  #6  
Old 05-07-2011, 09:09 AM
sorvani
Dragon
 
Join Date: May 2010
Posts: 966
Default

The Agnarr code in the quest SVN doesn't work right. That's why I was playing with it. It builds the entity list but the raid members are not being moved.

edit to add: Removing the player.pl entirely the clicker still gets ported up so the door code is working just fine, which means it is only the player.pl which is failing. I put a bunch of emotes into the player.pl to verify what it was doing and it would emote back the entire array correctly, but it always stopped when using the movepc command.

edit 2: started new thread sorry to derail this one.
Reply With Quote
  #7  
Old 05-07-2011, 02:03 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

np, this should help me out, i got a guy working with me thats better at coding than me somewhat. I think he can handle this with the help uve given me
Reply With Quote
  #8  
Old 05-07-2011, 07:28 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Is is possible to use
Code:
$pc->quest::updatetaskactivity(504, 1,[1]);
like that?

with the $pc->?
Reply With Quote
  #9  
Old 05-07-2011, 10:14 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Not quite. If you are wanting to go around perl, the client has:

Code:
inline void UpdateTaskActivity(int TaskID, int ActivityID, int Count)
So it would be $client->UpdateTaskActivity(taskid, activityid, count);
if you cast $pc to a client.
Reply With Quote
  #10  
Old 05-08-2011, 12:22 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by joligario View Post
Not quite. If you are wanting to go around perl, the client has:

Code:
inline void UpdateTaskActivity(int TaskID, int ActivityID, int Count)
So it would be $client->UpdateTaskActivity(taskid, activityid, count);
if you cast $pc to a client.
thanks man, we have been working on this script all day and cant get it working right
Reply With Quote
  #11  
Old 05-08-2011, 12:31 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

No prob. Anytime you want someone to look/troubleshoot, just post.
Reply With Quote
  #12  
Old 05-08-2011, 12:37 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Ok still having problems it doesnt trigger if im in a group or solo


Code:
$g = $client->GetGroup();			
	if(quest::istaskactive(504)) 
	{
		if(quest::istaskactivityactive(504,1)) {
		
			if($text=~/Hail/i) {
				quest::shout("Ahhh the orcses they are after meeez"); 
				#despawn gollum and respawn him at the next location
				quest::depop(999303);
				#spawn orc lieutants
				quest::spawn(999204,0,0,-866.3,357.1,90.3);
				#spawn gollum in dif loc
				quest::spawn(999303,0,0,-1023.7,-344.3,7.5);
				
				if(!$g)# No Group
				{ 
				$c->UpdateTaskActivity(504, 1, [1]);
				quest::shout("It works"); 
				}
                
				## Find Group Members
				else
				{
					for($i = 0; $i < 6; ++$i)
					{
					$c = $g->GetMember($i);
                               
						if($c)
						{
							# Update the group task
						$c->UpdateTaskActivity(504, 1, [1]);
						quest::shout("It works"); 
						}

					}	
				}
			}	
		}
Reply With Quote
  #13  
Old 05-08-2011, 01:06 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Try this:

Code:
$g = $client->GetGroup();

if(quest::istaskactive(504) && quest::istaskactivityactive(504,1)) {
  if($text=~/hail/i) {
    quest::shout("Ahhh the orcses they are after meeez");
    #despawn gollum and respawn him at the next location
    quest::depop(999303);
    #spawn orc lieutants
    quest::spawn(999204,0,0,-866.3,357.1,90.3);
    #spawn gollum in dif loc
    quest::spawn(999303,0,0,-1023.7,-344.3,7.5);
    if(!$g) { #No Group
      $client->UpdateTaskActivity(504, 1, 1);
      quest::shout("It works");
    }
    ## Find Group Members
    else {
      for($i = 0; $i < $g->GroupCount(); $i++) {
        $c = $g->GetMember($i);
        if($c) {
          # Update the group task
          $c->UpdateTaskActivity(504, 1, 1);
          quest::shout("It works"); 
        }
      }
    }
  }
}
Reply With Quote
  #14  
Old 05-08-2011, 01:24 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Nope, this is how I have it, i copied what you posted He will do the shout but not execute the group code

Code:
sub EVENT_SAY {
	$g = $client->GetGroup();
	
		if(quest::istaskactive(504) && quest::istaskactivityactive(504,1)) {
		
			if($text=~/hail/i) {
				quest::shout("Ahhh the orcses they are after meeez");
				#despawn gollum and respawn him at the next location
				#quest::depop(999303);
				#spawn orc lieutants
				#quest::spawn(999204,0,0,-866.3,357.1,90.3);
				#spawn gollum in dif loc
				#quest::spawn(999303,0,0,-1023.7,-344.3,7.5);
			
				if(!$g) { #No Group
					$client->UpdateTaskActivity(504, 1, 1);
					quest::shout("It works");
				}
				
				## Find Group Members
				else 
				{
					for($i = 0; $i < $g->GroupCount(); $i++) 
					{
						$c = $g->GetMember($i);
						if($c) 
						{
							# Update the group task
						$c->UpdateTaskActivity(504, 1, 1);
						quest::shout("It works"); 
						}
					}
				}
			}
		}
Reply With Quote
  #15  
Old 05-08-2011, 01:54 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

yeah im lost, if anyone can rewrite this function and make it work, ill love u long time
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 11:19 AM.


 

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