// 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 ,,,; This command behaves identically to 'skilleffect', however, the effect will not be centered on the invoking character's sprite, nor on the NPC sprite, if any, but will be centered at map coordinates given on the same map as the invoking character. Return to the table of contents *specialeffect ; This command will display special effect with the given number, centered on the specified NPCs coordinates, if any. For a full list of special effect numbers known see 'doc/effect_list.txt'. Some effect numbers are known not to work in some client releases. (Notably, rain is absent from any client executables released after April 2005.) Return to the table of contents *specialeffect2 ; This command behaves identically to the 'specialeffect', but the effect will be centered on the invoking character's sprite. Return to the table of contents *nude; This command will unequip anything equipped on the invoking character. It is not required to do this when changing jobs since 'jobchange' will unequip everything not equippable by the new job class anyway. Return to the table of contents *gmcommand ":"; *atcommand ":"; *charcommand ":"; This command will run the given command line exactly as if it was typed in from the keyboard by the player connected to the invoking character, and that character belonged to an account which had GM level 99. The first form, 'gmcommand' existed pre-SVN2177, after that, it was replaced by two different commands, one 'atcommand', for the commands that start with '@', the other, 'charcommand', for the commands that start with '#' and affect other characters. (You can configure this second symbol to be something else, so it might be different for you.) Even though the character name and the ':' are not used for anything whatsoever, it is required to give them in this command because it is processed exactly as if typed from the keyboard, and that is how it will arrive into the processing function if it is typed from the keyboard. The character name given must be the same length as the name of the invoking character object, although nothing else is required of it. // This will ask the invoker for a character name and then use the '@nuke' // GM command on them, killing them mercilessly. input @player$; atcommand strcharinfo(0)+":@nuke "+@player$ This command has a lot of good uses, I am sure you can have some fun with this one. Return to the table of contents *message "",""; That command will send a message to the chat window of the character specified by name. The text will also appear above the head of that character. It will not be seen by anyone else. Return to the table of contents *npctalk ""; This command will display a message to the surrounding area as if the NPC object running it was a player talking - that is, above their head and in the chat window. The display name of the NPC will get appended in front of the message to complete the effect. // This will make everyone in the area see the NPC greet the character // who just invoked it. npctalk "Hello "+strcharinfo(0)+" how are you"; Return to the table of contents *hasitems(0) This function will return 1 if the invoking character has anything at all in their inventory and 0 if they do not. Even though the argument is not used for anything, it is required. Return to the table of contents *getlook() 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() 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 ; *npcwalkto ,; *npcstop; These commands will make the NPC object in question move around the map. As they currently are, they are a bit buggy and are not useful for much more than making an NPC move randomly around the map. (see 'npc/custom/devnpc.txt' for an example of such usage) 'npcspeed' will set the NPCs walking speed to a specified value. As in the @speed GM command, 200 is the slowest possible speed while 0 is the fastest possible (instant motion). 100 is the default character walking speed. 'npcwalkto' will start the NPC sprite moving towards the specified coordinates on the same map as it is currently on. 'npcstop' will stop the motion. While in transit, the NPC will be clickable, but invoking it will cause it to stop motion, which will make it's coordinates different from what the client computed based on the speed and motion coordinates. The effect is rather unnerving. Only a few NPC sprites have walking animations, and those that do, do not get the animation invoked when moving the NPC, due to the problem in the npc walking code, which looks a bit silly. You might have better success by defining a job- sprite based sprite id in 'db/mob-avail.txt' with this. Return to the table of contents *getmapxy("",,,{,""}) This function will locate a character object, NPC object or pet's coordinates and place their coordinates into the variables specified when calling it. It will return 0 if the search was successful, and -1 if the parameters given were not variables or the search was not successful. Type is the type of object to search for: 0 - Character object 1 - NPC object 2 - Pet object 3 - Monster object. While 3 is meant to look for a monster object, no searching will be done if you specify type 3, and the function will always return -1. The search string is optional. If it is not specified, the location of the invoking character will always be returned for types 0 and 2, the location of the NPC running this function for type 1. If a search string is specified, for types 0 and 1, the character or NPC with the specified name will be located. If type is 3, the search will locate the current pet of the character who's name is given in the search string, it will NOT locate a pet by name. What a mess. Example, a working and tested one now: prontera.gat,164,301,3| |script| |Meh| |730,{ mes "My name is Meh. I'm here so that Nyah can find me."; close; } prontera.gat,164,299,3| |script| |Nyah| |730,{ mes "My name is Nyah."; mes "I will now search for Meh all across the world!"; if (getmapxy(@mapname$,@mapx,@mapy,1,"Meh")!=0) goto Notfound; mes "And I found him on map "+@mapname$+" at X:"+@mapx+" Y:"+@mapy+" !"; close; Notfound: mes "I can't seem to find Meh anywhere!"; close; } Notice that NPC objects disabled with 'disablenpc' will still be located. Return to the table of contents *guildgetexp ; This will give the specified amount of guild experience points to the guild the invoking character belongs to. It will silently fail if they do not belong to any guild. Return to the table of contents *skilluseid ,; *doskill ,; *skillusepos ,,,; These commands will cause the invoking character to use a specified skill at the specified level, as if they had that skill, with their current level and stats. If the skill involves targeting a character, no targeting pointer will come up - the invoking character will automatically be the skill target. 'doskill' is an alias for 'skilluseid'. 'skillusepos' will specify a target map square for the skill to be used. If that skill is an area effect skill, it will be centered at the square specified. It will not work if the skill is supposed to be targeted on character or monster. Return to the table of contents *logmes ""; This command will write the message given to the map server npc log file, as specified in 'conf/log_athena.conf'. In the TXT version of the server, the log file is 'log/npclog.log' by default. In the SQL version, if SQL logging is enabled, the message will go to the 'npclog' table, otherwise, it will go to the same log file. If logs are not enabled, nothing will happen. Return to the table of contents *summon "",{,""}; This command will summon a monster. (see also 'monster') Unlike monsters spawned with other commands, this one will set up the monster to fight to protect the invoking character. Monster name and mob id obey the same rules as the one given at the beginning of this document for permanent monster spawns with the exceptions mentioned when describing 'monster' command. The effect for the skill 'Call Homonuculus' will be displayed centered on the invoking character. If an event label is given, upon the monster being killed, the event label will run as if by 'donpcevent'. // Will summon a dead branch-style monster to fight for the character. summon "--ja--",-1; Return to the table of contents *isnight() *isday() These functions will return 1 or 0 depending on whether the server is in night mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday' the other way around. They can be used interchangeably, pick the one you like more: // These two are equivalent: if (isday()) mes "I only prowl in the night."; if (isnight()!=1) mes "I only prowl in the night."; Return to the table of contents *isequipped({,{,{,}}}) This function will return 1 if the invoking character has all of the card item IDs given inserted into slots in the equipment they are currently wearing at the same time. Up to 4 cards may be tested for at the same time. If even one of the cards given is not both inserted and worn, 0 will be returned. // (Poring,Santa Poring,Poporing,Marin) if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!"; // (Poring) if (isequipped(4001)) mes "A poring card is useful, don't you think?"; The function was meant for item scripts to support the cards released by Gravity in February 2005, but it will work just fine in normal NPC scripts. Return to the table of contents *isequippedcnt({,{,{,}}}) This function is similar to 'isequipped', but instead of 1 or 0, it will return the number of cards in the list given that were found on the invoking character. if (isequippedcnt(4001,4005,4033,4196)=4) mes "Finally got all four poring cards?"; Return to the table of contents *cardscnt() This function will return the number of cards inserted into the weapon currently equipped on the invoking character. While this function was meant for item scripts, it will work outside them: if (cardscnt()==4) mes "So you've stuck four cards into that weapon, think you're cool now?"; Return to the table of contents *getrefine() This function will return the number of plusses the weapon currently equipped on the invoking character has been refined for. While this function was meant for item scripts, it will work outside them: if (getrefine()==10) mes "Wow. That's a murder weapon."; Return to the table of contents *day; *night; These two commands will switch the entire server between day and night mode. Depending on the configuration, it may cause differing client effects. If your server is set to cycle between day and night, it will eventually return to that cycle. This example will set the night time to start at 03 AM and end at 08 AM, and the nighttime will persist if the server restarts during the night, if the automated day/night switching is turned off in the configuration files. Figure it out on your own: -| |script| |DayNight| |-1,{ end; OnClock0300: OnClock0800: OnInit: set $@minutesfrommidnight, gettime(3)*60+gettime(2); set $@night_start, 180; // 03:00 set $@night_end, 480; // 08:00 if ($@minutesfrommidnight>=$@night_start && $@minutesfrommidnight<$@night_end) goto StartNight; goto StartDay; StartNight: night; end; StartDay: day; end; } Return to the table of contents *getusersname; This command will give the invoking character a list of names of the connected characters (including themselves) into an NPC script message window (see 'mes') paging it by 10 names as if with the 'next' command. You need to put a 'close' after that yourself. Return to the table of contents *dispbottom ""; 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() This function will return pet information for the pet the invoking character currently has active. Valid types are: 0 - Unique pet ID number as stored by the char server and distinguishing it from all other pets the characters actually have. This value is currently useless, at most you can use it to tell pets apart reliably. 1 - Pet ID number as per 'db/pet_db.txt' - will tell you what kind of a pet it is. 2 - Pet name. Will return "null" if there's no pet. 4 - Pet friendly level (intimacy score). 1000 is full loyalty. 3 - Pet hungry level. 100 is completely full. Return to the table of contents *checkequipedcard() This function will return 1 if the card specified by it's item ID number is inserted into any equipment they have in their inventory, currently equipped or not. Return to the table of contents *globalmes "message"; This command will send a message to the chat window of all currently connected characters. Return to the table of contents *jump_zero (),