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