Académique Documents
Professionnel Documents
Culture Documents
1:To use one command, type it inside the message window where you usually
type to chat.
20:@h/@help - display this help guide.
20:@h2/@help2 - displays the second help guide.
1:
1:--- MESSAGE CMD --1:@main [on|off|message] - Turns on or off global chat (@main must be on to
see global chat messages)
1:@noask - Auto rejects Deals/Invites
20:@gmotd - Broadcasts the Message of The Day file to all players.
20:@me <message> - Displays normal text as a message in this format: *name
message* (like /me in mIRC)
20:@fakename [Name] - Changes your name to your choice temporarly.
20:@npctalk [NPC Name],[Message] - Forces a NPC to display a message in
normal chat.
40:/b/@broadcast <message> - Broadcasts a GM message with name of the GM (in
yellow)
40:/nb <message>/@kami <message> - Broadcasts a GM message without name of
the GM (in yellow)
40:@kamib <message> - Broadcasts a GM message without name of the GM (in
blue)
40:/lb/@localbroadcast <message> - Broadcasts a GM message with name of the
GM (in yellow) ONLY on your map
40:/nlb <message> - Broadcasts a GM message without name of the GM (in
yellow) ONLY on your map
1:
1:--- INFORMATION CMD --1:@commands - Displays a list of commands that you can use.
1:@rates - Displays the server's current rates.
1:@uptime - Displays how long the server has been online.
1:@showdelay - Shows/Hides the "there is a delay after this skill" message.
1:@exp - Displays current levels and % progress
1:@mobinfo/@monsterinfo/@mi [Mob ID|Part of monster name] - Shows Monster
Info (rates, stats, drops, MVP stuff)
1:@iteminfo/@ii [Item ID|Part of item name] - Shows Item info (type, price,
etc)
1:@whodrops [Item ID|Part of item name] - Shows who drops an item (mobs with
highest drop rates)
1:@version - Displays SVN version of the server
1:@email <actual@email> <new@email> - to change your e-mail (characters
protection)
1:@where [char name] - Tells you the location of a character
1:@time/@date/@server_date/@serverdate/@server_time/@servertime - Display
the date/time of the server
10:@showexp - Displays/Hides Experience gained.
10:@showzeny - Displays/Hides Zeny gained.
10:@mobsearch [Mob ID|Monster Name] - Shows the location of a certain mob on
the current map.
20:@who/@whois/@w [match_text] - Display a listing of who is online and their
party/guild.
20:@who2 [match_text] - Display a listing of who is online and their job.
20:@who3 [match_text] - Display a listing of who is online and where.
20:@whomap/@whomap2/@whomap3 [map] - like @who/@who2/@who3 but only for
specifical map.
20:@whogm [match_text] - Like @who+@who2+who3, but only for GM.
40:@charcartlist <char name> - Displays all items of a player's cart.
60:
60:@guildspy <guild_name/id> - You will receive all messages of the guild
channel (Chat logging must be enabled)
60:@partyspy <party_name/id> - You will receive all messages of the party
channel (Chat logging must be enabled)
99:@mapinfo [<0-3> [map]] - Give information about a map (general info +: 0:
no more, 1: players, 2: NPC, 3: shops/chat).
1:
1:--- CHANGE GM STATE CMD --1:@die - Kills yourself
10:@go <number/city_name> - Warps you to a city.
10: -3: (Memo point 2) 1: morocc
5: izlude
9: yuno
13:
niflheim
10: -2: (Memo point 1) 2: geffen
6: aldebaran
10: amatsu
14:
louyang
10: -1: (Memo point 0) 3: payon
7: xmas (lutie) 11: gonryun 15: start
point
10:
0: prontera
4: alberta 8: comodo
12: umbala
16:
prison/jail
10:
20:/shift/@jumpto/@warpto/@goto <char name> - Warps you to selected character
20:@follow <char_name> - follow a player
20:@mountpeco - Give/remove you a peco (Class is required, but not skill)
20:@disguise <monster_name_or_monster_ID> - Change your appearence to other
players to a mob.
20:@undisguise - Restore your normal appearance.
20:@model <hair ID: 0-17> <hair color: 0-8> <clothes color: 0-4> - Changes
your characters appearence.
20:@size <1-3> Changes your size (1-Smallest 2-Biggest 3-Normal)
40:/hide/@hide - Makes you character invisible (GM invisibility). Type /hide
or@hide again become visible.
40:@save - Sets respawn point to current spot
40:@load/@return - Warps you to your save point
40:/mm//mapmove/@warp/@rura/@mapmove <mapname> <x> <y> - Warps you to the
selected position
40:@jump [x [y]]- Randomly warps you like a flywing.
40:@job/@jobchange <job ID> - Changes your job
40: Listed below is all the ID's known to exist in the client.
40: Some ID's may not work due to not being added to the server.
40: Also, some of the ID's may use temporary sprites.
40: ----- Novice / 1st Class ----40:
0: Novice
1: Swordman
2: Mage
40:
3: Archer
4: Acolyte
5: Merchant
40:
6: Thief
40: ----- 2nd Class ----40:
7: Knight
8: Priest
9: Wizard
40:
10: Blacksmith
11: Hunter
12: Assassin
40:
14: Crusader
15: Monk
16: Sage
40:
17: Rogue
18: Alchemist
19: Bard
40:
20: Dancer
40: ----- High Novice / High 1st Class ----40: 4001: Novice
4002: High Swordman 4003: High Mage
40: 4004: High Archer
4005: High Acolyte
4006: High Merchant
40: 4007: High Thief
40: ----- Transcendent 2nd Class ----40: 4008: Lord Knight
4009: High Priest
4010: High Wizard
40: 4011: Whitesmith
4012: Sniper
4013: Assassin Cross
40:@heal [<HP> <SP>] - Heals the desired amount of HP and SP. No value
specified will do a full heal.
40:@option <param1> <param2> <param3> - Adds different visual effects on or
around your character
40:@dye/@ccolor <clothes color: 0-4> - Changes your characters appearence
(only clothes color).
40:@hairstyle/@hstyle <hair ID: 0-17> - Changes your characters appearence
(only hair style).
40:@haircolor/@hcolor <hair color: 0-8> - Changes your characters appearence
(only hair color).
40:@speed <1-1000> - Changes you walking speed. 1 being the fastest and 1000
the slowest. Default 150.
40:@effect <effect_id> [flag] - Give an efect to your character.
40:@dropall - throws all your possession on the ground
40:@storeall - puts all your possessions in storage
40:@killable - make your character killable
40:@memo [memo_position] - set/change a memo location (no position: display
memo points).
40:@spiritball <number: 1-1000> - Gives you "spirit spheres" like from the
skill "Call Spirits"
40:
(If the number you use is > 1000, your server may become instable or
crash)
40:@questskill <#> - Gives you the specified quest skill
40:@lostskill <#> - Takes away the specified quest skill from you
40:@skillid <name> - look up a skill by name
40:@useskill <skillid> <skillv> <target> - use a skill on target
40: Novice
Swordsman
Thief
Merchant
40: 142 = Emergency Care
144 = Moving HP Recovery
149 = Throw Sand
153 = Cart Revolution
40: 143 = Act dead
145 = Attack Weak Point
150 = Back Sliding
154 = Change Cart
40: Archer
146 = Auto Berserk
151 = Take Stone
155 = Crazy Uproar/Loud Voice
40: 147 = Arrow Creation
Acolyte
152 = Stone Throw
Magician
40: 148 = Charge Arrows
156 = Holy Light
157 = Energy Coat
40: @skilltree <
40: @marry <player1>,<player2> - marry two players
40: @divorce <player> - divorces the two players (you need just one name of
them)
60:@alive - Revives yourself from death
60:@lvup/@blevel/@baselvlup <number of levels> - Raises your base level the
desired number of levels. The max is 255 (User Defined).
60:@joblvup/@jlevel/@joblvlup <number of levels> -Raises your job level the
desired number of levels. The max is 50 For Basic Classes. For Super Novice
and Advanced Classes it is 70.
60:@allskill/@allskills/@skillall/@skillsall - Give you all skills.
60:@stpoint <number of points> - Gives you the desired number of stat points.
60:@skpoint <number of points> - Gives you the desired number of skill
points.
60:@zeny <amount> - Gives you desired amount of Zeny.
60:@cash <amount> - Gives you the specified amount of cash points.
60:@points <amount> - Gives you the specified amount of Kafra Points.
60:@str,@agi,@vit,@int,@dex,@luk <amount> - Adds desired amount to any stat.
For example "@str 10" raises your str by 10
Table of contents:
1. Introduction
2. Structure
3. Syntax
4. Script loading structure
5. What a RID is and why do you need to know
6. Item and pet scripts
7. Numbers
8. Variables and scope
9. Arrays
10.Variable type availability
11. Special variables
12.Operators
13.Labels
14.Scripting commands and functions
o Pet
o activatepset
o addtimer
o addtimercount
o addtoskill
o adopt
o adopt
o agitcheck
o agitcheck
o agitend
o agitstart
o announce
o areaannounce
o areamonster
o areawarp
o atcommand
o attachnpctimer
o attachrid
o basicskillcheck
o bonus
o bonus2
o bonus3
o bonus4
o bpet
o break
o callfunc
o callfunc
o callsub
o cardscnt
o changebase
o changesex
o charcommand
o charisalpha
o checkcart
o checkequipedcard
o checkfalcon
o checkoption
o checkoption1
o checkoption2
o checkriding
o checkweight
o checkweight
o classchange
o cleararray
o clearitem
o close
o close2
o cmdothernpc
o copyarray
o countitem
o countitem
o cutin
o cutincard
o day
o deactivatepset
o debugmes
o defpattern
o deletearray
o deletepset
o delitem
o delitem
o deltimer
o delwaitingroom
o detachnpctimer
o detachrid
o disablearena
o disablenpc
o disablewaitingroomevent
o dispbottom
o divorce
o doevent
o donpcevent
o doskill
o emotion
o enablearena
o enablenpc
o enablewaitingroomevent
o end
o failedrefitem
o failedremovecards
o fakenpcname
o flagemblem
o getareadropitem
o getareausers
o getarg
o getarraysize
o getbrokenid
o getcastledata
o getcastlename
o getcharid
o getelementofarray
o getequipcardcnt
o getequipid
o getequipisenableref
o getequipisequiped
o getequipisidentify
o getequipname
o getequippercentrefinery
o getequiprefinerycnt
o getequipweaponlv
o getexp
o getgdskilllv
o getgmlevel
o getguildmaster
o getguildmasterid
o getguildname
o getinventorylist
o getitem
o getitem
o getitem2
o getitem2
o getitemname
o getitemslots
o getlook
o getmapmobs
o getmapusers
o getmapxy
o getnameditem
o getnameditem
o getnpctimer
o getpartnerid
o getpartymember
o getpartyname
o getpetinfo
o getrefine
o getsavepoint
o getscrate
o getskilllist
o getskilllv
o getstrlen
o gettime
o gettimestr
o gettimetick
o getusers
o getusersname
o getwaitingroomstate
o globalmes
o gmcommand
o goto
o guardian
o guardianinfo
o guildgetexp
o guildopenstorage
o guildskill
o gvgoff
o gvgon
o hasitems
o heal
o hideoffnpc
o hideonnpc
o if
o initnpctimer
o inittimer
o input
o isday
o isequipped
o isequippedcnt
o isloggedin
o isnight
o ispartneron
o itemheal
o itemskill
o jobchange
o jump_zero
o killmonster
o killmonsterall
o logmes
o makeitem
o makeitem
o makepet
o mapannounce
o maprespawnguildid
o mapwarp
o marriage
o menu
o mes
o message
o misceffect
o mobcount
o monster
o next
o night
o npcskilleffect
o npcspeed
o npcstop
o npctalk
o npcwalkto
o nude
o openstorage
o percentheal
o pet
o petheal
o petloot
o petrecovery
o petskillattack
o petskillattack2
o petskillbonus
o petskillsupport
o produce
o pvpoff
o pvpon
o rand
o readparam
o recovery
o removemapflag
o repair
o requestguildinfo
o resetlvl
o resetskill
o resetstatus
o return
o save
o savepoint
o sc_end
o sc_start
o sc_start2
o select
o set
o setarray
o setcart
o setcastledata
o setfalcon
o setlook
o setmapflag
o setmapflagnosave
o setnpctimer
o setoption
o setriding
o skill
o skilleffect
o skilluseid
o skillusepos
o soundeffect
o soundeffectall
o specialeffect
o specialeffect2
o startnpctimer
o statusup
o statusup2
o stopnpctimer
o stoptimer
o strcharinfo
o strmobinfo
o successrefitem
o successremovecards
o summon
o unequip
o viewpoint
o waitingroom
o waitingroomkickall
o warp
o warpguild
o warppartner
o warpparty
o warpwaitingpc
o wedding
Introduction
This document is a reference manual for all the scripting commands and
functions
available in current eAthena SVN. It is not a simple tutorial. When people
tell
you to "Read The F***ing Manual", they mean this.
The information was mostly acquired through looking up how things actually
work
in the source code of the server, which was written by many people over time,
and lots of them don't speak English and never left any notes - or are
otherwise
not available for comments. As such, anything written in here might not be
Structure
The commands and functions are listed in no particular order:
*Name of the command and how to call it.
Descriptive text
Small example if possible. Will usually be incomplete, it's there just to
give you an idea of how it works in practice.
To find a specific command, use Ctrl+F, (or whatever keys call up a search
function in whatever you're reading this with) put an * followed by the
command
name, and it should find the command description for you.
If you find anything omitted, please respond. :)
Syntax
Throughout this document, wherever a command wants an argument, it is given in
<angle brackets>. This doesn't mean you should type the angle brackets. :) If
an
argument of a command is optional, it is given in {curly brackets}. You've
doubtlessly seen this convention somewhere, if you didn't, get used to it,
that's how big boys do it. If a command can optionally take an unspecified
than those given in this section. These commands set up the basic server
script
structure - create NPC objects, spawn monster objects, set map flags, etc. No
code is actually executed at this point except them. The top-level commands
the
scripting are pretty confusing, since they aren't structured like you would
expect commands, command name first, but rather, normally start with a map
name.
What's more confusing about the top-level commands is that most of them use a
tab symbol to divide their arguments.
To prevent problems and confusion, the tab symbols are written as '| |'
throughout this document, even though this makes the text a bit less readable.
Using an invisible symbol to denote arguments is one of the bad things about
this language, but we're stuck with it for now. :)
Here is a list of valid top-level commands:
|mapflag|
|<flag>
This will, upon loading, set a specified map flag on a map you like. These are
normally in files inside 'conf/mapflag' and are loaded first, so by the time
the
server's up, all the maps have the flags they should have. Map flags determine
the behavior of the map regarding various common problems, for a better
explanation, see 'setmapflag'.
version', (monster size class will increase) and if you add 2000, the 'tiny
version' of the monster will be created. This will not, however, make the
monster spawn with a bigger or smaller sprite, like with
@monstersmall/@monsterbig GM commands. Monster size class relates only to the
damage calculation.
Amount is the amount of monsters that will be spawned when this command is
executed, it is affected by spawn rates in 'battle_athena.conf'.
Delay1 and delay2 are the monster respawn delays - the first one counts the
time
since a monster defined in this spawn was last respawned and the second one
counts the time since the monster of this spawn was last killed. Whichever
turns
out to be higher will be used. If the resulting number is smaller than a
random
value between 5 and 10 seconds, this value will be used instead. (Which is
normally the case if both delay values are zero.) If both delay values are -1,
the monster will never respawn upon death until the server restarts. The times
are given in 1/1000ths of a second.
Level overrides the monster's level from the monster id database, if it is 0,
the level from the database is used.
Event name is an event label that will be triggered every time a monster of
that
spawn is killed. If you do not wish to define such an event, put '0' there.
For
a full description, of how monster kill events work, see the 'monster'
command.
This will define a warp NPC that will warp a player between maps, and while
most
arguments of that are obvious, some deserve special mention.
SpanX and SpanY will make the warp sensitive to a character who didn't step
directly on it, but walked into a zone which is centered on the warp from
coordinates and is SpanX in each direction across the X axis and SpanY in each
direction across the Y axis.
Warp NPC objects also have a name, because you can use it to refer to them
later
with 'enablenpc'/'disablenpc'
Facing of a warp object is irrelevant, it is not used in the code and all
current scripts have a zero in there.
|<NPC Name>|
|<sprite id>,
|<NPC Name>|
|<sprite
This will place an NPC object on a specified map at the specified location,
and
is a top-level command you will use the most in your custom scripting. The
NPCs
are triggered by clicking on them, and/or by walking in their trigger area, if
defined, see that below.
Facing is a direction the NPC sprite will face in. Not all NPC sprites have
different images depending on the direction you look from, so for some facing
will be meaningless. Facings are counted counterclockwise in increments of 45
degrees, where 0 means facing towards the top of the map. (So to turn the
sprite
towards the bottom of the map, you use facing 4, and to make it look southeast
it's facing 5.)
Sprite id is the sprite number used to display this particular NPC. For a full
list of sprite id numbers see http://kalen.s79.xrea.com/npc/npce.shtml You may
also use a monster's ID number instead to display a monster sprite for this
NPC.
It is possible to use a job sprite as well, but you must first define it as a
monster sprite in 'mob_avail.txt', a full description on how to do this is for
another manual. A '-1' sprite id will make the NPC invisible (and
unclickable).
A '111' sprite id will make an NPC which does not have a sprite, but is still
clickable, which is useful if you want to make a clickable object of the 3D
terrain.
TriggerX and triggerY, if given, will define an area, centered on NPC and
spanning triggerX cells in every direction across X and triggerY in every
direction across Y. Walking into that area will trigger the NPC. If no
'OnTouch:' special label is present in the NPC code, the execution will start
from the beginning of the script, otherwise, it will start from the 'OnTouch:'
label.
NPC name is kinda special, because it's not only the name of NPC you will see
on
screen. It's formatted this way:
<Screen name>{#<Extra name identifier>}{::<Label name>}
The extra identifier is there that you can make an npc with an invisible name
(just omit the screen name, but keep the identifier name) and so that you can
refer to several NPCs which have the same name on screen, which is useful to
make an NPC that relocates depending on special conditions, for example - you
define several NPC objects and hide all except one.
('Hunter#hunter1','Hunter#hunter2'...) The extra name identifiers will let
your
code tell them apart.
|duplicate(<NPC label>)|
|duplicate(<NPC label>)|
|<sprite id>
|<sprite
This will duplicate an NPC referred to by the label. The duplicate runs the
same
code as the NPC it refers to, but may have different location, facing and
sprite
ID. Whether it may actually have it's own size of trigger area is unclear at
the
moment - if you need that, try it and tell us of the results.
|script|
|-1,{<code>}
This will define an NPC object not triggerable by normal means. This would
normally mean it's pointless since it can't do anything, but there are
exceptions, mostly related to running scripts at specified time, which is what
these floating NPC objects are for. More on that below.
|<sprite
This will define a shop NPC, which, when triggered (which can only be done by
clicking) will cause a shop window to come up. No code whatsoever runs in shop
NPCs and you can't change the prices otherwise than by editing the script
itself. (No variables even exist at this point of scripting, so don't even
bother trying to use them.)
|script|
|<function name>|
|{
This will define a function object, callable with the 'callfunc' command (see
below). This object will load on every map server separately, so you can get
at
it from anywhere. It's not possible to call the code in this object by
anything other than the 'callfunc' script command.
The code part is the script code that will execute whenever the function is
called with 'callfunc'. It has to be in curly brackets, unlike elsewhere where
we use curly brackets, these do NOT signify an optional parameter.
|setcell|
|<type>,<x1>,<y1>,<x2>,<y2>
This is sneaky, and isn't used in any official scripts, but it will let you
define an area (x1/y1-x2/y2 square) of a map as having cell type 'type', where
type is a number, which, among other things, defines whether the area is
walkable or not, whether it has Basilica working in it or not, and some other
things. This is a solution just itching for a problem and there's a number of
interesting things you could use it for. Further investigation on what types
are
valid and mean what exactly is pending.
triggered without a RID attached. This will make a lot of commands and
functions
unusable, since they want data from a specific character, want to send stuff
to
a specific client, want to store variables specific to that character, and
they
would not know what character to work on if there's no RID.
Unless you use 'attachrid' to explicitly attach a character to the script
first.
Whenever we say 'invoking character', we mean 'the character who's RID is
attached to the running script.'
Numbers
Beside the common decimal numbers, which are nothing special whatsoever
(though
do not expect to use fractions, since ALL numbers are integer in this
language),
the script engine also handles hexadecimal numbers, which are otherwise
identical. Writing a number like '0x<hex digits>' will make it recognised as a
hexadecimal value. Notice that 0x10 is equal to 16. Also notice that if you
try
as
Some variables are special, that is, they are already defined for you by the
scripting engine. You can see the full list somewhere in 'db/const.txt', which
is a file you should read, since it also allows you to replace lots of
numbered
arguments for many commands with easier to read text. The special variables
most
commonly used are all permanent character-based variables:
StatusPoint
BaseLevel
SkillPoint
Class
Upper
Zeny
Sex
Weight
MaxWeight
JobLevel
BaseExp
level.
JobExp
NextBaseExp
NextJobExp
Hp
MaxHp
Sp
MaxSp
BaseJob
Karma
Manner
side
While these behave as variables, do not always expect to just set them - it is
not certain whether this will work for all of them. Whenever there is a
command
or a function to set something, it's usually preferable to use that instead.
The
notable exception is Zeny, which you can and often will address directly setting it will make the character own this number of zeny.
All of the above variables store numbers. They can store positive and negative
numbers, but only whole numbers (so don't expect to do any fractional math).
You
can also store a string in a variable, but this means naming it specially to
denote it contains text rather than a number:
@variable$ is a temporary string variable.
$@variable$ is a global temporary string variable.
Etc, etc.
Arrays
Arrays (in eAthena at least) are essentially a set of variables going under
the
same name. You can tell between the specific variables of an array with an
'array index', a number of a variable in that array:
<variable name>[<array index>]
Variables stored in this way, inside an array, are also called 'array
elements'.
Arrays are specifically useful for storing a set of similar data (like several
item IDs for example) and then looping through it. You can address any array
variable as if it was a normal variable:
set @arrayofnumbers[0],1;
You can also do sneaky things like using a variable (or an expression, or even
a
value from an another array) to get at an array value:
set @x,100;
set @arrayofnumbers[@x],10;
This will make @arrayofnumbers[100] equal to 10.
Notice that index numbering always starts with 0. Arrays cannot hold more than
128 variables. (So the last one can't have a number higher than 127)
And array indices probably can't be negative. Nobody tested what happens when
you try to get a negatively numbered variable from an array, but it's not
going
to be pretty. :)
Arrays can, naturaly, store strings:
@menulines$[0] is the 0th element of the @menulines$ array of strings. Notice
the '$', normally denoting a string variable, before the square brackets that
denotes an array index.
Special variables
Only those special variables not related directly to specific script commands
are listed here. For a list of those others, see 'getmapxy',
'getinventorylist',
'menu', 'select', 'warpwaitingpc'.
PC_DIE_COUNTER
skill that has been copied with the Plagiarism Rogue skill,
if
Operators
Operators are things you can do to variables and numbers. They are either the
common mathematical operations or conditional operators
+ - will add two numbers. If you try to add two strings, the result will be a
string glued together at the +. You can add a number to a string, and the
result will be a string. No other math operators work with strings.
- - will subtract two numbers.
* - will multiply two numbers.
/ - will divide two numbers. Note that this is an integer division rounding
down, i.e. 7/2 is not equal 3.5, it's equal 3.
% - will give you the remainder of the division. 7%2 is equal to 1.
There are also conditional operators. This has to do with the conditional
command 'if' and they are meant to return either 1 if the condition is
satisfied
and 0 if it isn't. (That's what they call 'boolean' variables. 0 means
'False'.
Anything except the zero is 'True' Odd as it is, -1 and -5 and anything below
zero will also be True.)
You can compare numbers to each other and you compare strings to each other,
but
you can not compare numbers to strings.
== same.
>= <= >
<
!= -
Is true if both sides are equal. For strings, it means they are the
True
True
True
True
True
if
if
if
if
if
the
the
the
the
the
first
first
first
first
first
value
value
value
value
value
is equal to,
is equal to,
greater than
is less than
IS NOT equal
Examples:
1==1 is True.
1<2 is True while 1>2 is False.
@x>2 is True if @x is equal to 3. But it isn't true if @x is 2.
Only '==' and '!=' have been tested for comparing strings. Since there's no
way
to code a seriously complex data structure in this language, trying to sort
strings by alphabet would be pointless anyway.
Comparisons can be stacked in the same condition:
&& - Is True if and only if BOTH sides are true.
('1==1 && 2=2' is true. '2=1 && 1=1' is false.)
Left shift.
Right shift.
And.
Or.
Xor.
If you don't know what these five mean, don't bother, you don't need them.
Whether '!' works as a binary not operator for numbers has not been tested.
Labels
Within executable script code, some lines can be labels:
<label name>:
Labels are points of reference in your script, which can be used to route
execution with 'goto', 'menu' and 'jump_zero' commands, invoked with 'doevent'
and 'donpcevent' commands and are otherwise essential. A label's name may not
be
longer than 22 characters. (23rd is the ':'.) There is some confusion in the
source about whether it's 22, 23 or 24 all over the place, so keeping labels
under 22 characters could be wise.
In addition to labels you name yourself, there are also some special labels
which the script engine will start execution from in all scripts it finds them
in if a special event happens:
OnClock<hour><minute>:
OnHour<hour>:
On<weekday><hour><minute>:
OnDay<month><day>:
This will execute when the server clock hits the specified date or time. Hours
and minutes are given in military time. ('0105' will mean 01:05 AM). Weekdays
are Sun,Mon,Tue,Wed,Thu,Fri,Sat. Months are 01 to 12, days are 01 to 31.
Remember the zero. :)
OnInit:
OnInterIfInit:
OnInterIfInitOnce:
OnInit will execute every time the scripts loading is complete, including when
they are reloaded with @reloadscript command. OnInterIfInit will execute when
the map server connects to a char server, OnInterIfInitOnce will only execute
once and will not execute if the map server reconnects to the char server
later.
OnAgitStart:
OnAgitEnd:
OnAgitInit:
OnAgitEliminate:
OnAgitBreak:
OnAgitStart will run whenever the server shifts into WoE mode, whether it is
done with @agitstart GM command or with 'AgitStart' script command. OnAgitEnd
will do likewise for the end of WoE. OnAgitInit will run when castle data is
loaded from the char-server by the map server. (Notice that it won't run when
you @reloadscript.) OnAgitBreak runs in all NPCs of a map when an Emperium is
destroyed. While it is explicitly defined as an event to run when it breaks
whenever an Emperium is spawned, it has some builtin code support for it, so
it's not certain whether you can have that event named anything else.
OnAgitEliminate is similar in that respect, and it runs when an Emperium is
destroyed in a castle that is currently not owned by a guild.
No RID will be attached while any of the abovementioned labels are triggered,
so
no character or account-based variables will be accessible, until you attach a
RID with 'attachrid' (see below).
OnTouch:
This label will be executed if a trigger area is defined for the NPC object
it's
in. If it isn't present, the execution will start from the beginning of the
NPC
code. The RID of the triggering character object will be attached.
OnPCDieEvent:
OnPCKillEvent:
OnPCLogoutEvent:
OnPCLoginEvent:
OnPCLoadMapEvent:
OnNPCKillEvent:
OnPCBaseUpEvent:
These special labels will be invoked if you have set 'event_script_type' value
in your 'script_athena.conf' to 1, and you can change their names by altering
the configuration options in 'script_athena.conf'. Otherwise, they are only
available as special NPC object names. For more information, see
'npc/sample/PCLoginEvent.txt'
PCDieEvent
this
PCKillEvent
character, with
were
Label:
goto Label;
mes "This will not be seen";
mes "This will be seen";
This command lets you call up a function NPC. A function NPC can be called
from
any script on any map server. Using the 'return' command it will come back to
the place that called it.
place.gat,50,50,6| |script|
|Woman| |115,{
mes "[Woman]"
mes "Lets see if you win";
callfunc "funcNPC";
mes "Well done you have won";
close;
}
function| |script|
|funcNPC|
|{
set @win, rand(2);
if(@win==0) return;
mes "Sorry you lost";
end;
}
You can pass arguments to your function - values telling it what exactly to do
which will be available there with getarg() (see 'getarg')
Notice that returning is not mandatory, you can end execution right there.
If you want to return a real value from inside your function NPC, it is better
to write it in the function form, which will also work and will make the
script
generally cleaner:
place.gat,50,50,6| |script|
|Man|
|115,{
mes "[Man]"
mes "Gimme a number!";
next;
input @number;
if (callfunc("OddFunc",@number)) mes "It's Odd!";
close;
}
function| |script|
|OddFunc|
|{
if (getarg(0)%2==0) goto ItsEven;
return (1);
ItsEven:
return (0);
}
Return to the table of contents
*callsub <label name>{,<argument>,...<argument>};
This command will go to a specified label within the current script (do NOT
use
quotes around it) coming in as if it were a 'callfunc' call, and pass it
arguments given, if any, which can be recovered there with 'getarg'. When done
there, you should use the 'return' command to go back to the point from where
this label was called. This is used when there is a specific thing the script
will do over and over, this lets you use the same bit of code as many times as
you like, to save space and time, without creating extra NPC objects which are
needed with 'callfunc'. A label is not callable in this manner from another
script.
Check:
mes "[Woman]"
mes "Lets see if you win";
callsub Check;
mes "Well done you have won";
set @win, rand(2);
if(@win==0) return;
mes "Sorry you lost";
This is another thing that can let you use the same but of code more than
once.
Argument numbering starts with 0, i.e. the first argument you gave is number
0.
If no such argument was given, a zero is returned.
place.gat,50,50,6| |script|
|Woman1|
mes "[Woman]";
mes "Lets see if you win";
callfunc "funcNPC",2;
mes "Well done you have won";
|115,{
...
place.gat,52,50,6| |script|
|Woman2|
mes "[Woman]";
mes "Lets see if you win";
callfunc "funcNPC",5;
mes "Well done you have won";
|115,{
...
function| |script|
|funcNPC|
set @win, rand(getarg(0));
if(@win==0) return;
mes "Sorry you lost";
|{
It is, however, better to use 'set' to get this value instead (see 'callfunc')
or use 'callfunc' as a function, because otherwise you can't call functions
from
within other functions. (Return values mess up the stack.)
Return to the table of contents
*next;
This command will create a 'next' button in the message window for the
invoking
character. If no window is currently on screen, it will be created. Used to
segment NPC talking, this command is used A LOT. See 'mes'.
mes "[Woman]";
mes "This would appear on the page";
next;
// This is needed cause it is a new page and the top will now be blank
mes "[Woman]";
mes "This would appear on the 2nd page";
Return to the table of contents
*close;
This command will create a 'close' button in the message window for the
invoking
character. If no window is currently on screen, it will be created. This is
one
of the ways to end a speech from an NPC. Once the button is clicked, the NPC
script execution will end, and the message box will disappear.
mes "[Woman]";
mes "I am finished talking to you, click the close button";
close;
mes "This command will not run at all, cause the script has ended.";
Return to the table of contents
*close2;
This command will create a 'close' button in the message window for
invoking
character. If no window is currently on screen, it will be created.
'close'.
There is one important difference, though - even though the message
have closed, the script execution will not stop, and commands after
will still run, meaning an 'end' has to be used to stop the script,
make it stop in some other manner.
mes "[Woman]";
mes "I will warp you now";
the
See
box will
'close2'
unless you
close2;
warp "place.gat",50,50;
end;
Don't expect things to run smoothly if you don't make your scripts 'end' or
'close'.
Return to the table of contents
*menu "<menu option>",<label>{,"<menu option>",<label>...};
This command will create a selectable menu for the invoking character. Only
one
menu can be on screen at the same time.
Depending on what the player picks from the menu, the script execution will
continue from the corresponding label. (it's string-label pairs, not labelstring)
It also sets a special temporary character variable @menu, which contains the
number of option the player picked. (Numbering of options starts at 1.)
menu "I want to Start",L_Start,"I want to end",L_End;
L_Start:
//If they click "I want to Start" they will end up here
L_End:
//If they click "I want to end" they will end up here
If a label is '-', the script execution will continue right after the menu
command if that option is selected, this can be used to save you time, and
optimize big scripts.
menu "I want to Start",-,"I want to end",L_End;
//If they click "I want to Start" they will end up here
L_End:
//If they click "I want to end" they will end up here
Both these examples will perform the same task.
If you give an empty string as a menu item, the item will not display.
However,
this will do nothing to the list of labels corresponding to the menu items,
(which should probably be considered a server bug) so
menu "",L_Start,"End",L_End;
will jump to the L_Start label, even though the user has picked "End" and can
only pick "End". You can get around this problem by making sure that all the
empty menu options are at the end of the menu command argument list, so
there's
no labels it could screw up. But what if you want to make a menu, but don't
know
beforehand if some of the options in it make sense?
You can do it by using arrays, but watch carefully - this trick isn't high
wizardry, but minor magic at least. You can't expect to easily duplicate it
until you understand how it works.
Create a temporary array of strings to contain your menu items, and populate
it
with the strings that should go into the menu at this execution, making sure
not
to leave any gaps. Normally, you do it with a loop and an extra counter, like
this:
setarray @possiblemenuitems$[0],<list of potential menu items>;
set @i,0; // That's our loop counter.
set @j,0; // That's the menu lines counter.
makemenuloop:
// We record the number of option into the list of options actually
// available. That 'condition' is whatever condition that determines
whether
// a menu item number @i actually goes into the menu or not.
if (<condition>) set @menulist$[@j],@possiblemenuitems$[@i];
// We just copied the string, we do need it's number for later though, so
we
This will create you an array @menulist$ which contains the text of all items
that should actually go into the menu based on your condition, and an array
@menureference, which contains their numbers in the list of possible menu
items.
(Remember, arrays start with 0.) There's less of them than the possible menu
items you've defined, but the menu command can handle the empty lines - only
if
they are last in the list, and if it's made this way, they are. Now comes a
dirty trick:
// X is whatever the most menu items you expect to handle.
menu @menulist$[0],-,@menulist$[1],-,....@menulist$[<X>],-;
This calls up a menu of all your items. Since you didn't copy some of the
possible menu items into the list, it's end is empty and so no menu items will
show up past the end. But this menu call doesn't jump anywhere, it just
continues execution right after the menu command. (And it's a good thing it
doesn't, cause you can only explicitly define labels to jump to, and how do
you
know which ones to define if you don't know beforehand which options will end
up
where in your menu?)
But how do you figure out which option the user picked? Enter the @menu.
@menu contains the number of option that the user selected from the list,
starting with 1 for the first option. You know now which option the user
picked
and which number in your real list of possible menu items it translated to:
mes "You selected "+@possiblemenuitems$[@menureference[@menu-1]]+"!";
@menu is the number of option the user picked.
@menu-1 is the array index for the list of actually used menu items that we
made.
@menureference[@menu-1] is the number of the item in the array of possible
menu
items that we've saved just for this purpose.
And @possiblemenuitems$[@menureference[@menu-1]] is the string that we used to
display the menu line the user picked. (Yes, it's a handful, but it works.)
You can set up a bunch of 'if (@menureference[@menu-1]==X) goto Y' statements
to
route your execution based on the line selected and still generate a different
menu every time, which is handy when you want to, for example, make users
select
items in any specific order before proceeding, or make a randomly shuffled
menu.
Kafra code bundled with the standard distribution uses a similar array-based
menu technique for teleport lists, but it's much simpler and doesn't use
@menu,
probably since that wasn't documented anywhere.
See also 'select', which is probably better in this particular case. Instead
of
menu, you could use 'select' like this:
set @dummy,select(@menulist$[0],@menulist$[1],....@menulist$[<X>]);
For the purposes of the technique described above these two statements are
perfectly equivalent.
Return to the table of contents
*rand(<number>{,<number>});
This function returns a number, randomly positioned between 0 and the number
you
specify (if you only specify one) and the two numbers you specify if you give
it
two.
rand(10) would result in 0,1,2,3,4,5,6,7,8 or 9
rand(2,10) would result in 2,3,4,5,6,7,8,9 or 10
Return to the table of contents
*warp "<map name>",<x>,<y>;
This command will take the invoking character to the specifed map, and if
wanted, specified coordinates too, but these can be random.
warp "place.gat",50,55;
This would take them to X 50 Y 55 on the map called "place". If your X and Y
coordinates land on an unwalkable map square, it will send the warped
character
to a random place. Same will happen if they are both zero:
warp "place.gat",0,0;
Notice that while warping people to coordinates 0,0 will normally get them
into
a random place, it's not certain to always be so. Darned if I know where this
is
actually coded, it might be that this happens because square 0,0 is unwalkable
on all official maps. If you're using custom maps, beware.
There are also three special 'map names' you can use.
"Random" will warp the player randomly on the current map.
"Save" and "SavePoint" will warp the player back to their savepoint.
Return to the table of contents
*areawarp "<from map name>",<x1>,<y1>,<x2>,<y2>,"<to map name>",<x3>,<y3>;
This command is similar to 'warp', however, it will not refer to the invoking
character, but instead, all characters within a specified area, defined by the
x1/y1-x2/y2 square, will be warped. Nobody outside the area will be affected,
including the activating character, if they are outside the area.
areawarp "place.gat",10,10,120,120,"place2.gat",150,150;
Everyone that is in the area between X 10 Y 10 and X 120 Y 120, in a square
shape, on the map called "place", will be affected, and warped to "place2" X
150
Y 150
areawarp "place.gat",10,10,120,120,"place2.gat",0,0;
By using ,0,0; as the destination coordinates it will take all the characters
in
the affected area to a random set of co-ordinates on "place2".
Like 'warp', areawarp will also explicitly warp characters randomly into the
current map if you give the 'to map name' as "Random".
See also 'warp'.
Return to the table of contents
*heal <hp>,<sp>;
This command will heal a set amount of HP and/or SP on the invoking character.
heal 30000,0; // This will heal 30,000 HP
heal 0,30000; // This will heal 30,000 SP
heal 300,300; // This will heal 300 HP and 300 SP
This command just alters the hit points and spell points of the invoking
character and produces no other output whatsoever.
Return to the table of contents
*itemheal <hp>,<sp>;
This command works on the invoking character like 'heal', however, it is not
normally used in NPC scripts and will not work as expected there, but is used
all over in item scripts.
Unlike 'heal', which just alters hp/sp and doesn't do anything else at all,
this
command also shows healing animations for potions and other stuff, checks
whether the potion was made by a famous alchemist and alters the amount
healed,
etc, etc. Since which kind of effect is shown depends on what item was used,
using it in an NPC script will not have a desired effect.
There is also a nice example on using this with the 'rand' function, to give
you
a random ammount of healing.
// This will heal anything thing from 100 to 150 HP and no SP
itemheal rand(100,150),0;
Return to the table of contents
*percentheal <hp>,<sp>;
This command will heal the invoking character. It heals the character, but not
by a set value - it adds percent of their maximum HP/SP.
close;
L_Correct:
mes "[Woman]";
mes "Well done that was the number I was thinking of";
close;
If you give the input command a string variable to put the input in, it will
allow the player to enter text. Otherwise, only numbers will be allowed.
mes "[Woman]";
mes "Please say HELLO";
next;
input @var$;
if(@var$=="HELLO") goto L_Correct;
mes "[Woman]";
mes "Sorry you got it wrong";
close;
L_Correct:
mes "[Woman]";
mes "Well done you typed it correctly";
close;
Notice that in current SVN, you may not input a negative number with this
command. This was done to prevent exploits in badly written scripts, which
would
let people, for example, put negative amounts of zeny into a bank script and
recieve free zeny as a result. Unfortunately it limits the uses of the 'input'
command quite a bit.
This command does not work in item scripts, although by all indications it
should. This appears to be either a client limitation or a problem in the way
the packet to open an input window is sent to the client. For now, you just
can't use it item scripts.
Return to the table of contents
*setlook <look type>,<look value>;
This command will alter the look data for the invoking character. It is used
mainly for changing the palette used on hair and clothes, you specify which
look
type you want to change, then the palette you want to use. Make sure you
specify
a palette number that exists/is usable by the client you use.
// This will change your hair(6), so that it uses palette 8, what ever
your
Base sprite
Hairstyle
Weapon
Head bottom
Head top
Head mid
Hair color
Clothes color
Shield
Shoes
Whatever 'shoes' means is anybody's guess, ask Gravity - the client does
nothing
with this value. It still wants it from the server though, so it is kept, but
normally doesn't do a thing.
Only the look data for hairstyle, hair color and clothes color are saved to
the
char server's database and will persist. The rest freely change as the
character
puts on and removes equipment, changes maps, logs in and out and otherwise you
should not expect to set them. In fact, messing with them is generally
hazardous, do it at your own risk, it is not tested what will this actually do
it won't cause database corruption and probably won't cause a server crash,
but
it's easy to crash the client with just about anything unusual.
However, it might be an easy way to quickly check for empty view IDs for
sprites, which is essential for making custom headgear.
Since a lot of people have different palettes for hair and clothes, it's
impossible to tell you what all the colour numbers are. If you want a serious
example, there is a Stylist script inside the default eAthena installation
that
you can look at, this may help you create a Stylist of your own:
'custom\dye.txt'
Return to the table of contents
*set <variable>,<expression>;
This command will set a variable to the value that the expression results in.
This is the only way to set a variable directly.
This is the most basic script command and is used a lot whenever you try to do
anything more advanced than just printing text into a messagebox.
set @x,100;
will make @x equal 100.
set @x,1+5/8+9;
will compute 1+5/8+9 (which is, surprisingly, 10 - remember, all numbers are
integer in this language) and make @x equal it.
Return to the table of contents
*setarray <array name>[<first value>],<value>{,<value>...<value>};
This command will allow you to quickly fill up an array in one go. Check the
Kafra scripts in the distribution to see this used a lot.
setarray @array[0], 100, 200, 300, 400, 500, 600;
First value is the index of the first element of the array to alter. For
example:
setarray @array[0],200,200,200;
setarray @array[1],300,150;
will produce:
@array[0]=200
@array[1]=300
@array[2]=150
Return to the table of contents
*cleararray <array name>[<first value to alter>],<value>,<number of values to
set>;
This command will change many array values at the same time to the same value.
setarray @array[0], 100, 200, 300, 400, 500, 600;
// This will make all 6 values 0
cleararray @array[0],0,6;
// This will make array element 0 change to 245
cleararray @array[0],245,1;
// This will make elements 1 and 2 change to 345
cleararray @array[1],345,2;
See 'setarray'.
Return to the table of contents
*copyarray <to array>[<first value>],<from array>[<first value>],<amount to
copy>;
This command lets you quickly shuffle a lot of data between arrays, which is
in
some cases invaluable.
setarray @array[0], 100, 200, 300, 400, 500, 600;
=
=
=
=
300
400
500
0
Notice that @array[5] wont be coppied to the second array, and it will return
a
0.
Return to the table of contents
*getarraysize(<array name>);
This function returns the number of values that are contained inside the
specified array. Notice that zeros and empty strings at the end of this array
are not counted towards this number.
For example:
setarray @array[0], 100, 200, 300, 400, 500, 600;
set @arraysize,getarraysize(@array);
This will make @arraysize == 6. But if you try this:
setarray @array[0], 100, 200, 300, 400, 500, 600, 0;
set @arraysize,getarraysize(@array);
@arraysize will still equal 6, even though you've set 7 values.
Return to the table of contents
*deletearray <array name>[<first value>],<how much to delete>
This command will delete a specified number of array elements totally from an
array, shifting all the elements beyond this towards the beginning.
// This will delete array element 0, and move all the other array elements
// up one place.
deletearray @array[0],1
(1)
(0)
(5)
(-1)
mes
mes
mes
mes
For more information on conditional operators see the operators section above.
Anything that is returned by a function can be used in a condition check
without
bothering to store it in a specific variable:
if (strcharinfo(0)=="Daniel Jackson") mes "It is true, you are Daniel!";
More examples of using the 'if' command in the real world:
Example 1:
set @var1,1;
input @var2;
if(@var1==@var2) goto L_Same;
mes "Sorry that is wrong";
close;
L_Same:
close;
Example 2:
set @var1,1;
input @var2;
if(@var1!=@var2) mes "Sorry that is wrong";
close;
(Notice examples 1 and 2 have the same effect.)
Example 3:
set @var1,@var1+1;
mes "[Forgetfull Man]";
if (@var==1) mes "This is
if (@var==2) mes "This is
if (@var==3) mes "This is
if (@var==4) mes "This is
think I am getting amnesia, I
if (@var==4) set @var,0;
close;
Example 4:
mes "[Quest Person]";
if(countitem(512)>=1) goto L_GiveApple;
// The number 512 was found from item_db, it is the item number for
the Apple.
mes "Can you please bring me an apple?";
close;
L_GiveApple:
mes "Oh an apple, I didnt want it, I just wanted to see one";
close;
Example 5:
mes "[Person Checker]";
if($name$!=null) goto L_Check;
mes "Please tell me someones name";
next;
input $name$;
set $name2$,strcharinfo(0);
mes "[Person Checker]";
mes "Thank you";
L_Check:
if($name$==strcharinfo(0) ) goto L_SameName;
Giving an item ID of -2
Giving an item ID of -3
Giving an item ID of -4
Giving an item ID of -5
current SVN, drops only
of
of
of
of
Calling this command with a negative item ID to create a random item will
create
an entry in the log file for those if such logging is enabled.
You may also create an item by it's name in the 'english name' field in the
item
database:
getitem "RED_POTION",10;
Which will do what you'd expect. If it can't find that name in the database,
apples will be created anyway. It is often a VERY GOOD IDEA to use it like
this.
This used in pretty much all NPC scripts that have to do with items and quite
a
few item scripts. For more examples check just about any official script.
Return to the table of contents
*getitem2 <item
id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,
<character ID>};
*getitem2 "<Item
name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4
>{,<character ID>};
This command will give an amount of specified items to the invoking character.
If an optional character ID is specified, and that character is currently
online, items will be created in their inventory instead. If they are not
online, nothing will happen. It works essentially the same as 'getitem' (it
even
works for negative ID numbers the same way, which is kinda silly) but is a lot
more flexible, since it allows you to give the player an item altered with
it's
specific properties.
Those parameters that are different from 'getitem' are:
identify
- Whether you want the item to be identified or not, 0
unidentified,
1 identified.
refine
- For how many plusses will it be refined.
It will not let you refine an item higher than +10, if you
specify more it'll still be 10.
attribute
- Whether the item is broken (1) or not (0) and NOT an elemental
attribute.
card1,2,3,4 - If you want a card compound to it, place the card ID number into
Found in 'db/item_db.txt'
Amount you want produced
The X coordinate
The Y coordinate
The map name.
This item will still disappear just like any other dropped item. Like
'getitem',
it also accepts an 'english name' field from the database and creates apples
if
the name isn't found.
Return to the table of contents
*delitem <item id>,<amount>;
*delitem "<item name>",<amount>;
This command will take a specified amount of items from the invoking
character.
As all the item commands, this one uses the ID of the item found inside
'db/item_db.txt'. The items are destroyed - there is no way an NPC can simply
own items and have an inventory of them, other as by destroying and recreating
them when needed.
what you want to do with a point, 1 will set it, while 2 will clear
number is the number of the point - you can have several. If more
is drawn at the same coordinates, they will cycle, which can be used
flashing marks.
*countitem(<item id>)
*countitem("<item name>")
This function will return the number of items for the specified item ID that
the
invoking character has in their inventory.
mes "[Item Checker]";
mes "Hmmm, it seems you have "+countitem(502)+" apples";
close;
Like 'getitem', this function will also accept an 'english name' from the
database as an argument.
If you want to state the number at the end of a sentence, you can do it by
adding up strings:
mes "[Item Checker]";
mes "Hmmm, the total number of apples you are holding is
"+countitem("APPLE");
close;
Return to the table of contents
*checkweight(<item id>,<amount>)
*checkweight("<item name>",<amount>)
This function will compute and return 1 if the total weight of a specified
number of specific items does not exceed the invoking character's carrying
capacity, and 0 otherwise. It is important to see if a player can carry the
items you expect to give them, failing to do that may open your script up to
abuse or create some very unfair errors.
Like 'getitem', this function will also accept an 'english name' from the
database as an argument.
checkweight(502,10) // 10 apples
if (checkweight(502,10) == 0 ) goto L_OverWeight;
getitem 502,10;
close;
L_OverWeight:
mes "Sorry you cannot hold this ammount of apples";
close;
Or to put this another way:
if (checkweight("APPLE",10)) goto L_Getapples;
mes "Sorry you cannot hold this ammount of apples";
close;
L_Getapples:
getitem 502,10;
close;
0
1
2
3
Character ID number.
Party ID number.
Guild ID number.
Account ID number
For most purposes other than printing it, a number is better to have than a
name
(people do horrifying things to their character names).
If the character is not in a party or not in a guild, the function will return
0
if guild or party number is requested. If a name is specified and the
character
is not found, 0 is returned.
If getcharid(0) returns a zero, the script got called not by a character and
doesn't have an attached RID.
if (!getcharid(2)) mes "Only members of a guild are allowed beyond this
point!";
If the character stated isnt online any number returned with be -1
Return to the table of contents
*getpartyname(<party id>)
This function will return the name of a party that has the specified ID
number.
If there is no such party ID, "null" will be returned.
Lets say the ID of a party was saved as a global variable:
// This would return the name of the party from the ID stored in a
variable
mes "You're in the '"+getpartyname($@var)"' party, I know!";
Return to the table of contents
*getpartymember <party id>;
Thank you to HappyDenn for all this information.
This command will find all members of a specified party and returns their
names
into an array of temporary global variables. There's actually quite a few
commands like this which will fill a special variable with data upon execution
and not do anything else.
Upon executing this,
$@partymembername$[] is a global temporary stringarray which contains all the
names of these party members.
$@partymembercount
is the number of party members that were found.
The party members will (apparently) be found regardless of whether they are
online or offline. Note that the names come in no particular order.
Be sure to use $@partymembercount to go through this array, and not
'getarraysize', because it is not cleared between runs of 'getpartymember'. If
someone with 7 party members invokes this script, the array would have 7
elements. But if another person calls up the NPC, and he has a party of 5, the
server will not clear the array for you, overwriting the values instead. So in
addition to returning the 5 member names, the 6th and 7th elements from the
last
call remain, and you will get 5+2 members, of which the last 2 don't belong to
the new guy's party. $@partymembercount will always contain the correct
number,
(5) unlike 'getarraysise()' which will return 7 in this case.
Example:
// get the character's party ID
getpartymember(getcharid(1));
// immediately copy $@partymembercount value to a new variable, since
// you don't know when 'getpartymember' will get called again for someone
// else's party, overwriting your global array.
set @partymembercount,$@partymembercount;
// copy $@partymembername array to a new array
copyarray @partymembername$[0],$@partymembername$[0],@partymembercount;
//list the party members in NPC dialog
set @count,0;
L_DisplayMember:
if(@count == @partymembercount) goto L_DisplayMemberEnd;
mes (@count + 1) + ". ^0000FF" + @partymembername$[@count] + "^000000";
set @count,@count+1;
goto L_DisplayMember;
L_DisplayMemberEnd:
close;
Return to the table of contents
*getguildname(<guild id>)
This function returns a guild's name given an ID number. If there is no such
guild, "null" will be returned;
// Would print what ever guild 10007 is, in my case this would return
"AlcoROhics"
mes "The guild "+GetGuildName(10007)+" are all nice people.";
// This will do the same as above:
set @var,10007;
mes "We have some friends in "+GetGuildName(@var)+", you know.";
This is used all over the WoE controlling scripts. You could also use it for a
guild-based event.
Return to the table of contents
*getguildmaster(<guild id>)
This function return the name of the master of the guild which has the
specified
ID number. If there is no such guild, "null" will be returned.
// Would return the guild master of guild 10007, whatever that might be.
// In this example it would return "MissDjax" cause she owns "AlcoROhics"
(10007)
mes getguildmaster(10007)+" runs "+getguildname(10007);
Can be used to check if the character is the guildmaster of the specified
guild.
Maybe you want to make a room only guildmasters can enter:
set @GID,getcharid(2);
if(@GID==0) goto L_NoGuild;
if(strcharinfo(0)==getguildmaster(@GID)) goto L_GuildMaster;
mes "Sorry you dont own the guild you are in";
close;
L_NoGuild:
mes "Sorry you are not in a guild";
close;
L_GuildMaster:
mes "Welcome guild master of "+GetGuildName(@GID);
close;
Return to the table of contents
*getguildmasterid(<guild id>)
This function will return the character ID number of the guildmaster of the
guild specified by the ID. 0 if the character is not a guildmaster of any
guild.
Return to the table of contents
*strcharinfo(<type>)
This function will return either the name, party name or guild name for the
invoking character. Whatever it returns is determined by type.
0 - Character's name.
1 - The name of the party they're in if any.
2 - The name of the guild they're in if any.
If a character is not a member of any party or guild, an empty string will be
Notice that a few items occupy several equipment slots, and if the character
is
wearing such an item, 'getequipid' will return it's ID number for either slot.
Can be used to check if you have something equiped, or if you haven't got
something equiped:
if(getequipid(1)==2234) goto L_WearingTiara;
mes "Come back when you have a Tiara on";
close;
L_WearingTiara:
mes "What a lovely Tiara you have on";
close;
You can also use it to make sure people dont pass a point before removing an
item totally from them. Let's say you dont want people to wear Legion Plate
armor, but also dont want them to equip if after the check, you would do this:
if ((getequipid(2) == 2341) || (getequipid(2) == 2342) goto
L_EquipedLegionPlate;
// the || is used as an or argument, there is 2341 and 2342 cause there
are
// two different legion plate armors, one with a slot one without.
if ((countitem(2341) > 0) || (countitem(2432) > 0) goto
L_InventoryLegionPlate;
mes "I will lets you pass";
close2;
warp "place.gat",50,50;
end;
L_EquipedLegionPlate:
mes "You are wearing some Legion Plate Armor, please drop that in your
stash before continuing";
close;
L_InventoryLegionPlate:
mes "You have some Legion Plate Armor in your inventory, please drop
that in your stash before continuing";
close;
Return to the table of contents
*getequipname(<equpment slot>)
This function will return the name of the item equipped in the specified
equipment slot on the invoking character. Almost identical to 'getequipid',
good
for an NPC to state what your are wearing, or maybe saving as a string
variable.
See 'getequipid' for a full list of valid equipment slots.
if (getequipname(1)==0) goto L_No_HeadGear;
mes "So you are wearing a "+getequipname(1)+" on your head";
close;
L_No_HeadGear:
mes "You are not wearing any head gear";
close;
Return to the table of contents
*getbrokenid(<number>)
This function will search the invoking character's inventory for any broken
items, and will return their item ID numbers. Since the character may have
several broken items, 0 given as an argument will return the first one found,
1
will return the second one, etc. Will return 0 if no such item is found.
// Let's see if they have anything broken:
if (getbrokenid(0)==0) goto Skip;
// They do, so let's print the name of the first broken item:
mes "Oh, I see you have a broken "+getitemname(getbrokenid(0))+"
here!";
Skip:
mes "You don't have anything broken, quit bothering me.";
Return to the table of contents
*repair <broken item number>;
This command repairs a broken peice of equipment, using the same list of
broken
items as available through 'getbrokenid'.
The official scripts seem to use the repair command as a function instead:
'repair(<number>)' but it returns nothing on the stack. Probably only Valaris,
who made it, can answer why is it so.
Can be used to check if you have reached a maximum refine value, default for
this is +10:
if(getequiprefinerycnt(1) < 10) goto L_Refine_HeadGear;
mes "Sorry, it's not possible to refine hats better than +10";
close;
L_Refine_HeadGear:
mes "I will now upgrade your "+getequipname(1);
Return to the table of contents
*getequipweaponlv(<equipment slot>)
This function returns the weapon level for the weapon equipped in the
specified
equipment slot on the invoking character. For a list of equipment slots see
'getequipid'.
Only 3 (Left hand) and 4 (Right hand) normally make sense, since only weapons
have a weapon level. You can, however, probably, use this field for other
equippable custom items as a flag or something.
If no item is equipped in this slot, or if it doesn't have a weapon level
according to the database, 0 will be returned.
if(getequipweaponlv(4)==0)
if(getequipweaponlv(4)==1)
if(getequipweaponlv(4)==2)
if(getequipweaponlv(4)==3)
if(getequipweaponlv(4)==4)
if(getequipweaponlv(4)==5)
be a custom design";
mes
mes
mes
mes
mes
mes
weapon on";
1 weapon";
2 weapon";
3 weapon";
4 weapon";
5 weapon, hm, must
a shield, so it doesnt
a
a
a
a
a
lvl
lvl
lvl
lvl
lvl
1
2
3
4
5
weapon";
weapon";
weapon";
weapon";
weapon, hm,
refine the item found in the specified equipment slot of the invoking
character
by +1. The actual formula is beyond the scope of this document, however, it is
calculated as if the character was a blacksmith trying to refine this
particular
weapon, and depends on lots and lots of stuff. For a list of equipment slots
see
'getequipid'.
These values can be displayed for the player to see, or used to calculate the
random change of a refine succeeding or failing and then going through with it
(which is what the official NPC refinery scripts use it for)
// This will find a random number from 0 - 99 and if that is equal to or more
// than the value recoverd by this command it will go to L_Fail
if (getequippercentrefinery(3)<=rand(100)) goto L_Fail;
Return to the table of contents
*successrefitem <equipment slot>;
This command will refine an item in the specified equipment slot of the
invoking
character by +1. For a list of equipment slots see 'getequipid'. This command
will not only add the +1, but also display a 'refine success' effect on the
character and put appropriate messages into their chat window. It will also
give
the character fame points if a weapon reached +10 this way, even though these
will only take effect for blacksmith who will later forge a weapon.
The official scripts seem to use the 'successrefitem' command as a function
instead: 'successrefitem(<number>)' but it returns nothing on the stack.
This is since jAthena, so probably nobody knows for sure why is it so.
Return to the table of contents
*failedrefitem <equipment slot>;
This command will fail to refine an item in the specified equipment slot of
the
invoking character. The item will be destroyed. This will also display a
'refine
failure' effect on the character and put appropriate messages into their chat
window.
The official scripts seem to use the 'failedrefitem' command as a function
instead: 'failedrefitem(<number>)' but it returns nothing on the stack. This
is
since jAthena, so probably nobody knows for sure why is it so.
Return to the table of contents
Giving an empty string for the filename and 255 for the position will remove
all
cutin pictures. Any other position value will not cause a script error but
will
cause the player's client to curl up and die. Only one cutin may be on screen
at
any given time, any new cutins will replace it.
// This will display the picture of the 7th kafra,
// the one in orange and the mini-skirt :P
cutin "kafra_7",2;
// This will remove the displayed picture.
cutin "Kafra_7",255;
// This will remove all pictures displayed.
cutin "",255;
The client comes with a few cutin pictures preinstalled which you can use, we
listed the most important ones here:
mets_alpha
- This is a old fat man, holding a pipe, also with a pocket watch
and cane
pay_soldier - Wanna take a wild guess, thats right, the Soldiers that appear
in
Payon :D
prt_soldier - Obvious
ein_soldier - This guy looks cool, you've got to see him ;) This picture is
for
moc_soldier
gef_soldier
katsua01
with
katsua02
katsua03
kafra_01
kafra_02
kafra_03
kafra_04
kafra_05
kafra_06
kafra_07
Strength
Vitality
Intelligence
Agility
Dexterity
Luck
This would give your character's guild one level of Approval (GD_APPROVAL
10000). Notice that if you try to add two levels of Approval, or add
Approval when the guild already has it, it will only have one level of
Approval afterwards.
guildskill 10000,1,0;
You might want to make a quest for getting a certain guild skill, make it hard
enough that all the guild needs to help or something. Doing this for the Glory
of the Guild skill, which allows your guild to use an emblem, is a good idea
for
a fun quest. (Wasting a level point on that is really annoying :D)
Return to the table of contents
*getskilllv(<skill id>)
This function returns the level of the specified skill that the invoking
character has. If they don't have the skill, 0 will be returned. The full list
of character skills is available in 'db/skill_db.txt'.
There are two main uses for this function, it can check whether the character
has a skill or not, and it can tell you if the level is high enough.
Example 1:
f (getskilllv(152)) goto L_HasSkillThrowStone;
mes "You dont have Throw Stone";
close;
L_HasSkillThrowStone:
mes "You have got the skill Throw Stone";
close;
Example 2:
if (getskilllv(28) >= 5) goto L_HasSkillHeallvl5orMore;
if (getskilllv(28) == 10) goto L_HasSkillHealMaxed;
mes "You heal skill is below lvl 5";
close;
L_HasSkillHeallvl6orMore:
mes "Your heal lvl is 5 or more";
close;
L_HasSkillHealMaxed:
mes "Your heal lvl has been maxed";
close;
Return to the table of contents
*getgdskilllv(<guild id>,<skill id>)
This function retirns the guild skills for the guild with a specified ID
exactly
as 'getskilllv' does.
Return to the table of contents
*basicskillcheck()
This function will return the state of the configuration option
'basic_skill_check' in 'battle_athena.conf'. It returns 1 if the option is
enabled and 0 if it isn't. If the 'basic_skill_check' option is enabled, which
it is by default, characters must have a certain number of basic skill levels
to
sit, request a trade, use emoticons, etc. Making your script behave
differently
depending on whether the characters must actually have the skill to do all
these
things might in some cases be required.
Return to the table of contents
*getgmlevel()
This function will return the GM level of the account to which the invoking
character belongs. If this is somehow executed from a console command, 99 will
be returned, and 0 will be returned if the account has no GM level.
This allows you to make NPC's only accessable for certain GM levels, or behave
specially when talked to by GMs.
if (getgmlevel()) mes "What is your command, your godhood?";
if (getgmlevel()) goto Wherever;
If you want to have a GM of a specific level only to access something you can
use
it like this
if (getgmlevel()<50) end;
Anyone with less that GM level 50 will have the script end on them, making it
only acessable by GM level 50 and over
Option numbers valid for the first version of this command are:
1
2
3
4
32
Petrified.
Frozen.
Stunned.
Sleeping.
Riding a Peco.
'setoption' will set options on the invoking character. There are no second
and
third versions of this command, so you can only change the
petrified/frozen/stunned/sleeping/riding status in this manner.
Option numbers valid for the second version of this command are:
1
2
4
8
Poisoned.
Cursed.
Silenced.
Blinded (Notice that unless you specfy variable night darkness in the
configuration, all characters will be 'blinded' during the night)
Option numbers valid for the third version of this command are:
1
2
4
8
64
128
256
512
1024
2048
4096
8192
Sight in effect.
Hide in effect.
Cloaking in effect.
Falcon present.
GM Perfect Hide in effect.
Cart number 2 present.
Cart number 3 present.
Cart number 4 present.
Cart number 5 present.
Orc head present.
The character is wearing a wedding sprite.
Ruwach is in effect.
Option numbers are bitmasks - add up option numbers to check for all of them
being present at the same time in one go.
This is definitely not a complete list of available option flag numbers. Ask a
core developer for the full list.
Return to the table of contents
*setcart;
*checkcart()
This command will give the invoking character a cart. The cart given will be
cart number 1 and will work regardless of whether the character is a merchant
class or not.
The accompanying function will return 1 if the invoking character has a cart
(any kind of cart) and 0 if they don't.
if (checkcart()) mes "But you already have a cart!";
This function will return the system time in UNIX epoch time (if tick type is
0)
or the time since the start of the current day in seconds if tick type is 1.
Just in case you don't know, UNIX epoch time is the number of seconds elapsed
since 1st of January 1970, and is useful to see, for example, for how long the
character has been online with PCLoginEvent and PCLogoutEvent, which could
allow
you to make an 'online time counted for conviction only' jail script.
Return to the table of contents
*gettime(<type>)
This function will return specified information about the current system time.
1
2
3
4
5
6
7
This will open a character's Kafra storage window on the client connected to
the
invoking character. It does not check wherever it is run from, so you can
allow
any feasible NPC to open a kafra storage. (It's not certain whether this works
in item scripts, but if it does, it could be interesting.)
The storage window might not open if a message box or a trade deal is present
on
screen already, so you should at least make sure the message box is closed
before you open storage.
mes "I will now open your stash for you";
close2;
openstorage;
end;
Return to the table of contents
*guildopenstorage()
This function works the same as 'openstorage' but will open a guild storage
window instead for the guild storage of the guild the invoking character
belongs
to. This is a function because it returns a value - 0 if the guild storage was
opened successfully and 1 if it wasn't. (Notice, it's a ZERO upon success.)
Since guild storage is only accessible to one character at one time, it may
fail
if another character is accessing the guild storage at the same time.
This will also fail and return 2 if the character does not belong to any
guild.
Return to the table of contents
*itemskill <skill id>,<skill level>,"<skill name to show>";
This is a command meant for item scripts to replicate single-use skills. It
will
not work properly in NPC scripts a lot of the time because casting a skill is
not allowed when there is a message window or menu on screen. If there isn't
one
cause you've made sure to run this when they already closed it, it should work
just fine and will even show a targeting pointer if this is a targeting skill.
// When you use Anodyne, you will cast Endure(8) level 1,
// and "Endure" will appear above your head as you use it.
605,Anodyne,Anodyne,11,2000,0,100,,,,,10477567,2,,,,,{ itemskill 8,1,"Endure";
},{}
Return to the table of contents
Level 1 Weapons
Level 2 Weapons
Level 3 Weapons
Blacksmith's Stones and Metals
Alchemist's Potions
Whitesmith's Coins
Whitesmith's Nuggets
Assassin Cross's Deadly Poison
name of the label must start with 'On', otherwise, it will not execute. The
RID
attached at this execution will be the RID of the killing character.
The NPC object must be located on the same map as the monster to be killed, or
nothing will be triggered.
monster "place.gat",60,100,"Poring",1002,1,"NPCNAME::OnLabel";
If you do not specify any event label, a label in the NPC object that ran this
command, called 'OnMyMobDead:' will execute anyway, if present.
The coordinates of 0,0 will spawn the monster on a random place on the map.
The 'areamonster' command works much like the 'monster' command and is not
significantly different, but spawns the monsters within a square defined by
x1/y1-x2/y2.
Simple monster killing script:
<Normal NPC object definition. Let's assume you called him NPCNAME.>
mes "[Summon Man]";
mes "Want to start the kill?";
next;
menu "Yes",L_Yes,"No",-;
mes "[Summon Man]";
mes "Come back later";
close;
L_Yes:
monster "prontera.gat",0,0,"Quest
Poring",1002,10,"NPCNAME::L_PoringKilled";
// By using 0,0 it will spawn them in a random place.
mes "[Summon Man]";
mes "Now go and kill all the Poring I summoned";
// He summoned ten.
close;
L_PoringKilled:
set $PoringKilled,$PoringKilled+1;
if ($PoringKilled==10) goto L_AllDead;
end;
L_AllDead:
announce "Summon Man: Well done all the poring are dead",3;
set $PoringKilled,0;
end;
For more good examples see just about any official 2-1 or 2-2 job quest
script.
Return to the table of contents
*killmonster "<map name>","<event label>";
This command will kill all monsters that were spawned with 'monster' or
'areamonster' and have a specified event label attached to them. Commonly used
to get rid of remaining quest monsters once the quest is complete.
If the label is given as "All", all monsters which have their respawn times
set
to -1 (like all the monsters summoned with 'monster' or 'areamonster' script
command, and all monsters summoned with GM commands, but no other ones - that
is, all non-permanent monsters) on the specified map will be killed regardless
of the event label value.
Return to the table of contents
*killmonsterall "<map name>";
This command will kill all monsters on a specified map name, regardless of how
they were spawned or what they are.
Return to the table of contents
*doevent "<NPC object name>::<event label>";
This command will start a new execution thread in a specified NPC object at
the
specified label. The execution of the script running this command will not
stop.
No parameters may be passed with a doevent call.
The script of the NPC object invoked in this manner will run as if it's been
invoked by the RID that was active in the script that issued a 'doevent'.
place.gat,100,100,1|
|script|
|NPC|
|53,{
mes "This is what you will see when you click me";
close;
Label:
mes "This is what you will see if the doevent is activated";
close;
}
....
doevent "NPC::Label";
Return to the table of contents
*donpcevent "<event label>";
This command is kinda confusing cause it performs in two completely different
ways.
If the event label is phrased like "::<label name>", all NPC objects that have
a
specified label in them will be invoked as if by a 'doevent', but no RID
whatsoever will be attached while they execute.
Otherwise, if the label is given as "<NPC name>::<label name>", a label within
the NPC object that runs this command will be called, but as if it was running
|NPC|
|53,{
place.gat,102,100,1|
|script|
mes "Hey NPC copy what I do";
close2;
set $@emo, rand(1,30);
donpcevent "NPC::OnEmo";
OnEmo:
emotion $@emo;
end;
}
|NPC2| |53,{
This will make both NPC perform the same random emotion from 1 to 30, and the
emotion will appear above each of their heads.
Return to the table of contents
*addtimer <ticks>,"<NPC object name>::<label>";
*deltimer "<NPC object name>::<event label>";
*addtimercount <ticks>,"<NPC object name>::<event label>";
These commands will create, destroy, and delay a countdown timer - 'addtimer'
to
create, 'deltimer' to destroy and 'addtimercount' to delay it by the specified
number of ticks. For all three cases, the event label given is the identifier
of
that timer.
When this timer runs out, a new execution thread will start in the specified
NPC
object at the specified label. If no such label is found in the NPC object, it
will run as if clicked. In either case, no RID will be attached during
execution.
The ticks are given in 1/1000ths of a second.
Return to the table of contents
*stoptimer;
*inittimer;
*enablearena;
*disablearena;
*cmdothernpc "<npc name?>","<command?>";
This set of commands is marked as added by someone going under the nickname
'RoVeRT', as mentioned the source code comments, and has to do with timers and
scheduling working entirely unlike any other timing commands. It is not
certain
that they actually even work properly anymore, and most of these read no
arguments, though the 'inittimer'/'stoptimer' pair of commands has to do
something with an 'OnTimer' label and will probably invoke it and
'cmdothernpc'
will execute starting with the label 'OnCommand'. Whatever they actually do,
the
other commands can most likely do it better. The two arena commands definitely
do not do anything useful at all.
None of these commands are used in any scripts bundled with eAthena. Most
probably they are deprecated and left in by mistake.
Unless RoVeRT can be found and asked to clarify what these were made for, that
is.
Return to the table of contents
*initnpctimer{ "<NPC object name>"};
*stopnpctimer{ "<NPC object name>"};
*startnpctimer{ "<NPC object name>"};
*setnpctimer <tick>{,"<NPC object name>"};
*getnpctimer(<type of information>{,"<NPC object name>"});
*attachnpctimer {"<character name>"};
*detachnpctimer {"<NPC object name>"};
This set of commands and functions will create and manage an NPC-object based
timer. The NPC object may be declared by name, or the name in all cases may be
omitted, in that case this timer will be based in the object the current
script
is running in.
Why is it actually part of an NPCs structure we aren't sure, but it is, and
while 'addtimer'/'deltimer' commands will let you have many different timers
referencing different labels in the same NPC, one each and each with their own
countdown, 'initnpctimer' can only have one per NPC object. But it can trigger
many labels and it can let you know how many have been triggered already and
how
many still remain.
This timer is counting up from 0 in ticks of 1/1000ths of a second each. Upon
creating this timer, the execution will not stop, but will happily continue
onward. The timer will then invoke new execution threads at labels
"OnTimer<time>:" in the NPC object it is attached to.
To create the timer, use the 'initnpctimer', which will start it running.
'stopnpctimer' will pause the timer, without clearing the current tick, while
'startnpctimer' will let the paused timer continue.
It is not quite clear whether the new invocations will always have a RID.
Apparently, the RID that was in effect when the timer was initialised will
still
be attached to these executions in some cases, but it's not quite clear experiment with RID-dependent commands, like 'mes', and tell us what happens
and
who gets the message, if anyone.
Even if they don't have a RID by default, 'attachnpctimer' will allow you to
explicitly attach a character's RID to the timer, which will make them the
target for all character-referencing commands and functions, not to mention
variables. 'detachnpctimer' will make the RID zero, making all characterreferencing functions fail with an error.
'setnpctimer' will explicitly set the timer to a given tick. To make it
useful,
you will need the 'getnpctimer' function, for which the type of information
argument means:
0 - Will return the current tick count of the timer.
1 - Will return 1 if there are remaining "OnTimer<ticks>:" labels in the
specified NPC waiting for execution.
2 - Will return the number of times the timer has triggered an
"OnTimer<tick>:"
label in the specified NPC.
Example 1:
<NPC Header> {
initnpctimer;
npctalk "I cant talk right now, give me 10 seconds";
end;
OnTimer5000:
npctalk "Ok 5 seconds more";
end;
OnTimer6000:
npctalk "4";
end;
OnTimer7000:
npctalk "3";
end;
OnTimer8000:
npctalk "2";
end;
OnTimer9000:
npctalk "1";
end;
OnTimer10000:
stopnpctimer;
mes "[Man]";
mes "Ok we can talk now";
}
Example 2:
OnTimer15000:
set $quote,rand(5);
if($quote == 0) goto Lquote0;
if($quote == 1) goto Lquote1;
if($quote == 2) goto Lquote2;
if($quote == 3) goto Lquote3;
if($quote == 4) goto Lquote4;
Lquote0:
npctalk "If 0 is randomly picked
setnpctimer 0;
end;
Lquote1:
npctalk "If 1 is randomly picked
setnpctimer 0;
end;
Lquote2:
npctalk "If 2 is randomly picked
setnpctimer 0;
end;
Lquote3:
npctalk "If 3 is randomly picked
setnpctimer 0;
end;
Lquote4:
npctalk "If 4 is randomly picked
setnpctimer 0;
end;
// This OnInit label will run when the script is loaded, so that the timer
// is initialised immediately as the server starts. It is dropped back to
0
Example 3:
mes "[Man]";
mes "I have been waiting "+(getnpctimer(0)/1000)+" seconds for you";
// we divide the timer returned by 1000 cause it will be displayed in
// milliseconds otherwise
close;
Example 4:
mes "[Man]";
mes "Ok I will let you have 30 sec more";
close2;
setnpctimer (getnpctimer(0)-30000);
// Notice the 'close2'. If there were a 'next' there the timer would be
// changed only after the player pressed the 'next' button.
end;
Return to the table of contents
*announce "<text>",<flag>
*mapannounce "<map name>","<text>",<flag>;
This command will broadcast a message to all or most players, similar to
@kami/@kamib GM commands.
The region the broadcast is heard in and the color the message will come up as
will be determined by the flags:
announce "This will be shown to everyone at all in yellow.",0;
The flag values given here definitely have some kind of bit mask behind them
but
it's not clear just what means what. Here are the flag values that were tested
and found to work:
0
1
2
3
16
17
18
19
Yellow To everyone
Yellow To everyone on the same map as the NPC object it's running from.
Yellow To everyone in the area around the NPC object.
Yellow, Can only be seen by the invoking player.
Blue To everyone.
Blue To everyone on the same map as the NPC object it's running from.
Blue To everyone in the area around the NPC object.
Blue, Can only be seen by the invoking player
Using this for private messages to players is probably not that good an idea.
the
// This will be a private message to the player using the NPC that made
// annonucement
announce "This is my message just for you",19;
// This will be shown on everyones screen that is in sight of the NPC.
announce "This is my message just for you people here",2;
The 'mapannounce' command will work just like 'announce', but will only
broadcast to characters currently residing on the specified map. The flags are
given the same as in 'announce', but it is not certain which values will
actually work correctly.
Return to the table of contents
*areaannounce "<map name>",<x1>,<y1>,<x2>,<y2>,"<text>",<flag>;
This command works like 'announce' but will only broadcast to characters
residing in the specified x1/y1-x2/y2 square on the map given. The flags are
given the same as in 'announce', but it is not certain which values will
actually work correctly.
areaannounce "prt_church.gat",0,0,350,350,"God's in his heaven, all right
with the world",0;
Return to the table of contents
*getusers(<type>)
This function will return a number of users on a map or the whole server. What
it returns is specified by Type.
Type is a bitmask, add up to get the effects you want:
8 - This will count all characters on the same map as the current NPC.
(By default, it will count people on the same map as the character)
7 - Return the amount of players for the entire server.
(By default, only the players on the map will be counted.)
So '
getusers(0)' will return the number of characters on the same map as
the
invoking character, while 'getusers(7)' will give the count for entire server.
Return to the table of contents
*getmapusers("<map name>")
This function will return the number of users currently located on the
specified
map.
Currently being used in the PVP scripts to check if a PVP room is full of not,
if the number returned it equal to the maximum allowed it will not let you
enter.
Return to the table of contents
*getareausers("<map name>",<x1>,<y1>,<x2>,<y2>)
This function will return the count of connected characters which are located
within the specified area - an x1/y1-x2/y2 square on the specified map.
This is useful for maps that are split into many buildings, such as all the
"*_in.gat" maps, due to all the shops and houses.
Return to the table of contents
*getareadropitem("<map name>",<x1>,<y1>,<x2>,<y2>,<item>)
This function will count all the items with the specified ID number lying on
the
ground on the specified map within the x1/y1-x2/y2 square on it and return
that
number.
This is the only function around where a parameter may be either a string or a
number! If it's a number, it means that only the items with that item ID
number
// the other"
In all cases it will also unequip everything the character has on.
Even though it doesn't return a value, it is used as a function in the
official
rebirth scripts. Ask AppleGirl why.
Return to the table of contents
*resetstatus;
This is a character reset command, which will reset the stats on the invoking
character and give back all the stat points used to raise them previously.
Nothing will happen to any other numbers about the character.
Used in reset NPC's (duh!)
Return to the table of contents
*resetskill;
This command takes off all the skill points on the invoking character, so they
only have Basic Skill blanked out (lvl 0) left, and returns the points for
them
to spend again. Nothing else will change but the skills. Quest skills will
also
reset if 'quest_skill_reset' option is set to Yes in 'battle_athena.conf'. If
the 'quest_skill_learn' option is set in there, the points in the quest skills
will also count towards the total.
Used in reset NPC's (duh!)
Return to the table of contents
*changebase <job ID number>;
This will change the appearance of the invoking character to that of a
specified
job class. Nothing but appearance will change. This command is used in item
scripts for "Wedding Dress" and "Tuxedo" so the character like job 22, which
is
the job number of the wedding sprites.
It would be entered in the equip bonus section of an item
2338,Wedding_Dress,Wedding Dress,5,43000,0,500,,0,,0,2088958,0,16,,0,0,{(This
is for use bonus)},{ bonus bMdef,15; changebase 22; },
This command only works when inside item scripts, though it's not certain why.
Return to the table of contents
*changesex;
This command will change the gender for the attached character's account. If
it
was male, it will become female, if it was female, it will become male. The
change will be written to the char server, but there is no way to send this
information to the client, so the player will continue to see their character
as
the gender it previously was. What the other players will see before the
relogin
is not clear.
If the character currently connected when this command was invoked was a
Dancer/Gypsy or Bard/Clown, they will become a Swordman upon 'changesex'.
Whatever happens to their skills is not clear. Whatever happens if another
character on the same account was a gender-specific class is not clear either,
but it's likely that the client will have serious issues with that, since no
other characters on the same account will get altered.
There's good reasons to be very careful when using this command. Resetting
their
skills beforehand if they were a Bard/Clown/Dancer/Gypsy, running 'jobchange'
on
them manually and using 'gmcommand' to immediately kick them offline once the
gender is changed is suggested.
Return to the table of contents
*waitingroom "<chatroom name>",<limit>{,<event label>,<trigger>};
This command will create a chat room, owned by the NPC object running this
script and displayed above the NPC sprite.
The maximum length of a chatroom name is 60 letters.
The limit is the maximum number of people allowed to enter the chat room. If
the
optional event and trigger parameters are given, the event label
("<NPC object name>::<label name>") will be invoked as if with a 'doevent'
upon
the number of people in the chat room reaching the given triggering amount.
It's funny, but for compatibility with jAthena, you can swap the event label
and
the trigger parameters, and it will still work.
// The NPC will just show a box above its head that says "Hello World",
clicking
// it will do nothing, since the limit is zero.
waitingroom "Hello World",0;
// The NPC will have a box above its head, it will say "Disco - Waiting Room"
// and will have 8 waiting slots. Clicking this will enter the chat room,
where
// the player will be able to wait until 8 people accumulate. Once this
happens,
0
1
2
3
4
5
to
This command would kick everybody out of a specified waiting room chat. IF it
was properly linked into the script interpreter which it isn't, even though
the
code for it is in place. Expect this to become available in upcoming SVN
releases.
Return to the table of contents
*attachrid(<Account ID>)
*detachrid
A 'RID' is an ID of a character who caused the NPC script to run, as has been
explained above in the introduction section. Quite a bit of commands want a
RID
to work, since they wouldn't know where to send information otherwise. And in
quite a few cases the script gets invoked with a RID of zero (like through
OnTime special labels). If an NPC script needs this, it can attach a specified
character's id to itself. by calling the 'attachrid' function.
'attachrid' returns 1 if the character was found online and 0 if it wasn't.
This could also be used, while running in a script invoked by a character
through talking to an NPC, to mess with other characters.
Detaching the RID will make the RID of the script zero.
You can gain you own RID by using this command
getcharid(3)
or for someone else
getcharid(3,NAME)
Where NAME = the name of the person
Example
input @NAME$; < You would enter the name of a person
attachrid(getcharid(3,@NAME$)); < It will find the RID of that person and
attach it to this script
mes "Someone want you"; < This will appear of the other persons screen
close;
This comes with its draw backs, without checks you will get errors in your
map-server
A check can look like this
input @NAME$;
if(isloggedin(getcharid(3,@NAME$))==0) goto L_Notlogged;
.........
L_Notlogged:
mes "That person is not logged in";
close;
Return to the table of contents
*isloggedin(<account id>)
This function returns 1 if the specified character is logged in and 0 if they
aren't.
Return to the table of contents
*setmapflagnosave "<map name>","<alternate map name>",<x>,<y>;
This command sets the 'nosave' flag for the specified map and also gives an
alternate respawn-upon-relogin point.
It does not make a map impossible to make a savepoint on as you would normally
think, 'savepoint' will still work. It will, however, make the specified map
kick the reconnecting players off to the alternate map given to the
coordinates
specified.
Return to the table of contents
*setmapflag "<map name>",<flag>;
This command marks a specified map with a map flag given. Map flags alter the
behavior of the map, you can see the list of the available ones in
'db/const.txt' under 'mf_'.
The map flags alter the behavior of the map regarding teleporting (mf_nomemo,
mf_noteleport, mf_nowarp, mf_nogo) storing location when disconnected
(mf_nosave), dead branch usage (mf_nobranch), penalties upon death
(mf_nopenalty, mf_nozenypenalty), PVP behavior (mf_pvp, mf_pvp_noparty,
mf_pvp_noguild, mf_nopvp), WoE behavior (mf_gvg,mf_gvg_noparty), ability to
use
skills or open up trade deals (mf_notrade, mf_noskill, mf_noicewall), current
weather effects (mf_snow, mf_fog, mf_sakura, mf_leaves, mf_rain, mf_clouds,
mf_fireworks) and whether day/night will be in effect on this map
(mf_indoors).
Return to the table of contents
*removemapflag "<map name>",<flag>;
This command removes a mapflag from a specified map. See 'setmapflag'.
Return to the table of contents
*pvpon "<map name>";
*pvpoff "<map name>";
These commands will turn PVP mode for the specified maps on and off. Beside
setting the flags referred to in 'setmapflag', 'pvpon' will also create a PVP
Flag 7 will, therefore, mean 'wipe all mobs but guardians and the emperium and
kick all characters out', which is what the official scripts do upon castle
surrender. Upon start of WoE, the scripts do 2 (warp all intruiders out).
Characters not belonging to any guild will warp out regardless of the flag
setting.
For examples, check the WoE scripts in the distribution.
Return to the table of contents
*agitstart;
*agitend;
These two commands will start and end War of Emperium.
This is a bit more complex than it sounds, since the commands themselves won't
*getequipcardcnt(<equipment slot>)
This function will return the number of cards that have been compounded onto a
specific equipped item for the invoking character. See 'getequipid' for a list
of possible equipment slots.
Return to the table of contents
*successremovecards <equipment slot>;
This command will remove all cards from the item found in the specified
equipment slot of the invoking character, create new card items and give them
to
the character. If any cards were removed in this manner, it will also show a
success effect.
Return to the table of contents
*failedremovecards <equipment slot>,<type>;
This command will remove all cards from the item found in the specified
equipment slot of the invoking character. 'type' determines what happens to
the
item and the cards:
0 - will destroy both the item and the cards.
1 - will keep the item, but destroy the cards.
2 - will keep the cards, but destroy the item.
Whatever the type is, it will also show a failure effect on screen.
Return to the table of contents
*marriage("<spouse name>");
This function will marry two characters, the invoking character and the one
referred to by name given, together, setting them up as each other's marriage
partner. No second function call has to be issued (in current SVN at least) to
make sure the marriage works both ways. The function returns 1 upon success,
or
0 if the marriage could not be completed, either because the other character
wasn't found or because one of the two characters is already married.
This will do nothing else for the marriage except setting up the spouse ID for
both of these characters. No rings will be given and no effects will be shown.
Return to the table of contents
*wedding;
This command will call up wedding effects - the music and confetti - centered
on
equipped and make them a Job_Baby class, as well as send them a 'your job has
been changed' message.
Beware of calling this from inside a 'callfunc' function, cause upon
successful
adoption, this command returns a zero, as if it were a function. This is
likely
to screw up execution of a 'return' command. You may try to call it as a
function instead, but it doesn't return anything upon an error, which may also
cause script execution to throw up errors.
Nothing will happen (and nothing will be returned either) if either future
parent is below base level 70 and/or if any of the three characters is not
found
online.
Return to the table of contents
*getitemname(<item id>)
Given the database ID number of an item, this function will return the text
stored in the 'japanese name' field (which, in eAthena, stores an english name
the players would normally see on screen.)
Return to the table of contents
*makepet <pet id>;
This command will create a pet egg and put it in the invoking character's
inventory. The kind of pet is specified by pet ID numbers listed in
'db/pet_db.txt'. The egg is created exactly as if the character just
successfuly
caught a pet in the normal way.
// This will make you a poring:
makepet 1002;
Notice that you absolutely have to create pet eggs with this command. If you
try
to give a pet egg with 'getitem', pet data will not be created by the char
server and the egg will disappear when anyone tries to hatch it.
Return to the table of contents
*getexp <base xp>,<job xp>;
This command will give the invoking character a specified number of base and
job
experience points. Can be used as a quest reward. Negative amounts of
experience
were not tested but should work.
getexp 10000,5000;
You can also use the "set" command with the constants defined in
'db/const.txt':
// These 2 combined has the same effect as the above command
set BaseExp,BaseExp+10000;
set JobExp,JobExp+5000;
You can also reduce the ammount of experience points:
set BaseExp,BaseExp-10000;
Return to the table of contents
*getinventorylist;
This command sets a bunch of arrays with a complete list of whatever the
invoking character has in their inventory, including all the data needed to
recreate these items perfectly if they are destroyed. Here's what you get:
@inventorylist_id[]
@inventorylist_amount[]
@inventorylist_equip[]
@inventorylist_refine[]
@inventorylist_identify[]
@inventorylist_attribute[]
@inventorylist_card1[]
items.
@inventorylist_card2[]
@inventorylist_card3[]
check
@inventorylist_card4[]
@inventorylist_count
@skilllist_count
While 'getskillv' is probably more useful for most situations, this is the
easiest way to store all the skills and make the character something else for
a
while. Advanced job for a day? :) This could also be useful to see how many
skills a character has.
Return to the table of contents
*clearitem;
This command will destroy all items the invoking character has in their
inventory. (that includes equipped items) It will not affect anything else,
like
storage or cart.
Return to the table of contents
*classchange <view id>,<type>;
This command is very ancient, it's origins are clouded in mystery.
It will send a 'display id change' packet to everyone in the immediate area of
the NPC object, which will supposedly make the NPC look like a different
sprite,
an NPC sprite ID, or a monster ID. This effect is not stored anywhere and will
not persist (Which is odd, cause it would be relatively easy to make it do so)
and most importantly, will not work at all since this command was broken with
the introduction of advanced classes. The code is written with the assumption
that the lowest sprite IDs are the job sprites and the anything beyond them is
monster and NPC sprites, but since the advanced classes rolled in, they got
the
ID numbers on the other end of the number pool where monster sprites float.
As a result it is currently impossible to call this command with a valid view
id. It will do nothing whatsoever if the view ID is below 4047. Getting it to
run will actually just crash the client.
It could be a real gem if it can be gotten to actually do what it's supposed
to
do, but this will only happen in a later SVN revision.
Return to the table of contents
*misceffect <effect number>;
This command, if run from an NPC object that has a sprite, will call up a
specified effect number, centered on the NPC sprite. If the running code does
not have an object ID (a 'floating' npc) or is not running from an NPC object
at
all (an item script) the effect will be centered on the character who's RID
got
attached to the script, if any. For usable item scripts, this command will
monsters instead. With the current dynamic mobs system, where mobs are not
kept
in memory for maps with no actual people playing on them, this will return a 0
for any such map.
Return to the table of contents
*strmobinfo(<type>,<monster id>);
This function will return information about a monster record in the database,
as
per 'db/mob_db.txt'. Type is the kind of information returned. Valid types
are:
1 - 'english name' field in the database, a string.
2 - 'japanese name' field in the database, a string.
All other returned values are numbers:
3 - Level.
4 - Maximum HP.
5 - Maximum SP.
6 - Experience reward.
7 - Job experience reward.
Return to the table of contents
*guardian "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event
label>"};
This command is roughly equivalent to 'monster', but is meant to be used with
castle guardian monsters and will only work with them. It will set the
guardian
characteristics up according to the castle's investment values and otherwise
set the things up that only castle guardians need.
Return to the table of contents
*guardianinfo(<guardian number>)
This function will return the current hit point value for the specified
guardian
number, if such guardian is currently installed. This function will only work
if
the invoking character is on a castle map, and will refer only to the
guardians
of that castle, regardless of anything else, i.e. whether the character is a
member of the guild owning the castle, etc, etc.
If no guardian is installed in this slot, the function will return -1.
Return to the table of contents
*Pet AI commands
These commands will only work if the invoking character has a pet, and are
meant
to be executed from pet scripts. They will modify the pet AI decision-making
for
the current pet of the invoking character, and will NOT have any independent
effect by themselves, which is why only one of them each may be in effect at
any
time for a specific pet. A pet may have 'petloot', 'petskillbonus',
'petskillattack' OR 'petpetskillattack2' and 'petskillsupport' OR 'petheal' at
the same time. 'petheal' is deprecated and is no longer used in the default
pet
scripts.
*petskillbonus <bonus type>,<value>,<duration>,<delay>;
This command will make the pet give a bonus to the owner's stat (bonus type bInt,bVit,bDex,bAgi,bLuk,bStr,bSpeedRate - for a full list, see the values
starting with 'b' in 'db/const.txt')
*petrecovery <status type>,<delay>;
This command will make the pet cure a specified status condition. The curing
actions will occur once every Delay seconds. For a full list of status
conditions that can be cured, see the list of 'SC_' status condition constants
in 'db/const.txt'
*petloot <max items>;
This command will turn on pet looting, with a maximum number of items to loot
specified. Pet will store items and return them when the maximum is reached or
when pet performance is activated.
*petskillsupport <skill id>,<skill level>,<delay>,<percent hp>,<percent sp>;
*petheal <level>,<delay>,<percent hp>,<percent sp>;
This will make the pet use a specified support skill on the owner whenever the
HP and SP are below the given percent values, with a specified delay time
between activations. The skill numbers are as per 'db/skill_db.txt'.
'petheal' works the same as 'petskillsupport' but has the skill ID hardcoded
to
28 (Heal). This command is deprecated.
It's not quite certain who's stats will be used for the skills cast, the
character's or the pets. Probably, Skotlex can answer that question.
*petskillattack <skill id>,<skill level>,<rate>,<bonusrate>;
*petskillattack2 <skill id>,<damage>,<number of attacks>,<rate>,<bonusrate>;
These two commands will make the pet cast an attack skill on the enemy the
pet's
owner is currently fighting. Skill IDs and levels are as per
'petskillsupport'.
'petskillattack2' will make the pet cast the skill with a fixed amount of
damage
inflicted and the specified number of attacks.
All commands with delays and durations will only make the behavior active for
the specified duration of seconds, with a delay of the specified number of
seconds between activations. Rates are a chance of the effect occuring and are
given in percent. 'bonusrate' is added to the normal rate if the pet intimacy
is
at the maximum possible.
The behavior modified with the abovementioned commands will only be exibited
if
the pet is loyal and appropriate configuration options are set in
'battle_athena.conf'.
Pet scripts in the database normally run whenever a pet of that type hatches
from the egg. Other commands usable in item scripts (see 'bonus') will also
happily run from pet scripts. Apparently, the pet-specific commands will also
work in NPC scripts and modify the behavior of the current pet up until the
pet
is hatched again. (Which will also occur when the character is logged in again
with the pet still out of the egg.) It is not certain for how long the effect
of
such command running from an NPC script will eventually persist, but
apparently,
it is possible to usefully employ them in usable item scripts to create pet
buffing items.
Nobody tried this before, so you're essentially on your own here.
Return to the table of contents
*skilleffect <skill id>,<number>;
This command will display the visual and sound effects of a specified skill
(see
'db/skill_db.txt' for a full list of skills) on the invoking character's
sprite.
Nothing but the special effects and animation will happen. If the skill's
normal
effect displays a floating number, the number given will float up.
// 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>;
*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
jobsprite 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
and place their coordinates
will return 0 if the search
were
not variables or the search
Character object
NPC object
Pet object
Monster object.
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
IDs given inserted
the
same time. Up to 4
If even one of the
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>}}})
|DayNight|
|-1,{
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:
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"
current map
"SavePoint"
of the
"SavePointAll" save