Installation :
--------------

To run this plugin you NEED:

- Latest version of Metamod installed and working (www.metamod.org)
- Latest version of AMX installed and working (http://amxmod.net/amx-dl.php)

It won't work with older version, you NEED at least AMX v0.9.2!!!

Now on how to install the actual plugin:

- Extract file warcraft3.amx to directory cstrike\addons\amx\plugins
- Open cstrike\addons\amx\plugins\plugins.ini
- Add a line containing : warcraft3.amx
- Extract the sound files to base cstrike directory and check they got put in cstrike\sound\warcraft3

Your not done yet, you need to install the warcraft3 AMX module:

For win32 servers:

- Extract file war3_ms.dll to directory cstrike\addons\amx\dlls
- Open cstrike\addons\amx\modules.ini
- Add a line containing : addons/amx/dlls/war3_ms.dll
- Open cstrike\addons\metamod\plugins.ini
- Add a line containing : win32 addons/amx/dlls/war3_ms.dll

For linux servers:

- Extract file war3_ms_i386.so to directory cstrike\addons\amx\dlls
- Open cstrike\addons\amx\modules.ini
- Add a line containing : addons/amx/dlls/war3_ms_i386.so
- Open cstrike\addons\metamod\plugins.ini
- Add a line containing : linux addons/amx/dlls/war3_ms_i386.so

Ok your done now, if you are getting the following error:
"[AMX] Unavailable native functions (plugin "warcraft3.amx")"

Then it could be one of the following:
- AMX fun module isn't installed correctly (read readme.txt from AMX very carefully)
- War3 module isn't installed correctly (check that you installed the warcraft3 AMX module)

If you want to compile warcraft3.sma you will have to also do this:

- Extract file war3.inc to directory cstrike\addons\amx\examples\include

Description: 
------------

When you enter the game you get to choose a race (undead, human, orc or night elf), each race has 3
different skills and an ultimate skill. You start out without any special skills, but as you gain
frags you gain Experience. With each new level of experience you get to select a new skill or upgrade
a skill you already have (the menu will popup at the start of the next round automatically, or you can
do it manually by typing "selectskill" in the console or binding a key to it). Once you get to level 6
you can choose the ultimate skill, to use these your going to need to bind a key to the command "ultimate".
type "war3help" in the game for more details.

Server Settings:
----------------

There are two modes this plugin can be run in: Short term XP and Long term XP.

Short Term XP

This is the default, in this mode XP is gained quite fast as is designed so that you should
be able to reach a high level within 30/40 minutes of playing. Your XP, race and skill information
are reset to 0 on each now map. If you just want to have a quick game then this is the best option.

Long Term XP

This is a new mode added in v2.10, in this mode you gain XP slower than the regular mode
but your XP is kept from map to map. Even if you disconnect and come back later your XP is saved
to a text file and you retreive it as soon as you join the server. XP is saved to "war3users.ini"
in the root CStrike directory. The plugin will first try to save XP for each person based on WonID
if that fails it will use the IP address (this is usefull for lans). Please don't mess around with
this file as it will most likely cause the plugin not to load properly.

To activate this mode you must set "mp_savexp 1"

please note that this will not take effect until the next map change. Also there is another server
variable that will help you adjust the speed at which you gain levels. "mp_xpmultiplier 1.0", the
default is 1.0, by changing this to say 0.5 it would allow you to gain a level at half the normal
xp required for that level. "mp_xpmultiplier 2.0" would require you to gain twice as much XP to reach
the same level. This is usefull for say lan parties where you want to play over the whole week-end,
you could adjust it take make sure you would reach level 10 by the end of the week-end but not before.

XP is saved for each race independently, this means that you can play as one race and then switch to
another race starting from 0 xp. But then if you switch back to your original race you will regain the
XP you had.

XP does not stay forever though, once per day the war3users.ini is updated removing any inactive entries.
If you don't connect to the server for a certain number of days you will be removed, there are two cvars
for this:

"sv_daysbeforedelete" (default 1)
"sv_dayslevelmodifier" (default 3)

sv_daysbeforedelete will set the number of days before you get deleted from the list. The default of 1
allows you to stay "offline" for 1 day without being deleted.

sv_dayslevelmodifier is added to daysbeforedelete to give the total number of days you can stay "offline".
is it easiest to explain by example, say sv_dayslevelmodifier is 3. This means that if you have reached
level 3 you will gain an extra day before being deleted, level 6 will get you 2 extra days, level 9 will get
you 3 extra days.

the formula is given by:

days = sv_daysbeforedelete + level / sv_dayslevelmodifier

days are always rounded down to a whole number
I have made the following table to illustrate how it works with default values (1 and 3):

level	days
-----	----
0	1
1	1
2	1
3	2
4	2
5	2
6	3
7	3
8	3
9	4
10	4

This is to prevent the war3users.ini file from getting too big, while allowing high level players to
keep their settings for longer.

Also if you want to prevent certain maps from being played with longterm xp, create a file named
war3maps.ini and place it in your cstrike root directory and put the name of the maps you want
on a seperate line, for example:

aim_map
awp_map
aim_ak-colt


Console Commands
----------------

Client:
"selectskill" - Allows you to select skills before the start of the next round
"changerace" - Allows you to change race during the game if "mp_allowchangerace" is "1"
"playerskills" - Shows you what skills other players have chosen
"skillsinfo" - Shows you what each skill does for the race you have selected
"itemsinfo" - Shows you a list of items and what they do
"iamadirtycheater" - if "sv_cheats" is "1" then it will set you to level 10
"cheatsoff" - will set your level back to what it should be
"war3help" - gives you a list of the console commands
"war3vote" - vote to switch the plugin on and off
"say /changerace" - same as "changerace"
"say /selectskill" - same as "selectskill"
"say /playerskills" - same as "playerskills"
"say /skillsinfo" - same as "skillinfo"
"say /itemsinfo" - same as "itemsinfo"
"say /level" - displays level, race and skill information
"say /war3vote" - vote to switch the plugin on or off
"say /war3help" - displays info about the plugin

Server:
"sv_warcraft3" - Enable/Disable the plugin (default 1, enabled)
"sv_allowwar3vote" - Enabled/Disable voting (default 1, enabled)
"sv_cheats" - this is a standard HL cvar, but you need this if you want to cheat
"mp_allowchangerace" - Allow people to change race during the game (default 0, disabled)
"mp_forceskin" - Forces player to choose skin according to race (default 0, disabled)
"mp_grenadeprotection" - prevents buying more than 1 HE gren per round (default 1, enabled)
"mp_weaponxpmodifier" - gives additional XP for using certain weaker weapons (default 1, enabled)
"amx_vote_delay" - set delay between which votes can be started (default 60)
"amx_vote_time" - set the amount of time you have to vote (default 10)
"amx_votewar3_ratio" - set the minimum ratio of votes required (default 0.40)
"amx_vote_answers" - display player votes (default 1, enabled)
"mp_savexp" - save XP to a txt file and restore it when player reconnects (default 0)
"mp_xpmultiplier" - set the level required to gain a level as a multiple (default 1.0)
"sv_daysbeforedelete" - see server settings above (default 1)
"sv_dayslevelmodifier" - see server settings above (default 3)


Skill Descriptions
------------------

UNDEAD

Vampiric Aura: Gives you (15%, 30% or 45%) of the damage you do in attack back as health,
               (i.e. if you shoot someone and do 100 hp damage you will get back either
               (15, 30 or 45 hp) back depending on the skill level)

Unholy Aura: Gives you a speed boost, also all weapons make you go at the same speed
             (running with knife will not make you move faster than running with AWP) 

Levitation: Allows you to jump higher, basically reduces your gravity to reach high places
            you wouldn't normally be able to reach. 

Ultimate, Suicide Bomber: player will explode when he dies, killing enemies around him

HUMAN

Invisibility: You become partially invisible

Devotion Aura: Gives you more heatlh at the start of each round (115, 130, 145)

Bash: When you shoot someone you have a (15%, 30% or 45%) chance of rendering them immobile
      for 1 second. (their maxspeed is set to 0 for a second) 

Ultimate, Teleport: Ability to teleport to team mates (10 second cooldown)

ORC

Critical Strike: Gives you a 15% chance of doing (2, 3, or 4) times normal damage on each shot

Critical Grenade: Will ALWAYS do (2, 4 or 6) times normal damage when you hit someone with
                  a grenade.

Equipment Reincarnation (Ankh): Gives you a (33%, 67% or 100%) chance in respawning with the
                                equipment you had before you died last round. 

Ultimate, Chain Lightning: Ability to cast lightning jumping from player to player harming them,
                           damage decreases by 2/3 each jump.

NIGHT ELF

Evasion: Gives you a (10%, 20% or 30%) chance of evading a shot, i.e. you will not lose any
         health over it but it will still seem as though you where hit. 

Thorns Aura: Does (10%, 20% or 30%) mirror damage to the person who shot you. 

Trueshot Aura: Does (15%, 30% or 45%) extra damage on each of your bullets. 

Ultimate, Entangle Roots: Immobilises enemy for 10 seconds.


Glow Colors

Red: Extra damage done to the player who glows (Critical Strike/Grenade or Thorns/Trueshot Aura)

White: This is when you get bashed, player glowing can't move for 1 second

Green: You will glow green if you have vampiric aura and do dammage to another player.
       You will also glow green at the start of the round if you have Weapon Reincarnation.

Blue: You glow blue when you evade a shot with the Night Elf Evade ability.


Shop Items
----------

The shop works in the same way as buying weapons, except you can buy anywhere. You can hold only
1 item at a time, with the exception of the tome of experience (you can buy as many as these as
you want without losing your current item). If you buy an item while already holding an
item your previous item will be lost.
In order to buy items you must bind a key to "shopmenu" for example (bind i shopmenu)

Ankh of Reincarnation: If you die you will retreive your equipment the following round

Boots of Speed: Allows you to run faster

Claws of Attack +6: An additional 6 hp will be removed from the enemy on every hit

Cloak of Shadows: Makes you partially invisible, invisibility is increased when holding the knife

Mask of Death: You will receive health for every hit on the enemy

Necklace of Immunity: You will be imune enemy ultimates

Orb of Frost: Slows your enemy down when you hit him

Periapt of Health: Receive extra health

Tome of Experience: Automatically gain experience, the item is used on purchase


Revision History
----------------

- v2.20: - added a shop to buy items, bind a key to "shopmenu" to use it
         - added option to gain more xp with weaker weapons "mp_weaponxpmodifier" default 1
         - changed skillsinfo to show actual skill values rather than hardcoding
         - changed playerinfo to also work when not connected to the server (via rcon)


- v2.11: - reduced thorns aura effectiveness by half
         - vampiric aura no longer restores health higher than 100 hp
         - added race name to the bottom left of the screen
         - added player levels to playerskills command
         - added option to save xp by name "mp_savexpbyname" default 0
         - fixed problem with changing race when mp_savexp was on
         - fixed bug related to aggressive skills and falling damage
         - fixed bug with vampiric aura "green flash" (i hope)
         - fixed bug with undead levitation skill being removed when gaining xp
         - fixed bug where death message sometimes showed wrong message
         - improved grenade spam protection (now only stops you from buying, doesn't kill)

- v2.10: - added hegrenade, flashbang and smokegrenade to Orc equipment reincarnation
         - gain xp for saving hostages, 100 xp per hostage, 50 xp if closeby when rescued
         - gain xp for killing the guy who is trying to save the hostages
         - lose xp for killing hostages
         - fixed bug where you could teleport at the end of the round
         - fixed bug where you would gain xp for planting bomb when sv_warcraft 3 was 0
         - sv_warcraft3 setting is only checked every 30 seconds to improve performance
         - added long term XP (saves your XP in a txt file, but you gain xp slower)
           read the "Server Settings" section above for more info on this
         - finally managed to remove double death messages ("player1 commited suicide"
           followed by "player2 killed player1"). Thanks to the AMX module.

- v2.06: - fixed some bugs

- v2.05: - human now becomes even more invisible while he holds his knife
         - new XP system, no longer based on frags, you gain more xp for killing higher level players
         - gain xp for planting and defusing bomb, and assisting plant/defuse
         - fixed various bugs
         - added command sv_war3debug, logs a lot of the plugin activity to a .log file in
           "addons/amx/logs/war3%m%d.log", will create some quite big files if left running
           for too long. Use this if your server is crashing and then send me the log files
           so i can figure out what is wrong. default 0, disabled.

- v2.04: - removed sv_uploadsounds, sounds will now upload if the server has them, if not
           then HL sounds will be used instead
         - changed mp_forceskin default to 0, skins will still be set according to race
           but not until the player dies. set it to 1 to force skin even if player is alive.
         - say commands now work with and without the slash ("say /level" & "say level" both work)
         - removed race selection before team (was causing more problems than anything else)
         - added voting to switch plugin on and off with "war3vote" and "sv_allowwar3vote"
         - changed weapon reincarnation to equipment reincarnation (also get armor & defuse kit back)

- v2.03: - Fixed a bug with the race selection not working properly on connect
         - Added mp_grenadeprotection, allows you to switch off spam protection
         - Undead with vampiric aura can go up to 105, 110 or 115 health depending on level.
         - Moved "you gained a level" up slightly on the screen

- v2.02: - Added warcraft 3 sounds, if the sounds arn't on your computer it will use HL sounds
         - You now have to select race before team
         - Devotion Aura hp increased for human from 110, 120, 130 to 115, 130, 145
         - Added HE grenade spam protection for orcs with critical grenade
         - Added sv_uploadsounds, allows you to force players to download warcraft3 sounds

- v2.01: - Reduced night elf evasion to (10%, 20%, 30%) chance from (15%, 30%, 45%)
         - Human devotion aura change, you now get extra health instead of armor
         - Human invisibilty increased a little
         - Added say /selectskill, say /skillsinfo, say /playerskills, etc...
         - Chain lightning damage decreases by 1/3 instead of 1/2 and does damage to armor too
         - Teleport now lets your choose a player to teleport to from a menu instead of aiming
           at the player
         - Chain lighting and Entangle roots have 45 second cooldown time
         - added say /war3help and war3help client commands
         - skill selection now automatically appears at round end and when you die
         - added mp_forceskin, forces player to choose skin according to race
         - fixed bug where you could "bash" yourself when falling from high up

- v2.00: - Fixed problem where player gets permanently frozen if hit twice by bash within 1 second
         - Added new client command to view skills information "skillsinfo"
         - Added screen fading so that when your model is glowing you can see it
         - Added level 6 ultimate skills for all races, they are:
           Undead : Suicide Bomber, player will explode when he dies, killing enemies around him
           Humain : Ability to teleport to team mates (10 second cooldown)
           Orc : Ability to cast chain lightning harming all players near the target once per round
           Night Elf : Ability to entangle roots, immobilising enemy for 10 seconds once per round
         - Replaced Endurance Aura with Invisibility for humans (all skills are now unique)
         - Added a cheat to become level 10 when sv_cheats is 1, see client console commands above.
         - Bots will use chain lightning and entangle roots when they shoot players with guns
         - Note: entangle roots does not work on bots (same as bash)

- v1.07: - Fixed problem where if you joined in the middle of the game you would have the level
           of the player who left the game and had the same id as you. Now your level is reset
           to 0 on connect and disconnect.
         - Fixed bug where you would be able to move during freezetime with unholy/endurance aura
         - Fixed bug where you would be able to move when bashed if you had unholy/endurance aura
         - Added description of skills and glows at the top of the file

- v1.06: - Added weapon names and headshots to death messages
         - Fixed a few small bugs related to changing race during the game
         - The 4 compiling "tag mismatch" warnings have gone with v0.8.4 of AMX which is good :)
         - Bots now choose random race and skills (before they wouldn't choose anything)
         - Added client command "playerskills" to see what skills everybody has chosen
         - Changed name of Undead skill "Decreased Gravity" to "Levitation"

- v1.05: - Fixed another bug to do with frags that cropped up :(
         - Added death messages for offensive skills (critical strike/grenade, trueshot, etc)
           you will see 2 death messages :(, one suicide and the new death message added by
           the plugin. with the current version of AMX i think it isn't possible to remove
           the suicide message (but if i am wrong plz tell me how ;).
         - Fixed several bugs with evasion aura, you will find that in previous versions that
           it does very strange things. hopefully its fixed now!
         - Replaced Ankh of Reincarnation with Weapon Reincarnation. What this means is that
           when you die, there is a 33%, 66% or 100% chance that your primary weapon will be 
           saved for the next round. Reason being that the Ankh of Reincarnation code was buggy.

- v1.04: - Better devotion aura, you now get more armor but you have to buy it first its not
           free like before. You now get 150, 200 or 250 armor depending on the skill level
         - Number of "maxspeed set for player" messages decreased

- v1.03: - Fixed evasion bug where you would get 100 health after evading a shot
         - Fixed bug where if you pressed cancel on race select you wouldn't be able to
           select a race if "mp_allowchangerace" was set to "0"
         - added cvar "sv_warcraft3" to switch the plugin on and off

- v1.02: - Skills like Critical Strike/Grenade, Thorns Aura and Trueshot Aura DO kill players
           again, but frags are awarded accordingly (note: scoreboard doesn't refresh immediatly)

- v1.01: - Added red glow for trueshot aura
         - Re-arranged code for extra performance
         - Added server-side svar "mp_allowchangerace" allows you to change race during the game
           if set to 1. use "changerace" command to change race, "selectskill" for skills.
         - Skills like Critical Strike/Grenade, Thorns Aura and Trueshot Aura no longer actually
           kill the enemy they will only set your health down to a minimum of 1
         - Evasion now works better, the player is given 1024 + whatever health he was on if he
           is going to evade the next shot. This way, even if he is shot in the head with an AWP
           he will still survive and allow the plugin to correct his health before he dies.
           1024 health shows up as 0 health on the HUD so the player will not notice.