plugins/include/sdktools_tempents_stocks.inc
author David Anderson <dvander@alliedmods.net>
Sat May 17 05:12:52 2008 +0000 (2008-05-17)
changeset 2056 f1fcde46ac7c
parent 1952 b7aa2b626807
child 2289 44045ead61cd
permissions -rw-r--r--
added amb1119 - sm_revote command
ds@1952
     1
/**
ds@1952
     2
 * vim: set ts=4 :
ds@1952
     3
 * =============================================================================
ds@1952
     4
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
ds@1952
     5
 * =============================================================================
ds@1952
     6
 *
ds@1952
     7
 * This file is part of the SourceMod/SourcePawn SDK.
ds@1952
     8
 *
ds@1952
     9
 * This program is free software; you can redistribute it and/or modify it under
ds@1952
    10
 * the terms of the GNU General Public License, version 3.0, as published by the
ds@1952
    11
 * Free Software Foundation.
ds@1952
    12
 * 
ds@1952
    13
 * This program is distributed in the hope that it will be useful, but WITHOUT
ds@1952
    14
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ds@1952
    15
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
ds@1952
    16
 * details.
ds@1952
    17
 *
ds@1952
    18
 * You should have received a copy of the GNU General Public License along with
ds@1952
    19
 * this program.  If not, see <http://www.gnu.org/licenses/>.
ds@1952
    20
 *
ds@1952
    21
 * As a special exception, AlliedModders LLC gives you permission to link the
ds@1952
    22
 * code of this program (as well as its derivative works) to "Half-Life 2," the
ds@1952
    23
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ds@1952
    24
 * by the Valve Corporation.  You must obey the GNU General Public License in
ds@1952
    25
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
ds@1952
    26
 * this exception to all derivative works.  AlliedModders LLC defines further
ds@1952
    27
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ds@1952
    28
 * or <http://www.sourcemod.net/license.php>.
ds@1952
    29
 *
ds@1952
    30
 * Version: $Id$
ds@1952
    31
 */
ds@1952
    32
ds@1952
    33
#if defined _te_stocks_included
ds@1952
    34
 #endinput
ds@1952
    35
#endif
ds@1952
    36
#define _te_stocks_included
ds@1952
    37
ds@1952
    38
/**
ds@1952
    39
 * @section TE Explosion flags.
ds@1952
    40
 */
ds@1952
    41
#define TE_EXPLFLAG_NONE		0x0	/**< all flags clear makes default Half-Life explosion */
ds@1952
    42
#define TE_EXPLFLAG_NOADDITIVE		0x1	/**< sprite will be drawn opaque (ensure that the sprite you send is a non-additive sprite) */
ds@1952
    43
#define TE_EXPLFLAG_NODLIGHTS		0x2	/**< do not render dynamic lights */
ds@1952
    44
#define TE_EXPLFLAG_NOSOUND		0x4	/**< do not play client explosion sound */
ds@1952
    45
#define TE_EXPLFLAG_NOPARTICLES		0x8	/**< do not draw particles */
ds@1952
    46
#define TE_EXPLFLAG_DRAWALPHA		0x10	/**< sprite will be drawn alpha */
ds@1952
    47
#define TE_EXPLFLAG_ROTATE		0x20	/**< rotate the sprite randomly */
ds@1952
    48
#define TE_EXPLFLAG_NOFIREBALL		0x40	/**< do not draw a fireball */
ds@1952
    49
#define TE_EXPLFLAG_NOFIREBALLSMOKE	0x80	/**< do not draw smoke with the fireball */
ds@1952
    50
ds@1952
    51
/**
ds@1952
    52
 * @endsection
ds@1952
    53
 */
ds@1952
    54
ds@1952
    55
/**
ds@1952
    56
 * @section TE Beam flags.
ds@1952
    57
 */
ds@1952
    58
#define FBEAM_STARTENTITY 	0x00000001
ds@1952
    59
#define	FBEAM_ENDENTITY		0x00000002
ds@1952
    60
#define	FBEAM_FADEIN		0x00000004
ds@1952
    61
#define	FBEAM_FADEOUT		0x00000008
ds@1952
    62
#define	FBEAM_SINENOISE		0x00000010
ds@1952
    63
#define	FBEAM_SOLID		0x00000020
ds@1952
    64
#define	FBEAM_SHADEIN		0x00000040
ds@1952
    65
#define	FBEAM_SHADEOUT		0x00000080
ds@1952
    66
#define	FBEAM_ONLYNOISEONCE	0x00000100 	/**< Only calculate our noise once */
ds@1952
    67
#define	FBEAM_NOTILE		0x00000200
ds@1952
    68
#define	FBEAM_USE_HITBOXES	0x00000400	/**< Attachment indices represent hitbox indices instead when this is set. */
ds@1952
    69
#define	FBEAM_STARTVISIBLE	0x00000800	/**< Has this client actually seen this beam's start entity yet? */
ds@1952
    70
#define	FBEAM_ENDVISIBLE	0x00001000	/**< Has this client actually seen this beam's end entity yet? */
ds@1952
    71
#define	FBEAM_ISACTIVE		0x00002000
ds@1952
    72
#define	FBEAM_FOREVER		0x00004000
ds@1952
    73
#define	FBEAM_HALOBEAM		0x00008000	/**< When drawing a beam with a halo, don't ignore the segments and endwidth */
ds@1952
    74
ds@1952
    75
/**
ds@1952
    76
 * @endsection
ds@1952
    77
 */
ds@1952
    78
ds@1952
    79
/**
ds@1952
    80
 * Sets up a sparks effect.
ds@1952
    81
 *
ds@1952
    82
 * @param pos			Position of the sparks.
ds@1952
    83
 * @param dir			Direction of the sparks.
ds@1952
    84
 * @param Magnitude		Sparks size.
ds@1952
    85
 * @param TrailLength		Trail lenght of the sparks.
ds@1952
    86
 * @noreturn
ds@1952
    87
 */
ds@1952
    88
stock TE_SetupSparks(const Float:pos[3], const Float:dir[3], Magnitude, TrailLength)
ds@1952
    89
{
ds@1952
    90
	TE_Start("Sparks");
ds@1952
    91
	TE_WriteVector("m_vecOrigin[0]", pos);
ds@1952
    92
	TE_WriteVector("m_vecDir", dir);
ds@1952
    93
	TE_WriteNum("m_nMagnitude", Magnitude);
ds@1952
    94
	TE_WriteNum("m_nTrailLength", TrailLength);
ds@1952
    95
}
ds@1952
    96
ds@1952
    97
/**
ds@1952
    98
 * Sets up a smoke effect.
ds@1952
    99
 *
ds@1952
   100
 * @param pos			Position of the smoke.
ds@1952
   101
 * @param Model			Precached model index.
ds@1952
   102
 * @param Scale			Scale of the smoke.
ds@1952
   103
 * @param Framerate		Frame rate of the smoke.
ds@1952
   104
 * @noreturn
ds@1952
   105
 */
ds@1952
   106
stock TE_SetupSmoke(const Float:pos[3], Model, Float:Scale, FrameRate)
ds@1952
   107
{
ds@1952
   108
	TE_Start("Smoke");
ds@1952
   109
	TE_WriteVector("m_vecOrigin", pos);
ds@1952
   110
	TE_WriteNum("m_nModelIndex", Model);
ds@1952
   111
	TE_WriteFloat("m_fScale", Scale);
ds@1952
   112
	TE_WriteNum("m_nFrameRate", FrameRate);
ds@1952
   113
}
ds@1952
   114
ds@1952
   115
/**
ds@1952
   116
 * Sets up a dust cloud effect.
ds@1952
   117
 *
ds@1952
   118
 * @param pos			Position of the dust.
ds@1952
   119
 * @param dir			Direction of the dust.
ds@1952
   120
 * @param Size			Dust cloud size.
ds@1952
   121
 * @param Speed			Dust cloud speed.
ds@1952
   122
 * @noreturn
ds@1952
   123
 */
ds@1952
   124
stock TE_SetupDust(const Float:pos[3], const Float:dir[3], Float:Size, Float:Speed)
ds@1952
   125
{
ds@1952
   126
	TE_Start("Dust");
ds@1952
   127
	TE_WriteVector("m_vecOrigin[0]", pos);
ds@1952
   128
	TE_WriteVector("m_vecDirection", dir);
ds@1952
   129
	TE_WriteFloat("m_flSize", Size);
ds@1952
   130
	TE_WriteFloat("m_flSpeed", Speed);
ds@1952
   131
}
ds@1952
   132
ds@1952
   133
/**
ds@1952
   134
 * Sets up a muzzle flash effect.
ds@1952
   135
 *
ds@1952
   136
 * @param pos			Position of the muzzle flash.
ds@1952
   137
 * @param angles		Rotation angles of the muzzle flash.
ds@1952
   138
 * @param Scale			Scale of the muzzle flash.
ds@1952
   139
 * @param Type			Muzzle flash type to render (Mod specific).
ds@1952
   140
 * @noreturn
ds@1952
   141
 */
ds@1952
   142
stock TE_SetupMuzzleFlash(const Float:pos[3], const Float:angles[3], Float:Scale, Type)
ds@1952
   143
{
ds@1952
   144
	TE_Start("MuzzleFlash");
ds@1952
   145
	TE_WriteVector("m_vecOrigin", pos);
ds@1952
   146
	TE_WriteVector("m_vecAngles", angles);
ds@1952
   147
	TE_WriteFloat("m_flScale", Scale);
ds@1952
   148
	TE_WriteNum("m_nType", Type);
ds@1952
   149
}
ds@1952
   150
ds@1952
   151
/**
ds@1952
   152
 * Sets up a metal sparks effect.
ds@1952
   153
 *
ds@1952
   154
 * @param pos			Position of the metal sparks.
ds@1952
   155
 * @param dir			Direction of the metal sparks.
ds@1952
   156
 * @noreturn
ds@1952
   157
 */
ds@1952
   158
stock TE_SetupMetalSparks(const Float:pos[3], const Float:dir[3])
ds@1952
   159
{
ds@1952
   160
	TE_Start("Metal Sparks");
ds@1952
   161
	TE_WriteVector("m_vecPos", pos);
ds@1952
   162
	TE_WriteVector("m_vecDir", dir);
ds@1952
   163
}
ds@1952
   164
ds@1952
   165
/**
ds@1952
   166
 * Sets up an energy splash effect.
ds@1952
   167
 *
ds@1952
   168
 * @param pos			Position of the energy splash.
ds@1952
   169
 * @param dir			Direction of the energy splash.
ds@1952
   170
 * @param Explosive		Makes the effect explosive.
ds@1952
   171
 * @noreturn
ds@1952
   172
 */
ds@1952
   173
stock TE_SetupEnergySplash(const Float:pos[3], const Float:dir[3], bool:Explosive)
ds@1952
   174
{
ds@1952
   175
	TE_Start("Energy Splash");
ds@1952
   176
	TE_WriteVector("m_vecPos", pos);
ds@1952
   177
	TE_WriteVector("m_vecDir", dir);
ds@1952
   178
	TE_WriteNum("m_bExplosive", Explosive);
ds@1952
   179
}
ds@1952
   180
ds@1952
   181
/**
ds@1952
   182
 * Sets up an armor ricochet effect.
ds@1952
   183
 *
ds@1952
   184
 * @param pos			Position of the armor ricochet.
ds@1952
   185
 * @param dir			Directon of the armor ricochet.
ds@1952
   186
 * @noreturn
ds@1952
   187
 */
ds@1952
   188
stock TE_SetupArmorRicochet(const Float:pos[3], const Float:dir[3])
ds@1952
   189
{
ds@1952
   190
	TE_Start("Armor Ricochet");
ds@1952
   191
	TE_WriteVector("m_vecPos", pos);
ds@1952
   192
	TE_WriteVector("m_vecDir", dir);
ds@1952
   193
}
ds@1952
   194
ds@1952
   195
/**
ds@1952
   196
 * Sets up a glowing sprite effect.
ds@1952
   197
 *
ds@1952
   198
 * @param pos			Position of the sprite.
ds@1952
   199
 * @param Model			Precached model index.
ds@1952
   200
 * @param Life			Time duration of the sprite.
ds@1952
   201
 * @param Size			Sprite size.
ds@1952
   202
 * @param Brightness		Sprite brightness.
ds@1952
   203
 * @noreturn
ds@1952
   204
 */
ds@1952
   205
stock TE_SetupGlowSprite(const Float:pos[3], Model, Float:Life, Float:Size, Brightness)
ds@1952
   206
{
ds@1952
   207
	TE_Start("GlowSprite");
ds@1952
   208
	TE_WriteVector("m_vecOrigin", pos);
ds@1952
   209
	TE_WriteNum("m_nModelIndex", Model);
ds@1952
   210
	TE_WriteFloat("m_fScale", Size);
ds@1952
   211
	TE_WriteFloat("m_fLife", Life);
ds@1952
   212
	TE_WriteNum("m_nBrightness", Brightness);
ds@1952
   213
}
ds@1952
   214
ds@1952
   215
/**
ds@1952
   216
 * Sets up a explosion effect.
ds@1952
   217
 *
ds@1952
   218
 * @param pos			Explosion position.
ds@1952
   219
 * @param Model			Precached model index.
ds@1952
   220
 * @param Scale			Explosion scale.
ds@1952
   221
 * @param Framerate		Explosion frame rate.
ds@1952
   222
 * @param Flags			Explosion flags.
ds@1952
   223
 * @param Radius		Explosion radius.
ds@1952
   224
 * @param Magnitude		Explosion size.
ds@1952
   225
 * @param normal		Normal vector to the explosion.
ds@1952
   226
 * @param MaterialType		Exploded material type.
ds@1952
   227
 * @noreturn
ds@1952
   228
 */
ds@1952
   229
stock TE_SetupExplosion(const Float:pos[3], Model, Float:Scale, Framerate, Flags, Radius, Magnitude, const Float:normal[3]={0.0, 0.0, 1.0}, MaterialType='C')
ds@1952
   230
{
ds@1952
   231
	TE_Start("Explosion");
ds@1952
   232
	TE_WriteVector("m_vecOrigin[0]", pos);
ds@1952
   233
	TE_WriteVector("m_vecNormal", normal);
ds@1952
   234
	TE_WriteNum("m_nModelIndex", Model);
ds@1952
   235
	TE_WriteFloat("m_fScale", Scale);
ds@1952
   236
	TE_WriteNum("m_nFrameRate", Framerate);
ds@1952
   237
	TE_WriteNum("m_nFlags", Flags);
ds@1952
   238
	TE_WriteNum("m_nRadius", Radius);
ds@1952
   239
	TE_WriteNum("m_nMagnitude", Magnitude);
ds@1952
   240
	TE_WriteNum("m_chMaterialType", MaterialType);
ds@1952
   241
}
ds@1952
   242
ds@1952
   243
/**
ds@1952
   244
 * Sets up a blood sprite effect.
ds@1952
   245
 *
ds@1952
   246
 * @param pos			Position of the sprite.
ds@1952
   247
 * @param dir			Sprite direction.
ds@1952
   248
 * @param color			Color array (r, g, b, a).
ds@1952
   249
 * @param Size			Sprite size.
ds@1952
   250
 * @param SprayModel		Precached model index.
ds@1952
   251
 * @param BloodDropModel	Precached model index.
ds@1952
   252
 * @noreturn
ds@1952
   253
 */
ds@1952
   254
stock TE_SetupBloodSprite(const Float:pos[3], const Float:dir[3], const color[4], Size, SprayModel, BloodDropModel)
ds@1952
   255
{
ds@1952
   256
	TE_Start("Blood Sprite");
ds@1952
   257
	TE_WriteVector("m_vecOrigin", pos);
ds@1952
   258
	TE_WriteVector("m_vecDirection", dir);
ds@1952
   259
	TE_WriteNum("r", color[0]);
ds@1952
   260
	TE_WriteNum("g", color[1]);
ds@1952
   261
	TE_WriteNum("b", color[2]);
ds@1952
   262
	TE_WriteNum("a", color[3]);
ds@1952
   263
	TE_WriteNum("m_nSize", Size);
ds@1952
   264
	TE_WriteNum("m_nSprayModel", SprayModel);
ds@1952
   265
	TE_WriteNum("m_nDropModel", BloodDropModel);
ds@1952
   266
}
ds@1952
   267
ds@1952
   268
/**
ds@1952
   269
 * Sets up a beam ring point effect.
ds@1952
   270
 *
ds@1952
   271
 * @param center		Center position of the ring.
ds@1952
   272
 * @param Start_Radius		Initial ring radius.
ds@1952
   273
 * @param End_Radius		Final ring radius.
ds@1952
   274
 * @param ModelIndex		Precached model index.
ds@1952
   275
 * @param HaloIndex		Precached model index.
ds@1952
   276
 * @param StartFrame		Initital frame to render.
ds@1952
   277
 * @param FrameRate		Ring frame rate.
ds@1952
   278
 * @param Life			Time duration of the ring.
ds@1952
   279
 * @param Width			Beam width.
ds@1952
   280
 * @param Amplitude		Beam amplitude.
ds@1952
   281
 * @param color			Color array (r, g, b, a).
ds@1952
   282
 * @param Speed			Speed of the beam.
ds@1952
   283
 * @param Flags			Beam flags.
ds@1952
   284
 * @noreturn
ds@1952
   285
 */
ds@1952
   286
stock TE_SetupBeamRingPoint(const Float:center[3], Float:Start_Radius, Float:End_Radius, ModelIndex, HaloIndex, StartFrame, 
ds@1952
   287
				FrameRate, Float:Life, Float:Width, Float:Amplitude, const Color[4], Speed, Flags)
ds@1952
   288
{
ds@1952
   289
	TE_Start("BeamRingPoint");
ds@1952
   290
	TE_WriteVector("m_vecCenter", center);
ds@1952
   291
	TE_WriteFloat("m_flStartRadius", Start_Radius);
ds@1952
   292
	TE_WriteFloat("m_flEndRadius", End_Radius);
ds@1952
   293
	TE_WriteNum("m_nModelIndex", ModelIndex);
ds@1952
   294
	TE_WriteNum("m_nHaloIndex", HaloIndex);
ds@1952
   295
	TE_WriteNum("m_nStartFrame", StartFrame);
ds@1952
   296
	TE_WriteNum("m_nFrameRate", FrameRate);
ds@1952
   297
	TE_WriteFloat("m_fLife", Life);
ds@1952
   298
	TE_WriteFloat("m_fWidth", Width);
ds@1952
   299
	TE_WriteFloat("m_fEndWidth", Width);
ds@1952
   300
	TE_WriteFloat("m_fAmplitude", Amplitude);
ds@1952
   301
	TE_WriteNum("r", Color[0]);
ds@1952
   302
	TE_WriteNum("g", Color[1]);
ds@1952
   303
	TE_WriteNum("b", Color[2]);
ds@1952
   304
	TE_WriteNum("a", Color[3]);
ds@1952
   305
	TE_WriteNum("m_nSpeed", Speed);
ds@1952
   306
	TE_WriteNum("m_nFlags", Flags);
ds@1952
   307
	TE_WriteNum("m_nFadeLength", 0);
ds@1952
   308
}
ds@1952
   309
ds@1952
   310
/**
ds@1952
   311
 * Sets up a point to point beam effect.
ds@1952
   312
 *
ds@1952
   313
 * @param start			Start position of the beam.
ds@1952
   314
 * @param end			End position of the beam.
ds@1952
   315
 * @param ModelIndex		Precached model index.
ds@1952
   316
 * @param HaloIndex		Precached model index.
ds@1952
   317
 * @param StartFrame		Initital frame to render.
ds@1952
   318
 * @param FrameRate		Beam frame rate.
ds@1952
   319
 * @param Life			Time duration of the beam.
ds@1952
   320
 * @param Width			Initial beam width.
ds@1952
   321
 * @param EndWidth		Final beam width.
ds@1952
   322
 * @param FadeLength		Beam fade time duration.
ds@1952
   323
 * @param Amplitude		Beam amplitude.
ds@1952
   324
 * @param color			Color array (r, g, b, a).
ds@1952
   325
 * @param Speed			Speed of the beam.
ds@1952
   326
 * @noreturn
ds@1952
   327
 */
ds@1952
   328
stock TE_SetupBeamPoints(const Float:start[3], const Float:end[3], ModelIndex, HaloIndex, StartFrame, FrameRate, Float:Life, 
ds@1952
   329
				Float:Width, Float:EndWidth, FadeLength, Float:Amplitude, const Color[4], Speed)
ds@1952
   330
{
ds@1952
   331
	TE_Start("BeamPoints");
ds@1952
   332
	TE_WriteVector("m_vecStartPoint", start);
ds@1952
   333
	TE_WriteVector("m_vecEndPoint", end);
ds@1952
   334
	TE_WriteNum("m_nModelIndex", ModelIndex);
ds@1952
   335
	TE_WriteNum("m_nHaloIndex", HaloIndex);
ds@1952
   336
	TE_WriteNum("m_nStartFrame", StartFrame);
ds@1952
   337
	TE_WriteNum("m_nFrameRate", FrameRate);
ds@1952
   338
	TE_WriteFloat("m_fLife", Life);
ds@1952
   339
	TE_WriteFloat("m_fWidth", Width);
ds@1952
   340
	TE_WriteFloat("m_fEndWidth", EndWidth);
ds@1952
   341
	TE_WriteFloat("m_fAmplitude", Amplitude);
ds@1952
   342
	TE_WriteNum("r", Color[0]);
ds@1952
   343
	TE_WriteNum("g", Color[1]);
ds@1952
   344
	TE_WriteNum("b", Color[2]);
ds@1952
   345
	TE_WriteNum("a", Color[3]);
ds@1952
   346
	TE_WriteNum("m_nSpeed", Speed);
ds@1952
   347
	TE_WriteNum("m_nFadeLength", FadeLength);
ds@1952
   348
}
ds@1952
   349
ds@1952
   350
/**
ds@1952
   351
 * Sets up an entity to entity laser effect.
ds@1952
   352
 *
ds@1952
   353
 * @param StartEntity		Entity index from where the beam starts.
ds@1952
   354
 * @param EndEntity		Entity index from where the beam ends.
ds@1952
   355
 * @param ModelIndex		Precached model index.
ds@1952
   356
 * @param HaloIndex		Precached model index.
ds@1952
   357
 * @param StartFrame		Initital frame to render.
ds@1952
   358
 * @param FrameRate		Beam frame rate.
ds@1952
   359
 * @param Life			Time duration of the beam.
ds@1952
   360
 * @param Width			Initial beam width.
ds@1952
   361
 * @param EndWidth		Final beam width.
ds@1952
   362
 * @param FadeLength		Beam fade time duration.
ds@1952
   363
 * @param Amplitude		Beam amplitude.
ds@1952
   364
 * @param color			Color array (r, g, b, a).
ds@1952
   365
 * @param Speed			Speed of the beam.
ds@1952
   366
 * @noreturn
ds@1952
   367
 */
ds@1952
   368
stock TE_SetupBeamLaser(StartEntity, EndEntity, ModelIndex, HaloIndex, StartFrame, FrameRate, Float:Life, 
ds@1952
   369
				Float:Width, Float:EndWidth, FadeLength, Float:Amplitude, const Color[4], Speed)
ds@1952
   370
{
ds@1952
   371
	TE_Start("BeamLaser");
ds@1952
   372
	TE_WriteEncodedEnt("m_nStartEntity", StartEntity);
ds@1952
   373
	TE_WriteEncodedEnt("m_nEndEntity", EndEntity);
ds@1952
   374
	TE_WriteNum("m_nModelIndex", ModelIndex);
ds@1952
   375
	TE_WriteNum("m_nHaloIndex", HaloIndex);
ds@1952
   376
	TE_WriteNum("m_nStartFrame", StartFrame);
ds@1952
   377
	TE_WriteNum("m_nFrameRate", FrameRate);
ds@1952
   378
	TE_WriteFloat("m_fLife", Life);
ds@1952
   379
	TE_WriteFloat("m_fWidth", Width);
ds@1952
   380
	TE_WriteFloat("m_fEndWidth", EndWidth);
ds@1952
   381
	TE_WriteFloat("m_fAmplitude", Amplitude);
ds@1952
   382
	TE_WriteNum("r", Color[0]);
ds@1952
   383
	TE_WriteNum("g", Color[1]);
ds@1952
   384
	TE_WriteNum("b", Color[2]);
ds@1952
   385
	TE_WriteNum("a", Color[3]);
ds@1952
   386
	TE_WriteNum("m_nSpeed", Speed);
ds@1952
   387
	TE_WriteNum("m_nFadeLength", FadeLength);
ds@1952
   388
}
ds@1952
   389
ds@1952
   390
/**
ds@1952
   391
 * Sets up a beam ring effect.
ds@1952
   392
 *
ds@1952
   393
 * @param StartEntity		Entity index from where the ring starts.
ds@1952
   394
 * @param EndEntity		Entity index from where the ring ends.
ds@1952
   395
 * @param ModelIndex		Precached model index.
ds@1952
   396
 * @param HaloIndex		Precached model index.
ds@1952
   397
 * @param StartFrame		Initital frame to render.
ds@1952
   398
 * @param FrameRate		Ring frame rate.
ds@1952
   399
 * @param Life			Time duration of the ring.
ds@1952
   400
 * @param Width			Beam width.
ds@1952
   401
 * @param Amplitude		Beam amplitude.
ds@1952
   402
 * @param color			Color array (r, g, b, a).
ds@1952
   403
 * @param Speed			Speed of the beam.
ds@1952
   404
 * @param Flags			Beam flags.
ds@1952
   405
 * @noreturn
ds@1952
   406
 */
ds@1952
   407
stock TE_SetupBeamRing(StartEntity, EndEntity, ModelIndex, HaloIndex, StartFrame, FrameRate, Float:Life, Float:Width, Float:Amplitude, const Color[4], Speed, Flags)
ds@1952
   408
{
ds@1952
   409
	TE_Start("BeamRing");
ds@1952
   410
	TE_WriteEncodedEnt("m_nStartEntity", StartEntity);
ds@1952
   411
	TE_WriteEncodedEnt("m_nEndEntity", EndEntity);
ds@1952
   412
	TE_WriteNum("m_nModelIndex", ModelIndex);
ds@1952
   413
	TE_WriteNum("m_nHaloIndex", HaloIndex);
ds@1952
   414
	TE_WriteNum("m_nStartFrame", StartFrame);
ds@1952
   415
	TE_WriteNum("m_nFrameRate", FrameRate);
ds@1952
   416
	TE_WriteFloat("m_fLife", Life);
ds@1952
   417
	TE_WriteFloat("m_fWidth", Width);
ds@1952
   418
	TE_WriteFloat("m_fEndWidth", Width);
ds@1952
   419
	TE_WriteFloat("m_fAmplitude", Amplitude);
ds@1952
   420
	TE_WriteNum("r", Color[0]);
ds@1952
   421
	TE_WriteNum("g", Color[1]);
ds@1952
   422
	TE_WriteNum("b", Color[2]);
ds@1952
   423
	TE_WriteNum("a", Color[3]);
ds@1952
   424
	TE_WriteNum("m_nSpeed", Speed);
ds@1952
   425
	TE_WriteNum("m_nFadeLength", 0);
ds@1952
   426
	TE_WriteNum("m_nFlags", Flags);
ds@1952
   427
}
ds@1952
   428
ds@1952
   429
/**
ds@1952
   430
 * Sets up a follow beam effect.
ds@1952
   431
 *
ds@1952
   432
 * @param EntIndex		Entity index from where the beam starts.
ds@1952
   433
 * @param ModelIndex		Precached model index.
ds@1952
   434
 * @param HaloIndex		Precached model index.
ds@1952
   435
 * @param Life			Time duration of the beam.
ds@1952
   436
 * @param Width			Initial beam width.
ds@1952
   437
 * @param EndWidth		Final beam width.
ds@1952
   438
 * @param FadeLength		Beam fade time duration.
ds@1952
   439
 * @param color			Color array (r, g, b, a).
ds@1952
   440
 * @noreturn
ds@1952
   441
 */
ds@1952
   442
stock TE_SetupBeamFollow(EntIndex, ModelIndex, HaloIndex, Float:Life, Float:Width, Float:EndWidth, FadeLength, const Color[4])
ds@1952
   443
{
ds@1952
   444
	TE_Start("BeamFollow");
ds@1952
   445
	TE_WriteEncodedEnt("m_iEntIndex", EntIndex);
ds@1952
   446
	TE_WriteNum("m_nModelIndex", ModelIndex);
ds@1952
   447
	TE_WriteNum("m_nHaloIndex", HaloIndex);
ds@1952
   448
	TE_WriteNum("m_nStartFrame", 0);
ds@1952
   449
	TE_WriteNum("m_nFrameRate", 0);
ds@1952
   450
	TE_WriteFloat("m_fLife", Life);
ds@1952
   451
	TE_WriteFloat("m_fWidth", Width);
ds@1952
   452
	TE_WriteFloat("m_fEndWidth", EndWidth);
ds@1952
   453
	TE_WriteNum("m_nFadeLength", FadeLength);
ds@1952
   454
	TE_WriteNum("r", Color[0]);
ds@1952
   455
	TE_WriteNum("g", Color[1]);
ds@1952
   456
	TE_WriteNum("b", Color[2]);
ds@1952
   457
	TE_WriteNum("a", Color[3]);
ds@1952
   458
}