diff options
Diffstat (limited to 'doc/script_commands.txt')
-rw-r--r-- | doc/script_commands.txt | 81 |
1 files changed, 44 insertions, 37 deletions
diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 5fc9d3082..e964385ba 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -5306,48 +5306,55 @@ Used in reset NPC's (duh!). *sc_start4 <effect type>,<ticks>,<value 1>,<value 2>,<value 3>,<value 4>{,<rate>,<flag>{,<GID>}}; *sc_end <effect type>{,<GID>}; -These command bestow a status effect on the invoking character. This -command is used a lot in the item scripts. +These commands will bestow a status effect on a character. - // This would poison them for 10 min - sc_start SC_Poison,600000,0; +The <effect type> determines which status is invoked. This can be either a number +or constant, with the common statuses (mostly negative) found in 'db/const.txt' +with the 'SC_' prefix. A full list is located in 'src/map/status.h', though +they are not currently documented. -Effect type is a number of effect, 'db/const.txt' lists the common (mostly -negative) status effect types as constants, starting with 'SC_'. You can -also use this to give someone an effect of a player-cast spell: +The duration of the status is given in <ticks>, or milleseconds. - // This will bless someone as if with Bless 10: +Certain status changes take an additional parameter <value 1>, which typically +modifies player stats by the given number or percentage. This differs for each +status, and is sometimes zero. + +Optional value <rate> is the chance that the status will be invoked (10000 = 1%). +This is used primarily in item scripts. When used in an NPC script, a flag MUST +be defined for the rate to work. + +Optional value <flag> is how the status change start will be handled (a bitmask). + 1: Status change cannot be avoided. + 2: Tick cannot be reduced by stats (default). + 4: sc_data loaded, so no value will be altered. + 8: Rate cannot be reduced. + +If a <GID> is given, the status change will be invoked on the specified character +instead of the one attached to the script. This can only be defined after setting +a rate and flag. + +'sc_start2' and 'sc_start4' allow extra parameters to be passed, and are used only +for effects that require them. The meaning of the extra values vary depending on the +effect type. + +'sc_end' will remove a specified status effect. If SC_ALL (-1) is given, it will +perform a complete removal of all statuses (although permanent ones will re-apply). + +Examples: + // This will poison the invoking character for 10 minutes at 50% chance. + sc_start SC_POISON,600000,0,5000; + + // This will bestow the effect of Level 10 Blessing. sc_start 10,240000,10; -Extra argument's meaning differs depending on the effect type, for most -effects caused by a player skill the extra argument means the level of the -skill that would have been used to create that effect, for others it might -have no meaning whatsoever. You can actually bless someone with a 0 bless -spell level this way, which is fun, but weird. - -The GID, if given, will cause the status effect to appear on a specified -character, instead of the one attached to the running script. This has not -been properly tested. - -'sc_start2' is perfectly equivalent, but unlike 'sc_start', a status -change effect will only occur with a specified percentage chance. 10000 -given as the chance is equivalent to a 100% chance, 0 is a zero. - -'sc_start4' is just like sc_start, however it takes four parameters for -the status change instead of one. What these values are depends on the -status change in question. For example, elemental armor defense takes the -following four values: -- val1 is the first element, val2 is the resistance to the element val1. -- val3 is the second element, val4 is the resistance to said element. -eg: sc_start4 SC_ARMOR_RESIST,300000,20,20,20,20; - -'sc_end' will remove a specified status effect. If SC_All is used (-1), it -will do a complete removal of all statuses (although permanent ones will -re-apply). - -You can see the full list of status effects caused by skills in -'src/map/status.h' - they are currently not fully documented, but most of -that should be rather obvious. + // Elemental armor defense takes the following four values: + // val1 is the first element, val2 is the resistance to the element val1. + // val3 is the second element, val4 is the resistance to the element val3. + sc_start4 SC_DefEle,60000,Ele_Fire,20,Ele_Water,-15; + + // This will end the Freezing status for the invoking character. + sc_end SC_FREEZE; + Note: to use SC_NOCHAT you should alter Manner Manner = -5; // Will mute a user for 5 minutes Manner = 0; // Will unmute a user |