Post by Sakrateri on Jan 23, 2005 5:20:35 GMT -5
Saving Quests
Save your quests as a .pl This can be done by going into Notepad --> Save As --> All File Types --> "npcid.pl"
If the quest applies to any mob in the zone with the same name(99% of all cases), Quests should be saved in $EQEmuDir$/quests/zonesn/NPC_NAME.pl (replacing ` with -)
If the quest applies to a specific NPC type in the zone, and there are several npc types with the same name in that zone, auests should be saved in $EQEmuDir$/quests/zonesn/NPCID.pl
Server-wide default quest in: $EQEmuDir$/quests/default.pl
Zone-wide default quests in: $EQEmuDir$/quests/zonesn/default.pl
Commands
- Comments -
Anything after an # is a comment, and is ignored by the parser. This is useful for leaving notes if you have more than one person working on a quest. Example of a comment:
# Monrezz: Next few lines are for the Hail response.
- Events -
sub EVENT_SAY - Triggered when a mob is targeted and the player types something.
sub EVENT_ITEM - Triggered when an item is turned into the mob via trade.
sub EVENT_DEATH - Triggered when the NPC dies.
sub EVENT_ATTACK - Triggered when the NPC is attacked.
sub EVENT_SPAWN - Triggered when the NPC spawns.
sub EVENT_TIMER - Triggered by a "quest::starttimer()"
sub EVENT_SLAY - Triggered whenever an NPC kills someone.
sub EVENT_WAYPOINT - Triggers when the mob reaches a waypoint.
sub EVENT_SIGNAL - Triggered by a call to quest::signal() or quest::signalwith().
sub EVENT_ENTER - Triggered by any client who enters a mob's proximity (see quest::set_proximity)
sub EVENT_EXIT - Triggered by any client who leaves a mob's proximity (see quest::set_proximity)
- Variables -
All speaking responses are included in a $text variable:
if ($text=~/Hail/i)
Note the /i. This means it is case insensitive. It is always better to include this.
$text =~/Hello/ - Would match "Hello", but not "hello".
$text =~/hello/ - Would match "hello", but not "Hello".
$text =~/hello/i - Would match "Hello" and "hello".
$text =~/me/ - Would match the "me" in name.
$text =~/\bme\b/ - Would not match the "me" in name. The "\b" means there must not be text next to the match so "me" must be by itself.
$text =~/^me$/i - Would only match if me is the only text said. The "^" tells it it must be the first thing said and the "$" tells it it must be the last thing.
This uses Perl Regular Expression Matching. See one of the following sites for more info:
aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlrequick.html
aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlretut.html
www.erudil.com/preqr.pdf
- Identifiers -
$name - Returns the name of the user that triggered the Event.
$race - Returns the race of the user that triggered the Event.
$class - Returns the class of the user that triggered the event.
$userid - Returns the ID of the user that triggered the Event.
$ulevel - Returns the level of the user that triggered the Event.
$uguildid - Returns the ID of the guild of the user that triggered the Event.
$uguildrank - Returns the guild rank of the user that triggered the Event.
$mname - Returns the Mob's name.
$mobid - Returns the NPCTypeID of the mob that the user triggered the Event on.
$mlevel - Returns the level of the mob that the user triggered the Event on.
$faction - Returns the faction level number of the user with the mob.
1: Ally
2: Kindly
3: Warmly
4: Amiably
5: Indifferent
6: Scowls
7: threatenly
8: Dubious
9: Apprehensive
$zoneid - Returns the zone id that the Event occured in.
$zonesn - Returns the zone short name that the Event occured in.
$zoneln - Returns the zone long name that the Event occured in.
$status - Returns the account status of the user that triggered the Event.
$item1 - The item# in the first slot.
$item2 - The item# in the second slot.
$item3 - The item# in the third slot.
$item4 - The item# in the fourth slot.
$itemcount{itemid} - $itemcount{1001} would return 2 if the user turned in 2 1001 items.
$copper - returns the number of copper coins given tothe mob.
$silver - returns the number of silver coins given tothe mob.
$gold - returns the number of gold coins given tothe mob.
$platinum - returns the number of platinum coins given to the mob.
$x - The x coordinate of the NPC.
$y - The y coordinate of the NPC.
$z - The z coordinate of the NPC.
$h - The heading of the NPC.
- Commands -
Commands require a semicolon ";" at the end of each one.
- Function List -
A more recent function list is avaliable here:
www.eqemulator.net/forums/showthread.php?t=16681
quest::ChooseRandom(123, 245, 789...); - returns one of the items listted in its args randomly
quest::say("Text"); - Mob will say "Text".
quest::emote("Text"); - Mob will emote "Text".
quest::shout("Text"); - Mob will shout "Text".
quest::spawn(npc_type,grid,guildwarset,x,y,z); - Spawn "npc_type" on "grid" with "guildwarset" (use 0) at "x","y","z".
quest::unique_spawn(npc_type,grid,guildwarset,x,y,z); - just like spawn() except will not spawn it if one of that npc_type is allready in zone.
quest::echo("Text"); - Echoes specified text to console.
quest::summonitem(itemid); or quest::summonitem(itemid,charges); - Summons "itemid" to user that triggered Event. Charges is the number of charges, or number of items in the stack depending on the item type, it is also optional.
quest::castspell(id,spellid); - Casts "spell" on entity with "id".
quest::selfcast(spellid); - Forces client to cast spell on themself (useful for self only and group effect spells).
quest::depop(); - Mob will de-spawn.
quest::cumflag(); - Flag 50 for mob will increase by 1.
quest::flagnpc(flag,flag_value); - Sets "flag" to "flag_value" for mob.
quest::flagclient(flag,flag_value); - Sets "flag" to "flag_value" for client.
quest::exp(amount); - Adds "amount" of exp to user's exp amount.
quest::level(newlevel); - Sets user level.
quest::safemove(); - Moves user to zone's safe x,y,z.
quest::rain(1/0); or quest::snow(1/0); - Makes it rain or snow in zone.
quest::givecash (cop.,silv.,gold,plat); - Gives client coin.
quest::pvp("on/off"); - Sets pvp on/off for user.
quest::doanim(anim_num); - Mob will do animation for "anim_num".
quest::addskill(skill,value); - Increases "skill" by "value" for user.
quest::me("text"); - Does a name-less emote, me("The ground below you begins to shake").
quest::faction(faction_id,value); - Give player faction "value" with "faction_id".
quest::setguild(guild_id,rank); - Add player to "guild_id" with a "rank".
quest::rebind(zone id,x,y,z) - Binds the user that triggered the Event to the provided zone and loc.
quest::flagcheck - Checks the value of a quest flag.
quest::write
quest::settime(hour,minute) - Sets zone time of day. Sky/lighting changes acordingly.
quest::setsky(0-255) - changes the sky.
quest::settimer(timerID,seconds) - Starts timer for use with EVENT_TIMER You can have multiple "timerID"'s that trigger every "seconds".
quest::stoptimer(timerID) - stops the timer "timerID".
quest::settarget(type,ID) - Quest mob targets "ID" by "type" = npctype or entity.
quest::follow(ID) - Mob starts to follow "ID".
quest::sfollow() - turns off follow.
quest::movepc(zoneid,x,y,z) - Moves the user that triggered the Event to the provided zone and loc.
quest::gmmove(x,y,z) - Moves the user that triggered the Event to the provided loc.
quest::movegrp(zoneid,x,y,z) - Moves the user's Group that triggered the Event to the provided zone and loc.
quest::setallskill(0-252) - Sets all skills to value.
quest::attack("name") - Attacks "name".
quest::save() - Saves player data? see note
quest::setglobal(varname,value,options,duration) - Sets a variable for the current quest mob. See Tark's post
quest::targlobal(varname,value,duration,npcid,charid,zoneid) - Set a variable for any mob. See Tark's post
quest::delglobal(varname) - delete a variable for the quest mob. See Tark's post
quest::signal(npc_id, [wait]) - cause an EVENT_SIGNAL on all mobs in the zone with this NPC type, with $signalid = 0. wait is an optional time to wait in ms before sending signal.
quest::signalwith(npc_id,signal_id, [wait]) - same as signal(), except it sets $signal to the supplied signal_id. wait is an optional time to wait in ms before sending signal.
quest::set_proximity(minx, maxx, miny, maxy [, minz, maxz]) - Creates a proximity, if a client moves into/out of the bounds specified, proper events are generated. A mob may only have one proximity.
quest::clear_proximity() - remove a mobs proximity.
continued here
kinanu.proboards26.com/index.cgi?board=quest&action=display&thread=1106475817#nosmileys
Save your quests as a .pl This can be done by going into Notepad --> Save As --> All File Types --> "npcid.pl"
If the quest applies to any mob in the zone with the same name(99% of all cases), Quests should be saved in $EQEmuDir$/quests/zonesn/NPC_NAME.pl (replacing ` with -)
If the quest applies to a specific NPC type in the zone, and there are several npc types with the same name in that zone, auests should be saved in $EQEmuDir$/quests/zonesn/NPCID.pl
Server-wide default quest in: $EQEmuDir$/quests/default.pl
Zone-wide default quests in: $EQEmuDir$/quests/zonesn/default.pl
Commands
- Comments -
Anything after an # is a comment, and is ignored by the parser. This is useful for leaving notes if you have more than one person working on a quest. Example of a comment:
# Monrezz: Next few lines are for the Hail response.
- Events -
sub EVENT_SAY - Triggered when a mob is targeted and the player types something.
sub EVENT_ITEM - Triggered when an item is turned into the mob via trade.
sub EVENT_DEATH - Triggered when the NPC dies.
sub EVENT_ATTACK - Triggered when the NPC is attacked.
sub EVENT_SPAWN - Triggered when the NPC spawns.
sub EVENT_TIMER - Triggered by a "quest::starttimer()"
sub EVENT_SLAY - Triggered whenever an NPC kills someone.
sub EVENT_WAYPOINT - Triggers when the mob reaches a waypoint.
sub EVENT_SIGNAL - Triggered by a call to quest::signal() or quest::signalwith().
sub EVENT_ENTER - Triggered by any client who enters a mob's proximity (see quest::set_proximity)
sub EVENT_EXIT - Triggered by any client who leaves a mob's proximity (see quest::set_proximity)
- Variables -
All speaking responses are included in a $text variable:
if ($text=~/Hail/i)
Note the /i. This means it is case insensitive. It is always better to include this.
$text =~/Hello/ - Would match "Hello", but not "hello".
$text =~/hello/ - Would match "hello", but not "Hello".
$text =~/hello/i - Would match "Hello" and "hello".
$text =~/me/ - Would match the "me" in name.
$text =~/\bme\b/ - Would not match the "me" in name. The "\b" means there must not be text next to the match so "me" must be by itself.
$text =~/^me$/i - Would only match if me is the only text said. The "^" tells it it must be the first thing said and the "$" tells it it must be the last thing.
This uses Perl Regular Expression Matching. See one of the following sites for more info:
aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlrequick.html
aspn.activestate.com/ASPN/docs/ActivePerl/lib/Pod/perlretut.html
www.erudil.com/preqr.pdf
- Identifiers -
$name - Returns the name of the user that triggered the Event.
$race - Returns the race of the user that triggered the Event.
$class - Returns the class of the user that triggered the event.
$userid - Returns the ID of the user that triggered the Event.
$ulevel - Returns the level of the user that triggered the Event.
$uguildid - Returns the ID of the guild of the user that triggered the Event.
$uguildrank - Returns the guild rank of the user that triggered the Event.
$mname - Returns the Mob's name.
$mobid - Returns the NPCTypeID of the mob that the user triggered the Event on.
$mlevel - Returns the level of the mob that the user triggered the Event on.
$faction - Returns the faction level number of the user with the mob.
1: Ally
2: Kindly
3: Warmly
4: Amiably
5: Indifferent
6: Scowls
7: threatenly
8: Dubious
9: Apprehensive
$zoneid - Returns the zone id that the Event occured in.
$zonesn - Returns the zone short name that the Event occured in.
$zoneln - Returns the zone long name that the Event occured in.
$status - Returns the account status of the user that triggered the Event.
$item1 - The item# in the first slot.
$item2 - The item# in the second slot.
$item3 - The item# in the third slot.
$item4 - The item# in the fourth slot.
$itemcount{itemid} - $itemcount{1001} would return 2 if the user turned in 2 1001 items.
$copper - returns the number of copper coins given tothe mob.
$silver - returns the number of silver coins given tothe mob.
$gold - returns the number of gold coins given tothe mob.
$platinum - returns the number of platinum coins given to the mob.
$x - The x coordinate of the NPC.
$y - The y coordinate of the NPC.
$z - The z coordinate of the NPC.
$h - The heading of the NPC.
- Commands -
Commands require a semicolon ";" at the end of each one.
- Function List -
A more recent function list is avaliable here:
www.eqemulator.net/forums/showthread.php?t=16681
quest::ChooseRandom(123, 245, 789...); - returns one of the items listted in its args randomly
quest::say("Text"); - Mob will say "Text".
quest::emote("Text"); - Mob will emote "Text".
quest::shout("Text"); - Mob will shout "Text".
quest::spawn(npc_type,grid,guildwarset,x,y,z); - Spawn "npc_type" on "grid" with "guildwarset" (use 0) at "x","y","z".
quest::unique_spawn(npc_type,grid,guildwarset,x,y,z); - just like spawn() except will not spawn it if one of that npc_type is allready in zone.
quest::echo("Text"); - Echoes specified text to console.
quest::summonitem(itemid); or quest::summonitem(itemid,charges); - Summons "itemid" to user that triggered Event. Charges is the number of charges, or number of items in the stack depending on the item type, it is also optional.
quest::castspell(id,spellid); - Casts "spell" on entity with "id".
quest::selfcast(spellid); - Forces client to cast spell on themself (useful for self only and group effect spells).
quest::depop(); - Mob will de-spawn.
quest::cumflag(); - Flag 50 for mob will increase by 1.
quest::flagnpc(flag,flag_value); - Sets "flag" to "flag_value" for mob.
quest::flagclient(flag,flag_value); - Sets "flag" to "flag_value" for client.
quest::exp(amount); - Adds "amount" of exp to user's exp amount.
quest::level(newlevel); - Sets user level.
quest::safemove(); - Moves user to zone's safe x,y,z.
quest::rain(1/0); or quest::snow(1/0); - Makes it rain or snow in zone.
quest::givecash (cop.,silv.,gold,plat); - Gives client coin.
quest::pvp("on/off"); - Sets pvp on/off for user.
quest::doanim(anim_num); - Mob will do animation for "anim_num".
quest::addskill(skill,value); - Increases "skill" by "value" for user.
quest::me("text"); - Does a name-less emote, me("The ground below you begins to shake").
quest::faction(faction_id,value); - Give player faction "value" with "faction_id".
quest::setguild(guild_id,rank); - Add player to "guild_id" with a "rank".
quest::rebind(zone id,x,y,z) - Binds the user that triggered the Event to the provided zone and loc.
quest::flagcheck - Checks the value of a quest flag.
quest::write
quest::settime(hour,minute) - Sets zone time of day. Sky/lighting changes acordingly.
quest::setsky(0-255) - changes the sky.
quest::settimer(timerID,seconds) - Starts timer for use with EVENT_TIMER You can have multiple "timerID"'s that trigger every "seconds".
quest::stoptimer(timerID) - stops the timer "timerID".
quest::settarget(type,ID) - Quest mob targets "ID" by "type" = npctype or entity.
quest::follow(ID) - Mob starts to follow "ID".
quest::sfollow() - turns off follow.
quest::movepc(zoneid,x,y,z) - Moves the user that triggered the Event to the provided zone and loc.
quest::gmmove(x,y,z) - Moves the user that triggered the Event to the provided loc.
quest::movegrp(zoneid,x,y,z) - Moves the user's Group that triggered the Event to the provided zone and loc.
quest::setallskill(0-252) - Sets all skills to value.
quest::attack("name") - Attacks "name".
quest::save() - Saves player data? see note
quest::setglobal(varname,value,options,duration) - Sets a variable for the current quest mob. See Tark's post
quest::targlobal(varname,value,duration,npcid,charid,zoneid) - Set a variable for any mob. See Tark's post
quest::delglobal(varname) - delete a variable for the quest mob. See Tark's post
quest::signal(npc_id, [wait]) - cause an EVENT_SIGNAL on all mobs in the zone with this NPC type, with $signalid = 0. wait is an optional time to wait in ms before sending signal.
quest::signalwith(npc_id,signal_id, [wait]) - same as signal(), except it sets $signal to the supplied signal_id. wait is an optional time to wait in ms before sending signal.
quest::set_proximity(minx, maxx, miny, maxy [, minz, maxz]) - Creates a proximity, if a client moves into/out of the bounds specified, proper events are generated. A mob may only have one proximity.
quest::clear_proximity() - remove a mobs proximity.
continued here
kinanu.proboards26.com/index.cgi?board=quest&action=display&thread=1106475817#nosmileys