This plugin is based on
Eggman's
Amplifier and
Geel9 &
Benjamuffin's
Repair Node plugins.
It will also, optionally, present a menu when building a dispenser to allow the engineer to pick if he wants a Dispenser, an Amplifier or a Repair Node. For those that don't want to be bothered with menus, you can also specify which to build ahead of time.
This plugin can also be used in conjunction with my
Remote Control/Build Plugin to build Amplifiers and Dispensers.
This plugin also has an extensive native interface that allows it to be called from other plugins.
The following convars are available to customize the plugin:
ampnode_spawn_menu (1/0, default 0)
Display selection menu when engineers spawn?
ampnode_regeneration (default 10)
Amount of metal amplifiers and repair nodes regenerate per second.
ampnode_max (default 400)
Maximum amount of metal an amplifier or repair node can hold.
amplifier_enable (1/0, default 1)
Enable or disable Amplifiers.
amplifier_upgradable (1/0, default 0)
Allow the amplifier to be upgraded? (1=yes,0=no)
amplifier_metal (default 5)
Amount of metal to use to apply a condition to a player (per second).
amplifier_percent (default 100)
Percent chance of the amplifier applying the condition.
amplifier_condition (default 16)
Condition that The amplifier dispenses (11=full crits, 16=mini crits, etc...).
amplifier_particle (1/0, default 1)
Enable the Buffed Particle? (1=yes,0=no)
amplifier_wallblock (1/0, default 1)
Teammates can (0) or can not (1) get crits through walls, players, props etc.
amplifier_sg_wrangler_mini_crit (1/0, default 1)
Controlled (by Wrangler) SentryGun will get mini-crits, if engineer near AMP
amplifier_range_1 (default 100.0)
Distance the amplifier works at level 1.
amplifier_range_2 (default 200.0)
Distance the amplifier works at level 2.
amplifier_range_3 (default 300.0)
Distance the amplifier works at level 3.
repair_node_enable (1/0, default 1)
Enable or disable Repair Nodes.
repair_node_metal (1/0, default 1)
Repair nodes use metal? (1=yes,0=no)
repair_node_percent (default 100)
Percent chance of the repair node repairing something.
repair_node_team (1/0, default 1)
Allow repair nodes to teammate's buildings? (1=yes,0=no)
repair_node_mini (1/0, default 0)
Allow repair nodes to repair mini sentries? (1=yes,0=no)
repair_node_range_1 (default 300.0)
How far away the Repair Node will heal a building at level 1.
repair_node_range_2 (default 400.0)
How far away the Repair Node will heal a building at level 2.
repair_node_range_3 (default 500.0)
How far away the Repair Node will heal a building at level 3.
repair_node_regen_1 (default 15)
How much the Repair Node will heal a building, per 2 seconds, at level 1.
repair_node_regen_2 (default 20)
How much the Repair Node will heal a building, per 2 seconds, at level 2.
repair_node_regen_3 (default 30)
How much the Repair Node will heal a building, per 2 seconds, at level 3.
repair_node_ammo_1 (default 0)
How much ammo the Repair Node will replenish, per 2 seconds, at level 1.
repair_node_ammo_2 (default 5)
How much ammo the Repair Node will replenish, per 2 seconds, at level 2.
repair_node_ammo_3 (default 10)
How much ammo the Repair Node will replenish, per 2 seconds, at level 3.
repair_node_rockets_1 (default 0)
How many rockets the Repair Node will replenish, per 2 seconds, at level 1.
repair_node_rockets_2 (default 0)
How many rockets the Repair Node will replenish, per 2 seconds, at level 2.
repair_node_rockets_3 (default 2)
How many rockets the Repair Node will replenish, per 2 seconds, at level 3.
The following commands are available:
sel,
amp,
amplifier: Select whether to build a Dispenser, Amplifier or Repair Nodes, can also specify to prompt each time a dispenser is built.
amp_help: Displays help on how to use the plugin.
This is the native interface, callable from other plugins:
PHP Code:
/**
* Assume control of the Amplifier plugin
*
* @param plugin_only Set to 1 to assume complete control of Amplifier.
* @return none
*/
native ControlAmpNode(bool:plugin_only=true);
/**
* Set the Building Type flag to Repair Node
*
* @param client Client index
* @param type Type of building to use when client builds Dispensers.
* @return none
*/
native SetBuildingType(client, TFExtObjectType:type);
/**
* Set the Building Type flag to Amplifier
*
* @param client Client index
* @param range Range of the amplifier (-1.0=use convar)
* @param condition Condition to set players within range of the amplifier (-1=use convar)
* @param percent Percent (0-100) chance of applying the condition (-1=use convar)
* @param enable Set true to enable the player to build Amplifiers.
* @param select Set true to set player's BuildingType to Amplifier
* @return none
*/
native SetAmplifier(client, TFCond:condition=TFCond:-1,
const Float:range[4]={-1.0,-1.0,-1.0,-1.0},
percent=-1, bool:enable=true, bool:select=false);
/**
* Set the Building Type flag to Repair Node
*
* @param client Client index
* @param range Range of the repair node for each level (-1.0=use convar).
* @param regen Regen rate of the repair node for each level (-1=use convar).
* @param shells Rate the repair node replenishes sentry shells for each level (-1=use convar).
* @param rockets Rate the repair node replenishes sentry rockets for each level (-1=use convar).
* @param team Flag to allow the repair node to repair team mates buildings. (0=no,1=yes,-1=use convar).
* @param mini Flag to allow the repair node to repair mini buildings. (0=no,1=yes,-1=use convar).
* @param percent Percent (0-100) chance of repairing the building (-1=use convar)
* @param enable Set true to enable the client to build Repair Nodes
* @param select Set true to set player's BuildingType to Repair Node
* @return none
*/
native SetRepairNode(client, const Float:range[4]={-1.0,-1.0,-1.0,-1.0},
const regen[4]={-1,-1,-1,-1}, const shells[4]={-1,-1,-1,-1},
const rockets[4]={-1,-1,-1,-1}, team=-1, mini=-1,
percent=-1, bool:enable=true, bool:select=false);
/**
* Count how many Buildings of a given type the client has constructed.
*
* @param index Client index
* @param type Type of building to count.
* @return The number of buildings of the given type the client has constructed.
*/
native CountConvertedBuildings(client, TFExtObjectType:type);
/**
* Converts a dispenser into an Amplifier
*
* @param entity Dispenser Entity to convert.
* @param client Client index of the owner.
* @param range Range of the amplifier (-1.0=use convar)
* @param condition Condition to set players within range of the amplifier (-1=use convar)
* @param percent Percent (0-100) chance of applying the condition (-1=use convar)
* @return none
*/
native ConvertToAmplifier(entity, client, TFCond:condition=TFCond:-1,
const Float:range[4]={-1.0,-1.0,-1.0,-1.0},
percent=-1);
/**
* Converts a dispenser into a Repair Node
*
* @param entity Dispenser Entity to convert.
* @param client Client index of the owner.
* @param range Range of the repair node for each level (-1.0=use convar).
* @param regen Regen rate of the repair node for each level (-1=use convar).
* @param shells Rate the repair node replenishes sentry shells for each level (-1=use convar).
* @param rockets Rate the repair node replenishes sentry rockets for each level (-1=use convar).
* @param team Flag to allow the repair node to repair team mates buildings. (0=no,1=yes,-1=use convar).
* @param mini Flag to allow the repair node to repair mini buildings. (0=no,1=yes,-1=use convar).
* @param percent Percent (0-100) chance of repairing the building (-1=use convar)
* @return none
*/
native ConvertToRepairNode(entity, client, const Float:range[4]={-1.0,-1.0,-1.0,-1.0},
const regen[4]={-1,-1,-1,-1}, const shells[4]={-1,-1,-1,-1},
const rockets[4]={-1,-1,-1,-1}, team=-1, mini=-1, percent=-1);
/**
* Gets called when the amplifier applys a condition to someone
*
* @param builder: The index of the client that built the amplifier.
* @param client: The index of the player that is being afected.
* @param condition The condition beign applied to the client.
* @return Plugin_Stop will prevent the client from being affected.
*/
forward Action:OnAmplify(builder,client,TFCond:condition);
Change log
11/9/2010 - v3.0
11/10/2010 - v3.1
- Added amplifier_upgradable convar to amp_node to prevent amplifiers from being upgraded.
- Changed amp_node so that Repair nodes can also replenish the sentries ammo (shells and rockets).
- Fixed some bugs.
11/15/2010 - v3.2
- Fixed amp_node requiring ztf2grab.
- Changed ammo regeneration to cap replenishment at the amount of metal instead of not allowing replenishment if there is insufficient metal..
- Fixed ConvertToRepairNode() setting RepairNodeRegen[] for rockets and shells.
11/16/2010 - v3.3
- Changed to use NoColor translations (without color codes) when compiled without colors.inc
- Ensure dispenser model doesn't become visible for repair nodes after upgrading.
11/26/2010 - v3.4
- Changed the Convert primitives to use the DispCheckStage1 timer handler instead of DispCheckStage2
- Fixed amplifiers and repair nodes not working when using the Convert natives without calling the Set native first.
- Initialize the Native* variables to -1 (so convars are used) in OnClientAuthorized()
12/10/2010 - v3.5
- Changed amp_node to have working slow, zoom (slower) and bonked (loser slow) amplifiers
- Changed amp_node to have working bleed and stun amplifiers
2/23/2012 - v4.0
- Changed SetRepairNode() and ConvertToRepairNode() to specify 1 value for rockets instead of an array
- Fixed invalid client index errors
- Added RegenBuffed and MarkedForDeath Amplifiers
- Changed to use the ResourceManager (if available)
- Updated for changes to TF2/SourceMod
6/26/2012 - v4.1
- Changed to use INVALID_ENT_REFERENCE for invalid refs instead of 0
- Replace RemoveEdict(ent) with AcceptEntityInput(ent, "kill")
- Added AutoExecConfig() to create a config file
6/26/2012 - v4.2
- Added ampnode_announce convar to disable announcements
8/25/2012 - v4.3
- Added Announce cvar to amp_node
- Fixed repair nodes sometimes reverting to (or merging with) dispenser models
- Fixed sappers permanently breaking amplifiers and repair nodes
- Revert amplifiers and repair nodes to use the dispenser model while sapped so the sapper is visible