Scriptie


SUBMITTED BY: xlaws27

DATE: June 1, 2016, 2:23 p.m.

FORMAT: Text only

SIZE: 22.6 kB

HITS: 652

  1. // This will heal the character with 2000 hp, buff with
  2. // Bless 10 and Increase AGI 5, and display appropriate
  3. // effects.
  4. mes "Blessed be!";
  5. skilleffect 28,2000;
  6. heal 2000,0;
  7. skilleffect 34,0;
  8. // That's bless 10.
  9. sc_start 10,240000,10;
  10. skilleffect 29,0;
  11. // That's agi 5
  12. sc_start 12,140000,5;
  13. Return to the table of contents
  14. *npcskilleffect <skill id>,<number>,<x>,<y>;
  15. This command behaves identically to 'skilleffect', however, the effect will not
  16. be centered on the invoking character's sprite, nor on the NPC sprite, if any,
  17. but will be centered at map coordinates given on the same map as the invoking
  18. character.
  19. Return to the table of contents
  20. *specialeffect <effect number>;
  21. This command will display special effect with the given number, centered on the
  22. specified NPCs coordinates, if any. For a full list of special effect numbers
  23. known see 'doc/effect_list.txt'. Some effect numbers are known not to work in
  24. some client releases. (Notably, rain is absent from any client executables
  25. released after April 2005.)
  26. Return to the table of contents
  27. *specialeffect2 <effect number>;
  28. This command behaves identically to the 'specialeffect', but the effect will be
  29. centered on the invoking character's sprite.
  30. Return to the table of contents
  31. *nude;
  32. This command will unequip anything equipped on the invoking character.
  33. It is not required to do this when changing jobs since 'jobchange' will unequip
  34. everything not equippable by the new job class anyway.
  35. Return to the table of contents
  36. *gmcommand "<character name>:<command line>";
  37. *atcommand "<character name>:<command line>";
  38. *charcommand "<character name>:<command line>";
  39. This command will run the given command line exactly as if it was typed in from
  40. the keyboard by the player connected to the invoking character, and that
  41. character belonged to an account which had GM level 99.
  42. The first form, 'gmcommand' existed pre-SVN2177, after that, it was replaced by
  43. two different commands, one 'atcommand', for the commands that start with '@',
  44. the other, 'charcommand', for the commands that start with '#' and affect other
  45. characters. (You can configure this second symbol to be something else, so it
  46. might be different for you.)
  47. Even though the character name and the ':' are not used for anything whatsoever,
  48. it is required to give them in this command because it is processed exactly as
  49. if typed from the keyboard, and that is how it will arrive into the processing
  50. function if it is typed from the keyboard. The character name given must be the
  51. same length as the name of the invoking character object, although nothing else
  52. is required of it.
  53. // This will ask the invoker for a character name and then use the '@nuke'
  54. // GM command on them, killing them mercilessly.
  55. input @player$;
  56. atcommand strcharinfo(0)+":@nuke "+@player$
  57. This command has a lot of good uses, I am sure you can have some fun with this
  58. one.
  59. Return to the table of contents
  60. *message "<character name>","<message>";
  61. That command will send a message to the chat window of the character specified
  62. by name. The text will also appear above the head of that character. It will not
  63. be seen by anyone else.
  64. Return to the table of contents
  65. *npctalk "<message>";
  66. This command will display a message to the surrounding area as if the NPC object
  67. running it was a player talking - that is, above their head and in the chat
  68. window. The display name of the NPC will get appended in front of the message to
  69. complete the effect.
  70. // This will make everyone in the area see the NPC greet the character
  71. // who just invoked it.
  72. npctalk "Hello "+strcharinfo(0)+" how are you";
  73. Return to the table of contents
  74. *hasitems(0)
  75. This function will return 1 if the invoking character has anything at all in
  76. their inventory and 0 if they do not. Even though the argument is not used for
  77. anything, it is required.
  78. Return to the table of contents
  79. *getlook(<type>)
  80. This function will return the number for the current look value of the invoking
  81. character specified by type. See 'setlook' for valid look types.
  82. This can be used to make a certain script behave differently for characters
  83. dressed in black. :)
  84. Return to the table of contents
  85. *getsavepoint(<information type>)
  86. This function will return information about the invoking character's save point.
  87. You can use it to let a character swap between several recorded savepoints.
  88. Available information types are:
  89. 0 - Map name (a string)
  90. 1 - X coordinate
  91. 2 - Y coordinate
  92. Return to the table of contents
  93. *npcspeed <speed value>;
  94. *npcwalkto <x>,<y>;
  95. *npcstop;
  96. These commands will make the NPC object in question move around the map. As they
  97. currently are, they are a bit buggy and are not useful for much more than making
  98. an NPC move randomly around the map. (see 'npc/custom/devnpc.txt' for an example
  99. of such usage)
  100. 'npcspeed' will set the NPCs walking speed to a specified value. As in the
  101. @speed GM command, 200 is the slowest possible speed while 0 is the fastest
  102. possible (instant motion). 100 is the default character walking speed.
  103. 'npcwalkto' will start the NPC sprite moving towards the specified coordinates
  104. on the same map as it is currently on.
  105. 'npcstop' will stop the motion.
  106. While in transit, the NPC will be clickable, but invoking it will cause it to
  107. stop motion, which will make it's coordinates different from what the client
  108. computed based on the speed and motion coordinates. The effect is rather
  109. unnerving.
  110. Only a few NPC sprites have walking animations, and those that do, do not get
  111. the animation invoked when moving the NPC, due to the problem in the npc walking
  112. code, which looks a bit silly. You might have better success by defining a job-
  113. sprite based sprite id in 'db/mob-avail.txt' with this.
  114. Return to the table of contents
  115. *getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})
  116. This function will locate a character object, NPC object or pet's coordinates
  117. and place their coordinates into the variables specified when calling it. It
  118. will return 0 if the search was successful, and -1 if the parameters given were
  119. not variables or the search was not successful.
  120. Type is the type of object to search for:
  121. 0 - Character object
  122. 1 - NPC object
  123. 2 - Pet object
  124. 3 - Monster object.
  125. While 3 is meant to look for a monster object, no searching will be done if you
  126. specify type 3, and the function will always return -1.
  127. The search string is optional. If it is not specified, the location of the
  128. invoking character will always be returned for types 0 and 2, the location of
  129. the NPC running this function for type 1.
  130. If a search string is specified, for types 0 and 1, the character or NPC with
  131. the specified name will be located. If type is 3, the search will locate the
  132. current pet of the character who's name is given in the search string, it will
  133. NOT locate a pet by name.
  134. What a mess. Example, a working and tested one now:
  135. prontera.gat,164,301,3| |script| |Meh| |730,{
  136. mes "My name is Meh. I'm here so that Nyah can find me.";
  137. close;
  138. }
  139. prontera.gat,164,299,3| |script| |Nyah| |730,{
  140. mes "My name is Nyah.";
  141. mes "I will now search for Meh all across the world!";
  142. if (getmapxy(@mapname$,@mapx,@mapy,1,"Meh")!=0) goto Notfound;
  143. mes "And I found him on map "+@mapname$+" at X:"+@mapx+" Y:"+@mapy+" !";
  144. close;
  145. Notfound:
  146. mes "I can't seem to find Meh anywhere!";
  147. close;
  148. }
  149. Notice that NPC objects disabled with 'disablenpc' will still be located.
  150. Return to the table of contents
  151. *guildgetexp <amount>;
  152. This will give the specified amount of guild experience points to the guild the
  153. invoking character belongs to. It will silently fail if they do not belong to
  154. any guild.
  155. Return to the table of contents
  156. *skilluseid <skill>,<level>;
  157. *doskill <skill>,<level>;
  158. *skillusepos <skill>,<level>,<x>,<y>;
  159. These commands will cause the invoking character to use a specified skill at the
  160. specified level, as if they had that skill, with their current level and stats.
  161. If the skill involves targeting a character, no targeting pointer will come up -
  162. the invoking character will automatically be the skill target.
  163. 'doskill' is an alias for 'skilluseid'.
  164. 'skillusepos' will specify a target map square for the skill to be used. If that
  165. skill is an area effect skill, it will be centered at the square specified. It
  166. will not work if the skill is supposed to be targeted on character or monster.
  167. Return to the table of contents
  168. *logmes "<message>";
  169. This command will write the message given to the map server npc log file, as
  170. specified in 'conf/log_athena.conf'. In the TXT version of the server, the log
  171. file is 'log/npclog.log' by default. In the SQL version, if SQL logging is
  172. enabled, the message will go to the 'npclog' table, otherwise, it will go to the
  173. same log file.
  174. If logs are not enabled, nothing will happen.
  175. Return to the table of contents
  176. *summon "<monster name>",<mob id>{,"<event label>"};
  177. This command will summon a monster. (see also 'monster') Unlike monsters spawned
  178. with other commands, this one will set up the monster to fight to protect the
  179. invoking character. Monster name and mob id obey the same rules as the one given
  180. at the beginning of this document for permanent monster spawns with the
  181. exceptions mentioned when describing 'monster' command.
  182. The effect for the skill 'Call Homonuculus' will be displayed centered on the
  183. invoking character.
  184. If an event label is given, upon the monster being killed, the event label will
  185. run as if by 'donpcevent'.
  186. // Will summon a dead branch-style monster to fight for the character.
  187. summon "--ja--",-1;
  188. Return to the table of contents
  189. *isnight()
  190. *isday()
  191. These functions will return 1 or 0 depending on whether the server is in night
  192. mode or day mode. 'isnight' returns 1 if it's night and 0 if it isn't, 'isday'
  193. the other way around. They can be used interchangeably, pick the one you like
  194. more:
  195. // These two are equivalent:
  196. if (isday()) mes "I only prowl in the night.";
  197. if (isnight()!=1) mes "I only prowl in the night.";
  198. Return to the table of contents
  199. *isequipped(<card id>{,<card id>{,<card id>{,<card id>}}})
  200. This function will return 1 if the invoking character has all of the card item
  201. IDs given inserted into slots in the equipment they are currently wearing at the
  202. same time. Up to 4 cards may be tested for at the same time.
  203. If even one of the cards given is not both inserted and worn, 0 will be
  204. returned.
  205. // (Poring,Santa Poring,Poporing,Marin)
  206. if (isequipped(4001,4005,4033,4196)) mes "Wow! You're wearing a full complement of possible poring cards!";
  207. // (Poring)
  208. if (isequipped(4001)) mes "A poring card is useful, don't you think?";
  209. The function was meant for item scripts to support the cards released by Gravity
  210. in February 2005, but it will work just fine in normal NPC scripts.
  211. Return to the table of contents
  212. *isequippedcnt(<card id>{,<card id>{,<card id>{,<card id>}}})
  213. This function is similar to 'isequipped', but instead of 1 or 0, it will return
  214. the number of cards in the list given that were found on the invoking character.
  215. if (isequippedcnt(4001,4005,4033,4196)=4) mes "Finally got all four poring cards?";
  216. Return to the table of contents
  217. *cardscnt()
  218. This function will return the number of cards inserted into the weapon currently
  219. equipped on the invoking character.
  220. While this function was meant for item scripts, it will work outside them:
  221. if (cardscnt()==4) mes "So you've stuck four cards into that weapon, think you're cool now?";
  222. Return to the table of contents
  223. *getrefine()
  224. This function will return the number of plusses the weapon currently equipped on
  225. the invoking character has been refined for.
  226. While this function was meant for item scripts, it will work outside them:
  227. if (getrefine()==10) mes "Wow. That's a murder weapon.";
  228. Return to the table of contents
  229. *day;
  230. *night;
  231. These two commands will switch the entire server between day and night mode.
  232. Depending on the configuration, it may cause differing client effects. If your
  233. server is set to cycle between day and night, it will eventually return to that
  234. cycle.
  235. This example will set the night time to start at 03 AM and end at 08 AM, and the
  236. nighttime will persist if the server restarts during the night, if the automated
  237. day/night switching is turned off in the configuration files. Figure it out on
  238. your own:
  239. -| |script| |DayNight| |-1,{
  240. end;
  241. OnClock0300:
  242. OnClock0800:
  243. OnInit:
  244. set $@minutesfrommidnight, gettime(3)*60+gettime(2);
  245. set $@night_start, 180; // 03:00
  246. set $@night_end, 480; // 08:00
  247. if ($@minutesfrommidnight>=$@night_start &&
  248. $@minutesfrommidnight<$@night_end) goto StartNight;
  249. goto StartDay;
  250. StartNight:
  251. night;
  252. end;
  253. StartDay:
  254. day;
  255. end;
  256. }
  257. Return to the table of contents
  258. *getusersname;
  259. This command will give the invoking character a list of names of the connected
  260. characters (including themselves) into an NPC script message window (see 'mes')
  261. paging it by 10 names as if with the 'next' command.
  262. You need to put a 'close' after that yourself.
  263. Return to the table of contents
  264. *dispbottom "<message>";
  265. This command will send the given message into the invoking character's chat
  266. window.
  267. Return to the table of contents
  268. *recovery;
  269. This command will revive and restore full HP and SP to all characters currently
  270. connected to the server.
  271. Return to the table of contents
  272. *getpetinfo(<type>)
  273. This function will return pet information for the pet the invoking character
  274. currently has active. Valid types are:
  275. 0 - Unique pet ID number as stored by the char server and distinguishing it
  276. from all other pets the characters actually have. This value is currently
  277. useless, at most you can use it to tell pets apart reliably.
  278. 1 - Pet ID number as per 'db/pet_db.txt' - will tell you what kind of a pet it
  279. is.
  280. 2 - Pet name. Will return "null" if there's no pet.
  281. 4 - Pet friendly level (intimacy score). 1000 is full loyalty.
  282. 3 - Pet hungry level. 100 is completely full.
  283. Return to the table of contents
  284. *checkequipedcard(<card id>)
  285. This function will return 1 if the card specified by it's item ID number is
  286. inserted into any equipment they have in their inventory, currently equipped or
  287. not.
  288. Return to the table of contents
  289. *globalmes "message";
  290. This command will send a message to the chat window of all currently connected
  291. characters.
  292. Return to the table of contents
  293. *jump_zero (<condition>),<label>;
  294. This command works kinda like an 'if'+'goto' combination in one go. (See 'if').
  295. If the condition is false (equal to zero) this command will immediately jump to
  296. the specified label like in 'goto'.
  297. While 'if' is more generally useful, for some cases this could be an
  298. optimisation.
  299. Return to the table of contents
  300. *select("<option>"{,"<option>"..."<option>"})
  301. This function is a handy replacement for 'menu' for some specific cases where
  302. you don't want a complex label structure - like, for example, asking simple yes-
  303. no questions. It will return the number of menu option picked, starting with 1.
  304. Like 'menu', it will also set the variable @menu to contain the option the user
  305. picked.
  306. if (select("Yes","No")==1) mes "You said yes, I know.";
  307. And like 'menu', this command has a problem with empty strings - if some of the
  308. option strings given to it are empty, you won't be able to tell which one the
  309. user really picked. The number it returns will only make sense if all the empty
  310. strings are last in the list of options.
  311. Return to the table of contents
  312. *getmapmobs("<map name>")
  313. This function will return the total count of monsters currently located on the
  314. specified map. If the map name is given as "this", the map the invoking
  315. character is on will be used. If the map is not found, or the invoker is not a
  316. character while the map is "this", it will return -1.
  317. Return to the table of contents
  318. *unequip <equipment slot>;
  319. This command will unequip whatever is currently equipped in the invoking
  320. character's specified equipment slot. For a full list of possible equipment
  321. slots see 'getequipid'.
  322. If an item occupies several equipment slots, it will get unequipped from all of
  323. them. (Which is a good thing.)
  324. Return to the table of contents
  325. *defpattern <set number>,"<regular expression pattern>","<event label>";
  326. *activatepset <set number>;
  327. *deactivatepset <set number>;
  328. *deletepset <set number>;
  329. This set of commands is only available if the server is compiled with regular
  330. expressions library enabled. Default compilation and most binary distributions
  331. aren't, which is probably bad, since these, while complex to use, are quite
  332. fascinating.
  333. They will make the NPC object listen for text spoken publicly by players and
  334. match it against regular expression patterns, then trigger labels associated
  335. with these regular expression patterns.
  336. Patterns are organised into sets, which are referred to by a set number. You can
  337. have multiple sets patterns, and multiple patterns may be active at once.
  338. Numbers for pattern sets start at 1.
  339. 'defpattern' will associate a given regular expression pattern with an event
  340. label. This event will be triggered whenever something a player says is matched
  341. by this regular expression pattern, if the pattern is currently active.
  342. 'activatepset' will make the pattern set specified active. An active pattern
  343. will enable triggering labels defined with 'defpattern', which will not happen
  344. by default.
  345. 'deactivatepset' will deactivate a specified pattern set. Giving -1 as a pattern
  346. set number in this case will deactivate all pattern sets defined.
  347. 'deletepset' will delete a pattern set from memory, so you can create a new
  348. pattern set in it's place.
  349. Using regular expressions is high wizardry. But with this high wizardry comes
  350. unparallelled power of text manipulation. For an explanation of what a regular
  351. expression pattern is, see a few web pages:
  352. http://www.regular-expressions.info/
  353. http://www.weitz.de/regex-coach/
  354. For an example of this in use, see 'npc\custom\eliza.txt'.
  355. With this you could, for example, automagically punish players for asking for
  356. zeny in public places, or alternatively, automagically give them zeny instead if
  357. they want it so much.
  358. Return to the table of contents
  359. *getstrlen("<string>")
  360. This function will return the length of the string given as an argument. It is
  361. useful to check if anything input by the player exceeds name length limits and
  362. other length limits and asking them to try to input something else.
  363. Return to the table of contents
  364. *charisalpha("<string>",<position>)
  365. This function will return 1 if the character number Position in the given string
  366. is a letter, 0 if it isn't a letter but a digit or a space.
  367. Return to the table of contents
  368. *getnameditem(<item id>,"<name to inscribe>");
  369. *getnameditem("<item name>","<name to inscribe>");
  370. This function is equivalent to using 'getitem', however, it will not just give
  371. the character an item object, but will also inscribe it with a specified
  372. character's name. You may not inscribe items with arbitrary strings, only with
  373. names of characters that actually exist. While this isn't said anywhere
  374. specifically, apparently, named items may not have cards in them, slots or no -
  375. these data slots are taken by the character ID who's name is inscribed. Only one
  376. remains free and it's not quite clear if a card may be there.
  377. Items that may not be equipped may NOT be inscribed with a name with this
  378. function. Which is why this is a function which will return a value - 1 if an
  379. item was successfully created and 0 if it wasn't for whatever reason. Like
  380. 'getitem' this function will also take an 'english name' from the itemdb
  381. database as an item name and will return 0 if nothing is found.
  382. Return to the table of contents
  383. *getitemslots(<item ID>)
  384. This function will look up the item with the specified ID number in the database
  385. and return the number of slots this kind of items has - 0 if they are not
  386. slotted. It will also be 0 for all non-equippable items, naturally, unless
  387. someone messed up the item database. It will return -1 if there is no such item.
  388. Return to the table of contents
  389. *fakenpcname "<npc object name>","<npc display name>",<npc sprite id>
  390. This function will change the specified NPC object's display name to the one you
  391. give. While the name the players will see will now be different, the real object
  392. name the NPC has will stay the same, so you can still adress it with events as
  393. you did before.
  394. The sprite used for the NPC will be changed to the one you specify as well, to
  395. keep it the same, specify the sprite you originally used when defining the NPC
  396. object.
  397. Return to the table of contents
  398. *warpparty "<map name>",<X>,<Y>,<Party ID>
  399. *warpguild "<map name>",<X>,<Y>,<Guild ID>
  400. Allow you to warp everyone inside a specific party/guild to another place
  401. Like the normal 'warp' command there are some special things you can put in
  402. the map name for added effects
  403. "Random" - Will warp everyone to a random location on thier current map
  404. "SavePoint" - Will take everyone in the party/guild to the save point of the
  405. person who activated this command
  406. "SavePointAll" - Will take everyone in the party/guild back to there own save
  407. point
  408. To find the Party/Guild ID you can use 'getcharid'
  409. warpparty "prontera.gat",150,150,getcharid(1);
  410. getcharid(1) will return the party ID of the person who activate the command
  411. Preseting a party ID as a Variable will work too, and also the rare occasion
  412. where you might just state the number, but I dont see that coming up
  413. Return to the table of contents

comments powered by Disqus