Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-01-2015, 09:46 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default Group Flagging.

This allows you to set and check whole groups flags. As it may not be obvious, this requires a custom file in your plugins folder.
Code:
sub CheckGroupFlag {
    my $client = plugin::val('client');
    my $flag = shift;
    if ($client->GetGroup()) {
        for ($i = 0; $i < 6; $i++) {
            if ($client->GetGroup()->GetMember($i) && !$client->GetGroup()->GetMember($i)->HasZoneFlag($flag)) {
                return 0;
            }
        }
    } else {
        if (!$client->HasZoneFlag($flag)) {
            return 0;
        }
    }
    return 1;
}

sub SetGroupFlag {
    my $client = plugin::val('client');
    my $flag = shift;
    if ($client->GetGroup()) {
        for ($i = 0; $i < 6; $i++) {
            if ($client->GetGroup()->GetMember($i) && !$client->GetGroup()->GetMember($i)->HasZoneFlag($flag)) {
                $client->GetGroup()->GetMember($i)->SetZoneFlag($flag);
            }
        }
    } else {
        if (!$client->HasZoneFlag($flag)) {
            $client->SetZoneFlag($flag);
        }
    }
}

return 1;
Reply With Quote
  #2  
Old 06-02-2015, 12:18 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Due to the new functionality mentioned here, you can now do this:
Code:
sub CheckGroupGlobal {
    my $client = plugin::val('client');
    my $global = shift;
    my $value = shift;
    if ($client->GetGroup()) {
        for ($i = 0; $i < 6; $i++) {
            if ($client->GetGroup()->GetMember($i) && $client->GetGroup()->GetMember($i)->GetGlobal($global) != $value) {
                return 0;
            }
        }
    } else {
        if ($client->GetGlobal($global) != $value) {
            return 0;
        }
    }
    return 1;
}

sub SetGroupGlobal {
    my $client = plugin::val('client');
    my $global = shift;
    my $value = shift;
    my $options = shift;
    my $duration = shift;
    if ($client->GetGroup()) {
        for ($i = 0; $i < 6; $i++) {
            if ($client->GetGroup()->GetMember($i) && $client->GetGroup()->GetMember($i)->GetGlobal($global) != $value) {
                $client->GetGroup()->GetMember($i)->SetGlobal($global, $value, $options, $duration);
            }
        }
    } else {
        if ($client->GetGlobal($global) != $value) {
            $client->SetGlobal($global, $value, $options, $duration);
        }
    }
}

return 1;
Reply With Quote
  #3  
Old 07-15-2015, 08:02 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,594
Default

Sorry to necro my own thread, but I'm just wondering if anyone has actually used this.

EDIT: On bot servers, you may want to edit the plugins to check if the member IsClient().
Reply With Quote
  #4  
Old 07-28-2015, 09:48 AM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

I've used something similar on Nagafens lair to do IP Flags and account based progression flags.

If I were to use flagging for any reason I'd adapt this.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
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:25 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