public void OnActivate(IObjAiBase unit, IBuff buff, ISpell ownerSpell) { var champ = unit as IChampion; string dashBase = "Yasuo_Base_E_Dash.troy"; string dashHit = "Yasuo_Base_E_dash_hit.troy"; //Skine göre kostüm if (champ.Skin == 2) { dashBase = "Yasuo_Skin1_E_Dash.troy"; dashHit = "Yasuo_Skin1_E_dash_hit.troy"; } CreateTimer(0.03f, () => { unit.IsCastingSpell = true; }); CreateTimer(2 * buff.Duration / 3, () => { unit.IsCastingSpell = false; }); AddParticleTarget(unit, dashBase, unit); AddParticleTarget(unit, dashHit, target); var to = Vector2.Normalize(target.GetPosition() - unit.GetPosition()); ownerSpell.DashToLocation(unit, target.X + to.X * 300f, target.Y + to.Y * 300f, 1100f, false, "SPELL3"); }
public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target) { // Calculate net coords var current = new Vector2(owner.X, owner.Y); var to = Vector2.Normalize(new Vector2(spell.X, spell.Y) - current); var range = to * 750; var trueCoords = current + range; // Calculate dash coords/vector var dash = Vector2.Negate(to) * 500; var dashCoords = current + dash; spell.DashToLocation(owner, dashCoords.X, dashCoords.Y, 1000, true, "Spell3b"); spell.AddProjectile("CaitlynEntrapmentMissile", owner.X, owner.Y, trueCoords.X, trueCoords.Y); }
public void OnFinishCasting(IObjAiBase owner, ISpell spell, IAttackableUnit target) { var current = new Vector2(owner.X, owner.Y); var dist = Vector2.Distance(current, new Vector2(target.X, target.Y)); var offset = 100; var to = Vector2.Normalize(new Vector2(target.X, target.Y) - current); var trueCoords = current + (to * (dist + offset)); //TODO: Dash to the correct location (in front of the enemy IChampion) instead of far behind or inside them spell.DashToLocation(owner, trueCoords.X, trueCoords.Y, 2200, false, "Attack1"); lastTarget = target; AddParticleTarget(owner, "akali_shadowDance_tar.troy", target, 1, ""); var bonusAd = owner.Stats.AttackDamage.Total - owner.Stats.AttackDamage.BaseValue; var ap = owner.Stats.AbilityPower.Total * 0.5f; var damage = 150 + spell.Level * 100 + bonusAd + ap; lastTarget.TakeDamage(owner, damage, DamageType.DAMAGE_TYPE_MAGICAL, DamageSource.DAMAGE_SOURCE_SPELL, false); }