Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using LeagueSharp;
- using LeagueSharp.Common;
- using SharpDX;
- namespace KatarinaTutorial
- {
- class Program
- {
- public static Spell Q;
- public static Spell W;
- public static Spell E;
- public static Spell R;
- private static Menu _menu;
- private static Orbwalking.Orbwalker _orbwalker;
- static void Main(string[] args)
- {
- Game.PrintChat("Katarina Script loaded");
- Game.OnGameUpdate += Game_OnGameUpdate;
- //We need to create our Spells. The 1st parameter is the SpellSlot and the 2nd one is the range/radius of the spell.
- Q = new Spell(SpellSlot.Q, 675);
- W = new Spell(SpellSlot.W, 375);
- E = new Spell(SpellSlot.E, 700);
- R = new Spell(SpellSlot.R, 550);
- Utility.HpBarDamageIndicator.DamageToUnit = CalculateDamage;
- Utility.HpBarDamageIndicator.Enabled = true;
- InitializeMenu();
- }
- static void Game_OnGameUpdate(EventArgs args)
- {
- }
- static void InitializeMenu()
- {
- //We create a Menu for the Orbwalker
- var orbwalkerMenu = new Menu("Orbwalker", "Orbwalker");
- //This creates a new instance of the Orbwalker with the menu from above
- _orbwalker = new Orbwalking.Orbwalker(orbwalkerMenu);
- //This creates the main Menu, the 1st parameter is the display Name, the 2nd one the internal Name and the 3rd one defines if this is a root menu.
- _menu = new Menu(ObjectManager.Player.ChampionName, ObjectManager.Player.ChampionName, true);
- //This adds the Main Menu to LeagueSharp so it's displayed.
- _menu.AddToMainMenu();
- //This is not necessary. It only shows a sub menu with infos about the script
- _menu.AddSubMenu(new Menu("Info", "Info"));
- {
- _menu.SubMenu("Info").AddItem(new MenuItem("Author", "By coolerfarmer"));
- _menu.SubMenu("Info").AddItem(new MenuItem("Version", "Version: 1.0.0"));
- }
- //This creates a new SubMenu for the TargetSelector
- _menu.AddSubMenu(new Menu("Target Selector", "Target Selector"));
- //here we add the TargetSelector to the menu created above.
- TargetSelector.AddToMenu(_menu.SubMenu("Target Selector"));
- //Finally we add the Orbwalking Menu from above to our Main Menu
- _menu.AddSubMenu(orbwalkerMenu);
- }
- static float CalculateDamage(Obj_AI_Hero target)
- {
- //Create a variable to add all the attack damages
- double damage = 0d;
- //when the Q spell is ready we add the damage of the hit AND the additional damage when striking a marked target
- if (Q.IsReady())
- damage += ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q) + //Damage of the attack
- ObjectManager.Player.GetSpellDamage(target, SpellSlot.Q, 1); //Damage of the mark
- //We do the same routine with the W spell
- if (W.IsReady())
- damage += ObjectManager.Player.GetSpellDamage(target, SpellSlot.W);
- //And the E
- if (E.IsReady())
- damage += ObjectManager.Player.GetSpellDamage(target, SpellSlot.E);
- //The Ultimate is a bit special. the function R.IsReady() only returns true if there's an enemy in range
- //otherwise the spell is supressed and the function returns false. To fix this we need to check
- //if the spell is either ready or surpressed. The problem is that the Spell is also surpressed when it's not yet leveled.
- //So we need to check if the level is > 0
- if (R.IsReady() || (ObjectManager.Player.GetSpell(R.Slot).State == SpellState.Surpressed && R.Level > 0))
- damage += ObjectManager.Player.GetSpellDamage(target, SpellSlot.R, 1); //the 3rd parameter is the state of the skill. In this case
- // state = 0 returns the damage of one dagger and state = 1
- // returns the total damage
- return (float) damage;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment