Sam's Flamethrower for Quake III Arena 06/02/2000
=================================================

Mod:      Sam's Flamethrower v1.0
Autor:    Sam (aka NEwT)
eMail:    sam@gweb.de
Homepage: http://www.gweb.de/sam/quake3/    or    http://www.newt.de/quake3/


Installation
============

To use this, unzip the contents of this zip file (pak9_model_flamethrower.pk3) 
in a subdirectory named flamethrower from your quake3 installation path .
For example:
c:\quake3\flamethrower\pak9_model_flamethrower.pk3


Start
=====

To use this mod, start quake with
quake3.exe +set fs_game flamethrower

to check it out type in console:
devmap q3dm17
/give all

Change to the flamethrower (weapon 6, lightninggun) and fire.


Description
===========

With this mod, you have a flamethrower as lightninggun. 
This flamethrower has a short range, the flame beam make direct damage 
and the flames at the end (if it hit something) make splash damage. 
The quad makes the falmethrower very deadly, for all players, including the user ! 
Use the flamethrower always carefully : )
Includes new qvm-files, model, skins (model, ammo, weaponhits), sounds, icons and a programmer tutorial.
Feel free to use this in your mods. 
If you do, it would be great if you send me a copy of your mod and add my name, 
eMail-adress and homepage-url to the readme (no must, feel free).


=====================================================================================


Tutorial:
=========

Beginning:
----------

To make a flamethrower is very easy. 
Ok, in the beginning i've need many try's to check the effects.
I've decided me to change the lightninggun as flamethrower.


Files:
------

The weapon model, skin and icons i've got from another Quake-Version 
and for the sounds i use Kingpin flamethrower sounds. Weaponhits and ammo are form Q3. 
I've modified the files, so that the graphics and sounds are fine for a flamethrower 
and it works with Q3. 


Source:
-------

cgame\cg_weapons.c
==================

Line: 427    

        cgs.media.lightningShader = trap_R_RegisterShader( "lightningBolt" );

change to 

        cgs.media.lightningShader = trap_R_RegisterShader( "rocketExplosion" );

This changed the lightning beam to a flamed beam.


Line: 1343

	case WP_LIGHTNING:
		// no explosion at LG impact, it is added with the beam
		r = rand() & 3;
		if ( r < 2 ) {
			sfx = cgs.media.sfx_lghit2;
		} else if ( r == 2 ) {
			sfx = cgs.media.sfx_lghit1;
		} else {
			sfx = cgs.media.sfx_lghit3;
		}
		mark = cgs.media.holeMarkShader;
		radius = 12;
		break;

change to

	case WP_LIGHTNING:
		// no explosion at LG impact, it is added with the beam 		
		r = rand() & 3;
		if ( r < 2 ) {
			sfx = cgs.media.sfx_lghit2;
		} else if ( r == 2 ) {
			sfx = cgs.media.sfx_lghit1;
		} else {
			sfx = cgs.media.sfx_lghit3;
		}

		mark = cgs.media.burnMarkShader;
		radius = 64;
		break;


We set the mark (wall mark) to a burning mark (like flamethrower) with the radius from the flamethrower. 


Line: 1504  

	switch ( weapon ) {
	case WP_GRENADE_LAUNCHER:
	case WP_ROCKET_LAUNCHER:
		CG_MissileHitWall( weapon, 0, origin, dir );
		break;
	default:
		break;
	}


change to

	switch ( weapon ) {
	case WP_GRENADE_LAUNCHER:
	case WP_ROCKET_LAUNCHER:
	case WP_LIGHTNING:
		CG_MissileHitWall( weapon, 0, origin, dir );
		break;
	default:
		break;
	}


Here we include the explosion if we hit a player.
So it looks like that the player burn.

===============================================================================

game\bg_misc.c
==============

Line: 252

/*QUAKED weapon_lightning (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
	{
		"weapon_lightning", 
		"sound/misc/w_pkup.wav",
        { "models/weapons2/lightning/lightning.md3", 
		0, 0, 0},
/* icon */		"icons/iconw_lightning",
/* pickup */	"Lightning Gun",
		100,
		IT_WEAPON,
		WP_LIGHTNING,
/* precache */ "",
/* sounds */ ""
	},


change to 


/*QUAKED weapon_lightning (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
	{
		"weapon_lightning", 
		"sound/misc/w_pkup.wav",
        { "models/weapons2/lightning/lightning.md3", 
		0, 0, 0},
/* icon */		"icons/iconw_lightning",
/* pickup */	"Flamethrower",
		200,
		IT_WEAPON,
		WP_LIGHTNING,
/* precache */ "",
/* sounds */ ""
	},


Now the name of the weapon is Flamethrower and the beginning ammo is 200.


Line: 398

/*QUAKED ammo_lightning (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
	{
		"ammo_lightning",
		"sound/misc/am_pkup.wav",
        { "models/powerups/ammo/lightningam.md3", 
		0, 0, 0},
/* icon */		"icons/icona_lightning",
/* pickup */	"Lightning",
		60,
		IT_AMMO,
		WP_LIGHTNING,
/* precache */ "",
/* sounds */ ""
	},


change to


/*QUAKED ammo_lightning (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
	{
		"ammo_lightning",
		"sound/misc/am_pkup.wav",
        { "models/powerups/ammo/lightningam.md3", 
		0, 0, 0},
/* icon */		"icons/icona_lightning",
/* pickup */	"Flamethrower",
		100,
		IT_AMMO,
		WP_LIGHTNING,
/* precache */ "",
/* sounds */ ""
	},


Now the name of the ammo is Flamethrower and one of these ammo pack gives 100 munition.

===============================================================================

game\bg_public.h
================

Line: 22

#define	LIGHTNING_RANGE		768

change to

#define	LIGHTNING_RANGE		300


This makes the beam of the gun shorter. Flamethrowers have no long range.

===============================================================================

game\g_missile.c
================

Line: 394

	VectorScale( dir, 900, bolt->s.pos.trDelta );

change to

	if (self->s.weapon == WP_LIGHTNING) {
	VectorScale( dir, 5000, bolt->s.pos.trDelta );
	}
	else {
	VectorScale( dir, 900, bolt->s.pos.trDelta );
	}        

We set the missile step to 5000 if the weapon are the lightninggun.
So we see the missile not, only the explosion.

===============================================================================

game\bg_pmove.c
===============

Line: 1539

	case WP_LIGHTNING:
		addTime = 50;
		break;

change to 

	case WP_LIGHTNING:
		addTime = 60;
		break;

We set the firerate a little slower.

===============================================================================

game\g_weapon.c
===============

Line: 481

void Weapon_LightningFire( gentity_t *ent ) {
	trace_t		tr;
	vec3_t		end;
	gentity_t	*traceEnt, *tent;
	int			damage;
                
	damage = 8 * s_quadFactor;

change to 

void Weapon_LightningFire( gentity_t *ent ) {
	trace_t		tr;
	vec3_t		end;
	gentity_t	*traceEnt, *tent, *m;
	int			damage;
                
	damage = 3 * s_quadFactor;


We need a new gentity_t: m
We reduce the lightning damage from our flamethrower beam.


Line: 511

	if ( traceEnt->takedamage) {
		G_Damage( traceEnt, ent, ent, forward, tr.endpos,
			damage, 0, MOD_LIGHTNING);
	}	
}


change to


	if ( traceEnt->takedamage) {
		G_Damage( traceEnt, ent, ent, forward, tr.endpos,
			damage, 0, MOD_LIGHTNING);
	}

	m = fire_rocket (ent, muzzle, forward);
	m->damage = 2;
	m->splashDamage = 15;
	m->splashRadius = 60;
	m->damage *= s_quadFactor;
	m->splashDamage *= s_quadFactor;
}


If the Lightninggun hit something, we include a rocketexplosion at the end.
We add a little bit direct rocket damage. Its additional to the lightningdamage and only in the beam present.
We add splash damage of the flames in a radius.
At last we multiple the damages with the quad factor.
The quad makes a flamethrower very dangerous and deadly, for other players and for the user too : )


=====================================================================================


Have a lot of fun,
                         Sam (aka NEwT)


=========================================================================

                          Sam's Quake3Arena Page
                         ------------------------

    http://www.gweb.de/sam/quake3/   or   http://www.newt.de/quake3/

                            eMail: sam@gweb.de

=========================================================================
