// This will heal the character with 2000 hp, buff with
// Bless 10 and Increase AGI 5, and display appropriate
// effects.
mes "Blessed be!";
skilleffect 28,2000;
heal 2000,0;
skilleffect 34,0;
// That's bless 10.
sc_start 10,240000,10;
skilleffect 29,0;
// That's agi 5
sc_start 12,140000,5;
Return to the table of contents
*npcskilleffect <skill id>,<number>,<x>,<y>;
This command behaves identically to 'skilleffect', however, the effect will not
be centered on the invoking character's sprite, nor on the NPC sprite, if any,
but will be centered at map coordinates given on the same map as the invoking
character.
Return to the table of contents
*specialeffect <effect number>;
This command will display special effect with the given number, centered on the
specified NPCs coordinates, if any. For a full list of special effect numbers
known see 'doc/effect_list.txt'. Some effect numbers are known not to work in
some client releases. (Notably, rain is absent from any client executables
released after April 2005.)
Return to the table of contents
*specialeffect2 <effect number>;
This command behaves identically to the 'specialeffect', but the effect will be
centered on the invoking character's sprite.
Return to the table of contents
*nude;
This command will unequip anything equipped on the invoking character.
It is not required to do this when changing jobs since 'jobchange' will unequip
everything not equippable by the new job class anyway.
Return to the table of contents
*gmcommand "<character name>:<command line>";
*atcommand "<character name>:<command line>";
*charcommand "<character name>:<command line>";
This command will run the given command line exactly as if it was typed in from
the keyboard by the player connected to the invoking character, and that
character belonged to an account which had GM level 99.
The first form, 'gmcommand' existed pre-SVN2177, after that, it was replaced by
two different commands, one 'atcommand', for the commands that start with '@',
the other, 'charcommand', for the commands that start with '#' and affect other
characters. (You can configure this second symbol to be something else, so it
might be different for you.)
Even though the character name and the ':' are not used for anything whatsoever,
it is required to give them in this command because it is processed exactly as
if typed from the keyboard, and that is how it will arrive into the processing
function if it is typed from the keyboard. The character name given must be the
same length as the name of the invoking character object, although nothing else
is required of it.
// This will ask the invoker for a character name and then use the '@nuke'
// GM command on them, killing them mercilessly.
input @player$;
atcommand strcharinfo(0)+":@nuke "+@player$
This command has a lot of good uses, I am sure you can have some fun with this
one.
Return to the table of contents
*message "<character name>","<message>";
That command will send a message to the chat window of the character specified
by name. The text will also appear above the head of that character. It will not
be seen by anyone else.
Return to the table of contents
*npctalk "<message>";
This command will display a message to the surrounding area as if the NPC object
running it was a player talking - that is, above their head and in the chat
window. The display name of the NPC will get appended in front of the message to
complete the effect.
// This will make everyone in the area see the NPC greet the character
// who just invoked it.
npctalk "Hello "+strcharinfo(0)+" how are you";
Return to the table of contents
*hasitems(0)
This function will return 1 if the invoking character has anything at all in
their inventory and 0 if they do not. Even though the argument is not used for
anything, it is required.
Return to the table of contents
*getlook(<type>)
This function will return the number for the current look value of the invoking
character specified by type. See 'setlook' for valid look types.
This can be used to make a certain script behave differently for characters
dressed in black. :)
Return to the table of contents
*getsavepoint(<information type>)
This function will return information about the invoking character's save point.
You can use it to let a character swap between several recorded savepoints.
Available information types are:
0 - Map name (a string)
1 - X coordinate
2 - Y coordinate
Return to the table of contents
*npcspeed <speed value>;
*npcwalkto <x>,<y>;
*npcstop;
These commands will make the NPC object in question move around the map. As they
currently are, they are a bit buggy and are not useful for much more than making
an NPC move randomly around the map. (see 'npc/custom/devnpc.txt' for an example
of such usage)
'npcspeed' will set the NPCs walking speed to a specified value. As in the
@speed GM command, 200 is the slowest possible speed while 0 is the fastest
possible (instant motion). 100 is the default character walking speed.
'npcwalkto' will start the NPC sprite moving towards the specified coordinates
on the same map as it is currently on.
'npcstop' will stop the motion.
While in transit, the NPC will be clickable, but invoking it will cause it to
stop motion, which will make it's coordinates different from what the client
computed based on the speed and motion coordinates. The effect is rather
unnerving.
Only a few NPC sprites have walking animations, and those that do, do not get
the animation invoked when moving the NPC, due to the problem in the npc walking
code, which looks a bit silly. You might have better success by defining a job-
sprite based sprite id in 'db/mob-avail.txt' with this.
Return to the table of contents
*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})
This function will locate a character object, NPC object or pet's coordinates
and place their coordinates into the variables specified when calling it. It
will return 0 if the search was successful, and -1 if the parameters given were
not variables or the search was not successful.
Type is the type of object to search for:
0 - Character object
1 - NPC object
2 - Pet object
3 - Monster object.
While 3 is meant to look for a monster object, no searching will be done if you
specify type 3, and the function will always return -1.
The search string is optional. If it is not specified, the location of the
invoking character will always be returned for types 0 and 2, the location of
the NPC running this function for type 1.
If a search string is specified, for types 0 and 1, the character or NPC with
the specified name will be located. If type is 3, the search will locate the
current pet of the character who's name is given in the search string, it will
NOT locate a pet by name.
What a mess. Example, a working and tested one now:
prontera.gat,164,301,3| |script| |Meh| |730,{
mes "My name is Meh. I'm here so that Nyah can find me.";
close;
}
prontera.gat,164,299,3| |script| |Nyah| |730,{
mes "My name is Nyah.";
mes "I will now search for Meh all across the world!";
if (getmapxy(@mapname$,@mapx,@mapy,1,"Meh")!=0) goto Notfound;
mes "And I found him on map "+@mapname$+" at X:"+@mapx+" Y:"+@mapy+" !";
close;
Notfound:
mes "I can't seem to find Meh anywhere!";
close;
}
Notice that NPC objects disabled with 'disablenpc' will still be located.
Return to the table of contents
*guildgetexp <amount>;
This will give the specified amount of guild experience points to the guild the
invoking character belongs to. It will silently fail if they do not belong to
any guild.
Return to the table of contents
*skilluseid <skill>,<level>;
*doskill <skill>,<level>;
*skillusepos <skill>,<level>,<x>,<y>;
These commands will cause the invoking character to use a specified skill at the
specified level, as if they had that skill, with their current level and stats.
If the skill involves targeting a character, no targeting pointer will come up -
the invoking character will automatically be the skill target.
'doskill' is an alias for 'skilluseid'.
'skillusepos' will specify a target map square for the skill to be used. If that
skill is an area effect skill, it will be centered at the square specified. It
will not work if the skill is supposed to be targeted on character or monster.
Return to the table of contents
*logmes "<message>";
This command will write the message given to the map server npc log file, as
specified in 'conf/log_athena.conf'. In the TXT version of the server, the log
file is 'log/npclog.log' by default. In the SQL version, if SQL logging is
enabled, the message will go to the 'npclog' table, otherwise, it will go to the
same log file.
If logs are not enabled, nothing will happen.
Return to the table of contents
*summon "<monster name>",<mob id>{,"<event label>"};
This command will summon a monster. (see also 'monster') Unlike monsters spawned
with other commands, this one will set up the monster to fight to protect the
invoking character. Monster name and mob id obey the same rules as the one given
at the beginning of this document for permanent monster spawns with the
exceptions mentioned when describing 'monster' command.
The effect for the skill 'Call Homonuculus' will be displayed centered on the
invoking character.
If an event label is given, upon the monster being killed, the event label will
run as if by 'donpcevent'.
// Will summon a dead branch-style monster to fight for the character.
summon "--ja--",-1;
Return to the table of contents
*isnight()
*isday()
These functions will return 1 or 0 depending on whether the server is in night
mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
the other way around. They can be used interchangeably, pick the one you like
more:
// These two are equivalent:
if (isday()) mes "I only prowl in the night.";
if (isnight()!=1) mes "I only prowl in the night.";
Return to the table of contents
*isequipped(<card id>{,<card id>{,<card id>{,<card id>}}})
This function will return 1 if the invoking character has all of the card item
IDs given inserted into slots in the equipment they are currently wearing at the
same time. Up to 4 cards may be tested for at the same time.
If even one of the cards given is not both inserted and worn, 0 will be
returned.
// (Poring,Santa Poring,Poporing,Marin)
if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!";
// (Poring)
if (isequipped(4001)) mes "A poring card is useful, don't you think?";
The function was meant for item scripts to support the cards released by Gravity
in February 2005, but it will work just fine in normal NPC scripts.
Return to the table of contents
*isequippedcnt(<card id>{,<card id>{,<card id>{,<card id>}}})
This function is similar to 'isequipped', but instead of 1 or 0, it will return
the number of cards in the list given that were found on the invoking character.
if (isequippedcnt(4001,4005,4033,4196)=4) mes "Finally got all four poring cards?";
Return to the table of contents
*cardscnt()
This function will return the number of cards inserted into the weapon currently
equipped on the invoking character.
While this function was meant for item scripts, it will work outside them:
if (cardscnt()==4) mes "So you've stuck four cards into that weapon, think you're cool now?";
Return to the table of contents
*getrefine()
This function will return the number of plusses the weapon currently equipped on
the invoking character has been refined for.
While this function was meant for item scripts, it will work outside them:
if (getrefine()==10) mes "Wow. That's a murder weapon.";
Return to the table of contents
*day;
*night;
These two commands will switch the entire server between day and night mode.
Depending on the configuration, it may cause differing client effects. If your
server is set to cycle between day and night, it will eventually return to that
cycle.
This example will set the night time to start at 03 AM and end at 08 AM, and the
nighttime will persist if the server restarts during the night, if the automated
day/night switching is turned off in the configuration files. Figure it out on
your own:
-| |script| |DayNight| |-1,{
end;
OnClock0300:
OnClock0800:
OnInit:
set $@minutesfrommidnight, gettime(3)*60+gettime(2);
set $@night_start, 180; // 03:00
set $@night_end, 480; // 08:00
if ($@minutesfrommidnight>=$@night_start &&
$@minutesfrommidnight<$@night_end) goto StartNight;
goto StartDay;
StartNight:
night;
end;
StartDay:
day;
end;
}
Return to the table of contents
*getusersname;
This command will give the invoking character a list of names of the connected
characters (including themselves) into an NPC script message window (see 'mes')
paging it by 10 names as if with the 'next' command.
You need to put a 'close' after that yourself.
Return to the table of contents
*dispbottom "<message>";
This command will send the given message into the invoking character's chat
window.
Return to the table of contents
*recovery;
This command will revive and restore full HP and SP to all characters currently
connected to the server.
Return to the table of contents
*getpetinfo(<type>)
This function will return pet information for the pet the invoking character
currently has active. Valid types are:
0 - Unique pet ID number as stored by the char server and distinguishing it
from all other pets the characters actually have. This value is currently
useless, at most you can use it to tell pets apart reliably.
1 - Pet ID number as per 'db/pet_db.txt' - will tell you what kind of a pet it
is.
2 - Pet name. Will return "null" if there's no pet.
4 - Pet friendly level (intimacy score). 1000 is full loyalty.
3 - Pet hungry level. 100 is completely full.
Return to the table of contents
*checkequipedcard(<card id>)
This function will return 1 if the card specified by it's item ID number is
inserted into any equipment they have in their inventory, currently equipped or
not.
Return to the table of contents
*globalmes "message";
This command will send a message to the chat window of all currently connected
characters.
Return to the table of contents
*jump_zero (<condition>),<label>;
This command works kinda like an 'if'+'goto' combination in one go. (See 'if').
If the condition is false (equal to zero) this command will immediately jump to
the specified label like in 'goto'.
While 'if' is more generally useful, for some cases this could be an
optimisation.
Return to the table of contents
*select("<option>"{,"<option>"..."<option>"})
This function is a handy replacement for 'menu' for some specific cases where
you don't want a complex label structure - like, for example, asking simple yes-
no questions. It will return the number of menu option picked, starting with 1.
Like 'menu', it will also set the variable @menu to contain the option the user
picked.
if (select("Yes","No")==1) mes "You said yes, I know.";
And like 'menu', this command has a problem with empty strings - if some of the
option strings given to it are empty, you won't be able to tell which one the
user really picked. The number it returns will only make sense if all the empty
strings are last in the list of options.
Return to the table of contents
*getmapmobs("<map name>")
This function will return the total count of monsters currently located on the
specified map. If the map name is given as "this", the map the invoking
character is on will be used. If the map is not found, or the invoker is not a
character while the map is "this", it will return -1.
Return to the table of contents
*unequip <equipment slot>;
This command will unequip whatever is currently equipped in the invoking
character's specified equipment slot. For a full list of possible equipment
slots see 'getequipid'.
If an item occupies several equipment slots, it will get unequipped from all of
them. (Which is a good thing.)
Return to the table of contents
*defpattern <set number>,"<regular expression pattern>","<event label>";
*activatepset <set number>;
*deactivatepset <set number>;
*deletepset <set number>;
This set of commands is only available if the server is compiled with regular
expressions library enabled. Default compilation and most binary distributions
aren't, which is probably bad, since these, while complex to use, are quite
fascinating.
They will make the NPC object listen for text spoken publicly by players and
match it against regular expression patterns, then trigger labels associated
with these regular expression patterns.
Patterns are organised into sets, which are referred to by a set number. You can
have multiple sets patterns, and multiple patterns may be active at once.
Numbers for pattern sets start at 1.
'defpattern' will associate a given regular expression pattern with an event
label. This event will be triggered whenever something a player says is matched
by this regular expression pattern, if the pattern is currently active.
'activatepset' will make the pattern set specified active. An active pattern
will enable triggering labels defined with 'defpattern', which will not happen
by default.
'deactivatepset' will deactivate a specified pattern set. Giving -1 as a pattern
set number in this case will deactivate all pattern sets defined.
'deletepset' will delete a pattern set from memory, so you can create a new
pattern set in it's place.
Using regular expressions is high wizardry. But with this high wizardry comes
unparallelled power of text manipulation. For an explanation of what a regular
expression pattern is, see a few web pages:
http://www.regular-expressions.info/
http://www.weitz.de/regex-coach/
For an example of this in use, see 'npc\custom\eliza.txt'.
With this you could, for example, automagically punish players for asking for
zeny in public places, or alternatively, automagically give them zeny instead if
they want it so much.
Return to the table of contents
*getstrlen("<string>")
This function will return the length of the string given as an argument. It is
useful to check if anything input by the player exceeds name length limits and
other length limits and asking them to try to input something else.
Return to the table of contents
*charisalpha("<string>",<position>)
This function will return 1 if the character number Position in the given string
is a letter, 0 if it isn't a letter but a digit or a space.
Return to the table of contents
*getnameditem(<item id>,"<name to inscribe>");
*getnameditem("<item name>","<name to inscribe>");
This function is equivalent to using 'getitem', however, it will not just give
the character an item object, but will also inscribe it with a specified
character's name. You may not inscribe items with arbitrary strings, only with
names of characters that actually exist. While this isn't said anywhere
specifically, apparently, named items may not have cards in them, slots or no -
these data slots are taken by the character ID who's name is inscribed. Only one
remains free and it's not quite clear if a card may be there.
Items that may not be equipped may NOT be inscribed with a name with this
function. Which is why this is a function which will return a value - 1 if an
item was successfully created and 0 if it wasn't for whatever reason. Like
'getitem' this function will also take an 'english name' from the itemdb
database as an item name and will return 0 if nothing is found.
Return to the table of contents
*getitemslots(<item ID>)
This function will look up the item with the specified ID number in the database
and return the number of slots this kind of items has - 0 if they are not
slotted. It will also be 0 for all non-equippable items, naturally, unless
someone messed up the item database. It will return -1 if there is no such item.
Return to the table of contents
*fakenpcname "<npc object name>","<npc display name>",<npc sprite id>
This function will change the specified NPC object's display name to the one you
give. While the name the players will see will now be different, the real object
name the NPC has will stay the same, so you can still adress it with events as
you did before.
The sprite used for the NPC will be changed to the one you specify as well, to
keep it the same, specify the sprite you originally used when defining the NPC
object.
Return to the table of contents
*warpparty "<map name>",<X>,<Y>,<Party ID>
*warpguild "<map name>",<X>,<Y>,<Guild ID>
Allow you to warp everyone inside a specific party/guild to another place
Like the normal 'warp' command there are some special things you can put in
the map name for added effects
"Random" - Will warp everyone to a random location on thier current map
"SavePoint" - Will take everyone in the party/guild to the save point of the
person who activated this command
"SavePointAll" - Will take everyone in the party/guild back to there own save
point
To find the Party/Guild ID you can use 'getcharid'
warpparty "prontera.gat",150,150,getcharid(1);
getcharid(1) will return the party ID of the person who activate the command
Preseting a party ID as a Variable will work too, and also the rare occasion
where you might just state the number, but I dont see that coming up
Return to the table of contents