Functions

This is a list of the perl functions available in the Quest API. A full list can always be found in the EQEmu source https://github.com/EQEmu/Server/blob/master/zone/questmgr.cpp

ProTip: hit ctrl + f (Windows) or ⌘ + f (Mac) to FIND something on this page

AssignGroupToInstance

Parmeter:

instance_id (uint16)

Usage:

Assigns a group to an instance.

Example:

#:: Create a scalar variable to store instance_id--GetInstanceID returns int
my $Instance = quest::GetInstanceID($zonesn, $instanceversion);
quest::AssignGroupToInstance($Instance);

AssignRaidToInstance

Parmeter:

instance_id (uint16)

Usage:

Assigns a raid to an instance.

Example:

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceID($zonesn, $instanceversion); #:: GetInstanceID returns int
quest::AssignRaidToInstance($Instance);

AssignToInstance

Parameter:

instance_id (uint16)

Usage:

Assigns a single player to an instance.

Example

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceID($zonesn, $instanceversion); #:: GetInstanceID returns int
quest::AssignToInstance($Instance);

AssignToInstanceByCharID

Parameter:

instance_id (uint16), char_id (uint32)

Usage:

Assigns a single player to an instance by character ID.

Example

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceIDByCharID($zonesn, $instanceversion, $charid); #:: Returns int
quest::AssignToInstanceByCharID($Instance, $charid);

ChooseRandom

Parameter(s):

option1, option2, option3...

Usage:

Returns one of the items listed in its arguments randomly.

Example:

#:: Choose a random reward: 1001 - Cloth Cap, 1004 - Cloth Shirt, 1011 - Cloth Pants
quest::summonitem(quest::ChooseRandom(1001, 1004, 1011);

CreateInstance

Parameter(s):

zone_name (string), version (uint16), duration (uint32)

Usage:

Creates an instance in the given zone using specified version and duration.

Example:

quest::CreateInstance("mirb", 50, 10800);

DestroyInstance

Parameter(s):

instance_id (uint16)

Usage:

Destroys the given instance.

Example:

quest::DestroyInstance(50);

FlagInstanceByGroupLeader

Parameter(s):

zone (uint32), version (uint16)

Usage:

Assigns the group leader's instance to a player

Example:

#:: Zone 237 (mirb), instance 50
quest::FlagInstanceByGroupLeader(237,50);

FlagInstanceByRaidLeader

Parameter(s):

zone (uint32), version (uint16)

Usage:

Assigns the raid leader's instance to a player

Example:

#:: Zone 237 (mirb), instance 50
quest::FlagInstanceByRaidLeader(237,50);

FlyMode

Parameter(s):

mode [0-3] (uint8)

Usage:

Sets flymode for player where 0 = Off, 1 = On, 2 = Levitate.

Example:

#:: Turn fly mode on
quest::FlyMode(1);

GetCharactersInInstance

Parameter(s):

instance_id (uint16)

Usage:

Returns a hash of character id and instance id

Example:

#:: Instance ID 50
quest::GetCharactersInInstance(50); #:: Returns 50,123456

GetInstanceID

Parameter(s):

zone_name (string), version (uint16)

Usage:

Returns the instance id of the given zone/verison.

Example

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceID($zonesn, $instanceversion); #:: Returns uint16
quest::AssignToInstance($Instance);

GetInstanceIDByCharID

Parameter(s):

zone_name (string), version (int16), char_id (uint32)

Usage:

Returns the instance ID of the given zone and version by character ID.

Example

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceIDByCharID($zonesn, $instanceversion, $charid); #:: Returns uint16
quest::AssignToInstance($Instance);

GetInstanceTimer

Parameter(s):

None.

Usage:

Returns the timer for the instance.

Example

quest::GetInstanceTimer(); #:: Returns uint32

GetInstanceTimerByID

Parameter(s):

instance_id (uint16)

Usage:

Returns the duration timer of the specified instance. Note: If you do not provide an instance_id in the method it defaults to instance id 0 and returns 0 for time remaining.

Example

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceID($zonesn, $instanceversion); #:: Returns uint16
quest::GetInstanceTimerByID($Instance); #:: Returns timer int

GetSpellResistType

Parameter(s):

spell_id (uint32)

Usage:

Returns the Resist Type of the specified spell.

Example

quest::GetSpellResistType($spell_id); #:: Returns int

GetSpellTargetType

Parameter(s):

spell_id (uint32)

Usage:

Returns the Target Type of the specified spell.

Example

quest::GetSpellTargetType($spell_id); #:: Returns int

GetTimeSeconds

Parameter(s):

None.

Usage:

Returns unix time in seconds.

Example:

quest::GetTimeSeconds(); #:: Returns int

GetZoneID

Parameter(s):

zone (string)

Usage:

Returns the zone id.

Example:

quest::GetZoneID($zonesn); #:: Returns int

GetZoneLongName

Parameter(s):

zone (string)

Usage:

Returns the long name of the zone.

Example:

quest::GetZoneLongName($zonesn); #:: Returns string

IsBeneficialSpell

Parameter(s):

spell_id (uint32)

Usage:

Returns true if the specified spell is beneficial.

Example:

quest::IsBeneficialSpell($spell_id); #:: Returns 0 or 1

IsEffectInSpell

Parameter(s):

spell_id (uint32), effect_id (uint32)

Usage:

Returns true if the specified spell has the specified Spell Effect.

Example:

#:: Check for Spell Effect 23 - Fear
quest::IsEffectInSpell($spell_id, 23); #:: Returns 0 or 1

IsRunning

Parameter(s):

None.

Usage:

Returns the running state--0 is walking, 1 is running.

Example:

quest::IsRunning(); #:: Returns 0 or 1

LearnRecipe

Parameter(s):

recipe_id (uint32)

Usage:

Makes the client learn a recipe.

Example:

#:: Teach recipe_id 2141 - Pickled Bixie
quest::LearnRecipe(2141);

MerchantCountItem

Parameter(s):

npc_id (uint32), item_id (uint32)

Usage:

Returns the number of the specified item in stock at the specified merchant.

Example:

#:: Find out how many 12260 - Fuzzlecutter Formula 5000 are in stock at Ping_Fuzzlecutter (9133)
quest::MerchantCountItem(9133, 12260); #:: Returns int

MerchantSetItem

Parameter(s):

npc_id (uint32), item_id (uint32), quantity (uint32)

Usage:

Changes the number of the specified items in stock, at the specified quantity, at the specified merchant.

Example:

#:: Make sure there is plenty of 12260 - Fuzzlecutter Formula 5000 in stock at Ping_Fuzzlecutter (9133)
quest::MerchantSetItem(9133, 12260, 1000); #:: Quantity 1000

ModifyNPCStat

Parameter(s):

key (string), value (string)

Usage:

Changes the specified npc_types stat of the specified NPC on the fly--changes are not saved to the npc_types in the DB.

Example:

#:: Adjust the runspeed to 1.25
quest::modifynpcstat("runspeed", 1.25);

MovePCInstance

Parameter(s):

zone_id (uint32), instance_id (uint32), x (float), y (float), z (float), heading (float)

Usage:

Moves a player to the specified instance of the specified zone at the specified location and heading.

Example:

sub EVENT_CLICKDOOR {
#:: Match door id 3: Frozen Nightmare (mirb) zone in
if ($doorid == 3) {
#:: Create a scalar variable to store instance_id--GetInstanceID returns int
my $InstanceMirB = quest::GetInstanceID("mirb",50);
#:: Match if an instance exists
if ($InstanceMirB > 0) {
#:: Move the player to mirb (237), to their instance, at X - 607, Y - 1503, Z - 33, Heading - 0 (north)
quest::MovePCInstance(237,$InstanceMirB,607,1503,33,0);
}
}
}

RemoveAllFromInstance

Parameter(s):

instance_id (uint16)

Usage:

Removes ALL players from an instance by instance ID.

Example:

sub EVENT_DEATH_COMPLETE {
#:: Instance ID is a pre-exported variable
quest::RemoveAllFromInstance($instanceid);
}

RemoveFromInstance

Parameter(s):

instance_id (uint16)

Usage:

Removes the player that triggered the event from an instance by instance ID.

Example:

sub EVENT_CLICKDOOR {
if ($doorid == 1) {
quest::RemoveFromInstance($instanceid);
}
}

RemoveFromInstanceByCharID

Parameter(s):

instance_id (uint16), char_id (uint32)

Usage:

Removes a client from an instance by character ID.

Example:

#:: Create a scalar variable to store instance_id
my $Instance = quest::GetInstanceIDByCharID($zonesn, $instanceversion, $charid); #:: Returns int
quest::RemoveFromInstanceByCharID($Instance, $charid);

SendMail

Parameter(s):

to (string), from (string), subject (string), message (string)

Usage:

Used to send a mail message.

SetRunning

Parameter(s):

is_running (bool)

Usage:

Used to toggle run/walk state.

Example:

sub EVENT_SPAWN {
#:: Set the NPC to run
quest::SetRunning(1);
}

UpdateInstanceTimer

Parameter(s):

instance_id (int16), duration (uint32)

Usage:

Used to update a zone instance timer by instance id by the number of seconds specified.

Example:

sub EVENT_CLICKDOOR {
#:: When they open door 7...
if ($doorid == 7) {
#:: Add one hour of time to the current instance
quest::UpdateInstanceTimer($instanceid,3600);
}
}

UpdateSpawnTimer

Parameter(s):

spawn2_id (uint32), updated_time_till_repop (uint32)

Usage:

Used to update a spawn timer by spawn2 ID and time specified in ms.

Example:

sub EVENT_DEATH_COMPLETE {
#:: Set a random timer on Fippy Darkpaw's spawn point
quest::updatespawntimer(10875,(int(rand(600))+3600)*1000);
}

UpdateZoneHeader

Parameter(s):

key (string), value (string)

Usage:

Allows you to manipulate zone header settings on the fly. The Quest Manager lists the following possible strings: ztype, fog_red, fog_green, fog_blue, fog_minclip, fog_maxclip, gravity, time_type, rain_chance, rain_duration, snow_chance, snow_duration, sky, safe_x, safe_y, safe_z, max_z, underworld, minclip, maxclip, fog_density, suspendbuffs.

Example:

#:: Set the max clip plane to 500 units
quest::UpdateZoneHeader("maxclip", 500);

activespeakactivity

Parameter(s):

task_id (int)

Usage:

Returns the Activity ID of the lowest numbered active activity to speak with an NPC in the specified task.

Example:

If you have task id 150: activity 0--kill three rats, activity 1--talk with NPC, activity 2--kill four fire beetles, activity 3--talk with NPC.

sub EVENT_SAY {
#:: Match text for hail, case insensitive
if ($text=~/hail/i) {
#:: Create a scalar variable to store the current speak activity for task 150
$speakactivity = quest::activespeakactivity(150); #:: Returns int
#:: Match if the player is on the first speak activity
if ($speakactivity == 1) {
quest::say("I really hate rats.");
}
#:: Match if the player is on the second speak activity
elsif ($speakactivity == 3) {
quest::say("I really hate fire beetles.");
}
}
}

activespeaktask

Parameter(s):

None.

Usage:

Returns the Task ID of the lowest numbered task slot if the player who triggered the event has an active task with an active activity to speak to the NPC (returns 0 if not).

Example:

If you have task id 150: activity 0--kill three rats, activity 1--talk with NPC, activity 2--kill four fire beetles, activity 3--talk with NPC.

sub EVENT_SAY {
#:: Match text for hail, case insensitive
if ($text=~/hail/i) {
#:: Create a scalar variable to store the current task that has a speak activity
$speaktask = quest::activespeaktask(); #:: Returns int
#:: Match if there's an active task with a speak activity
if ($speaktask => 1) {
quest::say("You have a task to speak with me and its ID is $speaktask.");
}
#:: Match if there's NO active task with a speak activity
else {
quest::say("You do not have any tasks with a speaking activity at this time.");
}
}
}

activetasksinset

Parameter(s):

task_set (int)

Usage:

Returns the number of tasks in the given TaskSet that the player has active.

Example:

You have a TaskSet "20", which consists of three tasks--200, 201, 202.

sub EVENT_SAY {
#:: Create a scalar variable to store the number of active tasks in TaskSet 20
$activetaskcount = quest::activetasksinset(20); #:: returns int
#:: Match text for hail, case insensitive
if ($text=~/hail/i) {
quest::say("You have $activetaskcount tasks remaining.");
}
}

addldonloss

Parameter(s):

losses (int), theme_id (int)

Usage:

Adds to loss count for LDON adventures by LDON Theme.

Example:

#:: Add a loss for Rujarkian Hills theme
quest::addldonloss(1,4);

addldonpoints

Parameter(s):

points (int), theme_id (int)

Usage:

Adds to points count for LDON adventures by LDON Theme.

Example:

#:: Add 100 points for Rujarkian Hills theme
quest::addldonpoints(100,4);

addldonwin

Parameter(s):

wins (int), theme_id (int)

Usage:

Adds to wins count for LDON adventures by LDON Theme.

Example:

#:: Add a loss for Rujarkian Hills theme
quest::addldonwin(1,4);

addloot

Parameter(s):

item_id (uint32), charges = 0 (uint16), equip_item = true (bool)

Usage:

Add an item with a number of charges to an NPC's loot (does not permanently change the loot table or lootdrop entries). If 'equipitem' is false (0), the item will not be used by (or shown in the hands of) the NPC.

Example:

#:: Add a 5013 - Rusty Short Sword to the NPC's loot, but do not equip the item
quest::addloot(5013,0,0);

addskill

Parameter(s):

skill_id (int), value (int)

Usage:

Sets the player's skill, by Skill ID, to the value specified.

Example:

sub EVENT_SAY {
#:: Match text for train, case insensitive
if ($text=~/train/i) {
#:: Call the custom subroutine "Train"
Train();
}
}
#:: Custom subroutine
sub Train {
#:: Send a message to the client in yellow (15) text
$client->Message( 15, "Your experiences across the realm have infused you with increased power and knowledge..." );
#:: Set all available skills to maximum for race/class at current level
foreach my $skill (0 .. 77) {
#:: Continue the foreach loop using the next skill ID if the client cannot use the skill ID
next unless $client->CanHaveSkill($skill);
#:: Create a scalar variable to store the maximum skill Value for the Skill ID
my $maxSkill = $client->MaxSkill($skill, $client->GetClass(), $ulevel);
#:: Continue the foreach loop using the next Skill ID if the client has a higher skill Value for the Skill ID
next unless $maxSkill > $client->GetRawSkill($skill);
#:: Set the Skill ID to the maximum Value that the client is allowed
$client->SetSkill($skill, $maxSkill);
}
#:: Scribe all spells for current level
quest::scribespells($ulevel);
}

assigntask

Parameter(s):

task_id (int), npcid (int), enforce_level_requirement = false (bool)

Usage:

Used to assign a task to a client, optionally this can include the NPC ID and whether or not to enforce the level requirement specified in the DB.

Example:

#:: Assign Task 102
quest::assigntask(102);
#:: Assign Task 103 with level requirement enforced
quest::assigntask(103, 1);
#:: Assign Task 104 and include the NPC ID
$client->AssignTask(104, $npc->GetID());
#:: Assign Task 105, include the NPC ID with level requirement enforced
$client->AssignTask(105, $npc->GetID(), 1);

attack

Parameter(s):

client_name (string)

Usage:

Used to make the NPC attack a client, by name.

Example:

sub EVENT_SAY {
#:: Match text for "mother", case insensitive
if ($text=~/mother/i) {
quest::say("How dare you talk about my mother!");
#:: Attack the client that triggered the event
quest::attack($name);
}
}

attacknpc

Parameter(s):

npc_entity_id (int)

Usage:

Used to make the NPC attack another NPC, by Entity ID.

Example:

#:: Create a scalar variable to store the Entity ID of a_large_rat
$aggromob = $entity_list->GetMobID(2011);
#:: Get him.
quest::attacknpc($aggromob);

attacknpctype

Parameter(s):

npc_type_id (int)

Usage:

Used to make the NPC attack another NPC, by NPC Type ID.

Example:

#:: Attack a_large_rat
quest::attacknpctype(2011);

buryplayercorpse

Parameter(s):

character_id (int)

Usage:

Buries and depops a single corpse by Character ID.

Example:

sub EVENT_SAY {
#:: Create a scalar variable for storing corpse count
my $CorpseCount = 0;
#:: Create a scalar variable for storing the Character ID of the Client that triggered the event
my $charid = $client->CharacterID();
if ($text=~/hail/i) {
#:: Send the client a message in yellow (15) text
$client->Message(15,"I can [bury a corpse] or [destroy a corpse] that you have unburied.");
}
if ($text=~/bury a corpse/i) {
#:: Match if the client character has a corpse (or corpses)
if ($CorpseCount > 0) {
#:: Bury the character's corpse
quest::buryplayercorpse($charid);
$client->Message(15,"Very well, burying one of your corpses now.");
}
#:: Match if the client character does not have a corpse
else {
$client->Message(13,"You have no unburied corpses, begone.");
}
}
}

castspell

Parameter(s):

spell_id (int), target_id (int)

Usage:

Used to make the NPC cast a spell, by ID, on a target, by ID.

Example:

#:: Cast spell 12 - Healing, on the user that triggered the event
quest::castspell(12,$userid);

changedeity

Parameter(s):

deity_id (int)

Usage:

Used to permanently change the client character's deity, by Deity ID; kicks the client to character select.

Example:

#:: Change the client character's deity to 201 - Bertoxxulous
quest::changedeity(201);

checktitle

Parameter(s):

title_set_id (int)

Usage:

Used to determine if a player has the specified titleset enabled or not.

Example:

#:: Check to see if Title Set 2 (prefix "Arbiter", suffix "Harbinger of the Old World") is enabled
quest::checktitle(2); #:: Returns bool

clear_npctype_cache

Parameter(s):

npc_type_id (int)

Usage:

Clears the NPC Table.

clear_proximity

Parameter(s):

None.

Usage:

Clears an NPC's defined proximity.

Example:

sub EVENT_SPAWN {
#:: Create a proximity, 50 units across
quest::set_proximity($x - 25, $x + 25, $y - 25, $y + 25);
}
sub EVENT_ENTER {
#:: Shout a message when the event is triggered
quest::shout("Congratulations $name, you have won the race!");
#:: Clear the proximity since second place is the first loser
quest::clear_proximity();
}

clear_zone_flag

Parameter(s):

zone_id (uint32)

Usage:

Used to clear the Zone Flag, by ID, of a client character.

Example:

#:: Clear the character's Zone Flag (Sleeper's Key) for 128 - The Sleeper's Tomb (sleeper)
quest::clear_zone_flag(128);

clearspawntimers

Parameter(s):

None.

Usage:

Used to reset the spawn timers and repop a zone--similar to #repop force.

Example:

quest::clearspawntimers();

collectitems

Parameter(s):

item_id (int), remove_item = true (bool)

Usage:

Returns the number of items by ID that exist in inventory. If remove is true, items are removed as they are counted.

Example:

sub EVENT_SAY {
#:: Match text for "hail", case insensitive, and the client that triggered the event has a 1001 - Cloth Cap
if ($text=~/hail/i && plugin::check_hasitem($client, 1001)) {
quest::emote("steals your cloth cap.");
quest::collectitems(1001, 1);
}
}

completedtasksinset

Parameter(s):

task_set (int)

Usage:

Returns the number of tasks in the given Task Set that the player has completed.

Example:

sub EVENT_SAY {
#:: Match text for "tasks", case insensitive
if ($text=~/tasks/i) {
#:: Create a scalar variable to store the count of completed tasks in task set "200"
my $TasksComplete = quest::completedtasksinset(200); #:: Returns int
quest::say("You have completed $TasksComplete tasks.");
}
}

createBot

Parameter(s):

first_name (string), last_name (string), level (int), race_id (int), class_id (int), gender_id (int)

Usage:

Used to create a bot with the given parameters.

Example:

sub EVENT_ENTERZONE {
#:: Create a bot named Leroy Jenkins, who is level 50, Human, Paladin, Male
quest::createBot("Leroy", "Jenkins", 50, 1, 3, 0);
}

createdoor

Parameter(s):

model_name (string), x (float), y (float), z (float), heading (float), object_type = 58 (int), size = 100 (int)

Usage:

Creates a new door, with type 58 and size 100 as the defaults.

Example:

quest::createdoor("POKTELE500", -582.532, 2324.96, -47.8143, 120, 58, 100);

creategroundobject

Parameter(s):

item_id (int), x (float), y (float), z (float), heading (float), decay_time (uint32)

Usage:

Creates an object on the ground with the given parameters, decay time is ms = 300000 by default.

Example:

sub EVENT_WAYPOINT_ARRIVE {
#:: Create a 12274 - Chalice of Conquest at the NPC's current location
quest::creategroundobject(12274, $x, $y, $z, $h);
}

creategroundobjectfrommodel

Parameter(s):

model_name (string), x (float), y (float), z (float), heading (float), object_type (int), decay_time (uint32)

Usage:

Creates an object on the ground with the given parameters, decay time is ms = 300000 by default.

Example:

#:: Create a 17330 - Bag of Supplies at the given location
quest::creategroundobjectfrommodel("IT64_ACTORDEF", 2497, -557, -327, 58, 17330);

createguild

Parameter(s):

guild_name (string), leader_name (string)

Usage:

Creates a guild.

Example:

sub EVENT_SAY{
if (quest::createguild("Akkadius Fire", $client->GetName())) {
$client->Message(15, "Guild has been created successfully");
}
else{
$client->Message(15, "Guild creation error");
}
}

crosszonemessageplayerbyname

Parameter(s):

channel_id (int), name (string), message (string)

Usage:

Sends a message to a client character on the specified channel. Useful for Expeditions and Shared Tasks.

Example:

quest::crosszonemessageplayerbyname(15, $name, "Hi.");

crosszonesetentityvariablebyclientname

Parameter(s):

client_name (string), key (string), value (string)

Usage:

Sets entity variables world-wide for the provided client character.

crosszonesetentityvariablebynpctypeid

Parameter(s):

npc_type_id (int), key (string), value (string)

Usage:

Sets entity variables world wide with specified npctype_id.

crosszonesignalclientbycharid

Parameter(s):

character_id (int), value (int)

Usage:

Signals the client by character ID world wide.

Example:

#:: Signal the client character who triggered the event with "5000"
quest::crosszonesignalclientbycharid($charid,5000);

crosszonesignalnpcbynpctypeid

Parameter(s):

npc_type_id (uint32), value (uint32)

Usage:

Signals all NPC entities world-wide with the specified value.

Example:

#:: Signal all 4036 - a_giant_rat with "99"
quest::crosszonesignalnpcbynpctypeid(4036, 99);

debug

Parameter(s):

message (string), debug_level (uint8)

Usage:

Allows you to export debug information for an event, at the specified level (1 through 3).

Example:

sub EVENT_ENVIRONMENTAL_DAMAGE {
quest::debug("EVENT_ENVIRONMENTAL_DAMAGE");
quest::debug("env_damage is " . $env_damage);
quest::debug("env_damage_type is " . $env_damage_type);
quest::debug("env_final_damage is " . $env_final_damage);
}

delglobal

Parameter(s):

key (string)

Usage:

Deletes a quest global. Please consider using Data Buckets instead of quest globals.

Example:

quest::delglobal("strongbox");

depop

Parameter(s):

npc_type_id (int)

Usage:

Depops an NPC by npc_type_id, default is 0 (self).

Example:

#:: Depop self
quest::depop();

depop_withtimer

Parameter(s):

npc_type_id (int)

Usage:

Depops an NPC by npc_type_id, default is 0 (self), and restarts the spawn point timer.

Example:

#:: Depop self and restart spawn timer
quest::depop_withtimer();

depopall

Parameter(s):

npc_type_id (int)

Usage:

Depops all NPC entities with npc_type_id in the zone. Default is 0 (self and others like me).

Example:

#:: Depop all 4036 - a_giant_rat
quest::depopall(4036);

depopzone

Parameter(s):

start_spawn_status (bool)

Usage:

Depops the zone with the specified parameter. Default is false (don't start spawn timers).

Example:

#:: Depop the zone and don't start the spawn timers
quest::depopzone();

ding

Parameter(s):

None.

Usage:

Plays the beautiful ding sound, the trumpet fanfare for your glorious deeds. Congratulations, winner. You did it.

Example:

#:: Ding!
quest::ding();

disable_proximity_say

Parameter(s):

None.

Usage:

Disables proximity say for the NPC. Proximity say must be enabled with quest::set_proximity(); and quest::enable_proximity_say();.

Example:

quest::disable_proximity_say();

disable_spawn2

Parameter(s):

spawn2_id (int)

Usage:

Disables the spawn point specified and depops any NPC entity from that spawn point.

Example:

#:: Disable the spawn point for 151562 - spawngroup ID 113004 - npcIDs 15138 (Droon) and 15160 (Proon)
quest::disable_spawn2(151562);

disablerecipe

Parameter(s):

recipe_id (int)

Usage:

Disables the recipe specified by Recipe ID.

Example:

#:: Disable recipe 1 - Blessed Fishing Rod
quest::disablerecipe(1);

disabletask

Parameter(s):

task_id (int)

Usage:

Disables a task so that it is not available to a client character. Useful if you do not want someone to repeat a task.

Example:

#:: Match if the player has an active task
if ($task != 0) {
#:: Create a scalar variable to store the active speak-to activity
$activity = quest::activespeakactivity($task);
#:: Mark the activity as complete
quest::updatetaskactivity($task, $activity);
quest::say("Well done!");
#:: Offer the next task, if there is one
if (!quest::istaskactive($task)) {
#:: Disable the task so that it cannot be repeated
quest::disabletask($task);
#:: Match if there are tasks remaining in the Task Set
if ($task != quest::lasttaskinset(200)) {
quest::say("Well done, I have another task if you are willing.");
#:: Enable the next Task in the Task Set
quest::enabletask(quest::nexttaskinset(200, $task));
}
#:: Match if there are no tasks remaining in the task set
else {
quest::say("Thank you for cleansing Qeynos Hills!");
}
}
}

doanim

Parameter(s):

animation_id (int)

Usage:

Makes the NPC perform the indicated Animation.

Example:

#:: Perform the Cheer animation
quest::doanim(27);

quest::echo

Parameter(s):

emote_color_id (int), message (string)

Usage:

Echoes the specified message string, in the specified color, to the client console.

Example:

#:: Echo a message in yellow text (15)
quest::echo(15,"Hello, world");

emote

Parameter(s):

message (string)

Usage:

Makes the NPC emote the specified message string.

Example:

sub EVENT_DEATH_COMPLETE {
quest::emote("'s corpse says 'How...did...ugh...'");
}

enable_proximity_say

Parameter(s):

None.

Usage:

Enables proximity say for the NPC--the target would not have to have the NPC targeted to interact if the NPC has a defined proximity and proximity say is enabled.

Example:

sub EVENT_SPAWN {
#:: Create a proximity, 100 units across, 100 units tall, enable proximity say
quest::set_proximity($x - 50, $x + 50, $y - 50, $y + 50, $z - 50, $z + 50, 1);
#:: Also, enable proximity say
quest::enable_proximity_say();
}
sub EVENT_PROXIMITY_SAY {
if ($text=~/Ganelorn Oast/i) {
quest::say("Ganelorn Oast! For he has single-handedly caught more poachers than any other ranger. He is credited for helping numerous endangered species recover from certain extinction. I suppose I am lucky he is fond of my sister, as I am soon to train under him as an apprentice. Perhaps one day I will even [" . quest::saylink("call upon the flames") . "] in the way that he does.");
}
elsif ($text=~/call upon the flames/i) {
quest::say("Aye, Ganelorn is renowned not only for his abilities as an archer and a master of melee combat, but also for his use of powerful magics. Never before have I seen a forester evoke a fireball of such great force. It would be any ranger's dream to become his pupil just to study that one spell. Ganelorn doesn't train just anyone, though. If you want to learn from him, I'm certain you would have to prove yourself as a forester.");
}
if ($text=~/I want to learn/i) {
quest::say("He is a very busy individual. I believe he is currently in the eastern part of the Karanas trying to track down a poacher. Even if you can track him down, don't get your hopes up.");
#:: Send a signal 2 to The Greater Faydark >> Lily_Ashwood (54086)
quest::signalwith(54086, 2, 3);
}
}

enable_spawn2

Parameter(s):

spawn2_id (int)

Usage:

Enables the specified spawn point.

Example:

sub EVENT_DEATH_COMPLETE {
#:: Enable the spawn timer for 151562 - spawngroup ID 113004 - npcIDs 15138 (Droon) and 15160 (Proon)
quest::enable_spawn2(151562);
}

enabledtaskcount

Parameter(s):

task_set (int)

Usage:

Counts the enabled tasks in the specified Task Set.

Example:

#:: Match if there are no enabled tasks in Task Set 10
if (quest::enabledtaskcount(10) == 0) {
quest::enabletask(50, 51, 52);
}

enablerecipe

Parameter(s):

recipe_id (int)

Usage:

Enables the recipe specified by Recipe ID.

Example:

#:: Enable recipe 1 - Blessed Fishing Rod
quest::enablerecipe(1);

enabletask

Parameter(s):

task_id (int)

Usage:

Enables a task.

Example:

#:: Match if the player has an active task
if ($task != 0) {
#:: Create a scalar variable to store the active speak-to activity
$activity = quest::activespeakactivity($task);
#:: Mark the activity as complete
quest::updatetaskactivity($task, $activity);
quest::say("Well done!");
#:: Offer the next task, if there is one
if (!quest::istaskactive($task)) {
#:: Disable the task so that it cannot be repeated
quest::disabletask($task);
#:: Match if there are tasks remaining in the Task Set
if ($task != quest::lasttaskinset(200)) {
quest::say("Well done, I have another task if you are willing.");
#:: Enable the next Task in the Task Set
quest::enabletask(quest::nexttaskinset(200, $task));
}
#:: Match if there are no tasks remaining in the task set
else {
quest::say("Thank you for cleansing Qeynos Hills!");
}
}
}

enabletitle

Parameter(s):

title_set_id (int)

Usage:

Enables the specified Title Set.

Example:

sub EVENT_ITEM_CLICK {
#:: Match if item 98471 - Mastering Tinkering Master I is clicked
if ($itemid == 98471) {
#:: Tinkering Mastery AA ID 575 Rank 1
$client->GrantAlternateAdvancementAbility(575,1,0);
#:: Send a message in Yellow (15) text
$client->Message(15,"You have mastered tinkering!");
#:: Ding!
quest::ding();
#:: Enable tinkering mastery title set
quest::enabletitle(10);
}
}

exp

Parameter(s):

amount (int)

Usage:

Gives the amount of experience specified to the client character.

Example:

#:: Grant 100 experience points
quest::exp(100);

faction

Parameter(s):

faction_id (int), value (int), temp (int)

Usage:

Gives the client character the faction, specified by Faction ID, in the amount specified by value. Temp is optional, and defaults to 0. Temp values are: 0 (permanent, with a message), 1 (temporary, without a message), 2 (temporary, with a message), or 3 (permanent, without a message).

Example:

#:: Set faction
quest::faction(192,10); #:: +10 League of Antonican Bards
quest::faction(184,10); #:: +10 Knights of Truth
quest::faction(135,10); #:: +10 Guards of Qeynos
quest::faction(273,-30); #:: -30 Ring of Scale

factionvalue

Parameter(s):

None.

Usage:

Returns faction values for the client character that triggered the event. Generally the opposite values of $faction, with 1 being "scowls" and 9 being "ally" ($faction considers 1 to be "ally", and 9 "scowls").

Example:

sub EVENT_SAY {
if ($text=~/hail/i) {
#:: Create a scalar variable for storing faction
my $backwardfaction = quest::factionvalue(); #:: Returns int
quest::say("Your faction is $faction, but your faction is $backwardfaction"); #:: $faction is pre-exported and returns int
}
}

failtask

Parameter(s):

task_id (int)

Usage:

Fails the task, by Task ID, for the client character that triggered the event.

Example:

#:: Fail Task 216
quest::failtask(216);

firsttaskinset

Parameter(s):

task_set (int)

Usage:

Returns the first task in the specified Task Set.

Example:

sub EVENT_SAY {
#:: If the player hasn't completed the last task in the Task Set
if (!quest::istaskcompleted(quest::lasttaskinset(200))) {
#:: If the player has no tasks enabled for this task set, enable the first one
if (quest::enabledtaskcount(200) == 0) {
quest::say("You have not done any of my tasks before!");
#:: Enable the first task in Task Set 200
quest::enabletask(quest::firsttaskinset(200));
}
}
}

follow

Parameter(s):

entity_id (int), distance (int)

Usage:

Used to make an NPC follow another NPC, specified by Entity ID. The distance determines how many units the NPC will follow behind the specified NPC, with a default value of 10; distance is optional.

Example:

sub EVENT_SPAWN {
#:: Create a timer that triggers every 10 seconds
quest::settimer("follow",10);
}
sub EVENT_TIMER {
#:: Match if the timer is named "follow"
if ($timer eq "follow") {
#:: Create a scalar variable to store the NPC Type ID for mob 2161
my $getmobbynpctype = $entity_list->GetMobByNpcTypeID(2161);
#:: Create a scalar variable to store the Entity ID of the aforementioned NPC
my $follow_target = $getmobbynpctype->GetID();
#:: Follow the NPC at a default distance of 10 units
quest::follow($follow_target);
#:: Clean up and stop the timer
quest::stoptimer("follow");
}
}

forcedoorclose

Parameter(s):

door_id (int), alt_mode (bool)

Usage:

Forces a door, by Door ID, to close. Alt_Mode is default false.

Example:

#:: Close Door ID 31 in Befallen
quest::forcedoorclose(31);

forcedooropen

Parameter(s):

door_id (int), alt_mode (bool)

Usage:

Forces a door, by Door ID, to open. Alt_Mode is default false.

Example:

#:: Open Door ID 31 in Befallen
quest::forcedooropen(31);

get_rule

Parameter(s):

rule_name (string)

Usage:

Returns the value of the specified Rule for the zone you're in.

Example:

#:: Get the rule value for rule "Zone:UseZoneController"
sub EVENT_SAY {
if ($text=~/Hail/i) {
plugin::Whisper(quest::get_rule("Zone:UseZoneController")); #:: Whispers rule value to client.
}
}

get_spawn_condition

Parameter(s):

zone_short (string), instance_id (int), condition_id (int)

Usage:

Returns the value of the specified spawn condition.

Example:

#:: Get the Spawn Condition for Condition ID 1, in the default instance of Lesser Faydark
quest::get_spawn_condition("lfaydark", 0, 1); #:: Returns int

getguildnamebyid

Parameter(s):

guild_id (uint32)

Usage:

Returns the name of the Guild for the specified Guild ID.

Example:

sub EVENT_CONNECT {
#:: Announce the name of the client character that triggered the event in GM Say
quest::gmsay("$name has connected.", 18, 1);
#:: Announce the Account Name of the client character that triggered the event in GM Say
quest::gmsay(" Account Name: " . $client->AccountName() . " - Status: $status", 18, 1);
#:: Match if the client character has a guild
if ($uguild_id > 0) {
#:: Create a scalar variable to store the name of the client character's guild
my $guildname = quest::getguildnamebyid($uguild_id);
#:: Announce the client character's information in GM Say
quest::gmsay("(Character Profile: Level $ulevel $race $class) <$guildname>)", 18, 1);
}
#:: Match if the client character does not have a guild
else {
#:: Announce the client character's information in GM Say
quest::gmsay("(Character Profile: Level $ulevel $race $class) <No Guild>", 18, 1);
}
}

getinventoryslotid

Parameter(s):

identifier (string)

Usage:

Returns the Inventory Slot ID for the specified identifier. Reference Perl Inventory Slot Identifiers for appropriate identifier tokens.

Example:

#:: Create a scalar variable to store an item ID
my $charmitem = $client->GetItemIDAt(quest::getinventoryslotid("charm")); #:: returns int

getlevel

Parameter(s):

type (int)

Usage:

Returns the level for the Type specified. Types can be 0 (self), 1 (group average), 2 (raid average), 3 (raid average, group average, or self), or 4 (self level 2--the highest level attained by self).

Example:

#:: Get the level of the client character
quest::getlevel(0); #:: Returns int

getplayerburiedcorpsecount

Parameter(s):

character_id (int)

Usage:

Returns the number of corpses for the specified Character ID that are buried.

Example:

#:: Get the number of burried corpses for character ID 12345
quest::getplayerburriedcorpsecount(12345); #:: return int

gettaskactivitydonecount

Parameter(s):

task_id (int), activity_id (int)

Usage:

Returns the task activity done count, by Task ID and Activity ID, for the client entity.

Example:

#:: Find out how many times the client character has killed 10 beetles in Unrest
quest::gettaskactivitydonecount(15,3); #:: Returns int

givecash

Parameter(s):

copper (int), silver (int), gold (int), platinum (int)

Usage:

Gives the specified amount of money to the client that triggered the event.

Example:

#:: Create a hash for storing cash - 20 to 100cp
my %cash = plugin::RandomCash(20,100);
#:: Grant a random cash reward
quest::givecash($cash{copper},$cash{silver},$cash{gold},$cash{platinum});

gmmove

Parameter(s):

x (float), y (float), z (float)

Usage:

Moves the entity to the specified coordinates.

Example:

sub EVENT_SPAWN {
#:: Create a timer that loops each second
quest::settimer("position",1);
}
sub EVENT_TIMER {
#:: Match if the timer "position" has looped and the X and Y coordinates are outside the specified range
if ($timer eq "position" && ($x < -353 || $x > -109 || $y < -549 || $y > -310)) {
quest::shout("No! I must not leave the time chamber! If I do, I'll age and die!");
#:: Move the NPC back to the chamber
$npc->GMMove(-231.464005,-432.937469,202.375946,.125);
}
}
sub EVENT_DEATH_COMPLETE {
quest::stoptimer("position");
}

gmsay

Parameter(s):

message (string), color_id (int), send_to_world (bool), guild_id (uint32), minstatus ()

Usage:

Sends a message to the client console if the parameters are met. Color, Send to World, Guild ID, and Minimum Status are all optional, but Color defaults to 0 (white), Send to World defaults to 0 (false), and Minimum Status defaults to 80.

Example:

#:: Send white text to all players in the current zone with an admin status of >= 80
quest::gmsay("Text");
#:: Send yellow (15) text to all players in the current zone with an admin status of >= 80
quest::gmsay("Text", 15);
#:: Send yellow (15) text to all players with an admin status of >= 80 in all zones
quest::gmsay("Text", 15, 1);
#:: Send yellow (15) text to all players with an admin status of >= 80 in all zones, who are in a guild with a Guild ID of 30
quest::gmsay("Text", 15, 1, 30);
#:: Send yellow (15) text to all players with an admin status of >= 0 in all zones, who are in a guild with a Guild ID of 30
quest::gmsay("Text", 15, 1, 30, 0);

has_zone_flag

Parameter(s):

zone_id (uint32)

Usage:

Used to verify that a client character has the required zone flag for the specified zone.

Example:

sub EVENT_CLICKDOOR {
if ($doorid == 12) {
if (quest::has_zone_flag(200) != 1) { #:: Returns bool
quest::set_zone_flag(200);
}
}
}

incstat

Parameter(s):

stat_id (int), value (int)

Usage:

Increases the specified stat by double the specified value. Stat IDs: STR = 0, STA = 1, AGI = 2, DEX = 3, INT = 4, WIS = 5, CHA = 6. Note: if you're increasing stats, the client will have to zone to see the effect.

Example:

#:: Increase STR by 20
quest::incstat(0, 10);

isdisctome

Parameter(s):

item_id (int)

Usage:

Used to check if the specified item, by Item ID, is a discipline tome. You likely have a plugin for this (plugin::try_tome_handins).

Example:

sub EVENT_ITEM {
quest::traindisc($item1) if (quest::isdisctome($item1));
quest::traindisc($item2) if (quest::isdisctome($item2));
quest::traindisc($item3) if (quest::isdisctome($item3));
quest::traindisc($item4) if (quest::isdisctome($item4));
}

isdooropen

Parameter(s):

door_id (int)

Usage:

Checks to see if the specified door is open.

Example:

sub EVENT_CLICKDOOR {
my $doorcheck = quest::isdooropen(41); #:: Returns bool
if ($doorid == 41 && $doorcheck == 0) {
quest::forcedooropen(41);
}
}

istaskaappropriate

Parameter(s):

task_id (int)

Usage:

Used to see if a task is set for the appropriate level for the client character who initiated the event.

Example:

#:: Check if task 200 is appropriate
quest::istaskaappropriate(200); #:: Returns bool

istaskactive

Parameter(s):

task_id (int)

Usage:

Used to determine if a task is active, by Task ID.

Example:

#:: Check if task 212 is active
quest::istaskactive(212); #:: Returns bool

istaskactivityactive

Parameter(s):

task_id (int), activity_id (int)

Usage:

Used to determine if a task activity is active, by Task ID and Activity ID.

Example:

#:: Check if Activity 9 of Task 212 is active
quest::istaskactivityactive(212, 9); #:: Returns bool

istaskcompleted

Parameter(s):

task_id (int)

Usage:

Used to determine if a task is completed, by Task ID.

Example:

#:: Check if task 212 is completed
quest::istaskcompleted(212); #:: Returns bool

istaskenabled

Parameter(s):

task_id (int)

Usage:

Used to determine if a task is enabled, by Task ID.

Example:

#:: Check if task 212 is enabled
quest::istaskenabled(212); #:: Returns bool

Parameter(s):

item_id (int)

Usage:

Used to send a link of the specified item, by Item ID.

Example:

#:: Send an item link for a 1001 - Cloth Cap
quest::itemlink(1001);

lasttaskinset

Parameter(s):

task_set (int)

Usage:

Returns the last task in the specified Task Set.

Example:

#:: Find the Task ID of the last task in Task Set 200
quest::lasttaskinset(200); #:: Returns int

level

Parameter(s):

new_level (int)

Usage:

Sets the level to the specified new level for the client character that triggered the event.

Example:

sub EVENT_SAY {
if ($text=~/level/i) {
#:: Match if user's level is 20 or under
if ($ulevel <= 20) {
#:: Give the player one more level
quest::level($ulevel+1);
}
elsif ($ulevel >= 21) {
$npc->CastSpell(808, $userid);
quest::say("Begone!");
}
}
}

me

Parameter(s):

message (string)

Usage:

Sends an emote without a name.

Example:

quest::me("This creature has no need for your money.");

movegrp

Parameter(s):

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

Usage:

Moves the group of the client character that triggered the event to the specified Zone, by Zone ID, to the location specified.

Example:

#:: Match text for "we are ready", case insensitive
if ($text=~/We are ready/i) {
#:: Move the group to The Plane of Nightmares (ponightmare) at X=1194, Y=1121, Z=208
quest::movegrp(204,1194,1121,280);
}

movepc

Parameter(s):

zone_id (int), x (float), y (float), z (float), heading (float)

Usage:

Moves the client character that triggered the event to the specified zone, by Zone ID, at the specified location. Heading is optional, but will default to 0 (North).

Example:

#:: Match text for "travel to butcherblock", case insensitive
if ($text=~/travel to butcherblock/i) {
#:: Move the character to Butcherblock Mountains (butcher), at X=3168.92, Y=851.92, Z=11.66--the Southern dock
quest::movepc(68,3168.92,851.92,11.66);
}

moveto

Parameter(s):

x (float), y (float), z (float), heading (float), save_guard_location (bool)

Usage:

Used to move the NPC to the specified location. Heading and Save Guard Location are optional. Heading will default to 0 (North), and Save Guard Location will also default to 0, causing the NPC to path back. Set Save Guard Location to 1 to make the NPC stay at the moveto location.

Example:

sub EVENT_ITEM {
#:: Match a 12278 - Abandoned Orc Shovel
if (plugin::takeItems(12278 => 1)) {
#:: 0=Stand, 1=Sit, 2=Duck, 3=Feign Death, 4=Kneel
$npc->SetAppearance(0);
#:: Move to the specified location and guard
quest::moveto(-395.87, 807.04, 70.53, 0, 1);
}
#:: Return unused items
plugin::returnUnusedItems();
}

nexttaskinset

Parameter(s):

task_set (int), task_id (int)

Usage:

Returns the next task in the specified Task Set that comes after the specified Task ID.

Example:

sub EVENT_SAY {
#:: Create a scalar variable to store a task integer
$task = quest::activespeaktask();
#:: Match if there is an active task to speak to the NPC
if ($task != 0) {
#:: Match if there are no active tasks for the current speaking task
if (!quest::istaskactive($task)) {
#:: Disable the current speaking task
quest::disabletask($task);
#:: Match if the current speaking task is NOT the last task in the Task Set
if ($task != quest::lasttaskinset(200)) {
quest::say("Well done, I have another task if you are willing.");
#:: Enable the next task in Task Set 200
quest::enabletask(quest::nexttaskinset(200, $task));
}
else {
quest::say("Thank you for cleansing Qeynos Hills!");
}
}
}
}

npcfeature

Parameter(s):

feature (string), value (int)

Usage:

Allows you to temporarily change the specified feature on the NPC to the specified value. Allowable features are: race, gender, texture, helm, haircolor, beardcolor, eyecolor1, eyecolor2, hair, face, beard, heritage, tatoo, details, and size.

Example:

#:: Change the NPC's size to 10
quest::npcfeature("size", 10);

npcgender

Parameter(s):

gender_id (int)

Usage:

Used to temporarily change the gender of the NPC as specified: 0 = Male, 1 = Female, 2 = Neuter.

Example:

#:: Change the NPC's gender to female
quest::npcgender(1);

npcrace

Parameter(s):

race_id (int)

Usage:

Used to temporarily change an NPC's Race.

Example:

#:: Change the NPC's Race to Golem (17)
quest::npcrace(17);

npcsize

Parameter(s):

size (int)

Usage:

Used to temporarily change the NPC's size.

Example:

#:: Change the NPC's size to 17
quest::npcsize(17);

npctexture

Parameter(s):

texture_id (int)

Usage:

Used to temporarily change the NPC's texture.

Example:

#:: Change the NPC's texture to 2
quest::npctexture(2);

pause

Parameter(s):

duration-ms (int)

Usage:

Forces the NPC to pause for the specified duration in ms.

Example:

#:: Pause for 1 second
quest::pause(1000);

permaclass

Parameter(s):

class_id (int)

Usage:

Permanently changes the class of the client character that triggered the event to the specified class, and disconnects them.

Example:

#:: Change class to Warrior
quest::permaclass(1);

permagender

Parameter(s):

gender_id (int)

Usage:

Permanently changes the gender of the client character that triggered the event to the specified gender, and disconnects them.

Example:

#:: Change gender 0 = Male, 1 = Female, 2 = Neuter.
quest::permagender(0);

permarace

Parameter(s):

race_id (int)

Usage:

Permanently changes the Race Type of the client character that triggered the event to the specified race, and disconnects them.

Example:

#:: Change race to Human
quest::permarace(1);

playerfeature

Parameter(s):

feature (string), setting (int)

Usage:

Temporarily changes the player feature to the specified setting. Acceptable strings are: race, gender, texture, helm, haircolor, beardcolor, eyecolor1, eyecolor2, hair, face, beard, heritage, tattoo, details, or size.

Example:

#:: Change race to Human
quest::playerfeature("race", 1);

playergender

Parameter(s):

gender_id (int)

Usage:

Temporarily changes the gender of the client character that triggered the event to the specified gender.

Example:

#:: Change gender 0 = Male, 1 = Female, 2 = Neuter.
quest::playergender(0);

playerrace

Parameter(s):

race_id (int)

Usage:

Temporarily changes the Race Type of the client character that triggered the event to the specified race.

Example:

#:: Change race to Human
quest::playerrace(1);

playersize

Parameter(s):

newsize (int)

Usage:

Temporarily adjusts the size of the client character that triggered the event to the specified size.

Example:

#:: Change size to 10
quest::playersize(10);

playertexture

Parameter(s):

texture_id (int)

Usage:

Temporarily changes the texture of the client character that triggered the event to the specified texture.

Example:

#:: Change texture to 2
quest::playertexture(2);

Parameter(s):

window_title (string), message (string), popup_id (int), buttons (int), duration (int)

Usage:

Used to create a popup window with the specified parameters. The parameters popup_id, buttons, and duration are optional. Button parameters are: 0=OK button, 1=Yes/No buttons. Setting duration to 0 results in a popup that will remain until dismissed.

Example:

sub EVENT_ENTER {
#:: Popup window entitled "Teleport", Question: "Teleport to The Plane of Hate?", popup ID 666, Yes/No buttons, remain until dismissed
quest::popup('Teleport', 'Teleport to The Plane of Hate?', 666, 1, 0);
}
sub EVENT_POPUPRESPONSE {
if ($popupid == 666) {
#:: Teleport the player to The Plane of Hate
quest::movepc(186,-393,656,3);
}
}

pvp

Parameter(s):

mode (string)

Usage:

Toggles the PVP setting for the client character that triggered the event. String can be on, or off.

Example:

#:: Turn pvp on
quest::pvp("on");
#:: Turn pvp off
quest::pvp("off");

qs_player_event

Parameter(s):

character_id (int), message (string)

Usage:

Adds a record to table qs_player_events with the specified parameters.

Example:

quest::qs_player_event($charid,"Triggered an event with this API call in it.")

qs_send_query

Parameter(s):

query (string)

Usage:

Send a raw query to the QueryServ process.

Example:

quest::qs_send_query("SELECT * FROM `qs_player_events` WHERE `event_desc` LIKE '%level%' LIMIT 0,1000;");

rain

Parameter(s):

weather (int)

Usage:

Changes the rainy weather to the specified setting: 0=none, 1=rain. See also quest::snow().

Example:

sub EVENT_ZONE {
if ($name=~/turmoiltoad/i) {
#:: Turn on the rain for those left behind
quest::rain(1);
}
}

rebind

Parameter(s):

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

Usage:

Binds the client character that triggered the event to the specified zone (by Zone ID) at the specified location.

Example:

#:: Change bind point to Rivervale, X=0, Y=0, Z=3.13
quest::rebind(19, 0.00, 0.00, 3.13);

removetitle

Parameter(s):

title_set_id (int)

Usage:

Removes the specified Title Set from the client character that triggered the event.

Example:

#:: Remove Title Set 2 (prefix "Arbiter", suffix "Harbinger of the Old World")
quest::removetitle(2);

repopzone

Parameter(s):

None.

Usage:

Repops the zone and re-enables spawn timers.

Example:

#:: Repop the zone
quest::repopzone();

resettaskactivity

Parameter(s):

task_id (int), activity_id (int)

Usage:

Sets the done count to 0 for the specified Task ID

Example:

#:: Reset the activity done count for task 202
quest::resettaskactivity(202);

respawn

Parameter(s):

npc_type_id (int), grid_id (int)

Usage:

Respawns the specified NPC by npc_type ID on the specified grid. This is similar to quest::spawn2(), but without the specified x, y, z, heading parameters.

Example:

#:: Spawn Fippy Darkpaw again
quest::respawn(2001);

resume

Parameter(s):

None.

Usage:

Used to resume pathing on a grid that has been stopped.

Example:

#:: Resume pathing on grid
quest::resume();

safemove

Parameter(s):

None.

Usage:

Moves the client character that triggered the event to the safe coordinates of the current zone.

Example:

#:: Move to safe
quest::safemove();

save

Parameter(s):

None.

Usage:

Saves the character data for the client character that triggered the event.

Example:

#:: Save Save Save
quest::save();

say

Parameter(s):

message (string), language_id (int)

Usage:

Used to make your NPC speak. Language ID is optional--if not specified, the NPC will speak in common tongue.

Example:

quest::say("Hello.");
#:: Now in Barbarian
quest::say("Hello.", 1);

Parameter(s):

message (string), silent (bool)

Usage:

Used to create a say link. The silent parameter bools false by default, and is optional.

Example:

quest::say("This is [" . quest::saylink("purple text") . "] that you can click.");

scribespells

Parameter(s):

max_level (int), min_level (int)

Usage:

Used to add spells to the spell book of the client character that triggered the event.

Example:

#:: Scribe all spells up to current level
quest::scribespells($ulevel,1);

selfcast

Parameter(s):

spell_id (int)

Usage:

Used to cause client characters to cast the specified spell on themselves.

Example:

#:: Not with your hand, with MY hand!
quest::selfcast(521);

set_proximity

Parameter(s):

min_x (float), max_x (float), min_y