#include <amxmodx>
#include <d2lod>

new PLUGIN_NAME[] = "Example Skill"
new PLUGIN_AUTHOR[] = "xbatista"
new PLUGIN_VERSION[] = "1.0"

new Skill_Level = 1;

new g_SkillId;

new g_iCurSkill[33];

public plugin_init() 
{
	register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)

	// We are registering a Skill.
	// The hero value and display type you can look in /include/d2lod.inc
	g_SkillId = register_d2_skill(PLUGIN_NAME, "Some example", AMAZON, Skill_Level, DISPLAY)

}

public d2_skill_selected(id, skill_id)
{
	// This Forward called when player selects the skill with E button

	g_iCurSkill[id] = skill_id;
}

public d2_skill_fired(id)
{
	// This Forward called when player fires his skill, 'bind t +skills'

	if ( g_iCurSkill[id] == g_SkillId )
	{
		// do something
	}
}

public d2_takedamage(victim, attacker, Float:iDamage[1])
{
	// Called when the player gets damaged, you can also change damage, example : iDamage[0] += 5.0
}

public d2_logged(id, log_type)
{
	// Called when player connects to the server, and loads his character, value is LOGGED - 1 , also called when player gets unlogged when types /spec, value is UNLOGGED - 0.

	if ( log_type == LOGGED )
	{
		// player loaded his character, do something
	}
	else
	{
		// player has been switched (unlogged) to the main connect menu, do something
	}
}
