public static bool Cast(this Spells spell, Vector3 from, Obj_AI_Base ToTarget, Spells.HitChances minhitchance = Spells.HitChances.VeryLow, bool UseExtendRadiusSSCirle = true) { if (spell.spellslot.IsReady()) { if (GetHiChance(from, ToTarget, spell) >= spell.MinHitChance && GetHiChance(from, ToTarget, spell) >= minhitchance) { Vector3 y = new Vector3(0, 0, 0); Vector3 pos = Predictions.GetPrediction(from, ToTarget, spell, true); if (Player.Distance(pos) <= spell.range && pos != y) { if (spell.collision == false) { return(Player.Spellbook.CastSpell(spell.spellslot, pos)); } else { List <Obj_AI_Base> list = Collisions.GetCollision(from, pos, spell); if (list.Count == 0) { Vector3 pos1 = Predictions.GetPrediction(from, ToTarget, spell); return(Player.Spellbook.CastSpell(spell.spellslot, pos1)); } else { return(false); } } } else if (UseExtendRadiusSSCirle == true && spell.skillshottype == SkillshotType.SkillshotCircle) { Spells x = new Spells(spell.spellslot, spell.skillshottype, spell.range + spell.radius - 20, spell.delay, 20, false, spell.speed); Vector3 y1 = new Vector3(0, 0, 0); Vector3 pos1 = Predictions.GetPrediction(from, ToTarget, x, true); if (Player.Distance(pos1) <= x.range && pos1 != y1) { var pos2 = Player.Position.Extend(pos1, spell.range); return(Player.Spellbook.CastSpell(spell.spellslot, pos2)); } else { return(false); } } else { return(false); } } else { return(false); } } else { return(false); } }
public static bool Cast(this Spells spell, bool DragSpell, Vector3 from, Obj_AI_Base ToTarget, Spells.HitChances minhitchance = Spells.HitChances.VeryLow, bool UseExtendRadiusSSCirle = true) { if (spell.spellslot.IsReady()) { if (GetHiChance(from, ToTarget, spell) >= spell.MinHitChance && GetHiChance(from, ToTarget, spell) >= minhitchance) { Vector3 y = new Vector3(0, 0, 0); Vector3 pos = Predictions.GetPrediction(from, ToTarget, spell, true); if (Player.Distance(from) <= spell.range && from.Distance(pos) <= spell.extrarange && pos != y) { if (spell.collision == false) { return(Player.Spellbook.CastSpell(spell.spellslot, from, pos)); } else { List <Obj_AI_Base> list = Collisions.GetCollision(from, pos, spell); if (list.Count == 0) { Vector3 pos1 = Predictions.GetPrediction(from, ToTarget, spell); return(Player.Spellbook.CastSpell(spell.spellslot, from, pos1)); } else { return(false); } } } else { return(false); } } else { return(false); } } else { return(false); } }