Skip to content

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.

quest::add_expedition_lockout_all_clients("Added expedition", "Added event", 7200);

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

quest::add_expedition_lockout_by_char_id($client->CharacterID(), "Added expedition", "Added event", 7200);

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.

my $dz = quest::get_expedition();
if ($dz) {
  quest::debug(sprintf("current zone is expedition id [%d]'s dz instance", $dz->GetID()));
}

Expedition* get_expedition_by_char_id(int character_id)

Returns the character's current Expedition if the character is in one, otherwise returns nullptr.

my $dz = quest::get_expedition_by_char_id($client->CharacterID());
if ($dz) {
  quest::debug(sprintf("client [%d] is in expedition id [%d]", $client->CharacterID(), $dz->GetID()));
}

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.

my $dzid = 0;
my $dz = quest::get_expedition_by_char_id($client->CharacterID());
if ($dz) {
  $dzid = $dz->GetDynamicZoneID();
}

if ($dzid > 0) {
  my $expedition_from_dzid = quest::get_expedition_by_dz_id($dzid);
  if ($expedition_from_dzid) {
    quest::debug(sprintf("dz id [%d] is for expedition id [%d]", $dzid, $expedition_from_dzid->GetID()));
  }
}

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.

# assuming character is in an anguish expedition
my $zoneid = quest::GetZoneID("anguish");
my $instanceid = quest::GetInstanceIDByCharID("anguish", 0, $client->CharacterID());

my $dz = quest::get_expedition_by_zone_instance($zoneid, $instanceid);
if ($dz) {
  quest::debug(sprintf("zone id [%d] instance id [%d] is for expedition id [%d]", $zoneid, $instanceid, $dz->GetID()));
}

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

my $lockout = quest::get_expedition_lockout_by_char_id($client->CharacterID(), "Anguish, the Fallen Palace", "Ture");
if (keys %{ $lockout }) {
  quest::debug(sprintf("lockout remaining: [%d] seconds, uuid: [%s]", $lockout->{'remaining'}, $lockout->{'uuid'}));
} else {
  quest::debug(sprintf("character [%d] does not have this lockout", $client->CharacterID()));
}

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

# without filter on expedition name
my $lockouts = quest::get_expedition_lockouts_by_char_id($client->CharacterID());
foreach my $expedition_name (keys %{ $lockouts }) {
  my $events = $lockouts->{$expedition_name};
  foreach my $event_name (keys %{ $events }) {
    my $lockout = $events->{$event_name};
    quest::debug("expedition: [$expedition_name] event: [$event_name] seconds remaining: [$lockout->{'remaining'}] uuid: [$lockout->{'uuid'}]");
  }
}
# with filter on expedition name
my $anguish_lockouts = quest::get_expedition_lockouts_by_char_id($client->CharacterID(), "Anguish, the Fallen Palace");
foreach my $event_name (keys %{ $anguish_lockouts }) {
  my $lockout = $anguish_lockouts->{$event_name};
  quest::debug("event: [$event_name] seconds remaining: [$lockout->{'remaining'}] uuid: [$lockout->{'uuid'}]");
}

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

# removes all lockouts
quest::remove_all_expedition_lockouts_by_char_id($client->CharacterID());
# removes all anguish lockouts
quest::remove_all_expedition_lockouts_by_char_id($client->CharacterID(), "Anguish, the Fallen Palace");

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

quest::remove_expedition_lockout_by_char_id($client->CharacterID(), "Added expedition", "Added event");