Skip to content

Commit 360583c

Browse files
authored
OCT2024a (#316)
1 parent 585f260 commit 360583c

File tree

1,403 files changed

+19548
-33866
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,403 files changed

+19548
-33866
lines changed

ms.stx

Lines changed: 37 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ $float //(<precision>,<number>) - Returns <number> as a float with <precision>
3838
$can_damage //(<target_ent>,[targetting_ent]) - Returns 1 if <target_ent> can be damaged by [targetting_ent] which is assumed to be the calling script, if ommited (MAR2008a)
3939
$filesize //(<filespec>) return size of a file - path begins at root, use forward slashes, eg. $filesize(maps/edana.bsp)
4040
$filehash //(<file>,[hash]) - if [hash] is unprovided, returns the hash for the file, or 0 if not found. If [hash] is provided, returns 1 if hash mathches.
41-
$func //(<event>,[params]) - Calls <event> and replaces itself with the result of the return statement within. (Won't work with delays, but will work with calleventloop's)
41+
$func //(<event>,[params]) - Calls <event> and replaces itself with the result of the return statement within. Returns 0 instead, if the value returned is empty. (Won't work with delays, but will work with calleventloop's)
4242
$getcl_beam //(<beam_idx>,<property>) - returns property of beam as described in beam_update above (mostly for debugging)
4343
$get //$get(<entity>,<property>,[options]) - get a property from a server side entity (see $get'ables and Scripting_AllDocs.txt for more info), propertie same as $get_by_idx below:
4444
$get_by_idx //$get_by_idx(<entity_idx>,<property>,[options])
@@ -254,7 +254,7 @@ $min //$min(<1>,[2]..[n]) - returns the lowest number in a series of floats
254254
$max //$max(<1>,[2]..[n]) - returns the highest number in a series of floats
255255
$get_sky_height //(<origin>) returns Z coordinate of sky brush - screwy sometimes, $get_traceline is more dependable
256256
$get_under_sky //(<origin>) returns if point is under sky (at all - isn't fooled by sloppy brushwork)
257-
$get_token //(<token_string>,<idx>) returns an item in a token string
257+
$get_token //(<token_string>,<idx>) returns an item in a token string. Returns 0 if index is out of bounds.
258258
$get_token_amt //(<token_string>) returns # of items in a token string (remember, token strings are index 0, but this counts the full amount)
259259
$getcl_tsphere //(<origin>,<range>,[flags]) - Clientside, assembles a token string of model indexes in <range> from <origin>.
260260
//flags: players (only include players) addbrushes (also include brushes with origins) [system cannot determine the distance of brushes without origins]
@@ -306,7 +306,7 @@ setvarg //<name> <value> - set a variable globally, has issues, server side only
306306
const //<name> <value> - set a constant (can't be read by higher scripts, overrides const definitions in lower scripts)
307307

308308
addstoreitem //<store_name> <item_script> <#toadd> <price%> [sell_ratio] [bundle_size]
309-
addvelocity //(pitch,yaw,roll) - add speed to a target, see also setvelocity
309+
addvelocity //(pitch,yaw,roll) [override] - add speed to a target, see also setvelocity. Push resist == stun resist, it is automatically adjusted unless override is specified.
310310
blood //<red|green|none>
311311
cancelattack //(items only) cancels/resets current attack
312312
catchspeech //<event> <trigger_words...> - calls event when NPC hears any trigger_words from local chat
@@ -516,9 +516,10 @@ setprop //<target> <property> <value>
516516
//- rendercolor <RRR,GGG,BBB>
517517
//- scale <ratio>
518518
//- setbody <group> <submodel> - as setmodelbody
519+
//- angles <vec>
519520
setsolid //<none/box/slidebox/trigger> - set object solidity (monters will not walk through, regardless of setting)
520521
setstat //<skill> <value> - Best used to set monsters parry scores.
521-
setvelocity //<target> <(vector)> - Sets the velocity on <target> to the specified value
522+
setvelocity //<target> <(vector)> [override] - Sets the velocity on <target> to the specified value. Stun resist == push resist, it is automatically adjusted unless override is specified
522523
skilllevel //set experience value for monster (Use NPC_GIVE_EXP in monsters/base_monster)
523524
sound
524525
play3d //sound.play3d <sound> <volume> <origin> [attenuation] [channel] [pitch] - client side playsound at origin
@@ -535,6 +536,7 @@ token //(see next)
535536
add //token.add <token_string> <string> - adds <string> to <token_string> as new token
536537
del //token.del <token_string> <token_index> - removes token #token_index
537538
sqrt //$math(sqrt,<num>) - not available as an independant command
539+
sin //$math(sin,<num>)
538540
tossprojectile //<projectile scriptname> <"view"|(src_origin)> <target|(targ_origin)|none> <speed> <damage> <cof> <skill|none>
539541
//- the target origin is used for the direction of the projectile
540542
//-if the target origin is set to none, the projectile will be tossed from the entity's view angle
@@ -580,6 +582,7 @@ capvar //<var> <min> <max>
580582
setanim //.framerate/.movespeed - both are ratio floats - use $get(<target>,framerate/movespeed) to pull current
581583
addgold //<amt> - adds gold to script (use external event: ext_addgold, to add gold to others)
582584
attackprop //<target> <attack_idx> <property> <value> - changes the property of a registerattack
585+
//Warning: will crash if used in game_deploy. Add a .01 second timer if you do to prevent crashes
583586
bleed //<target> <red|green|yellow> <amt> - Spew some blood at random vectors
584587
changelevel //<mapname> - guess what this does
585588
chatlog //<string> - append the server chatlog (writes even if ms_chatlog is 0 - so check that first)
@@ -621,7 +624,6 @@ strconc //<var> <strings or variables...> - simpler string concatenation
621624
summonpets //<player> - summons a player's companions (if any) (defunct)
622625
splayviewanim //<target_item> <anim_idx> - cause a specific item to play a specific viewanim from the server side
623626
tospawn //<player> [spawn_name] - send players to specific spawn points
624-
ververify //verifies ms.dll<->sc.dll consistancy and sets DLL_VER to 1 (security, only needed once)
625627
wipespell //<target> <spell_idx> - removes a spell from a player's memorized list (use $get(<target>,spellname,<idx>) to id spells)
626628
xdodamage //<target|(src_origin)> <range|aoe|(dest_origin)|direct> <damage> <cth|fall_off> <attacker> <inflciter> <skill|none> <dmg_type> [flag_string]
627629
//fully dynamic damage
@@ -637,7 +639,7 @@ xdodamage //<target|(src_origin)> <range|aoe|(dest_origin)|direct> <damage> <cth
637639
//- If prefix begins with * - <prefix>_dodamage will be called on <inflictor> instead of <attacker>, sans the * (for weapons)
638640
//= "nodecal"
639641
//- Causes trace damage events not to decal walls (note that they still fire hitwall/game_hitworld when calling from an item/weapon script)
640-
hitmulti //<target> <ratio> - multiplies hit chances by this ratio (for instilling to-hit penalties)
642+
hitmulti //<target> <ratio> - multiplies hit chances by this ratio (for instilling to-hit penalties) (0 returns hitmulti to normal)
641643
torandomspawn //<target> - moves to a random ms_player_spawn within 256 units, if any
642644
callclitemevent //<item_id> <event_name> <params...> - calls event on item, only affects owner's client
643645
clearplayerhits //<monster> <player|all> - clears record of hits on monster (used to calculate xp) from a specific player or all
@@ -790,21 +792,32 @@ trade
790792

791793
//common dmg types
792794
holy //all but undead/demon immune by default (also players with signfigant darkness contamination)
795+
holy_effect
793796
dark //damages everything, though some things are resistant
797+
dark_effect
794798
earth //rarely used, earth damage is blunt unless directly channeled
795799
cold
800+
cold_effect
796801
fire
802+
fire_effect
797803
lightning
804+
lightning_effect
798805
blunt
806+
blunt_effect
799807
slash
808+
slash_effect
800809
pierce
810+
pierce_effect
801811
poison
812+
poison_effect
802813
acid
814+
acid_effect
803815
siege
804816
training
805817
apostle
806818
magic //can't be parried
807819
target //can't be parried, usually 0 damage for target gathering that's stopped by walls
820+
stun //while not a dmgtype, still used with $get_takedmg() to determine stun resistance
808821

809822
//setbbox
810823
animsize
@@ -1043,25 +1056,8 @@ NPC_IS_TURRET //Set this to 1 on mobs that don't move
10431056
NPC_PASS_APPLYEFFECTS //if set to a target, applyeffects used against script with this var will instead be applied to that target, if it is valid
10441057
EFFECT_IGNORE_CLEARFX //when set to 1 in an applyeffect script, this setvard prevents removal via clearfx (though can still be removed directly via removeeffect).
10451058

1046-
//immunes - setting takedmg on any of these will set this var accordingly, automagically (JUN2007a)
1047-
//if takedmg xxx 1.0 - IMMUNE_XXX will be set 0.99 (as IMMUNE_XXX == 1 means total immune, while takedmg xxx 1.0 = 100% dmg)
1048-
//players have an alternate set callsed PIMMUNE_ - so monsters can check immunity of players even if they are immune themselves ( $get(x,scriptvar,y) local conflict)
1049-
//- see newer method: $get_takedmg(<target>,<type>)
1050-
IMMUNE_COLD //ratio, 1=immune >1=vulnerable <1=resistant
1051-
IMMUNE_FIRE //ratio, 1=immune >1=vulnerable <1=resistant
1052-
IMMUNE_LIGHTNING //ratio, 1=immune >1=vulnerable <1=resistant
1053-
IMMUNE_POISON //ratio, 1=immune >1=vulnerable <1=resistant
1054-
IMMUNE_ACID //ratio, 1=immune >1=vulnerable <1=resistant
1055-
IMMUNE_MAGIC //ratio, 1=immune >1=vulnerable <1=resistant
1056-
IMMUNE_HOLY //ratio, 1=immune >1=vulnerable <1=resistant (creatures are immune to holy by default, exceptions: race undead and race demon)
1057-
1058-
//special, not affected by takedmg
1059-
IMMUNE_STUN //this one works 0-100%
1060-
IMMUNE_PUSH //this is either 1 or 0 (see newer method: nopush 0|1, and $get(<target>,nopush) )
1061-
10621059
IS_BLOODLESS //setting 1 indicates mob is immune to vampyric effects
10631060

1064-
10651061
//chests
10661062
TC_NPLAYERS //#players returned by get_players or get_players_by_stat
10671063
GIVE_PRIZE //returned by get_chance
@@ -1084,7 +1080,7 @@ game_deploy //called when item put in hands
10841080
game_dodamage //PARAM1=hit:0|1 PARAM2=ent_hit PARAM3=(start) PARAM4=(end) PARAM5=DmgType PARAM6=DmgAmt
10851081
game_drop //called when item dropped
10861082
game_dynamically_created //called whenever createnpc used (possibly createitem as well) - params in createnpc command are passed here
1087-
game_fall //called when item falls
1083+
game_fall //Called on an item when it begins to fall. Also called on a player when they hit the ground and take damage.
10881084
game_heardsound //PARAM1=type:combat|move|danger PARAM2=(origin) PARAM3=danger_radius
10891085
game_heardtext //PARAM1=text PARAM2=player_id (general catch for local speech)
10901086
game_parry //PARAM1=attacker PARAM2=dmg PARAM3=dmg_type PARAM4=Parry_Roll PARAM5=Attack_Roll
@@ -1114,6 +1110,7 @@ game_viewanimdone //(Item Only - Client Only) Called when view animation done -
11141110
game_attack1_down //(Item only) goes off every frame mouse1 is down
11151111
game_-attack1 //(item only) goes off every frame mouse1 is up
11161112
game_attack1 //(item only) goes off once when mouse1 is pressed down
1113+
game_attack2 //(item only) goes off once when mouse2 is pressed down
11171114
game_+attack2 //(item only) goes off every frame mouse2 is down
11181115
game_-attack2 //(item only) goes off every frame mouse2 is up
11191116
game_hitnpc //(item only) goes off when NPC struck (even if miss) [sadly no param to tell you what NPC was hit]
@@ -1194,40 +1191,19 @@ get_chance_ultra_rare //<hp_req> - callevent get_chance 1 2 50 HP_REQ
11941191

11951192

11961193
//common effects
1197-
blind //<duration>
1198-
effect_burn //<duration> <inflictor_id> [damage] [noglow_shell-0|1] [nolight-0|1] [xp_skill] //EFFECT_ID DOT_fire
1199-
effect_defile //<duration> <attacker> [dmg] [ratio] [skill] (increases damage from all sources, dark DOT, generally low but with prolonged duration) //EFFECT_ID DOT_defile
1200-
effect_drunk //<duration>
1201-
effect_flames //<duration> - fx only
1202-
effect_freeze //<duration> <???> - secondary djinn effect (defunct)
1203-
effect_frost //<duration> [inflictor_id] <dmg> [glow-0|1] [xp_skill] - (djinn_ice version - defunct)
1204-
effect_frostbite //<duration> [inflictor_id] (slows, no damage)
1205-
effect_frostbite_dmg //<duration> <inflictor_id> <dmg> [xp_skill] (slows, generally half damage) //EFFECT_ID DOT_cold
1206-
effect_holy_dmg //<duration> <inflictor_id> <dmg> [xp_skill] //EFFECT_ID DOT_holy
1207-
effect_iceshield //<duration> <dmg_multiplier>
1208-
effect_light //<duration> <radius> <color>
1209-
effect_poison //<duration> <inflictor_id> <dmg> <poison/disease-0|1> [xp_skill] (usually double duration, quarter damage) //EFFECT_ID DOT_poison
1210-
effect_push //<duration> <(vel)> [screenshake-0|1]
1211-
effect_rejuv2 //<heal_amt> [divinaion_skill] [healer_id]
1212-
effect_shadowflames //<duration> <inflictor_id> [dmg] [xp_skill] (dark damage flames, generally 0.5 damage, adds Darkness Contamination)
1213-
effect_shock_dmg //<duration> <inflictor_id> [dmg] [xp_skill] (damage is adjusted to 0.75 effect side, decreases accuracy) //EFFECT_ID DOT_lightning
1214-
effect_stun //<duration> [slow_push-0|1] [cant_attack-0|1] [attacker]
1215-
freeze_solid //<duration> <inflictor_id> [dot] [xp_skill] [max_hp] (prevents movement and attacking)
1216-
generic_damage //<dmg> <inflictor_id> [noise-0|1] [dmg_type] [xp_skill]
1217-
greater_poison //<duration> <inflictor_id> <dmg> [xp_skill] //EFFECT_ID DOT_gpoison
1218-
poison_spore //<duration> <inflictor_id> <dmg> [xp_skill]
1219-
heavy_stun //<duration> [inflictor_id] [cant_attack:0|1]
1220-
protection //<duration> <dmg_multiplier>
1221-
sfx_motionblur //<ent_idx> [duration]
1222-
speed //<duration> <speed%> <framerate> - not sure if this works 100%
1223-
torch_flame //<duration> - less sticky than items/base_lighted
1224-
effect_poison_dmg //convention alias: effect_poison
1225-
effect_fire_dmg //convention alias: effect_burn
1226-
effect_cold_dmg //convention alias: effect_frostbite_dmg
1227-
effect_lightning_dmg //convention alias: effect_shock_dmg
1228-
hold_person //<duration> <inflictor_id> [dmg] (prevents movement but not attacking)
1229-
effect_webbed //<cocoon_hp[x10,usually use mons maxhp]> <web_strength[>1 reduces webs needed for cocoon]> [attacker] [duration] [dot]
1230-
effect_poison_blinding //<duration> <inflictor_id> [dmg] [xp_skill]
1194+
debuff_hold //<duration> <cage_type:0|1> - 0 == lightning cage, 1 == beam cage
1195+
debuff_stun //<duration> <attacker>
1196+
dot_acid //<duration> <attacker> <dps> <skill>
1197+
dot_bleed //<duration> <attacker> <dps> <skill>
1198+
dot_cold //<duration> <attacker> <dps> <skill>
1199+
dot_cold_freeze //<duration> <attacker> <dps> <skill> [maxhp] - monster must be at or below maxhp in order to freeze
1200+
dot_dark //<duration> <attacker> <dps> <skill>
1201+
dot_fire //<duration> <attacker> <dps> <skill>
1202+
dot_holy //<duration> <attacker> <dps> <skill>
1203+
dot_lightning //<duration> <attacker> <dps> <skill>
1204+
dot_lightning_cage //<duration> <attacker> <dps> <skill> [maxhp]
1205+
dot_poison //<duration> <attacker> <dps> <skill>
1206+
dot_poison_blind //<duration> <attacker> <dps> <skill>
12311207

12321208
#KEYWORD=Reserved_attribs
12331209
//most of these can be pulled with $get(<ent>,xx)
@@ -1627,10 +1603,12 @@ callevent //<delay> <event_name> OR <event_name> [params...]
16271603
calleventloop //<#_of_iterations> <event_name> - loop event_name X times. Progress of loop stored in game.script.iteration - loops can be embedded
16281604
calleventtimed //same as callevent <delay> <event_name>
16291605
callexternal //<target|players|all> <event_name> [params...] - calls script on another target
1630-
clientevent //<new|update|persists> <target|all> <script_file|script_idx> <event_name> [params...] - see client side scripting docs
1606+
clientevent //<new|update|persists|remove> <target|all> <script_file|script_idx> <event_name> [params...] - see client side scripting docs //"remove" stops the effect from persisting, but does not remove any active scripts.
1607+
//clientevent update <target|all> const.localplayer.scriptID <event_name> [params...] - calls player client script event
16311608
override //{ [override] eventname - override's lower instances of same event, can cause issues when overriding a higher occurance
16321609
exitevent //Ends execution of commands in the current script event (less need for if !EXIT_SUB)
16331610
breakloop //terminates a calleventloop in progress
1611+
resetloop //<#_of_iterations to repeat>
16341612

16351613
//comparative operators (case sensitive)
16361614
if //if [(] <condition> [)] dostuffs (remember spaces are parsers), if no parantheses are around ( condition ) execution ends if condition is false

0 commit comments

Comments
 (0)