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

05-07-2011, 01:03 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
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");
}
}
|

05-07-2011, 01:34 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
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());
}
...
|

05-07-2011, 02:14 AM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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.
|

05-07-2011, 04:25 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
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);
}
...
|

05-07-2011, 05:17 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
I will say that the group members must be in zone (not zoning) to catch each one.
|

05-07-2011, 09:09 AM
|
Dragon
|
|
Join Date: May 2010
Posts: 965
|
|
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.
|

05-07-2011, 02:03 PM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
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
|

05-07-2011, 07:28 PM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Is is possible to use
Code:
$pc->quest::updatetaskactivity(504, 1,[1]);
like that?
with the $pc->?
|

05-07-2011, 10:14 PM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
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.
|

05-08-2011, 12:22 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Quote:
Originally Posted by joligario
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
|

05-08-2011, 12:31 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
No prob. Anytime you want someone to look/troubleshoot, just post.
|

05-08-2011, 12:37 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
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");
}
}
}
}
}
|

05-08-2011, 01:06 AM
|
 |
Developer
|
|
Join Date: Mar 2003
Posts: 1,498
|
|
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");
}
}
}
}
}
|

05-08-2011, 01:24 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
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");
}
}
}
}
}
|

05-08-2011, 01:54 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
yeah im lost, if anyone can rewrite this function and make it work, ill love u long time
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 08:38 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |