diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/constants.md | 143 | ||||
-rw-r--r-- | doc/mob_db.txt | 219 | ||||
-rw-r--r-- | doc/script_commands.txt | 321 |
3 files changed, 649 insertions, 34 deletions
diff --git a/doc/constants.md b/doc/constants.md index 208d6dad2..22521a60c 100644 --- a/doc/constants.md +++ b/doc/constants.md @@ -3430,6 +3430,50 @@ - `4_F_REBELLION2`: 10201 - `4_F_REBELLION3`: 10202 - `4_M_ILYA`: 10203 +- `4_ELDER`: 10205 +- `4_LUNATIC`: 10206 +- `4_F_NOVICE2`: 10207 +- `4_WICKEDNYMPH`: 10208 +- `4_F_PREMI`: 10209 +- `4_M_COSTELL`: 10210 +- `4_M_YATTWARP`: 10211 +- `4_M_EVOKASCUDI`: 10212 +- `4_M_JOHNNYJAMES`: 10213 +- `4_M_ALBERTFORD`: 10214 +- `4_M_SEANMCCURDY`: 10215 +- `4_M_KARAMPUCCI`: 10216 +- `4_M_CACTUSMAN1`: 10217 +- `4_M_CACTUSMAN2`: 10218 +- `4_M_CACTUSMAN3`: 10219 +- `4_M_CACTUSLADY`: 10220 +- `4_M_GAST`: 10221 +- `4_M_CACTUSCHILD`: 10222 +- `4_KING`: 10223 +- `4_F_BOMI`: 10224 +- `4_M_CACTUSCHIEF`: 10225 +- `4_F_CACTUSCHILD2`: 10226 +- `4_F_CACTUSLADY2`: 10227 +- `4_F_CACTUSLADY3`: 10228 +- `4_M_CACTUS`: 10229 +- `4_M_COWRAIDERS1`: 10230 +- `4_M_COWRAIDERS2`: 10231 +- `4_M_COWRAIDERS3`: 10232 +- `4_F_JP14THEVT`: 10233 +- `4_M_POORSCHOLAR`: 10234 +- `4_M_PEPPERROTI`: 10235 +- `JP_NPC01`: 10236 +- `4_PURPLE_WARP`: 10237 +- `4_F_NARIN`: 10238 +- `4_M_URGENT_MAN`: 10239 +- `4_M_KEEN_SOLDIER`: 10240 +- `4_F_SLOPPY_WOMAN`: 10241 +- `4_F_DRKAFRA01`: 10242 +- `4_M_DRZONDA01`: 10243 +- `4_M_SWD_RENO`: 10244 +- `4_M_KNG_RENO`: 10245 +- `4_M_AC_RUMIN`: 10246 +- `4_M_HIGH_WIZARD`: 10247 +- `4_SYSTEM_BOX`: 10248 ### Mercenary IDs @@ -3613,7 +3657,7 @@ - `MOUNT_DRAGON_BLUE`: 7 - `MOUNT_DRAGON_RED`: 8 -### gettime +### Gettime Types - `GETTIME_SECOND`: 1 - `GETTIME_MINUTE`: 2 @@ -3624,6 +3668,12 @@ - `GETTIME_YEAR`: 7 - `GETTIME_DAYOFYEAR`: 8 +### gettimer + +- `TIMER_COUNT`: 0 +- `TIMER_TICK_NEXT`: 1 +- `TIMER_TICK_LAST`: 2 + ### unit types - `UNITTYPE_PC`: 0 @@ -3634,6 +3684,14 @@ - `UNITTYPE_MER`: 5 - `UNITTYPE_ELEM`: 6 +### Unit AI Types + +- `AI_NONE`: 0 +- `AI_ATTACK`: 1 +- `AI_SPHERE`: 2 +- `AI_FLORA`: 3 +- `AI_ZANZOU`: 4 + ### Colors - `C_AQUA`: 65535 @@ -3663,6 +3721,64 @@ - `SEX_FEMALE`: 0 - `SEX_MALE`: 1 +### Script Unit Data Types + +- `UDT_TYPE`: 0 +- `UDT_SIZE`: 1 +- `UDT_LEVEL`: 2 +- `UDT_HP`: 3 +- `UDT_MAXHP`: 4 +- `UDT_SP`: 5 +- `UDT_MAXSP`: 6 +- `UDT_MASTERAID`: 7 +- `UDT_MASTERCID`: 8 +- `UDT_MAPIDXY`: 9 +- `UDT_WALKTOXY`: 10 +- `UDT_SPEED`: 11 +- `UDT_MODE`: 12 +- `UDT_AI`: 13 +- `UDT_SCOPTION`: 14 +- `UDT_SEX`: 15 +- `UDT_CLASS`: 16 +- `UDT_HAIRSTYLE`: 17 +- `UDT_HAIRCOLOR`: 18 +- `UDT_HEADBOTTOM`: 19 +- `UDT_HEADMIDDLE`: 20 +- `UDT_HEADTOP`: 21 +- `UDT_CLOTHCOLOR`: 22 +- `UDT_SHIELD`: 23 +- `UDT_WEAPON`: 24 +- `UDT_LOOKDIR`: 25 +- `UDT_CANMOVETICK`: 26 +- `UDT_STR`: 27 +- `UDT_AGI`: 28 +- `UDT_VIT`: 29 +- `UDT_INT`: 30 +- `UDT_DEX`: 31 +- `UDT_LUK`: 32 +- `UDT_ATKRANGE`: 33 +- `UDT_ATKMIN`: 34 +- `UDT_ATKMAX`: 35 +- `UDT_MATKMIN`: 36 +- `UDT_MATKMAX`: 37 +- `UDT_DEF`: 38 +- `UDT_MDEF`: 39 +- `UDT_HIT`: 40 +- `UDT_FLEE`: 41 +- `UDT_PDODGE`: 42 +- `UDT_CRIT`: 43 +- `UDT_RACE`: 44 +- `UDT_ELETYPE`: 45 +- `UDT_ELELEVEL`: 46 +- `UDT_AMOTION`: 47 +- `UDT_ADELAY`: 48 +- `UDT_DMOTION`: 49 +- `UDT_HUNGER`: 50 +- `UDT_INTIMACY`: 51 +- `UDT_LIFETIME`: 52 +- `UDT_MERC_KILLCOUNT`: 53 +- `UDT_STATADD`: 54 + ## Hardcoded Constants (source) @@ -3793,6 +3909,16 @@ - `EQP_SHADOW_ACC_R`: 1048576 - `EQP_SHADOW_ACC_L`: 2097152 +### Item Option Types + +- `IT_OPT_INDEX`: 0 +- `IT_OPT_VALUE`: 1 +- `IT_OPT_PARAM`: 2 + +### Maximum Item Options + +- `MAX_ITEM_OPTIONS`: 5 + ### Navigation constants, use with *navigateto* - `NAV_NONE`: 0 @@ -3804,6 +3930,21 @@ - `NAV_KAFRA_AND_SCROLL`: 110 - `NAV_ALL`: 111 +### BL types + +- `BL_PC`: 1 +- `BL_MOB`: 2 +- `BL_PET`: 4 +- `BL_HOM`: 8 +- `BL_MER`: 16 +- `BL_ITEM`: 32 +- `BL_SKILL`: 64 +- `BL_NPC`: 128 +- `BL_CHAT`: 256 +- `BL_ELEM`: 512 +- `BL_CHAR`: 539 +- `BL_ALL`: 4095 + ### Renewal - `RENEWAL`: 1 diff --git a/doc/mob_db.txt b/doc/mob_db.txt new file mode 100644 index 000000000..29d2ab465 --- /dev/null +++ b/doc/mob_db.txt @@ -0,0 +1,219 @@ +//===== Hercules Documentation =============================== +//= Monster Database +//===== By: ================================================== +//= Hercules Dev Team +//===== Current Version: ===================================== +//= 20170311 +//===== Description: ========================================= +//= Explanation of the mob_db.conf file and structure. +//============================================================ + +mob_db: ( +{ + // ================ Mandatory fields ============================== + Id: ID (int) + SpriteName: "SPRITE_NAME" (string) + Name: "Mob name" (string) + // ================ Optional fields =============================== + JName: "Mob name" (string) + Lv: level (int, defaults to 1) + Hp: health (int, defaults to 1) + Sp: mana (int, defaults to 0) + Exp: basic experience (int, defaults to 0) + JExp: job experience (int, defaults to 0) + AttackRange: attack range (int, defaults to 1) + Attack: [attack1, attack2] (int, defaults to 0) + Def: defence (int, defaults to 0) + Mdef: magic defence (int, defaults to 0) + Stats: { + Str: strength (int, defaults to 0) + Agi: agility (int, defaults to 0) + Vit: vitality (int, defaults to 0) + Int: intelligence (int, defaults to 0) + Dex: dexterity (int, defaults to 0) + Luk: luck (int, defaults to 0) + } + ViewRange: view range (int, defaults to 1) + ChaseRange: chase range (int, defaults to 1) + Size: size (string, defaults to "Size_Medium") + Race: race (string, defaults to "RC_Formless") + Element: (type, level) + Mode: { + CanMove: true/false (bool, defaults to false) + Looter: true/false (bool, defaults to false) + Aggressive: true/false (bool, defaults to false) + Assist: true/false (bool, defaults to false) + CastSensorIdle:true/false (bool, defaults to false) + Boss: true/false (bool, defaults to false) + Plant: true/false (bool, defaults to false) + CanAttack: true/false (bool, defaults to false) + Detector: true/false (bool, defaults to false) + CastSensorChase: true/false (bool, defaults to false) + ChangeChase: true/false (bool, defaults to false) + Angry: true/false (bool, defaults to false) + ChangeTargetMelee: true/false (bool, defaults to false) + ChangeTargetChase: true/false (bool, defaults to false) + TargetWeak: true/false (bool, defaults to false) + NoKnockback: true/false (bool, defaults to false) + } + MoveSpeed: move speed (int, defaults to 0) + AttackDelay: attack delay (int, defaults to 4000) + AttackMotion: attack motion (int, defaults to 2000) + DamageMotion: damage motion (int, defaults to 0) + MvpExp: mvp experience (int, defaults to 0) + MvpDrops: { + AegisName: chance (string: int) + // ... + } + Drops: { + AegisName: chance (string: int) + // ... + } +}, +... +) + +Id: Monster id + +Sprite: Monster name as it is named on client. + Allowed characters: [A-Za-z0-9_] + +Name: Name displaying as output for @ and script commands. + This is the name shown when summon a monster with "--en--" as monster name. + +JName: Name displaying as output for @ and script commands. + When provided, this has preference over Name value. + This is the name shown when summon a monster with "--ja--" as monster name. + +Lv: Monster level + When not specified, becomes 1. + +Hp: Monster Hp + When not specified, becomes 1. + +Sp: Monster Sp + When not specified, becomes 0. + +Exp: Base Experience given by the monster. + When not specified, becomes 0. + +JExp: Job Experience given by the monster. + When not specified, becomes 0. + +AttackRange: Range for monster's attack. + When the range between monster and target is greater than 3 the skill is considered long-range, + otherwise it's a melee range. + When not specified, becomes 1. + +Attack: Attack of the monster, represented in two values: attack1 and attack2. + attack1 is minimal attack for the monster. + attack2, when pre-renewal is set, it's a value that sets maximum attack for monster. + Example: Familiar's attack is "Attack: [68, 77]", that is min attack of 68 and max attack of 77. + attack2, when renewal is set, it's a value added to attack1 to calculate maximum attack for monster. + Example: Familiar's attack is "Attack: [68, 9]", that is min attack of 68 and max attack of 77 (68+9). + When not specified, becomes 0. + +Def: Monster defense to physical attacks. + When not specified, becomes 0. + +Mdef: Monster defense to magical attacks. + When not specified, becomes 0. + +Stats: { + Str: monster strength points (When not specified, becomes 0) + Agi: monster agility points (When not specified, becomes 0) + Vit: monster vitality points (When not specified, becomes 0) + Int: monster intelligence points (When not specified, becomes 0) + Dex: monster dexterity points (When not specified, becomes 0) + Luk: monster luck points (When not specified, becomes 0) +} + +ViewRange: Range for monster's view. + Aggressive monsters will attack when Player is inside view range. + When not specified, becomes 1. + +ChaseRange: Range for monster's chase. + Aggressive and attacking monsters will stop chasing when Player gets outside chase range. + When not specified, becomes 1. + +Size: Sets monster's size. Accepts these constants: + "Size_Small" + "Size_Medium" + "Size_Large" + When not specified, becomes "Size_Medium". + +Race: Sets monster's race. Accepts these constants: + "RC_Formless" + "RC_Undead" + "RC_Brute" + "RC_Plant" + "RC_Insect" + "RC_Fish" + "RC_Demon" + "RC_DemiHuman" + "RC_Angel" + "RC_Dragon" + When not specified, becomes "RC_Formless". + +Element: Monster's element. Sets element type and level. + Required format: ("Element Type", Level). + Accepts these constants for Element Type: + "Ele_Neutral" + "Ele_Water" + "Ele_Earth" + "Ele_Fire" + "Ele_Wind" + "Ele_Poison" + "Ele_Holy" + "Ele_Dark" + "Ele_Ghost" + "Ele_Undead" + Level is an integer. Valid values: 1 ~ 4. + +Mode: Monster AI behaviour. If this block is omitted, monster doesn't react to anything. + All the settings in this group are boolean values, + Default value is false (mode not set) for any missing setting. + See /doc/sample/mob_db_mode_list.txt for more information about monsters Mode types. + +MoveSpeed: Monster's speed. Sets speed (cells/sec). + MoveSpeed is calculated to Hercules with this formula: 1000 / SPEED (CELLS/SEC) + When not specified, becomes 0. + +AttackDelay: Sets time delay between monster attack. Also refered as aspd. + Monster will not be able to do new attack until AttackDelay ends. + If AttackMotion is bigger than AttackDelay, monster will need to wait to AttackMotion delay. + When not specified, becomes 4000. + +AttackMotion: Sets time delay between animation motion. + Monster will not be able to do new attack until AttackMotion ends. + If AttackDelay is bigger than AttackMotion, monster will need to wait to AttackDelay delay. + AttackMotion is calculated to Hercules with this formula: 1000 / ASPD (ATTACKS/SEC) + When not specified, becomes 2000. + +DamageMotion: Sets time delay between damage motion. + When not specified, becomes 2000. + +MvpExp: Base Experience given by the monster to the player who inflict more attack. + Having any value except 0 will trigger MVP banner to the player who inflict more attack. + When not specified, becomes 0. + + +MvpDrops: Sets monster mvp drops list. Requires to have MvpExp to trigger. + Accepted values are AegisName as defined on item_db.conf and a chance. + Chance is an integer from 1 to 10000 (10000 = 100%). + Required format: + MvpDrops: { + AegisName: chance + // ... + } + When not specified, becomes false. + +Drops: Sets monster drops list. + Accepted values are AegisName as defined on item_db.conf and a chance. + Chance is an integer from 1 to 10000 (10000 = 100%). + Required format: + Drops: { + AegisName: chance + // ... + } + When not specified, becomes false. diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 0efe238c4..d7795b7a6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1409,6 +1409,27 @@ getvariableofnpc() should not be used on them. --------------------------------------- +*getvariableofpc(<variable>, <account id>{, <default value>}) + +Returns a reference to a PC variable from the target player. +If <default value> is passed, it will return this value if the player is +not found. + +Examples: + +//This will return the value of @var, note that this can't be used, since +//the value isn't caught. + getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")); + +//This will set the .@v variable to the value of the player's @var +//variable. + .@v = getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")); + +//This will set the @var variable of the player to 1. + set(getvariableofpc(@var, getcharid(CHAR_ID_ACCOUNT, "player")), 1); + +--------------------------------------- + *goto(<label>) This command will make the script jump to a label, usually used in @@ -2341,7 +2362,7 @@ deleted. //===================================== --------------------------------------- -*strcharinfo(<type>) +*strcharinfo(<type>{, <default value>{, <GID>}}) This function will return either the name, party name or guild name for the invoking character. Whatever it returns is determined by type. @@ -2349,6 +2370,10 @@ the invoking character. Whatever it returns is determined by type. (1) PC_PARTY - The name of the party they're in if any. (2) PC_GUILD - The name of the guild they're in if any. (3) PC_MAP - The name of the map the character is in. + +If <GID> is passed, it will return the value of the specified player instead +the attached player. If the player is not found, it will return +<default value>, if any, or else return an empty string. If a character is not a member of any party or guild, an empty string will be returned when requesting that information. @@ -2358,7 +2383,7 @@ using only numbers reduces script readability --------------------------------------- -*strnpcinfo(<type>) +*strnpcinfo(<type>{, <default value>{, <GID>}}) This function will return the various parts of the name of the calling NPC. Whatever it returns is determined by type. @@ -2369,6 +2394,10 @@ Whatever it returns is determined by type. (3) NPC_NAME_UNIQUE - The NPC's unique name (::name) (4) NPC_MAP - The name of the map the NPC is in. +If <GID> is passed, it will return the value of the specified NPC instead of +the attached NPC. If the NPC is not found, it will return <default value>, +if any, or else return an empty string. + --------------------------------------- *charid2rid(<char id>) @@ -2658,7 +2687,7 @@ Example 2: check party count (with a next() pause), before warping to event } // Finally, it's safe to start the event! - warpparty("event_map", 0, 0, getcharid(CHAR_ID_PARTY)); + warpparty("event_map", 0, 0, getcharid(CHAR_ID_PARTY), true); --------------------------------------- @@ -3244,6 +3273,40 @@ Notice that NPC objects disabled with disablenpc() will still be located. --------------------------------------- +*getunits(<type>, <variable>, <limit>, "<map>"{, <x1>, <y1>, <x2>, <y2>}) + +This function searches a whole map or area for units and adds their GID to +the provided <variable> array. It filters units by <type> and stops searching +after <limit> units have been found. Set <limit> to false (0) if you wish to +disable the limit altogether. + +Type is the type of unit to search for: + + BL_PC - Character object + BL_MOB - Monster object + BL_PET - Pet object + BL_HOM - Homunculus object + BL_MER - Mercenary object + BL_IEM - Item object (item drops) + BL_SKILL - Skill object (skill fx & sfx) + BL_NPC - NPC object + BL_CHAT - Chat object + BL_ELEM - Elemental object + BL_CHAR - Shorthand for (BL_PC|BL_MOB|BL_HOM|BL_MER|BL_ELEM) + BL_ALL - Any kind of object + +** Do NOT use UNITTYPE_ constants here, they have different values. + +Example: + + .@count = getunits((BL_PC | BL_NPC), .@units, false, "prontera"); + +The above example would search the map "prontera" for all PC and NPC units and +add them to the .@units array, while setting .@count to the amount of units +added to the array (useful in for() loops). + +--------------------------------------- + *getgmlevel() This function will return the (GM) level of player group the account to @@ -4292,7 +4355,7 @@ See also warp(). --------------------------------------- -*warpparty("<to_mapname>", <x>, <y>, <party_id>, {"<from_mapname>"}) +*warpparty("<to_mapname>", <x>, <y>, <party_id>, "<from_mapname>", <include_leader>) Warps a party to specified map and coordinate given the party ID, which you can get with getcharid(CHAR_ID_PARTY). You can also request another party id given @@ -4312,13 +4375,15 @@ Leader: All party members are warped to the leader's position. The If you specify a from_mapname, warpparty() will only affect those on that map. +You can exclude Party leader from warping, by keeping include_leader option as false. + Example: mes("[Party Warper]"); mes("Here you go!"); close2(); .@id = getcharid(CHAR_ID_PARTY); - warpparty("prontera", 150, 100, .@id); + warpparty("prontera", 150, 100, .@id, true); close(); --------------------------------------- @@ -4336,7 +4401,7 @@ Example: --------------------------------------- -*warpguild("<mapname>", <x>, <y>, <guild_id>) +*warpguild("<mapname>", <x>, <y>, <guild_id>, {"<from_mapname>"}) Warps a guild to specified map and coordinate given the guild id, which you can get with getcharid(CHAR_ID_GUILD). You can also request another guild id given @@ -4350,9 +4415,12 @@ SavePoint: All guild members are warped to the save point of the currently attached player (will fail if there's no player attached). +If you specify a from_mapname, warpguild() will only affect those on that map. + Example: warpguild("prontera", x, y, Guild_ID); + warpguild("prontera", x, y, Guild_ID, "payon"); // warp member from Payon map only. --------------------------------------- @@ -4551,26 +4619,17 @@ changebase(Class); // Changes player back to default sprite. --------------------------------------- -*classchange(<view id>, <type>) +*classchange(<view id>, <type> {, <char id>}) 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. +It will send a 'display id change' packet to player with given char ID +or to everyone in the immediate area of the NPC object if char ID is 0 or +not passed, which will 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. +Note that you can't send a Job sprite ID -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 Git revision. +type is not used and should always be 0. --------------------------------------- @@ -6499,17 +6558,14 @@ Size is 0 = normal 1 = small 2 = big. //===================================== --------------------------------------- -*addtimer(<ticks>, "NPC::OnLabel") -*deltimer("NPC::OnLabel") -*addtimercount("NPC::OnLabel", <ticks>) +*addtimer(<ticks>, "NPC::OnLabel"{, <account id>}) -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. The timer runs on the character -object that is attached to the script, and can have multiple instances. -When the label is run, it is run as if the player that the timer runs on -has clicked the NPC. +This command will create a countdown timer. +The event label given is the identifier of that timer. +The timer runs on the character object that is attached to the script, +and can have multiple instances. If <acccount id> is passed, this player +will be used instead. When the label is run, it is run as if the player +that the timer runs on has clicked the NPC. When this timer runs out, a new execution thread will start in the specified NPC object at the specified label. @@ -6533,6 +6589,39 @@ On5secs: --------------------------------------- +*deltimer("NPC::OnLabel"{, <account id>}) + +Deletes timers created by addtimer() that matches the given event +label. Refer to addtimer() for additional information. + +--------------------------------------- + +*addtimercount("NPC::OnLabel", <ticks>{, <account id>}) + +Delays a timer that was created with addtimer() by <ticks> ticks +if it matches the given event label. Refer to addtimer() for additional +information. + +--------------------------------------- + +*gettimer(<type>{, <account id>{, "<event>"}}) + +Returns informations on timers that were created by addtimer(). + +valid <type> for gettimer() are: + +(0) TIMER_COUNT + Will return the total number of timers for the specified or + attached player. Can be filtered by <event>. +(1) TIMER_TICK_NEXT + Will return the number of ticks until the next timer runs + for the specified or attached player. Can be filtered by <event>. +(2) TIMER_TICK_LAST + Will return the number of ticks until the last timer runs + for the specified or attached player. Can be filtered by <event>. + +--------------------------------------- + *initnpctimer({ "<NPC name>" {, <Attach Flag>} } | { "<NPC name>" | <Attach Flag> }) *stopnpctimer({ "<NPC name>" {, <Detach Flag>} } | @@ -8090,6 +8179,26 @@ Example: --------------------------------------- +*chr(<int>) + +Returns a char from its ASCII value. + +Example: + + chr(99); //returns "c" + +--------------------------------------- + +*ord(<chr>) + +Returns the ASCII value of char <chr>. + +Example: + + ord("c"); //returns 99 + +--------------------------------------- + *setchar(<string>, <char>, <index>) Returns the original string with the char at the specified index set to @@ -9370,3 +9479,149 @@ to be used within a "OnPayFunds" event of a NST_CUSTOM trader. Returns the amount of still-available <Item_ID> in the shop (on a NST_MARKET trader). --------------------------------------- + +*setunitdata(<GUID>, <DataType>, <Val1> {,<Val2>,<Val3>}) + +Sets or alters the data in real-time for game objects of the following types - +NPCs, Pets, Monsters, Homunuculus', Mercenaries, Elementals. + +Applicable Data Types (available as constants) - + Data Types Description (parameter type) + UDT_SIZE: Unit Size (int) + UDT_LEVEL: Level (int) + UDT_HP: Current HP (int) + UDT_MAXHP: Max HP (int) + UDT_SP: SP (int) + UDT_MAXSP: MAX SP (int) + UDT_MASTERAID: Master Account ID (for Summons) (int) + UDT_MASTERCID: Master Char ID (for Summons) (int) + UDT_MAPIDXY: Warp a Unit to a map. (Val1 = (string) MapName, Val2 = (int) x, Val3 = (int) y) + UDT_WALKTOXY: Make a unit walk to certain co-ordinates. (Val1 = (int) x, Val2 = (int) y) + UDT_SPEED: Unit Speed. (int) + UDT_MODE: Mode (Mobs only) (int) + UDT_AI: Unit AI Type (see constants.conf for Unit AI Types) + UDT_SCOPTION: Status Options. (see constants.conf for Unit Option Types) + UDT_SEX: Gender of the unit. (see constants.conf for Genders) + UDT_CLASS: Class of the unit. (Monster ID) (int) + UDT_HAIRSTYLE: Hair Style ID. (int) + UDT_HAIRCOLOR: Hair Color ID. (int) + UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int) + UDT_HEADMIDDLE: Headgear Middle Sprite ID. (int) + UDT_HEADTOP: Headgear Top Sprite ID. (int) + UDT_CLOTHCOLOR: Cloth Color ID. (int) + UDT_SHIELD: Shield Sprite ID. (int) + UDT_WEAPON: Weapon Sprite ID. (int) + UDT_LOOKDIR: Face direction. (int) + UDT_CANMOVETICK: Stop a unit from move for n seconds. (int) + UDT_STR: Unit STR. (int) + UDT_AGI: Unit AGI. (int) + UDT_VIT: Unit VIT. (int) + UDT_INT: Unit INT. (int) + UDT_DEX: Unit DEX. (int) + UDT_LUK: Unit LUK. (int) + UDT_ATKRANGE: Attack range of a unit. (int) + UDT_ATKMIN: Min Atk of a unit. (int) + UDT_ATKMAX: Max Atk of a unit. (int) + UDT_MATKMIN: Min MATK of a unit. (int) + UDT_MATKMAX: Max MATK of a unit. (int) + UDT_DEF: DEF. (int) + UDT_MDEF: MDEF. (int) + UDT_HIT: HIT. (int) + UDT_FLEE: FLEE. (int) + UDT_PDODGE: Perfect Dodge. (int) + UDT_CRIT: Critical Rate. (int) + UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7). + UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0). + UDT_ELELEVEL: Element Level (int). + UDT_AMOTION: AMotion Rate (int). + UDT_ADELAY: ADelay Rate (int). + UDT_DMOTION: DMotion Rate (int). + UDT_HUNGER: Hunger Rate (int) - for summons. + UDT_INTIMACY: Intimacy Rate (int) - for summons. + UDT_LIFETIME: LifeTime (int) - for summons. + UDT_MERC_KILLCOUNT: Kill count for mercenaries (int). + UDT_STATADD: Status Points (int) - for NPCs. + +returns 0 if value could not be set, 1 if successful. + +--------------------------------------- + +*getunitdata (<GUID>,<DataType>{,<Variable>}) + +Retrieves real-time data of a game object. For data with multiple return values, +an array variable may be passed to store the data in. + +Applicable Data types (available as constants) - + Data Types Description (return type) + UDT_SIZE: Unit Size (int) + UDT_LEVEL: Level (int) + UDT_HP: Current HP (int) + UDT_MAXHP: Max HP (int) + UDT_SP: SP (int) + UDT_MAXSP: MAX SP (int) + UDT_MASTERAID: Master Account ID (for Summons) (int) + UDT_MASTERCID: Master Char ID (for Summons) (int) + UDT_MAPIDXY: Warp a Unit to a map. (Val1 = (string) MapName, Val2 = (int) x, Val3 = (int) y) + UDT_SPEED: Unit Speed. (int) + UDT_MODE: Mode (Mobs only) (int) + UDT_AI: Unit AI Type (see constants.conf for Unit AI Types) + UDT_SCOPTION: Status Options. (see constants.conf for Unit Option Types) + UDT_SEX: Gender of the unit. (see constants.conf for Genders) + UDT_CLASS: Class of the unit. (Monster ID) (int) + UDT_HAIRSTYLE: Hair Style ID. (int) + UDT_HAIRCOLOR: Hair Color ID. (int) + UDT_HEADBOTTOM: Headgear Bottom Sprite ID. (int) + UDT_HEADMIDDLE: Headgear Middle Sprite ID. (int) + UDT_HEADTOP: Headgear Top Sprite ID. (int) + UDT_CLOTHCOLOR: Cloth Color ID. (int) + UDT_SHIELD: Shield Sprite ID. (int) + UDT_WEAPON: Weapon Sprite ID. (int) + UDT_LOOKDIR: Face direction. (int) + UDT_CANMOVETICK: Stop a unit from move for n seconds. (int) + UDT_STR: Unit STR. (int) + UDT_AGI: Unit AGI. (int) + UDT_VIT: Unit VIT. (int) + UDT_INT: Unit INT. (int) + UDT_DEX: Unit DEX. (int) + UDT_LUK: Unit LUK. (int) + UDT_ATKRANGE: Attack range of a unit. (int) + UDT_ATKMIN: Min Atk of a unit. (int) + UDT_ATKMAX: Max Atk of a unit. (int) + UDT_MATKMIN: Min MATK of a unit. (int) + UDT_MATKMAX: Max MATK of a unit. (int) + UDT_DEF: DEF. (int) + UDT_MDEF: MDEF. (int) + UDT_HIT: HIT. (int) + UDT_FLEE: FLEE. (int) + UDT_PDODGE: Perfect Dodge. (int) + UDT_CRIT: Critical Rate. (int) + UDT_RACE: Race. (Eg. string constants RC_DemiHuman or Integer 7). + UDT_ELETYPE: Element. (Eg. string constants Ele_Neutral or Integer 0). + UDT_ELELEVEL: Element Level (int). + UDT_AMOTION: AMotion Rate (int). + UDT_ADELAY: ADelay Rate (int). + UDT_DMOTION: DMotion Rate (int). + UDT_HUNGER: Hunger Rate (int) - for summons. + UDT_INTIMACY: Intimacy Rate (int) - for summons. + UDT_LIFETIME: LifeTime (int) - for summons. + UDT_MERC_KILLCOUNT: Kill count for mercenaries (int). + +returns 0 if value could not be retrieved. + +--------------------------------------- + +*getunitname(<GID>) + +Retrieve the name of a unit. + +returns "Unknown" if the value could not be retrieved. + +--------------------------------------- + +*setunitname(<GID>, <Name>) + +Changes the name of a unit. + +Supported Types - [ MOB | HOM | PET ]. + +returns 1 on success, 0 on failure. |