Global Methods

void add_expedition_lockout_all_clients(string expedition_name, string event_name, int seconds, string uuid = "")

Adds the specified lockout to all clients in the current zone. If a client already has the lockout it's replaced with this one. If a uuid is not supplied one is generated and applied to all clients.
1
quest::add_expedition_lockout_all_clients("Added expedition", "Added event", 7200);
Copied!

void add_expedition_lockout_by_char_id(int character_id, string expedition_name, string event_name, int seconds, string uuid = "")

Adds the specified lockout to the character with an optional specified uuid. If the client already has the lockout it's replaced with this one. If a uuid is not supplied one is generated when the lockout is added to the character
1
quest::add_expedition_lockout_by_char_id($client->CharacterID(), "Added expedition", "Added event", 7200);
Copied!

Expedition* get_expedition()

Returns an Expedition object corresponding to current zone if it's a valid dynamic zone instance being used for an expedition, otherwise returns nullptr.
1
my $dz = quest::get_expedition();
2
if ($dz) {
3
quest::debug(sprintf("current zone is expedition id [%d]'s dz instance", $dz->GetID()));
4
}
Copied!

Expedition* get_expedition_by_char_id(int character_id)

Returns the character's current Expedition if the character is in one, otherwise returns nullptr.
1
my $dz = quest::get_expedition_by_char_id($client->CharacterID());
2
if ($dz) {
3
quest::debug(sprintf("client [%d] is in expedition id [%d]", $client->CharacterID(), $dz->GetID()));
4
}
Copied!

Expedition* get_expedition_by_dz_id(int dz_id)

Returns the Expedition for the specified dynamic zone id if it's valid, otherwise returns nullptr.
1
my $dzid = 0;
2
my $dz = quest::get_expedition_by_char_id($client->CharacterID());
3
if ($dz) {
4
$dzid = $dz->GetDynamicZoneID();
5
}
6
7
if ($dzid > 0) {
8
my $expedition_from_dzid = quest::get_expedition_by_dz_id($dzid);
9
if ($expedition_from_dzid) {
10
quest::debug(sprintf("dz id [%d] is for expedition id [%d]", $dzid, $expedition_from_dzid->GetID()));
11
}
12
}
Copied!

Expedition* get_expedition_by_zone_instance(int zone_id, int instance_id)

Returns the Expedition for the specified zone and instance id if it's a valid dynamic zone instance, otherwise returns nullptr.
1
# assuming character is in an anguish expedition
2
my $zoneid = quest::GetZoneID("anguish");
3
my $instanceid = quest::GetInstanceIDByCharID("anguish", 0, $client->CharacterID());
4
5
my $dz = quest::get_expedition_by_zone_instance($zoneid, $instanceid);
6
if ($dz) {
7
quest::debug(sprintf("zone id [%d] instance id [%d] is for expedition id [%d]", $zoneid, $instanceid, $dz->GetID()));
8
}
Copied!

HASHREF get_expedition_lockout_by_char_id(int character_id, string expedition_name, string event_name)

Returns a hash reference containing lockout details.
The hash contains the keys remaining and uuid. remaining is the seconds remaining on the lockout and uuid is the expedition uuid the lockout was originally assigned in.
If the character doesn't have a lockout for the specified expedition event empty hash values are returned
1
my $lockout = quest::get_expedition_lockout_by_char_id($client->CharacterID(), "Anguish, the Fallen Palace", "Ture");
2
if (keys %{ $lockout }) {
3
quest::debug(sprintf("lockout remaining: [%d] seconds, uuid: [%s]", $lockout->{'remaining'}, $lockout->{'uuid'}));
4
} else {
5
quest::debug(sprintf("character [%d] does not have this lockout", $client->CharacterID()));
6
}
Copied!

HASHREF get_expedition_lockouts_by_char_id(int character_id, string expedition_name = "")

Returns a hash reference containing all of character's current lockouts keyed by expedition name. If an optional expedition_name is passed in it returns a hash reference of lockouts keyed by event name for that expedition.
Each character lockout contains a hash reference with remaining and uuid keys
If the character has no lockouts, the hash values are empty
1
# without filter on expedition name
2
my $lockouts = quest::get_expedition_lockouts_by_char_id($client->CharacterID());
3
foreach my $expedition_name (keys %{ $lockouts }) {
4
my $events = $lockouts->{$expedition_name};
5
foreach my $event_name (keys %{ $events }) {
6
my $lockout = $events->{$event_name};
7
quest::debug("expedition: [$expedition_name] event: [$event_name] seconds remaining: [$lockout->{'remaining'}] uuid: [$lockout->{'uuid'}]");
8
}
9
}
Copied!
1
# with filter on expedition name
2
my $anguish_lockouts = quest::get_expedition_lockouts_by_char_id($client->CharacterID(), "Anguish, the Fallen Palace");
3
foreach my $event_name (keys %{ $anguish_lockouts }) {
4
my $lockout = $anguish_lockouts->{$event_name};
5
quest::debug("event: [$event_name] seconds remaining: [$lockout->{'remaining'}] uuid: [$lockout->{'uuid'}]");
6
}
Copied!

void remove_all_expedition_lockouts_by_char_id(int character_id, string expedition_name = "")

Removes all expedition lockouts from the character, optionally filtered on an expedition name
1
# removes all lockouts
2
quest::remove_all_expedition_lockouts_by_char_id($client->CharacterID());
3
# removes all anguish lockouts
4
quest::remove_all_expedition_lockouts_by_char_id($client->CharacterID(), "Anguish, the Fallen Palace");
Copied!

void remove_expedition_lockout_by_char_id(int character_id, string expedition_name, string event_name)

Removes the specified lockout from the character. No-op if the character doesn't have the lockout
1
quest::remove_expedition_lockout_by_char_id($client->CharacterID(), "Added expedition", "Added event");
Copied!
Last modified 9mo ago