using System;
using server;
using vscripts;
using kvlib;
using particles;
using source;
using resource;
namespace abilities
{
public class dota_items : Item
{
public override void OnInit()
{
AssociateKVlibs(this);
}
public class item_dagon_1
{
public override void OnSpellStart()
{
var player = clients.GetCurrentPlayer ();
var damage = this.GetKVValueFor ("damage", item_dagon_1);
var tooltip_range = this.GetKVValueFor ("tooltip_range", item_dagon_1);
var target = this.GetTarget ();
if (target.CanReflect (this) == false)
{
var prindex = Particles.CreateParticle (this, player, particle_name);
prindex.SetControlPoint (0, player.GetOrigins ());
prindex.SetControlPoint (1, target.GetOrigins ());
RleaseObjectIndex (this, prindex);
int[] args = new int[] { player, target, this.GetDamageType(), true, false };
ApllyDamageTable (damage, args);
}
else
{
Reflect (this, target);
}
}
public override void GetDamageType(int damage_type)
{
damage_type = DAMAGE_TYPE_MAGICAL;
}
public override void GetTargetsType(string target_type)
{
target_type = this.GetKVTooltipFor("AbilityUnitTargetType", this.GetAbilityName());
}
public override void GetTeamType(string team_type)
{
team_type = this.GetKVTooltipFor("AbilityUnitTargetTeam", this.GetAbilityName());
}
public override void IsSpellImmunityIgnore(string immune_ignore)
{
immune_ignore = this.GetKVTooltipFor("SpellImmunityType", this.GetAbilityName());
}
public override void AbilityTextureName(string texture)
{
texture = this.GetKVTooltipFor("AbilityTextureName", this.GetAbilityName());
if (texture == null)
{
texture = resource.GetTextureForAbility (this, this.GetAbilityName ());
}
}
}
}
}