Expedition Methods

void AddLockout(string event_name, uint32 seconds_duration)

Adds an event lockout timer to the expedition with the specified duration.
The lockout is added to all current members of the expedition whether they're inside the zone or not. This also adds the lockout to any clients inside the dynamic zone that are not part of the expedition (in the event that they've quit the expedition and haven't been teleported out yet)
The lockout is also stored internally in the expedition. New members added to the expedition will receive these lockouts once they zone into the expedition's dynamic zone.
The lockout replaces any existing lockout held by the expedition and members.
The lockout is assigned the current expedition's internal uuid for tracking.
Note: The source adds 60s to the lockout timer sent to clients to compensate for the client displaying lockouts rounded down to the nearest minute. If adding lockout times using live packet data subtract 60s from the time (live adds 60s as well)
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
$dz->AddLockout("Expedition Event Name", 3600); # 1 hour lockout
4
}
Copied!

void AddLockoutDuration(string event_name, int seconds, bool members_only = true)

Adds duration to existing member lockouts for the event. If seconds is negative then lockout duration is reduced.
Unlike UpdateLockoutDuration which applies a static lockout duration to all members based on the expedition's internal lockout, this modifies each member's existing lockout duration separately.
If a member does not have the specified event lockout and seconds is positive, the lockout is added to the member with the current expedition's uuid.
By default this only updates expedition members. Passing false for members_only will update the expedition's internal lockout duration as well which will affect any future members added to the expedition.
Non-expedition members inside the expedition's dynamic zone instance are always updated
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
$dz->AddLockoutDuration("Expedition Event Name", 3600); # add 1 hour to lockout
4
}
Copied!

void AddReplayLockout(int seconds_duration)

Adds a Replay Timer lockout to the expedition. This is a shortcut alternative to adding the lockout by name through the AddLockout method.
Replay Timer's use a hardcoded event name and are used as a lockout against requesting the expedition itself.
Unlike normal event lockouts, any members added to the expedition after a replay timer has been assigned will receive the lockout immediately with a reset expiration timer based on the original duration.
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
$dz->AddReplayLockout(7200); # 2 hour replay timer
4
}
Copied!

void AddReplayLockoutDuration(int seconds, bool members_only = true)

Adds duration to expedition's Replay Timer lockout. See AddLockoutDuration
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
$dz->AddReplayLockoutDuration(7200); # add 2 hours to replay timer
4
}
Copied!

uint32_t GetDynamicZoneID()

Returns the expedition's dynamic zone id
1
my $dz_id = $expedition->GetDynamicZoneID();
Copied!

uint32_t GetID()

Returns the expedition's id
1
my $id = $expedition->GetID();
Copied!

int GetInstanceID()

Returns the expedition's dynamic zone instance id
1
my $id = $expedition->GetInstanceID();
Copied!

string GetLeaderName()

Returns the expedition's current leader name
1
my $leader_name = expedition:GetLeaderName();
Copied!

HASHREF GetLockouts()

Returns a hash reference containing the expedition's current internal lockouts and time remaining. This includes lockouts that were inherited by the leader on creation and not just lockouts assigned during the current expedition.
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
my $lockouts = $dz->GetLockouts();
4
foreach my $event_name (keys %{ $lockouts }) {
5
quest::debug("event: [$event_name] seconds remaining: [$lockouts->{$event_name}]");
6
}
7
}
Copied!

string GetLootEventByNPCTypeID(uint32 npc_type_id)

string GetLootEventBySpawnID(uint32 spawn_id)

Returns an event name associated with an npc type id or spawn id set by the SetLootEventByNPCTypeID or SetLootEventBySpawnID apis.
Returns an empty string if no event set
Important: This is only valid inside the expedition's dynamic zone instance
1
my $dz = quest::get_expedition();
2
if ($dz) {
3
quest::debug("npc type id 12345 event: " . $dz->GetLootEventByNPCTypeID(12345));
4
quest::debug("spawn id 20 event: " . $dz->GetLootEventBySpawnID(20));
5
}
Copied!

int GetMemberCount()

Returns number of members in expedition
1
my $count = $dz->GetMemberCount();
Copied!

HASHREF GetMembers()

Returns a hash reference containing member names and character ids
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
my $members = $dz->GetMembers();
4
foreach my $member_name (keys %{ $members }) {
5
quest::debug("char name: [$member_name] char id: [$members->{$member_name}]");
6
}
7
}
Copied!

string GetName()

Returns name of the expedition
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
quest::debug("expedition name: " . $dz->GetName());
4
}
Copied!

int GetSecondsRemaining()

Returns seconds remaining until expedition's dynamic zone expires
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
quest::debug("expedition seconds remaining: " . $dz->GetSecondsRemaining());
4
}
Copied!

string GetUUID()

Returns expedition's internal uuid assigned on creation
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
quest::debug("expedition uuid: " . $dz->GetUUID());
4
}
Copied!

int GetZoneID()

Returns zone id of the expedition's dynamic zone
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
quest::debug("expedition's dz zone id: " . $dz->GetZoneID());
4
}
Copied!

string GetZoneName()

Returns zone short name of the expedition's dynamic zone
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
quest::debug("expedition's dz zone name: " . $dz->GetZoneName());
4
}
Copied!

int GetZoneVersion()

Returns zone version of the expedition's dynamic zone instance
1
my $dz = $client->GetExpedition();
2
if ($dz) {
3
quest::debug("expedition's dz zone version: " . $dz->GetZoneVersion());
4
}
Copied!

bool HasLockout(string event_name)

Returns whether the expedition internally has the specified event lockout. This is the primary function that should be used for initialization scripts to determine which events are available to an expedition.
1
my $dz = quest::get_expedition();
2
if ($dz) {
3
my $has_lockout = $dz->HasLockout("Ture") ? 1 : 0;
4
quest::debug("expedition has Ture lockout: " . $has_lockout);
5
}
Copied!

bool HasReplayLockout()

Returns whether the expedition internally has a Replay Timer lockout set. Shortcut alternative to checking HasLockout
1
my $dz = quest::get_expedition();
2
if ($dz) {
3
my $has_lockout = $dz->HasReplayLockout() ? 1 : 0;
4
quest::debug("expedition has Replay lockout: " . $has_lockout);
5
}
Copied!

bool IsLocked()

Returns if the expedition is currently locked by SetLocked
1
my $dz = quest::get_expedition();
2
if ($dz) {
3
if ($dz->IsLocked()) {
4
quest::debug("expedition is locked");
5
} else {
6
quest::debug("expedition is not locked");
7
}
8
}
Copied!

void RemoveCompass()

Removes any compass set by SetCompass
1
$dz->RemoveCompass();
Copied!

void RemoveLockout(string event_name)

Removes the lockout from the expedition and from any current members
1
$dz->RemoveLockout("Ture");
Copied!

void SetCompass(int zone_id, float x, float y, float z)

void SetCompass(string zone_short_name, float x, float y, float z)

Set the location of the expedition's dynamic zone compass. This only applies to non-instances outside of the dz.
1
$dz->SetCompass(300, 1353.15, 1712.19, 109.001); # by zone id
2
$dz->SetCompass("wallofslaughter", 1353.15, 1712.19, 109.001); # by zone name
Copied!

void SetLocked(bool locked, ExpeditionLockMessage lock_msg = ExpeditionLockMessage::None, uint32_t msg_color = Chat::Yellow)

If true, lock an expedition to prevent new members from being added. False unlocks.
Passing a lock_msg sends an expedition locked message to clients inside the expedition's dynamic zone. See ExpeditionLockMessage for types and messages
1
$dz->SetLocked(true, ExpeditionLockMessage::None); # lock with no message
2
$dz->SetLocked(true, ExpeditionLockMessage::Close); # lock with "closing" message
Copied!

void SetLootEventByNPCTypeID(uint32_t npc_type_id, string event_name)

Important: This must be set from a script inside the expedition's dynamic zone instance
Associates an event with the specified npc type id to prevent it from being looted by characters that didn't receive the event lockout from the current expedition.
This is an important initialization step to prevent exploits in expeditions
1
$dz->SetLootEventByNPCTypeID(317005, 'Keldovan the Harrier');
Copied!

void SetLootEventBySpawnID(uint32_t spawn_id, string event_name)

Important: This must be set from a script inside the expedition's dynamic zone instance
Associates an event with the specified entity spawn id to prevent it from being looted by characters that didn't receive the event lockout from the current expedition.
This is an important initialization step to prevent exploits in expeditions
Unlike SetLootEventByNPCTypeID this associates the event with specific spawns inside the dynamic zone. This is for cases where multiple npc types may exist like spawnable chests which should be associated with the event that spawned them.
1
my $chest_id = quest::spawn2(317087, 0, 0, -301 ,702, -201, 0);
2
$dz->SetLootEventBySpawnID($chest_id, "Lower Globe of Discordant Energy");
Copied!

void SetReplayLockoutOnMemberJoin(bool value)

This toggles whether Replay Timer lockouts are automatically added to new members that join an expedition
1
$dz->SetReplayLockoutOnMemberJoin(0);
Copied!

void SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading)

void SetSafeReturn(string zone_short_name, float x, float y, float z, float heading)

Set the expedition's dynamic zone safe return zone and coordinates. This is the location clients are moved to when an expedition expires or for clients that are automatically teleported out of the zone by the kick timer if they quit the expedition
1
$dz->SetSafeReturn("wallofslaughter", 1349.13, 1715.00, 123.81, 0);
Copied!

void SetSecondsRemaining(uint32 seconds_remaining)

Set seconds remaining on expedition's dynamic zone before it expires. This currently only supports reducing time. It will have no effect if the new seconds remaining is larger than the current time remaining.
Note: this method is async, GetSecondsRemaining will not immediately show the change.
1
$dz->SetSecondsRemaining(300); # close down expedition in 5 minutes
Copied!

void SetZoneInLocation(float x, float y, float z, float heading)

Override the zone-in location of the expedition's dynamic zone used by Client::MovePCDynamicZone
1
$dz->SetZoneInLocation(-9, -2466, -79, 0);
Copied!

void UpdateLockoutDuration(string event_name, uint32_t seconds, bool members_only = true)

Sets the lockout of all members in the expedition to the specified duration based on the expedition's internal lockout start time.
Unlike AddLockout which replaces lockouts with a new lockout timer, this modifies the duration of an existing lockout relative to its original start time.
Calling this on an expedition that does not have the internal lockout has no effect. All members essentially receive an updated lockout copied from the expedition's internal timer.
Prefer using AddLockoutDuration to update individual member lockouts
The expedition's internal lockout is NOT modified by default. New members added to the expedition that zone in to the dz will receive the lockout as originally added. This can be overridden by passing false for the members_only parameter.
Note: Member lockouts updated with this method are assigned the current expedition's uuid
1
$dz->UpdateLockoutDuration("Replay Timer", 25200) # 7 hours
Copied!
Last modified 6mo ago
Copy link
Contents
void AddLockout(string event_name, uint32 seconds_duration)
void AddLockoutDuration(string event_name, int seconds, bool members_only = true)
void AddReplayLockout(int seconds_duration)
void AddReplayLockoutDuration(int seconds, bool members_only = true)
uint32_t GetDynamicZoneID()
uint32_t GetID()
int GetInstanceID()
string GetLeaderName()
HASHREF GetLockouts()
string GetLootEventByNPCTypeID(uint32 npc_type_id)
string GetLootEventBySpawnID(uint32 spawn_id)
int GetMemberCount()
HASHREF GetMembers()
string GetName()
int GetSecondsRemaining()
string GetUUID()
int GetZoneID()
string GetZoneName()
int GetZoneVersion()
bool HasLockout(string event_name)
bool HasReplayLockout()
bool IsLocked()
void RemoveCompass()
void RemoveLockout(string event_name)
void SetCompass(int zone_id, float x, float y, float z)
void SetCompass(string zone_short_name, float x, float y, float z)
void SetLocked(bool locked, ExpeditionLockMessage lock_msg = ExpeditionLockMessage::None, uint32_t msg_color = Chat::Yellow)
void SetLootEventByNPCTypeID(uint32_t npc_type_id, string event_name)
void SetLootEventBySpawnID(uint32_t spawn_id, string event_name)
void SetReplayLockoutOnMemberJoin(bool value)
void SetSafeReturn(uint32_t zone_id, float x, float y, float z, float heading)
void SetSafeReturn(string zone_short_name, float x, float y, float z, float heading)
void SetSecondsRemaining(uint32 seconds_remaining)
void SetZoneInLocation(float x, float y, float z, float heading)
void UpdateLockoutDuration(string event_name, uint32_t seconds, bool members_only = true)