示例#1
0
 void Awake()
 {
     if (instance == null)
         instance = this;
     else if (instance != null) {
         Destroy(this);
     }
 }
示例#2
0
 public static void InitializeManager()
 {
     CharacterMgr = CharacterStore.GetInstance();
     ObjectMgr = ObjectManager.GetInstance();
     SkillMgr = SkillManager.GetInstance();
     SpellMgr = SpellManager.GetInstance();
     WorldMgr = WorldManager.GetInstance();
 }
示例#3
0
 public static void InitializeManager()
 {
     DataMgr = DataManager.GetInstance();
     ObjectMgr = ObjectManager.GetInstance();
     SkillMgr = SkillManager.GetInstance();
     SpawnMgr = SpawnManager.GetInstance();
     SpellMgr = SpellManager.GetInstance();
     WorldMgr = WorldManager.GetInstance();
 }
示例#4
0
    public void Invoc(SpellManager.spellType type)
    {
        GameObject[] tab = SpellManager.Instance.GetPrefab(type);

        GameObject invocPrefab = tab[0];

        for (int i = 0; i < nbGeneration; i++)
        {
            Vector3 spawnPosition;
            float x, z;

            do
            {
                x = Random.Range(transform.position.x - invocationRadius, transform.position.x + invocationRadius);
                z = Random.Range(transform.position.z - invocationRadius, transform.position.z + invocationRadius);
                spawnPosition = new Vector3(x, transform.position.y, z);
            }
            while (Vector3.Distance(spawnPosition,transform.position)< detectionRadius);
            
            GameObject go = Instantiate(invocPrefab, spawnPosition, Quaternion.identity) as GameObject;

            /*if (tab[1])
            {
                GameObject model = Instantiate(tab[1], spawnPosition, Quaternion.identity) as GameObject;
                model.transform.parent = go.transform;
            }*/

            CreateModel(type, go);

            go.AddComponent<curveScript>();

            Vector3 center = go.transform.position;

            Collider[] hitColliders = Physics.OverlapSphere(center, detectionRadius);

            bool canExist = true;
            bool nearGround = false;

            foreach (Collider col in hitColliders)
            {
                if (col.tag != "Ground" && col.gameObject != go && col.tag != "InteractableWater")
                {
                    canExist = false;
                }
				else if(col.tag == "Ground" || col.tag == "InteractableWater")
                {
                    nearGround = true;
                }
            }

            if (!canExist || !nearGround)
            {
                Destroy(go);
            }
        }
    }
示例#5
0
    public void Start()
    {
        if (!menuManager)
            menuManager = GameObject.FindObjectOfType<MenuManager>();

        if (!spellMenu)
            spellMenu = GameObject.FindObjectOfType<SpellMenu>();

        spellManager = GetComponent<SpellManager>();
    }
    private void Awake()
    {
        // spell manager
        spellmanager = FindObjectOfType<SpellManager>();
        if (spellmanager == null) Debug.LogError("SpellManager not found");

        // events
        spellmanager.event_spelllist_populated += PopulateUISpellList;
        spellmanager.event_spell_cast += OnSpellCast;
    }
示例#7
0
	//Create a spell with elements from player when player demands it
	public SpellManager CreateSpellNetworked(elementType t, Vector3 position){
		Debug.Log ("Count CreateSpellNetworked");
		SpellManager spell = new SpellManager();
		GameObject g;

		spell.id = spellId;
		spellId++;
//		shield.id = shieldId;
//		shieldId++;
		PhotonView currentPhotonView;
		SpellObserver spellObserver;

		if (spellBook.TryGetValue (t.ToString () + "Spell", out g)) {

			currentPhotonView = g.GetComponent<PhotonView>();
			
			if(currentPhotonView == null){
				currentPhotonView = g.AddComponent<PhotonView>();
			}
			

			spellObserver = g.GetComponent<SpellObserver>();
			if (spellObserver == null){
				spellObserver = g.AddComponent<SpellObserver>();
			}
			
			//				Debug.Log("currentPhotonView Count: " + currentPhotonView.ObservedComponents.Count);
			currentPhotonView.ObservedComponents.Clear();
//			currentPhotonView.ObservedComponents.Add();

			if(currentPhotonView.ObservedComponents!=null && currentPhotonView.ObservedComponents.Count==0)
			{
				currentPhotonView.ObservedComponents.Add(spellObserver);
//				currentPhotonView.ObservedComponents.Add(this.transform);
				//					currentPhotonView.ObservedComponents[0] = shieldObserver;
				//					currentPhotonView.ObservedComponents.
			}
			
			// Instantiate on network (call current element shield from within shield folder)
			spell.instance = (GameObject) PhotonNetwork.Instantiate(
				"Spells/"+g.name, inFrontOfPlayer.position, inFrontOfPlayer.rotation,0);
			Debug.Log("spellspawner:instantiate " + g.name);

//			spell.instance.

//			spell.instance = (GameObject)Instantiate (g, inFrontOfPlayer.position, transform.rotation);
			spell.Setup ();
			spell.spellCollision.elementType = t;
		} else {
			spell = null;
		}
		
		return spell; 
	}
示例#8
0
    void CreateModel(SpellManager.spellType type, GameObject go)
    {


        GameObject model = null;

        switch (type)
        {
            case SpellManager.spellType.ELEMENT:
                
                break;
            case SpellManager.spellType.PLANTE:
                model = SpellManager.Instance.GetPlante1Model();
                break;
            case SpellManager.spellType.PLANTE2:
                model = SpellManager.Instance.GetPlante2Model();
                break;
            case SpellManager.spellType.BUISSON:
                model = SpellManager.Instance.GetBuissonModel();
                break;
            case SpellManager.spellType.ROCK:
                model = SpellManager.Instance.GetRockModel();
                break;
            case SpellManager.spellType.TREE:
                model = SpellManager.Instance.GetTreeModel();
                break;
            case SpellManager.spellType.ARTIFICE:
                
                break;
            case SpellManager.spellType.BUGS:
                
                break;
            case SpellManager.spellType.OISEAUX:
                
                break;
        }

        if (model)
        {
            model = Instantiate(model, go.transform.position, Quaternion.identity) as GameObject;
            model.transform.parent = go.transform;

            float randRotation = Random.Range(0f, 360f);

            model.transform.localEulerAngles = new Vector3(model.transform.localEulerAngles.x, randRotation, model.transform.localEulerAngles.z);

            float randSize = Random.Range(model.transform.localScale.x * 0.7f, model.transform.localScale.x * 1.5f);

            model.transform.localScale = Vector3.one * randSize;
                
        }
        
    }
示例#9
0
        protected override void InitializeSpells(ref SpellManager Spells)
        {
            Spell Q = new Spell(SpellSlot.Q, 625);
            Spell W = new Spell(SpellSlot.W, 600);
            Spell E = new Spell(SpellSlot.E, 600);
            Spell R = new Spell(SpellSlot.R, 625);

            Spells.Add("Q", Q);
            Spells.Add("W", W);
            Spells.Add("E", E);
            Spells.Add("R", R);
        }
示例#10
0
文件: Globals.cs 项目: Mogale/Arctium
 public static void InitializeManager()
 {
     ActionMgr         = ActionManager.GetInstance();
     AddonMgr          = AddonManager.GetInstance();
     SkillMgr          = SkillManager.GetInstance();
     SpellMgr          = SpellManager.GetInstance();
     SpecializationMgr = SpecializationManager.GetInstance();
     DataMgr           = DataManager.GetInstance();
     SpawnMgr          = SpawnManager.GetInstance();
     GossipMgr         = GossipManager.GetInstance();
     ObjectMgr         = ObjectManager.GetInstance();
     WorldMgr          = WorldManager.GetInstance();
 }
示例#11
0
	//Create a spell with elements from player when player demands it
	public SpellManager CreateSpell(elementType t, Vector3 position){
		SpellManager spell = new SpellManager();
		GameObject g;
		if (spellBook.TryGetValue (t.ToString () + "Spell", out g)) {
			//spell.instance = (GameObject)Instantiate (g, position, transform.rotation);
			spell.instance = (GameObject)Instantiate (g, inFrontOfPlayer.position, transform.rotation);
			spell.Setup ();
			spell.spellCollision.elementType = t;
		} else {
			spell = null;
		}

		return spell; 
	}
示例#12
0
    private void Game_OnGameLoad(EventArgs args)
    {
        Player = ObjectManager.Player;

        if (ChampName.ToLower() != Player.ChampionName.ToLower())
            return;

        SkinManager = new SkinManager();
        Spells = new SpellManager();

        InitializeSpells(ref Spells);
        InitializeSkins(ref SkinManager);

        Menu = new Menu("Easy" + ChampName, "Easy" + ChampName, true);

        SkinManager.AddToMenu(ref Menu);

        Menu.AddSubMenu(new Menu("Target Selector", "Target Selector"));
        SimpleTs.AddToMenu(Menu.SubMenu("Target Selector"));

        Menu.AddSubMenu(new Menu("Orbwalker", "Orbwalker"));
        Orbwalker = new Orbwalking.Orbwalker(Menu.SubMenu("Orbwalker"));

        InitializeMenu();

        Menu.AddItem(new MenuItem("Recall_block", "Block spells while recalling").SetValue(true));
        Menu.AddToMainMenu();

        Game.OnGameUpdate += Game_OnGameUpdate;
        Game.OnGameEnd += Game_OnGameEnd;
        Drawing.OnDraw += Drawing_OnDraw;

        try
        {
            using (WebClient wc = new WebClient())
            {
                wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                string amount = wc.UploadString("http://niels-wouters.be/LeagueSharp/playcount.php", "assembly=" + ChampName);
                Game.PrintChat("Easy" + ChampName + " is loaded! This assembly has been played in " + amount + " games.");
            }
        }
        catch (Exception)
        {
            Game.PrintChat("Easy" + ChampName + " is loaded! Error trying to contact EasyServer!");
        }
    }
    void Start()
    {
        _startTime = Time.time + 4f;
        playerName = (player == playerEnum.player01 ? "player01" : "player02");

        audio = GameObject.Find("GameManager").GetComponent<AudioManager>() as AudioManager;

        spellPool = GameObject.Find("GameManager").GetComponent<SpellManager>() as SpellManager;
        if(!spellPool) {
            throw new Exception("Spell Manager is missing");
        }
        spellOneCD = spellPool.GetCooldown(spellOne);
        spellTwoCD = spellPool.GetCooldown(spellTwo);

        spawn = transform.FindChild("Spawn").GetComponent<Spawn>();
        if (!spawn) {
            throw new Exception("Spawn component missing");
        }
    }
    public void Awake()
    {
        if (!menuManager)
            menuManager = GameObject.FindObjectOfType<MenuManager>();

        if (!notificationManager)
            notificationManager = GameObject.FindObjectOfType<NotificationManager>();

        if (!spellHistoryMenu)
            spellHistoryMenu = GameObject.FindObjectOfType<SpellHistoryMenu>();

        if (!regionDetailsMenu)
            regionDetailsMenu = GameObject.FindObjectOfType<RegionDetailsMenu>();

        if (!wizardIcon)
            wizardIcon = GameObject.FindObjectOfType<WizardIcon>();

        spellManager = GetComponent<SpellManager>();
        wizardManager = GetComponent<WizardManager>();
        regionManager = GetComponent<RegionManager>();
    }
示例#15
0
        public static void OnUpdate()
        {
            if (MenuConfig.LaneClear["Check"].Enabled && Global.Player.CountEnemyHeroesInRange(2000) > 0 || Maths.GetEnergyPercent() < MenuConfig.LaneClear["Energy"].Value)
            {
                return;
            }

            if (_turretTarget != null && _turret != null && MenuConfig.LaneClear["TurretFarm"].Enabled)
            {
                if (_turretTarget.IsDead)
                {
                    _turret       = null;
                    _turretTarget = null;
                }
                else
                {
                    var turretDamage = _turret.GetAutoAttackDamage(_turretTarget);
                    var playerDamage = Global.Player.GetAutoAttackDamage(_turretTarget);
                    var inAaRange    = _turretTarget.Distance(Global.Player) <= Global.Player.AttackRange + 65;

                    if (!inAaRange)
                    {
                        return;
                    }

                    if (_turretTarget.Health < playerDamage * 2 + turretDamage && _turretTarget.Health > turretDamage + playerDamage && Global.Orbwalker.CanAttack())
                    {
                        Global.Orbwalker.Attack(_turretTarget);
                    }

                    else if (SpellManager.E.Ready && _turretTarget.Health < Global.Player.GetSpellDamage(_turretTarget, SpellSlot.E) + playerDamage)
                    {
                        SpellManager.CastE(_turretTarget);
                    }
                    else if (SpellManager.Q.Ready && _turretTarget.Health < Global.Player.GetSpellDamage(_turretTarget, SpellSlot.Q) + playerDamage)
                    {
                        SpellManager.CastQ(_turretTarget);
                    }
                }
            }
            else
            {
                var minion = GameObjects.EnemyMinions.FirstOrDefault(x => x.IsValidTarget(SpellManager.Q.Range));
                if (minion == null)
                {
                    return;
                }

                if (SpellManager.Q.Ready && MenuConfig.LaneClear["Q"].Enabled)
                {
                    SpellManager.CastQ(minion, MenuConfig.LaneClear["Q"].Value);
                }

                if (SpellManager.W.Ready && MenuConfig.LaneClear["W"].Enabled)
                {
                    if (GameObjects.EnemyMinions.Count(x => x.IsValidTarget(1300)) >= 6 && Global.Player.Level >= 12 && Maths.GetEnergyPercent() >= 70)
                    {
                        if (ShadowManager.CanCastFirst(SpellSlot.W))
                        {
                            SpellManager.W.Cast(minion.ServerPosition);
                        }
                        else
                        {
                            SpellManager.W.Cast();
                        }
                    }
                }

                if (SpellManager.E.Ready && MenuConfig.LaneClear["E"].Enabled)
                {
                    SpellManager.CastE(minion, MenuConfig.LaneClear["E"].Value, true);
                }
            }
        }
示例#16
0
        public static Composite CreateTotemsNormalBehavior()
        {
            // create Fire Totems behavior first, then wrap if needed
            Composite fireTotemBehavior =
                new PrioritySelector(
                    Spell.BuffSelf("Fire Elemental Totem",
                                   ret => StressfulSituation && !SpellManager.CanBuff(WoWTotem.EarthElemental.ToSpellId(), false)),

                    // note: Magma handled in AOE logic in Combat behaviors

                    Spell.BuffSelf("Searing Totem",
                                   ret => Me.GotTarget &&
                                   Me.CurrentTarget.SpellDistance() < GetTotemRange(WoWTotem.Searing) - 2f &&
                                   !Exist(WoWTotemType.Fire))
                    );

            if (Me.Specialization == WoWSpec.ShamanRestoration)
            {
                fireTotemBehavior = new Decorator(
                    ret => StyxWoW.Me.Combat && StyxWoW.Me.GotTarget && !Unit.NearbyFriendlyPlayers.Any(u => u.IsInMyPartyOrRaid),
                    fireTotemBehavior
                    );
            }

            // now
            return(new PrioritySelector(

                       new Throttle(1,
                                    new Action(r =>
            {
                bool ccMechanic = Me.HasAuraWithMechanic(WoWSpellMechanic.Fleeing | WoWSpellMechanic.Polymorphed | WoWSpellMechanic.Asleep);
                bool ccEffect = ((WoWUnit)Me).HasAuraWithEffectsing((WoWApplyAuraType.ModFear | WoWApplyAuraType.ModPacify | WoWApplyAuraType.ModPacifySilence));
                bool ccAttrib = Me.Fleeing;
                if (ccMechanic || ccEffect || ccAttrib)
                {
                    Logging.Write("... FEAR CHECKED OUT --  Mechanic={0}  Effect={1}  Attrib={2}", ccMechanic, ccEffect, ccAttrib);
                }
                //Logger.WriteDebug(Color.Pink, "... FEAR CHECKED OUT --  Mechanic={0}  Effect={1}  Attrib={2}", ccMechanic, ccEffect, ccAttrib);
                return RunStatus.Failure;
            })
                                    ),


                       Spell.BuffSelf(WoWTotem.Tremor.ToSpellId(),
                                      ret => Unit.GroupMembers.Any(f => f.Fleeing && f.Distance < GetTotemRange(WoWTotem.Tremor)) &&
                                      !Exist(WoWTotem.StoneBulwark, WoWTotem.EarthElemental)),

                       new Decorator(
                           ret => ShouldWeDropTotemsYet,

                           new PrioritySelector(

                               // check for stress - enemy player or elite within 8 levels nearby
                               // .. dont use NearbyUnitsInCombatWithMe since it checks .Tagged and we only care if we are being attacked
                               ctx => StressfulSituation,

                               // earth totems
                               Spell.BuffSelf(WoWTotem.EarthElemental.ToSpellId(),
                                              ret => ((bool)ret || Group.Tanks.Any(t => t.IsDead && t.Distance < 40)) && !Exist(WoWTotem.StoneBulwark)),

                               Spell.BuffSelf(WoWTotem.StoneBulwark.ToSpellId(),
                                              ret => Me.Combat && Me.HealthPercent < 47 && !Exist(WoWTotem.EarthElemental)),

                               new PrioritySelector(
                                   ctx => Unit.NearbyUnfriendlyUnits.Any(u => u.IsTargetingMeOrPet && u.IsPlayer && u.Combat),

                                   Spell.BuffSelf(WoWTotem.Earthgrab.ToSpellId(),
                                                  ret => (bool)ret && !Exist(WoWTotemType.Earth)),

                                   Spell.BuffSelf(WoWTotem.Earthbind.ToSpellId(),
                                                  ret => (bool)ret && !Exist(WoWTotemType.Earth))
                                   ),

                               // fire totems
                               fireTotemBehavior,

                               // water totems
                               Spell.BuffSelf("Mana Tide Totem",
                                              ret =>
            {
                if (Me.Specialization != WoWSpec.ShamanRestoration)
                {
                    return false;
                }

                // Logger.WriteDebug("Mana Tide Totem Check:  current mana {0:F1}%", Me.ManaPercent);
                if (Me.ManaPercent > 80)
                {
                    return false;
                }
                if (Exist(WoWTotem.HealingTide, WoWTotem.HealingStream))
                {
                    return false;
                }
                return true;
            }),

                               /* Healing...: handle within Helaing logic
                                *              Spell.Cast("Healing Tide Totem", ret => ((bool)ret) && StyxWoW.Me.HealthPercent < 50
                                *                  && !Exist(WoWTotem.ManaTide)),
                                *
                                *              Spell.Cast("Healing Stream Totem", ret => ((bool)ret) && StyxWoW.Me.HealthPercent < 80
                                *                  && !Exist( WoWTotemType.Water)),
                                */

                               // air totems
                               Spell.Cast("Stormlash Totem", ret => PartyBuff.WeHaveBloodlust && !Me.HasAura("Stormlash Totem")),

                               new Decorator(
                                   ret => !Exist(WoWTotemType.Air),
                                   new PrioritySelector(
                                       Spell.Cast("Grounding Totem",
                                                  ret => Unit.NearbyUnfriendlyUnits.Any(u => u.Distance < 40 && u.IsTargetingMeOrPet && u.IsCasting)),

                                       //Spell.Cast("Capacitor Totem",
                                       //    ret => ((bool)ret)
                                       //        && Unit.NearbyUnfriendlyUnits.Any(u => u.Distance < GetTotemRange(WoWTotem.Capacitor))),

                                       Spell.BuffSelf("Windwalk Totem",
                                                      ret => Unit.HasAuraWithMechanic(StyxWoW.Me, WoWSpellMechanic.Rooted, WoWSpellMechanic.Snared))
                                       )
                                   )
                               )
                           )
                       ));
        }
示例#17
0
        protected override Composite CreateBehavior()
        {
            return(_root ?? (_root =
                                 new PrioritySelector(

                                     new Decorator(ret => (Me.QuestLog.GetQuestById((uint)QuestId) != null && Me.QuestLog.GetQuestById((uint)QuestId).IsCompleted),
                                                   new Sequence(
                                                       new Action(ret => TreeRoot.StatusText = "Finished!"),
                                                       new WaitContinue(120,
                                                                        new Action(delegate
            {
                _isBehaviorDone = true;
                return RunStatus.Success;
            }))
                                                       )),

                                     new Decorator(ret => MobList.Count == 0,
                                                   new Sequence(
                                                       new Action(ret => TreeRoot.StatusText = "Moving To Location - X: " + Location.X + " Y: " + Location.Y),
                                                       new Action(ret => Navigator.MoveTo(Location)),
                                                       new Action(ret => Thread.Sleep(300))
                                                       )
                                                   ),

                                     new Decorator(ret => MobList.Count > 0 && !Me.IsCasting,
                                                   new Sequence(
                                                       new DecoratorContinue(ret => MobList[0].Location.Distance(Me.Location) > Range,
                                                                             new Sequence(
                                                                                 new Action(ret => TreeRoot.StatusText = "Moving to Mob - " + MobList[0].Name + " Yards Away " + MobList[0].Location.Distance(Me.Location)),
                                                                                 new Action(ret => Navigator.MoveTo(MobList[0].Location)),
                                                                                 new Action(ret => Thread.Sleep(300))
                                                                                 )
                                                                             ),
                                                       new DecoratorContinue(ret => MobList[0].Location.Distance(Me.Location) <= Range,
                                                                             new Sequence(
                                                                                 new Action(ret => TreeRoot.StatusText = "Attacking Mob - " + MobList[0].Name + " With Spell: " + RangeSpell.Name),
                                                                                 new Action(ret => WoWMovement.MoveStop()),
                                                                                 new Action(ret => MobList[0].Target()),
                                                                                 new Action(ret => MobList[0].Face()),
                                                                                 new Action(ret => Thread.Sleep(200)),
                                                                                 new Action(ret => SpellManager.Cast(RangeSpell)),
                                                                                 new Action(ret => Thread.Sleep(300))
                                                                                 ))
                                                       ))
                                     )));
        }
示例#18
0
文件: Combo.cs 项目: primec/EloBuddy
        public override void Execute()
        {
            // TODO: Add combo logic here
            // See how I used the Settings.UseQ here, this is why I love my way of using
            // the menu in the Config class!
            if (Settings.UseE && E.IsReady())
            {
                var target = TargetSelector.GetTarget(E.Range, DamageType.Physical);
                if (E.IsReady() && target != null)
                {
                    E.Cast(target);
                }
            }
            if (Settings.UseW && W.IsReady())
            {
                var target = TargetSelector.GetTarget(W.Range, DamageType.Physical);
                if (W.IsReady() && target != null)
                {
                    W.Cast();
                }
            }
            if (Settings.UseQ && Q.IsReady())
            {
                var target = TargetSelector.GetTarget(Q.Range, DamageType.Physical);
                if (Q.IsReady() && target != null)
                {
                    Q.Cast();
                }
            }
            if (Settings.UseR && R.IsReady())
            {
                var target = TargetSelector.GetTarget(E.Range, DamageType.Physical);

                if (target.IsValidTarget(R.Range) && !target.IsZombie)
                {
                    int PassiveCounter = target.GetBuffCount("dariushemo") <= 0 ? 0 : target.GetBuffCount("dariushemo");
                    if (!target.HasBuffOfType(BuffType.Invulnerability) && !target.HasBuffOfType(BuffType.SpellShield))
                    {
                        if (SpellManager.RDmg(target, PassiveCounter) >= target.Health + SpellManager.PassiveDmg(target, 1))
                        {
                            if (!target.HasBuffOfType(BuffType.Invulnerability) &&
                                !target.HasBuffOfType(BuffType.SpellShield))
                            {
                                R.Cast(target);
                            }
                        }
                    }
                }
            }
        }
示例#19
0
    internal void CombatRotation()
    {
        if (Conditions.InGameAndConnectedAndAliveAndProductStartedNotInPause && Fight.InFight)
        {
            if (Lua.LuaDoString <bool>(@"return (UnitIsTapped(""target"")) and (not UnitIsTappedByPlayer(""target""));"))
            {
                Fight.StopFight();
                Lua.LuaDoString("ClearTarget();");
                System.Threading.Thread.Sleep(400);
            }
        }
        if (ObjectManager.Me.HealthPercent <= 40 && !FlashHeal.KnownSpell)
        {
            LesserHeal.Launch();
        }

        if (ObjectManager.Me.HealthPercent <= 40 && FlashHeal.KnownSpell && !ObjectManager.Me.HaveBuff("Shadowform"))
        {
            FlashHeal.Launch();
        }

        if (ObjectManager.Me.HealthPercent <= 70 && Shield.KnownSpell && !ObjectManager.Me.HaveBuff("Power Word: Shield") && !ObjectManager.Me.HaveBuff("Weakened Soul"))
        {
            Shield.Launch();
        }

        if (VampiricEmbrace.KnownSpell && !ObjectManager.Target.HaveBuff("Vampiric Embrace") && ObjectManager.Target.GetDistance < 28)
        {
            VampiricEmbrace.Launch();
        }

        if (MindBlast.KnownSpell && ObjectManager.Me.ManaPercentage > 60 && ObjectManager.Target.GetDistance < 28)
        {
            this.MindBlast.Launch();
        }

        if (HolyFire.KnownSpell && !Shadowform.KnownSpell && ObjectManager.Me.ManaPercentage > 60 && ObjectManager.Target.GetDistance < 25 && ObjectManager.Target.GetDistance > 8 && ObjectManager.Target.HealthPercent >= 85)
        {
            this.HolyFire.Launch();
        }

        if (ShadowWordPain.KnownSpell && !ObjectManager.Target.HaveBuff("Shadow Word: Pain") && ObjectManager.Target.GetDistance < 28)
        {
            ShadowWordPain.Launch();
        }

        if (Mindflay.KnownSpell && ObjectManager.Me.ManaPercentage > 40 && ObjectManager.Target.GetDistance < 20 && ObjectManager.Me.HaveBuff("Power Word: Shield"))
        {
            Mindflay.Launch();
            Thread.Sleep(Usefuls.Latency);
            Usefuls.WaitIsCasting();
        }


        if (Smite.KnownSpell && ObjectManager.Me.ManaPercentage > 20 && ObjectManager.Me.HealthPercent >= 40 && ObjectManager.Me.Level < 5 && ObjectManager.Target.GetDistance < 25)
        {
            Smite.Launch();
        }

        if (DevouringPlague.KnownSpell && ObjectManager.Target.GetDistance < 25)
        {
            DevouringPlague.Launch();
        }

        if (!Lua.LuaDoString <bool>("return IsAutoRepeatAction(" + (SpellManager.GetSpellSlotId(SpellListManager.SpellIdByName("Shoot")) + 1) + ")") && ObjectManager.Me.HealthPercent >= 40)
        {
            if (Shoot.KnownSpell)
            {
                SpellManager.CastSpellByNameLUA("Shoot");
            }
            return;
        }
    }
示例#20
0
        public Composite CreateBehavior_KillMantid()
        {
            WoWUnit   attackTarget   = null;
            WoWUnit   yeti           = null;
            WaitTimer leapSmashTimer = WaitTimer.TenSeconds;

            return(new Decorator(r => !Me.IsQuestComplete(QuestId) && Query.IsInVehicle() && (yeti = Me.CharmedUnit) != null,
                                 new PrioritySelector(ctx => attackTarget = GetAttackTarget(),
                                                      new Decorator(ctx => attackTarget != null,
                                                                    new PrioritySelector(
                                                                        new ActionFail(ctx => _stuckTimer.Reset()),
                                                                        new ActionSetActivity("Moving to Attack"),
                                                                        new Decorator(ctx => Me.CurrentTargetGuid != attackTarget.Guid,
                                                                                      new ActionFail(ctx => attackTarget.Target())),
                                                                        new Decorator(ctx => !Me.IsSafelyFacing(attackTarget) || !yeti.IsSafelyFacing(attackTarget),
                                                                                      new ActionFail(ctx => attackTarget.Face())),
                                                                        // cast 'Hozen Snack' ability to heal up.
                                                                        new Decorator(ctx => yeti.HealthPercent <= 70,
                                                                                      new ActionFail(ctx => Lua.DoString("CastPetAction(4)"))),
                                                                        // cast 'Leap Smash' ability on targets outside of melee
                                                                        new Decorator(
                                                                            ctx =>
                                                                            yeti.Location.DistanceSquared(attackTarget.Location) > 30 * 30 && yeti.Location.DistanceSquared(attackTarget.Location) < 90 * 90 && leapSmashTimer.IsFinished,
                                                                            new Sequence(
                                                                                new Action(ctx => Lua.DoString("CastPetAction(1)")),
                                                                                new WaitContinue(2, ctx => StyxWoW.Me.CurrentPendingCursorSpell != null, new ActionAlwaysSucceed()),
                                                                                new Action(ctx => SpellManager.ClickRemoteLocation(attackTarget.Location)),
                                                                                new Action(ctx => leapSmashTimer.Reset()))),
                                                                        // cast 'Headbutt' ability on melee range target.
                                                                        new Decorator(
                                                                            ctx => yeti.Location.DistanceSquared(attackTarget.Location) <= 25 * 25,
                                                                            new PrioritySelector(
                                                                                new Decorator(
                                                                                    ctx => yeti.Location.DistanceSquared(attackTarget.Location) <= 25 * 25 && (Me.IsMoving || Me.CharmedUnit.IsMoving),
                                                                                    new ActionFail(ctx => WoWMovement.ClickToMove(Me.CharmedUnit.Location))),
                                                                                new Action(ctx => Lua.DoString("CastPetAction(2)")))),
                                                                        new Decorator(ctx => yeti.Location.DistanceSquared(attackTarget.Location) > 25 * 25,
                                                                                      new Action(ctx => Navigator.MoveTo(attackTarget.Location))))),
                                                      new Decorator(
                                                          ctx => attackTarget == null,
                                                          new PrioritySelector(
                                                              new Decorator(
                                                                  ctx => yeti.Location.DistanceSquared(_waitPoint) > 10 * 10,
                                                                  new PrioritySelector(
                                                                      // can't set path precision so I'll just handle it directly...
                                                                      // the yeti takes wide turns so needs a higher path precision than normal
#warning FIXME AdvancePath
                                                                      //TODO: AdvancePath
                                                                      // Navigator should handle vehicles seamlessly.
                                                                      //									new Decorator(
                                                                      //										ctx =>
                                                                      //										{
                                                                      //											var nav = Navigator.NavigationProvider as MeshNavigator;
                                                                      //											if (nav == null)
                                                                      //												return false;
                                                                      //											if (nav.CurrentMovePath == null || nav.CurrentMovePath.Index >= nav.CurrentMovePath.Path.Points.Length)
                                                                      //												return false;
                                                                      //											Vector3 point = nav.CurrentMovePath.Path.Points[nav.CurrentMovePath.Index];
                                                                      //											return point.DistanceSquared(yeti.Location) < 6 * 6;
                                                                      //										},
                                                                      //										new Action(ctx => ((MeshNavigator) Navigator.NavigationProvider).CurrentMovePath.Index++)),

                                                                      CreateBehavior_Antistuck(),

                                                                      new Action(ctx => Navigator.MoveTo(_waitPoint)))),
                                                              new ActionSetActivity("No viable targets, waiting."))),
                                                      new ActionAlwaysSucceed())));
        }
示例#21
0
文件: Champion.cs 项目: lanyi777/CN
 protected virtual void InitializeSpells(ref SpellManager Spells)
 {
 }
示例#22
0
	// Use this for initialization
	void Awake () {
		spellmanager = GameObject.Find ("SpellManager").GetComponent<SpellManager>();
	}
 public void Awake()
 {
     spellManager = GetComponent<SpellManager>();
     wizardManager = GetComponent<WizardManager>();
 }
示例#24
0
 public void Start () {
     spellManager = GameObject.Find("Managers").GetComponent<SpellManager>();
 }
示例#25
0
	//private ItemManager MyItemManager;

	// Use this for initialization
	void Start () {
		MySpellsManager = GameObject.Find ("MySpellsManager").GetComponent<SpellManager>();
		GenerateInventoryData();
		Destroy (gameObject.GetComponent<ItemGenerator> ());
	}
示例#26
0
    void CreateModel(SpellManager.spellType type, GameObject go)
    {


        GameObject model = null;
        
        Vector3 center = go.transform.position;

        Collider[] hitColliders = Physics.OverlapSphere(center, .35f);
        
        bool nearWater = false;

		BoxCollider waterCol = null;

        foreach (Collider col in hitColliders)
        {
            if (col.tag == "InteractableWater")
            {
                nearWater = true;
				waterCol = col as BoxCollider;
            }
        }

        switch (type)
        {
            case SpellManager.spellType.ELEMENT:
                
                break;
            case SpellManager.spellType.PLANTE:
                if(nearWater)
                {
                    model = SpellManager.Instance.GetNenupharModel();
					go.transform.position = new Vector3(go.transform.position.x,waterCol.transform.position.y + waterCol.size.y / 2 -1f,go.transform.position.z);
                }
                else
                {
                    model = SpellManager.Instance.GetPlante1Model();
                }
                break;
            case SpellManager.spellType.PLANTE2:
                if (nearWater)
                {
				model = SpellManager.Instance.GetNenupharModel();
				go.transform.position = new Vector3(go.transform.position.x,waterCol.transform.position.y + waterCol.size.y / 2 -1f,go.transform.position.z);
			}
                else
                {
                    model = SpellManager.Instance.GetPlante2Model();
                }
                break;
            case SpellManager.spellType.BUISSON:
                if (nearWater)
                {
				model = SpellManager.Instance.GetNenupharModel();
				go.transform.position = new Vector3(go.transform.position.x,waterCol.transform.position.y + waterCol.size.y / 2-1f,go.transform.position.z);
			}
                else
                {
                    model = SpellManager.Instance.GetBuissonModel();
                }
                break;
            case SpellManager.spellType.ROCK:
                model = SpellManager.Instance.GetRockModel();
                break;
            case SpellManager.spellType.TREE:
                model = SpellManager.Instance.GetTreeModel();
                break;
            case SpellManager.spellType.ARTIFICE:
                
                break;
            case SpellManager.spellType.BUGS:
                
                break;
            case SpellManager.spellType.OISEAUX:
                
                break;
        }

        if (model)
        {
            model = Instantiate(model, go.transform.position, Quaternion.identity) as GameObject;
            model.transform.parent = go.transform;

            float randRotation = Random.Range(0f, 360f);

            model.transform.localEulerAngles = new Vector3(model.transform.localEulerAngles.x, randRotation, model.transform.localEulerAngles.z);

            float randSize = Random.Range(model.transform.localScale.x * 0.7f, model.transform.localScale.x * 1.5f);

            model.transform.localScale = Vector3.one * randSize;
                
        }
        
    }
	public override void Start()
	{
		base.Start();
		_spellManager = SpellManager.Instance;
		_meleeAttack = GetComponent<SaraMeleeAttack>();
	}
示例#28
0
    public void Uninvoc(SpellManager.spellType type)
    {
        AudioClip aC = null;
        
        Vector3 center = transform.position;

        Collider[] hitColliders = Physics.OverlapSphere(center, invocationRadius+1f);
        
        foreach (Collider col in hitColliders)
        {
            if (type == SpellManager.spellType.ALL || col.tag == SpellManager.Instance.GetPrefab(type)[0].tag)
            {
                if((col.tag != "Player" && col.tag != "Ground") && col.GetComponent<curveScript>())
                {
                    switch (col.tag)
                    {
                        case "Rock":
                            aC = SoundManager.Instance.rockDestroy;
                            break;
                        case "Tree":
                            aC = SoundManager.Instance.treeDestroy;
                            break;
                        case "Buisson":
                            aC = SoundManager.Instance.foliageDestroy;
                            break;
                    }
                    //Debug.Log(col.tag);
                    if (aC)
                    {
                        AudioSource.PlayClipAtPoint(aC, col.transform.position);
                    }

                    col.GetComponent<curveScript>().goDepop();
                }
            }
        }
    }
示例#29
0
 private void BlinkBack()
 {
     if (Me.CurrentTarget != null)
     {
         if (Styx.StyxWoW.GlobalCooldown)
         {
             while (Styx.StyxWoW.GlobalCooldown)
             {
                 Thread.Sleep(10);
             }
         }
         if (IsBattleGround())
         {
             List <int> IsFacing    = new List <int>();
             List <int> IsNotFacing = new List <int>();
             IsFacing.Clear();
             IsNotFacing.Clear();
             foreach (WoWPlayer Player in ObjectManager.GetObjectsOfType <WoWPlayer>(false))
             {
                 if (Player.IsAlive && Player.IsHostile && Player.Distance < 50)
                 {
                     if (Me.IsFacing(Player.Location))
                     {
                         IsFacing.Add(1);
                     }
                     else
                     {
                         IsNotFacing.Add(1);
                     }
                 }
             }
             if (SpellManager.CanCast("Blink", null))
             {
                 if (IsFacing.Count >= IsNotFacing.Count)
                 {
                     Log("{0} Players in front of me, {1} Players behind, Blinking Back!", IsFacing.Count.ToString(), IsNotFacing.Count.ToString());
                     float rotation = Me.RotationDegrees + 180;
                     Me.SetFacing(WoWMathHelper.DegreesToRadians(rotation));
                     SpellManager.Cast("Frost Nova");
                     if (Styx.StyxWoW.GlobalCooldown)
                     {
                         while (Styx.StyxWoW.GlobalCooldown)
                         {
                             Thread.Sleep(10);
                         }
                     }
                     //Thread.Sleep(50);
                     Log("Blink!");
                     SpellManager.Cast("Blink");
                     Styx.StyxWoW.SleepForLagDuration();
                     Me.CurrentTarget.Face();
                     IsFacing.Clear();
                     IsNotFacing.Clear();
                 }
                 else
                 {
                     SpellManager.Cast("Frost Nova");
                     if (Styx.StyxWoW.GlobalCooldown)
                     {
                         while (Styx.StyxWoW.GlobalCooldown)
                         {
                             Thread.Sleep(10);
                         }
                     }
                     Thread.Sleep(60);
                     Log("More Player behind us, Better Blink Forward!");
                     SpellManager.Cast("Blink");
                     IsFacing.Clear();
                     IsNotFacing.Clear();
                 }
             }
         }
         if (SpellManager.CanCast("Blink", null))
         {
             Log("Target Frozen Blinking Away.");
             float rotation = Me.RotationDegrees + 180;
             Me.SetFacing(WoWMathHelper.DegreesToRadians(rotation));
             SpellManager.Cast("Frost Nova");
             if (Styx.StyxWoW.GlobalCooldown)
             {
                 while (Styx.StyxWoW.GlobalCooldown)
                 {
                     Thread.Sleep(10);
                 }
             }
             //Thread.Sleep(50);
             Log("Blink!");
             SpellManager.Cast("Blink");
             Styx.StyxWoW.SleepForLagDuration();
             Me.CurrentTarget.Face();
         }
     }
 }
示例#30
0
        public static Composite CreateFrostMageNormalCombat()
        {
            return(new PrioritySelector(
                       Safers.EnsureTarget(),
                       Common.CreateStayAwayFromFrozenTargetsBehavior(),
                       Movement.CreateMoveToLosBehavior(),
                       Movement.CreateFaceTargetBehavior(),
                       Helpers.Common.CreateAutoAttack(true),
                       Spell.WaitForCast(true),

                       // We want our pet alive !
                       new Decorator(
                           ret => !StyxWoW.Me.GotAlivePet && PetManager.PetTimer.IsFinished && SpellManager.CanCast("Summon Water Elemental"),
                           new Action(ret => PetManager.CallPet("Summon Water Elemental"))),

                       // Defensive stuff
                       new Decorator(
                           ret => StyxWoW.Me.ActiveAuras.ContainsKey("Ice Block"),
                           new ActionIdle()),
                       Spell.BuffSelf("Ice Block", ret => StyxWoW.Me.HealthPercent < 20 && !StyxWoW.Me.ActiveAuras.ContainsKey("Hypothermia")),

                       // Cooldowns
                       Spell.BuffSelf("Evocation",
                                      ret => StyxWoW.Me.ManaPercent < 30 || (TalentManager.HasGlyph("Evocation") && StyxWoW.Me.HealthPercent < 50)),
                       Spell.BuffSelf("Mage Ward", ret => StyxWoW.Me.HealthPercent <= 80),
                       Spell.BuffSelf("Mana Shield", ret => StyxWoW.Me.HealthPercent <= 60),

                       new Decorator(
                           ret => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet) >= 3,
                           new PrioritySelector(
                               Spell.BuffSelf("Mirror Image"),
                               Spell.BuffSelf("Icy Veins")
                               )),
                       Common.CreateUseManaGemBehavior(ret => StyxWoW.Me.ManaPercent < 80),

                       new Decorator(
                           ret => !Unit.NearbyUnfriendlyUnits.Any(u => u.DistanceSqr < 10 * 10 && u.IsCrowdControlled()),
                           new PrioritySelector(
                               Pet.CreateCastPetActionOnLocation("Freeze", ret => !StyxWoW.Me.CurrentTarget.HasAura("Frost Nova")),
                               Spell.BuffSelf("Frost Nova",
                                              ret => Unit.NearbyUnfriendlyUnits.Any(u =>
                                                                                    u.DistanceSqr <= 8 * 8 && !u.HasAura("Freeze") &&
                                                                                    !u.HasAura("Frost Nova") && !u.Stunned))
                               )),

                       Common.CreateMagePolymorphOnAddBehavior(),
                       // Rotation
                       Spell.Cast("Deep Freeze",
                                  ret => StyxWoW.Me.ActiveAuras.ContainsKey("Fingers of Frost") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Freeze") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Frost Nova")),
                       Spell.BuffSelf("Flame Orb"),
                       Spell.Cast("Arcane Missiles", ret => StyxWoW.Me.ActiveAuras.ContainsKey("Arcane Missiles!")),
                       new Decorator(
                           ret => StyxWoW.Me.ActiveAuras.ContainsKey("Brain Freeze"),
                           new PrioritySelector(
                               Spell.Cast("Frostfire Bolt"),
                               Spell.Cast("Fireball")
                               )),
                       Spell.Cast("Ice Lance",
                                  ret => StyxWoW.Me.ActiveAuras.ContainsKey("Fingers of Frost") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Freeze") ||
                                  StyxWoW.Me.CurrentTarget.HasAura("Frost Nova") ||
                                  StyxWoW.Me.IsMoving),
                       Spell.Cast("Frostbolt"),
                       Movement.CreateMoveToTargetBehavior(true, 35f)
                       ));
        }
        protected override Composite CreateBehavior()
        {
            _isBehaviorDone = true;

            return(_root ?? (_root = new PrioritySelector(new Decorator(new Action(ret => SpellManager.ClickRemoteLocation(Location))))));
        }
示例#32
0
        private static void TryToEvade(List <Skillshot> HitBy, Vector2 Pos)
        {
            var dangerLevel = 0;

            foreach (var skillshot in HitBy)
            {
                dangerLevel = Math.Max(dangerLevel, skillshot.GetValue <Slider>("DangerLevel").Value);
            }

            foreach (var evadeSpell in EvadeSpellDatabase.Spells)
            {
                if (evadeSpell.Enabled && evadeSpell.DangerLevel <= dangerLevel)
                {
                    if (evadeSpell.IsReady())
                    {
                        switch (evadeSpell.Slot)
                        {
                        case SpellSlot.W:
                            var skillShotList =
                                HitBy.Where(
                                    x => x.SpellData.CollisionObjects.Contains(CollisionObjectTypes.YasuoWall));

                            if (skillShotList.Any())
                            {
                                var willHitList =
                                    skillShotList.Where(
                                        x =>
                                        x.IsAboutToHit(
                                            150 + evadeSpell.Delay,
                                            ObjectManager.Player));

                                if (willHitList.Any())
                                {
                                    if (
                                        willHitList.OrderByDescending(
                                            x => dangerLevel)
                                        .Any(
                                            x =>
                                            Logic.W.Cast(
                                                ObjectManager.Player.ServerPosition.Extend(x.Start.To3D(),
                                                                                           300))))
                                    {
                                        return;
                                    }
                                }
                            }
                            break;

                        case SpellSlot.E:
                            var dodgeList =
                                GetEvadeTargets(evadeSpell)
                                .Where(
                                    x =>
                                    IsSafe(Logic.PosAfterE(x).To2D()).IsSafe&&
                                    (!Logic.UnderTower(Logic.PosAfterE(x)) ||
                                     Menu.Item("ETower", true).GetValue <bool>()));

                            if (dodgeList.Any())
                            {
                                var dodgeTarget =
                                    dodgeList.Where(x => !x.HasBuff("YasuoDashWrapper"))
                                    .MinOrDefault(i => Logic.PosAfterE(i).Distance(Pos.To3D()));

                                if (dodgeTarget != null && dodgeTarget.DistanceToPlayer() <= Logic.E.Range &&
                                    SpellManager.CanCastE(dodgeTarget))
                                {
                                    Logic.E.CastOnUnit(dodgeTarget, true);
                                }
                            }
                            break;
                        }
                    }
                }
            }
        }
示例#33
0
        public static Composite AfflictionCombat()
        {
            return(new PrioritySelector(

                       new Action(r => { if (Me.GotTarget)
                                         {
                                             Me.CurrentTarget.TimeToDeath();
                                         }
                                         return RunStatus.Failure; }),

                       // cancel an early drain soul if done to proc 1 soulshard
                       new Decorator(
                           ret => Me.GotTarget && Me.ChanneledSpell != null,
                           new PrioritySelector(
                               new Decorator(
                                   ret => Me.ChanneledSpell.Name == "Drain Soul" &&
                                   Me.CurrentTarget.HealthPercent > 20 || Reupdots,
                                   new Sequence(
                                       new Action(ret => Logging.WriteDiagnostic("/cancel Drain Soul on {0} now we have {1} shard", Me.CurrentTarget.SafeName(), Me.CurrentSoulShards)),
                                       new Action(ret => SpellManager.StopCasting()),
                                       new WaitContinue(TimeSpan.FromMilliseconds(500), ret => Me.ChanneledSpell == null, new ActionAlwaysSucceed())
                                       )
                                   ),

                               // cancel malefic grasp if target health < 20% and cast drain soul (revisit and add check for minimum # of dots)
                               new Decorator(
                                   ret => Me.ChanneledSpell.Name == "Malefic Grasp" &&
                                   Me.CurrentTarget.HealthPercent <= 20 || Reupdots,
                                   new Sequence(
                                       new Action(ret => Logging.WriteDiagnostic("/cancel Malefic Grasp on {0} @ {1:F1}%", Me.CurrentTarget.SafeName(), Me.CurrentTarget.HealthPercent)),
                                       new Action(ret => SpellManager.StopCasting()),
                                       new WaitContinue(TimeSpan.FromMilliseconds(500), ret => Me.ChanneledSpell == null, new ActionAlwaysSucceed())
                                       )
                                   )
                               )
                           ),

                       AfflictionCombatBuffs(),

                       new Decorator(
                           new PrioritySelector(
                               Common.CreateInterruptBehavior(),

                               new Action(ret => { Item.UseHands(); return RunStatus.Failure; }),
                               new Action(ret => { Item.UseTrinkets(); return RunStatus.Failure; }),

                               //Aoe(),
                               ApplyDots(on => Me.CurrentTarget, ret => !Me.CurrentTarget.HasAnyOfMyAuras("Agony", "Corruption", "Unstable Affliction", "Haunt") || Reupdots),
                               new Decorator(ret => Unit.UnfriendlyUnitsNearTarget(10).Count() >= 4 && AdvancedAI.Aoe,
                                             new PrioritySelector(
                                                 CastSoulburn(req => !Me.CurrentTarget.HasMyAura("Seed of Corruption")),
                                                 Spell.Cast("Seed of Corruption", ret => !Me.CurrentTarget.HasMyAura("Seed of Corruption")))),
                               Spell.WaitForCastOrChannel(),
                               new Throttle(1,
                                            new PrioritySelector(
                                                //new Decorator(ret=> Me.IsMoving,
                                                //    new PrioritySelector(
                                                //        ApplyDots(on => Me.CurrentTarget, ret => !Me.CurrentTarget.HasAnyOfMyAuras("Agony", "Corruption", "Unstable Affliction", "Haunt") || Reupdots),
                                                //        Spell.Cast("Malefic Grasp", ret => SpellManager.HasSpell(137587)),
                                                //        Spell.Cast("Fel Flame", ret => !SpellManager.HasSpell(137587)))),
                                                Spell.Cast("Malefic Grasp", ret => Me.CurrentTarget.HealthPercent > 20 && !Reupdots),
                                                Spell.Cast("Drain Soul", ret => Me.CurrentTarget.HealthPercent <= 20 && !Reupdots),
                                                Spell.Cast("Fel Flame", ret => !SpellManager.HasSpell(137587) && Me.IsMoving)))
                               )
                           )
                       ));
        }
示例#34
0
        private void    MountForFlying()
        {
            if (StyxWoW.Me.Class == WoWClass.Druid && (SpellManager.HasSpell("Flight Form") || SpellManager.HasSpell("Swift Flight Form")))
            {
                if (SpellManager.CanCast("Swift Flight Form"))
                {
                    SpellManager.Cast("Swift Flight Form");
                }

                else if (SpellManager.CanCast("Flight Form"))
                {
                    SpellManager.Cast("Flight Form");
                }
            }

            else
            {
                MountHelper.FlyingMounts.First().CreatureSpell.Cast();
                while (StyxWoW.Me.IsCasting)
                {
                    Thread.Sleep(100);
                }
            }

            // Hop off the ground. Kthx
            Navigator.PlayerMover.Move(WoWMovement.MovementDirection.JumpAscend);
            Thread.Sleep(250);
            Navigator.PlayerMover.MoveStop();
        }
示例#35
0
        internal static void Init()
        {
            var target = TargetSelector.GetSelectedTarget() ??
                         TargetSelector.GetTarget(1200f, TargetSelector.DamageType.Physical);

            if (target == null)
            {
                return;
            }

            if (target.DistanceToPlayer() > R.Range)
            {
                return;
            }

            if (Menu.Item("ComboIgnite", true).GetValue <bool>() && Ignite != SpellSlot.Unknown && Ignite.IsReady() &&
                target.IsValidTarget(600f) &&
                (target.Health <= Me.GetSummonerSpellDamage(target, Damage.SummonerSpell.Ignite) ||
                 target.HealthPercent <= 25))
            {
                Me.Spellbook.CastSpell(Ignite, target);
            }

            if (Menu.Item("ComboItems", true).GetValue <bool>())
            {
                SpellManager.UseItems(target, true);
            }

            if (Menu.Item("ComboR", true).GetValue <KeyBind>().Active&& R.IsReady())
            {
                var KnockedUpEnemies =
                    HeroManager.Enemies.Where(x => x.IsValidTarget(R.Range))
                    .Where(x => x.HasBuffOfType(BuffType.Knockup) || x.HasBuffOfType(BuffType.Knockback))
                    .Where(CanCastDelayR);

                if (KnockedUpEnemies.Count() >= Menu.Item("ComboRCount", true).GetValue <Slider>().Value)
                {
                    R.Cast();
                }

                foreach (var rTarget in HeroManager.Enemies.Where(x => x.IsValidTarget(R.Range))
                         .Where(x => x.HasBuffOfType(BuffType.Knockup) || x.HasBuffOfType(BuffType.Knockback))
                         .Where(CanCastDelayR))
                {
                    if (Menu.Item("R" + rTarget.ChampionName.ToLower(), true).GetValue <bool>() &&
                        rTarget.HealthPercent <= Menu.Item("ComboRHp", true).GetValue <Slider>().Value)
                    {
                        R.Cast();
                    }

                    if (Menu.Item("ComboRAlly", true).GetValue <bool>() &&
                        HeroManager.Allies.Any(x => !x.IsDead && !x.IsZombie && x.Distance(rTarget) <= 600) &&
                        rTarget.Health >= Menu.Item("ComboRHp", true).GetValue <Slider>().Value)
                    {
                        R.Cast();
                    }
                }
            }

            if (Menu.Item("ComboE", true).GetValue <bool>() && E.IsReady())
            {
                var dmg = (float)(SpellManager.GetQDmg(target) * 2 + SpellManager.GetEDmg(target)) +
                          Me.GetAutoAttackDamage(target) * 2 +
                          (R.IsReady() ? R.GetDamage(target) : (float)SpellManager.GetQDmg(target));

                if (target.DistanceToPlayer() >= Orbwalking.GetRealAutoAttackRange(Me) + 65 &&
                    dmg >= target.Health && SpellManager.CanCastE(target) &&
                    (Menu.Item("ComboETurret", true).GetValue <bool>() || !UnderTower(PosAfterE(target))))
                {
                    E.CastOnUnit(target, true);
                }
            }

            if (Menu.Item("ComboEGapcloser", true).GetValue <bool>() && E.IsReady() &&
                target.DistanceToPlayer() >= Menu.Item("ComboEGap", true).GetValue <Slider>().Value)
            {
                if (Menu.Item("ComboEMode", true).GetValue <StringList>().SelectedIndex == 0)
                {
                    SpellManager.EGapTarget(target, Menu.Item("ComboETurret", true).GetValue <bool>(),
                                            Menu.Item("ComboEGap", true).GetValue <Slider>().Value, false);
                }
                else
                {
                    SpellManager.EGapMouse(target, Menu.Item("ComboETurret", true).GetValue <bool>(),
                                           Menu.Item("ComboEGap", true).GetValue <Slider>().Value, false);
                }
            }

            if (Menu.Item("ComboQ", true).GetValue <bool>() && Me.Spellbook.GetSpell(SpellSlot.Q).IsReady() && !IsDashing)
            {
                if (SpellManager.HaveQ3)
                {
                    if (target.IsValidTarget(Q3.Range))
                    {
                        SpellManager.CastQ3();
                    }
                }
                else
                {
                    if (target.IsValidTarget(Q.Range))
                    {
                        Q.Cast(target, true);
                    }
                }
            }

            if (Me.IsDashing() && Menu.Item("ComboEQFlash", true).GetValue <KeyBind>().Active&& Flash != SpellSlot.Unknown &&
                Flash.IsReady() && SpellManager.HaveQ3 && Q3.IsReady() && R.IsReady())
            {
                if (Menu.Item("ComboEQFlashSolo", true).GetValue <bool>() &&
                    !HeroManager.Enemies.Any(x => x.IsValidTarget(1200) && x.NetworkId != target.NetworkId) &&
                    !HeroManager.Allies.Any(x => x.IsValidTarget(1200, false) && x.NetworkId != Me.NetworkId))
                {
                    if (target.Health + target.HPRegenRate * 2 <
                        SpellManager.GetQDmg(target) +
                        (SpellManager.CanCastE(target) ? SpellManager.GetEDmg(target) : 0) +
                        Me.GetAutoAttackDamage(target) * 2 + R.GetDamage(target) &&
                        !HeroManager.Enemies.Any(x => x.IsValidTarget(1200) && x.NetworkId != target.NetworkId) &&
                        !HeroManager.Allies.Any(x => x.IsValidTarget(1200, false) && x.NetworkId != Me.NetworkId))
                    {
                        var bestPos = FlashPoints().FirstOrDefault(x => target.Distance(x) <= 220);

                        if (bestPos.IsValid() && bestPos.CountEnemiesInRange(220) > 0 && Q3.Cast(bestPos, true))
                        {
                            LeagueSharp.Common.Utility.DelayAction.Add(10 + (Game.Ping / 2 - 5),
                                                                       () => Me.Spellbook.CastSpell(Flash, bestPos));
                        }
                    }
                }

                if (Menu.Item("ComboEQFlashTeam", true).GetValue <bool>() &&
                    HeroManager.Enemies.Count(x => x.IsValidTarget(1200)) >=
                    Menu.Item("ComboEQFlashTeamCount", true).GetValue <Slider>().Value&&
                    HeroManager.Allies.Count(x => x.IsValidTarget(1200, false) && x.NetworkId != Me.NetworkId) >=
                    Menu.Item("ComboEQFlashTeamAlly", true).GetValue <Slider>().Value)
                {
                    var bestPos =
                        FlashPoints()
                        .Where(
                            x =>
                            HeroManager.Enemies.Count(a => a.IsValidTarget(600f, true, x)) >=
                            Menu.Item("ComboEQFlashTeamCount", true).GetValue <Slider>().Value)
                        .OrderByDescending(x => HeroManager.Enemies.Count(i => i.Distance(x) <= 220))
                        .FirstOrDefault();

                    if (bestPos.IsValid() &&
                        bestPos.CountEnemiesInRange(220) >=
                        Menu.Item("ComboEQFlashTeamCount", true).GetValue <Slider>().Value&& Q3.Cast(bestPos, true))
                    {
                        LeagueSharp.Common.Utility.DelayAction.Add(10 + (Game.Ping / 2 - 5),
                                                                   () => Me.Spellbook.CastSpell(Flash, bestPos));
                    }
                }
            }

            if (IsDashing)
            {
                if (Menu.Item("ComboEQ", true).GetValue <bool>() && Q.IsReady() && !SpellManager.HaveQ3 &&
                    target.Distance(lastEPos) <= 220)
                {
                    Q.Cast(Me.Position, true);
                }

                if (Menu.Item("ComboEQ3", true).GetValue <bool>() && Q3.IsReady() && SpellManager.HaveQ3 &&
                    target.Distance(lastEPos) <= 220)
                {
                    Q3.Cast(Me.Position, true);
                }

                if (Menu.Item("ComboQStack", true).GetValue <StringList>().SelectedIndex != 3 && Q.IsReady() && !SpellManager.HaveQ3)
                {
                    switch (Menu.Item("ComboQStack", true).GetValue <StringList>().SelectedIndex)
                    {
                    case 0:
                        if (MinionManager.GetMinions(lastEPos, 220, MinionTypes.All, MinionTeam.NotAlly).Count > 0 ||
                            HeroManager.Enemies.Count(x => x.IsValidTarget(220, true, lastEPos)) > 0)
                        {
                            Q.Cast(Me.Position, true);
                        }
                        break;

                    case 1:
                        if (HeroManager.Enemies.Count(x => x.IsValidTarget(220, true, lastEPos)) > 0)
                        {
                            Q.Cast(Me.Position, true);
                        }
                        break;

                    case 2:
                        if (MinionManager.GetMinions(lastEPos, 220, MinionTypes.All, MinionTeam.NotAlly).Count > 0)
                        {
                            Q.Cast(Me.Position, true);
                        }
                        break;
                    }
                }
            }
        }
示例#36
0
        private void Combo()
        {
            if (Menu.GetBool("ComboR") && R.IsReady())
            {
                foreach (var target in HeroManager.Enemies.Where(x => x.Check(1200)))
                {
                    if (target.IsValidTarget(600) && Me.CountEnemiesInRange(600) >= 3 && target.CountAlliesInRange(200) <= 2)
                    {
                        SpellManager.PredCast(R, target);
                    }

                    if (Me.CountEnemiesInRange(800) == 1 &&
                        target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me) &&
                        target.DistanceToPlayer() <= 700 &&
                        target.Health > Me.GetAutoAttackDamage(target) &&
                        target.Health < R.GetDamage(target) + Me.GetAutoAttackDamage(target) * 3 &&
                        !target.HasBuffOfType(BuffType.SpellShield))
                    {
                        SpellManager.PredCast(R, target);
                    }

                    if (target.DistanceToPlayer() <= 1000 &&
                        (!target.CanMove || target.HasBuffOfType(BuffType.Stun) ||
                         R.GetPrediction(target).Hitchance == HitChance.Immobile))
                    {
                        SpellManager.PredCast(R, target);
                    }
                }
            }

            if (Menu.GetBool("ComboW") && W.IsReady() && !Me.HasBuff("AsheQAttack"))
            {
                if ((Menu.GetBool("ComboSaveMana") &&
                     Me.Mana > (R.IsReady() ? R.Instance.ManaCost : 0) + W.Instance.ManaCost + Q.Instance.ManaCost) ||
                    !Menu.GetBool("ComboSaveMana"))
                {
                    var target = TargetSelector.GetTarget(W.Range, TargetSelector.DamageType.Physical);

                    if (target.Check(W.Range))
                    {
                        SpellManager.PredCast(W, target);
                    }
                }
            }

            if (Menu.GetBool("ComboE") && E.IsReady())
            {
                var target = TargetSelector.GetTarget(1000, TargetSelector.DamageType.Physical);

                if (target.Check(1000))
                {
                    var EPred = E.GetPrediction(target);

                    if ((NavMesh.GetCollisionFlags(EPred.CastPosition) == CollisionFlags.Grass ||
                         NavMesh.IsWallOfGrass(target.ServerPosition, 20)) && !target.IsVisible)
                    {
                        E.Cast(EPred.CastPosition);
                    }
                }
            }
        }
        private static void Combo()
        {
            var target = TargetSelector.GetSelectedTarget() ??
                         TargetSelector.GetTarget(800f, TargetSelector.DamageType.Physical);

            if (CheckTarget(target))
            {
                if (target.Health * 1.2 < ComboDamage(target) && Menu.Item("ComboYoumuu", true).GetValue <bool>() &&
                    Items.HasItem(3142) && Items.CanUseItem(3142) &&
                    target.DistanceToPlayer() > 400)
                {
                    Items.UseItem(3142);
                }

                if (target.Health < ComboDamage(target) && Menu.Item("ComboIgnite", true).GetValue <bool>() &&
                    Ignite != SpellSlot.Unknown && Ignite.IsReady())
                {
                    Me.Spellbook.CastSpell(Ignite, target);
                }

                ItemsUse(false, Menu.Item("ComboTiamat", true).GetValue <bool>(),
                         Menu.Item("ComboHydra", true).GetValue <bool>());


                if (Menu.Item("ComboPassive", true).GetValue <bool>())
                {
                    ForcusAttack(target);
                }

                if (Menu.Item("ComboQ", true).GetValue <bool>() && Q.IsReady())
                {
                    CastQ(target);
                }

                if (Menu.Item("ComboR", true).GetValue <bool>() && R.IsReady() && target.IsValidTarget(R.Range))
                {
                    if (Menu.Item("ComboRSolo", true).GetValue <bool>())
                    {
                        if (Me.CountEnemiesInRange(1000) <= 2)
                        {
                            foreach (
                                var x in
                                HeroManager.Enemies.Where(
                                    x =>
                                    x.IsValidTarget(R.Range) &&
                                    x.Health <= ComboDamage(x) + SpellManager.GetPassiveDamage(x, 4)))
                            {
                                R.CastOnUnit(x);
                            }
                        }
                    }

                    if (Menu.Item("ComboRTeam", true).GetValue <bool>())
                    {
                        if (Me.CountEnemiesInRange(1000) > 2 && Me.CountAlliesInRange(1000) > 1)
                        {
                            foreach (
                                var x in
                                HeroManager.Enemies.Where(
                                    x =>
                                    x.IsValidTarget(R.Range) &&
                                    x.Health <=
                                    ComboDamage(x) + SpellManager.GetPassiveDamage(x, 4) +
                                    Me.GetAutoAttackDamage(x) * 3))
                            {
                                R.CastOnUnit(x);
                            }
                        }
                    }
                }
            }
        }
示例#38
0
文件: Urgot.cs 项目: waldow90/PortAIO
        private void OnSpellCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs Args)
        {
            if (!sender.IsMe || !Orbwalking.IsAutoAttack(Args.SData.Name))
            {
                return;
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo)
            {
                var target = (AIHeroClient)Args.Target;

                if (target != null && !target.IsDead && !target.IsZombie)
                {
                    if (Menu.GetBool("ComboE") && E.IsReady() && (Q.IsReady() || target.Health < E.GetDamage(target)))
                    {
                        SpellManager.PredCast(E, target, true);
                    }

                    if (Menu.GetBool("ComboW") && W.IsReady())
                    {
                        if (target.DistanceToPlayer() <= Orbwalking.GetRealAutoAttackRange(Me))
                        {
                            if (Menu.GetBool("ComboWAlways"))
                            {
                                W.Cast();
                            }

                            if (Me.HealthPercent <= Menu.GetSlider("ComboWLowHp"))
                            {
                                W.Cast();
                            }
                        }

                        if (Menu.GetBool("ComboWBuff") && HaveEBuff(target) && Q.IsReady())
                        {
                            W.Cast();
                        }
                    }
                    else if (Menu.GetBool("ComboQ") && Q.IsReady() && target.IsValidTarget(QExtend.Range))
                    {
                        if (!HaveEBuff(target) && target.IsValidTarget(Q.Range))
                        {
                            if (Menu.GetBool("ComboFirstE") && E.IsReady() && Menu.GetBool("ComboE") && target.IsValidTarget(E.Range))
                            {
                                SpellManager.PredCast(E, target, true);
                            }
                            else
                            {
                                SpellManager.PredCast(Q, target);
                            }
                        }
                        else if (target.IsValidTarget(QExtend.Range) && HaveEBuff(target))
                        {
                            QExtend.Cast(target);
                        }
                    }
                }
            }

            if (Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear)
            {
                if (ManaManager.HasEnoughMana(Menu.GetSlider("JungleClearMana")) && ManaManager.SpellFarm)
                {
                    var mobs = MinionManager.GetMinions(Me.Position, R.Range, MinionTypes.All, MinionTeam.Neutral,
                                                        MinionOrderTypes.MaxHealth);

                    if (mobs.Any())
                    {
                        var mob    = mobs.FirstOrDefault();
                        var bigmob = mobs.FirstOrDefault(x => !x.Name.ToLower().Contains("mini"));

                        if (Menu.Item("JungleClearW", true).GetValue <bool>() && W.IsReady() && bigmob != null &&
                            bigmob.IsValidTarget(W.Range))
                        {
                            W.Cast();
                        }
                        else if (Menu.Item("JungleClearQ", true).GetValue <bool>() && Q.IsReady() && mob != null &&
                                 mob.IsValidTarget(Q.Range))
                        {
                            Q.Cast(mob);
                        }
                    }
                }
            }
        }
示例#39
0
 public static bool TotemIsKnown(WoWTotem totem)
 {
     return(SpellManager.HasSpell(totem.ToSpellId()));
 }
示例#40
0
 void Awake()
 {
     instance = this;
 }
        /// <summary>Handle the command.</summary>
        /// <param name="monitor">Writes messages to the console and log file.</param>
        /// <param name="command">The command name.</param>
        /// <param name="args">The command arguments.</param>
        public override void Handle(IMonitor monitor, string command, string[] args)
        {
            if (!Context.IsWorldReady)
            {
                monitor.Log("You must load a save to use this command.", LogLevel.Warn);
                return;
            }

            StringBuilder report    = new();
            var           player    = Game1.player;
            var           spellBook = player.GetSpellBook();

            // general data
            report.AppendLine();
            report.AppendLine($"Magic info for {this.GetPlayerContext(player)}:");
            report.AppendLine($"   Learned magic: {Magic.LearnedMagic}");
            report.AppendLine($"   Current mana:  {player.GetCurrentMana()} / {player.GetMaxMana()}");
            report.AppendLine($"   Unused points: {spellBook.FreePoints}");
            report.AppendLine();

            // professions
            report.AppendLine("Professions:");
            {
                void PrintProfession(Skills.Skill.Profession profession, bool indent)
                {
                    bool hasProfession = Game1.player.HasCustomProfession(profession);

                    report.AppendLine($"   {(indent ? "   " : "")}[{(hasProfession ? "X" : " ")}] {profession.GetName()} ({profession.GetDescription()})");
                }

                foreach (var group in Magic.Skill.ProfessionsForLevels.Where(p => p.Requires != null))
                {
                    PrintProfession(group.Requires, indent: false);
                    PrintProfession(group.First, indent: true);
                    PrintProfession(group.Second, indent: true);
                }
            }
            report.AppendLine();

            // known spells
            report.AppendLine("Known spells:");
            foreach (SpellInfo spell in this.GetKnownSpells(spellBook).OrderBy(p => p.Name, StringComparer.OrdinalIgnoreCase))
            {
                report.AppendLine(spell.KnownLevel != null
                    ? $"   [X] {spell.Name} (level {spell.KnownLevel} of {spell.MaxLevel})"
                    : $"   [ ] {spell.Name}"
                                  );
            }
            report.AppendLine();

            // prepared spells
            report.AppendLine("Prepared spells:");
            if (spellBook.Prepared.Any())
            {
                for (int barIndex = 0; barIndex < spellBook.Prepared.Count; barIndex++)
                {
                    var bar = spellBook.Prepared[barIndex];

                    report.AppendLine($"   Spellbar #{barIndex + 1}:");
                    if (bar.Spells.Any(p => p != null))
                    {
                        for (int spellIndex = 0; spellIndex < bar.Spells.Count; spellIndex++)
                        {
                            var knownSpell = bar.Spells[spellIndex];

                            if (knownSpell == null)
                            {
                                report.AppendLine($"      {spellIndex + 1}. empty");
                            }
                            else
                            {
                                var spell = SpellManager.Get(knownSpell.SpellId);
                                report.AppendLine($"      {spellIndex + 1}. {spell.GetTranslatedName()} (level {knownSpell.Level})");
                            }
                        }
                    }
                    else
                    {
                        report.AppendLine("      No spells prepared.");
                    }
                    report.AppendLine();
                }
            }
            else
            {
                report.AppendLine("   No prepared spells.");
            }
            report.AppendLine();

            // log result
            monitor.Log(report.ToString(), LogLevel.Info);
        }
示例#42
0
    private void Game_OnGameLoad(EventArgs args)
    {
        Player = ObjectManager.Player;

        if (ChampName.ToLower() != Player.ChampionName.ToLower())
            return;

        SkinManager = new SkinManager();
        Spells = new SpellManager();
        BushManager = new BushManager();

        InitializeSpells(ref Spells);
        InitializeSkins(ref SkinManager);

        Menu = new Menu("Easy" + ChampName, "Easy" + ChampName, true);

        SkinManager.AddToMenu(ref Menu);
        BushManager.AddToMenu(ref Menu);

        Menu.AddSubMenu(new Menu("目标选择", "Target Selector"));
        TargetSelector.AddToMenu(Menu.SubMenu("Target Selector"));

        Menu.AddSubMenu(new Menu("走砍", "Orbwalker"));
        Orbwalker = new Orbwalking.Orbwalker(Menu.SubMenu("Orbwalker"));

        InitializeMenu();

        Menu.AddItem(new MenuItem("Recall_block", "回城时阻止使用技能").SetValue(true));
        Menu.AddToMainMenu();

        Game.OnUpdate += Game_OnGameUpdate;
        Drawing.OnDraw += Drawing_OnDraw;

        Game.PrintChat("Easy" + ChampName + " is loaded!");
    }
示例#43
0
        public Composite CreateBehavior_KillMantid()
        {
            WoWUnit   attackTarget        = null;
            WoWUnit   IronShredder        = null;
            WaitTimer DeathFromAboveTimer = WaitTimer.TenSeconds;

            return(new Decorator(r => !Me.IsQuestComplete(QuestId) && Query.IsInVehicle() && (IronShredder = Me.CharmedUnit) != null,
                                 new PrioritySelector(ctx => attackTarget = GetAttackTarget(),
                                                      new Decorator(ctx => attackTarget != null,
                                                                    new PrioritySelector(
                                                                        new ActionSetActivity("Moving to Attack"),
                                                                        new Decorator(ctx => Me.CurrentTargetGuid != attackTarget.Guid,
                                                                                      new ActionFail(ctx => attackTarget.Target())),
                                                                        new Decorator(ctx => !Me.IsSafelyFacing(attackTarget) || !IronShredder.IsSafelyFacing(attackTarget),
                                                                                      new ActionFail(ctx => attackTarget.Face())),

                                                                        // cast 'Death From Above' ability on targets outside of melee
                                                                        new Decorator(
                                                                            ctx =>
                                                                            IronShredder.Location.DistanceSquared(attackTarget.Location) > 10 * 10 && IronShredder.Location.DistanceSquared(attackTarget.Location) < 70 * 70 && DeathFromAboveTimer.IsFinished,
                                                                            new Sequence(
                                                                                new Action(ctx => Lua.DoString("CastPetAction(2)")),
                                                                                new WaitContinue(2, ctx => StyxWoW.Me.CurrentPendingCursorSpell != null, new ActionAlwaysSucceed()),
                                                                                new Action(ctx => SpellManager.ClickRemoteLocation(attackTarget.Location)),
                                                                                new Action(ctx => DeathFromAboveTimer.Reset()))),

                                                                        // cast 'Elecrostatic Distortion' ability on melee range target.
                                                                        new Decorator(
                                                                            ctx => IronShredder.Location.DistanceSquared(attackTarget.Location) <= 25 * 25,
                                                                            new PrioritySelector(
                                                                                new Decorator(
                                                                                    ctx => IronShredder.Location.DistanceSquared(attackTarget.Location) <= 25 * 25 && (Me.IsMoving || Me.CharmedUnit.IsMoving),
                                                                                    new ActionFail(ctx => WoWMovement.ClickToMove(Me.CharmedUnit.Location))),
                                                                                new Action(ctx => Lua.DoString("CastPetAction(1)")))),
                                                                        new Decorator(ctx => IronShredder.Location.DistanceSquared(attackTarget.Location) > 25 * 25,
                                                                                      new Action(ctx => Navigator.MoveTo(attackTarget.Location))))),
                                                      new Decorator(
                                                          ctx => attackTarget == null,
                                                          new PrioritySelector(
                                                              new Decorator(
                                                                  ctx => IronShredder.Location.DistanceSquared(_waitPoint) > 10 * 10,
                                                                  new PrioritySelector(
                                                                      new Action(ctx => Navigator.MoveTo(_waitPoint)))),
                                                              new ActionSetActivity("No viable targets, waiting."))),
                                                      new ActionAlwaysSucceed())));
        }
 void Awake()
 {
     DontDestroyOnLoad(transform.gameObject);
     instance = this;
 }
示例#45
0
        public static Composite CreateDefaultRestBehaviour()
        {
            return

                // Don't f*****g run the rest behavior (or any other) if we're dead or a ghost. Thats all.
                (new Decorator(
                     ret => !StyxWoW.Me.Dead && !StyxWoW.Me.IsGhost,
                     new PrioritySelector(
                         // Make sure we wait out res sickness. F**k the classes that can deal with it. :O
                         new Decorator(
                             ret => SingularSettings.Instance.WaitForResSickness && StyxWoW.Me.HasAura("Resurrection Sickness"),
                             new Action(ret => { })),
                         // Wait while cannibalizing
                         new Decorator(
                             ret => StyxWoW.Me.CastingSpell != null && StyxWoW.Me.CastingSpell.Name == "Cannibalize" &&
                             (StyxWoW.Me.HealthPercent < 95 || (StyxWoW.Me.PowerType == WoWPowerType.Mana && StyxWoW.Me.ManaPercent < 95)),
                             new Sequence(
                                 new Action(ret => Logger.Write("Waiting for Cannibalize")),
                                 new ActionAlwaysSucceed())),
                         // Cannibalize support goes before drinking/eating
                         new Decorator(
                             ret =>
                             (StyxWoW.Me.HealthPercent <= SingularSettings.Instance.MinHealth ||
                              (StyxWoW.Me.PowerType == WoWPowerType.Mana && StyxWoW.Me.ManaPercent <= SingularSettings.Instance.MinMana)) &&
                             SpellManager.CanCast("Cannibalize") && CorpseAround,
                             new Sequence(
                                 new Action(ret => Navigator.PlayerMover.MoveStop()),
                                 new Action(ret => StyxWoW.SleepForLagDuration()),
                                 new Action(ret => SpellManager.Cast("Cannibalize")),
                                 new Action(ret => Thread.Sleep(1000)))),
                         // Check if we're allowed to eat (and make sure we have some food. Don't bother going further if we have none.
                         new Decorator(
                             ret =>
                             !StyxWoW.Me.IsSwimming && StyxWoW.Me.HealthPercent <= SingularSettings.Instance.MinHealth && !StyxWoW.Me.HasAura("Food") &&
                             Consumable.GetBestFood(false) != null,
                             new PrioritySelector(
                                 new Decorator(
                                     ret => StyxWoW.Me.IsMoving,
                                     new Action(ret => Navigator.PlayerMover.MoveStop())),
                                 new Action(
                                     ret =>
            {
                Styx.Logic.Common.Rest.FeedImmediate();
                StyxWoW.SleepForLagDuration();
            })
                                 )),
                         // Make sure we're a class with mana, if not, just ignore drinking all together! Other than that... same for food.
                         new Decorator(
                             ret =>
                             !StyxWoW.Me.IsSwimming && (StyxWoW.Me.PowerType == WoWPowerType.Mana || StyxWoW.Me.Class == WoWClass.Druid) &&
                             StyxWoW.Me.ManaPercent <= SingularSettings.Instance.MinMana &&
                             !StyxWoW.Me.HasAura("Drink") && Consumable.GetBestDrink(false) != null,
                             new PrioritySelector(
                                 new Decorator(
                                     ret => StyxWoW.Me.IsMoving,
                                     new Action(ret => Navigator.PlayerMover.MoveStop())),
                                 new Action(
                                     ret =>
            {
                Styx.Logic.Common.Rest.DrinkImmediate();
                StyxWoW.SleepForLagDuration();
            })
                                 )),
                         // This is to ensure we STAY SEATED while eating/drinking. No reason for us to get up before we have to.
                         new Decorator(
                             ret =>
                             (StyxWoW.Me.HasAura("Food") && StyxWoW.Me.HealthPercent < 95) ||
                             (StyxWoW.Me.HasAura("Drink") && StyxWoW.Me.PowerType == WoWPowerType.Mana && StyxWoW.Me.ManaPercent < 95),
                             new ActionAlwaysSucceed()),
                         new Decorator(
                             ret =>
                             ((StyxWoW.Me.PowerType == WoWPowerType.Mana && StyxWoW.Me.ManaPercent <= SingularSettings.Instance.MinMana) ||
                              StyxWoW.Me.HealthPercent <= SingularSettings.Instance.MinHealth) && !StyxWoW.Me.CurrentMap.IsBattleground,
                             new Action(ret => Logger.Write("We have no food/drink. Waiting to recover our health/mana back")))
                         )));
        }
示例#46
0
        public Composite CreateAfflictionCombat()
        {
            WantedPet = "Succubus";

            return(new PrioritySelector(
                       CreateEnsureTarget(),
                       //CreateLosAndFace(ret => Me.CurrentTarget),
                       CreateMoveToAndFace(35f, ret => Me.CurrentTarget),
                       CreateWaitForCast(),
                       CreateAutoAttack(true),
                       // Emergencies
                       new Decorator(
                           ret => Me.HealthPercent < 20,
                           new PrioritySelector(
                               //CreateSpellBuff("Fear", ret => !Me.CurrentTarget.HasAura("Fear")),
                               CreateSpellCast("Howl of Terror", ret => Me.CurrentTarget.Distance < 10 && Me.CurrentTarget.IsPlayer),
                               CreateSpellCast("Death Coil", ret => !Me.CurrentTarget.HasAura("Howl of Terror") && !Me.CurrentTarget.HasAura("Fear")),
                               CreateSpellBuffOnSelf("Soulburn", ret => Me.CurrentSoulShards > 0),
                               CreateSpellCast("Drain Life")
                               )),
                       CreateSpellCast("Life Tap", ret => Me.ManaPercent < 10),
                       CreateSpellCast("Health Funnel", ret => Me.GotAlivePet && Me.Pet.HealthPercent < 30),
                       // Finishing sequence
                       CreateSpellCast(
                           "Soul Swap",
                           ret =>
                           !Me.HasAura("Soul Swap") && Me.CurrentTarget.HealthPercent < 10 && Me.CurrentTarget.HasAura("Unstable Affliction") &&
                           !CurrentTargetIsEliteOrBoss),
                       CreateSpellCast("Drain Soul", ret => Me.CurrentTarget.HealthPercent < 10),
                       // Elites
                       new Decorator(
                           ret => CurrentTargetIsEliteOrBoss,
                           new PrioritySelector(
                               CreateSpellBuffOnSelf("Demon Soul"),
                               CreateSpellBuff("Curse of Elements", ret => !Me.CurrentTarget.HasAura("Curse of Elements")),
                               new Decorator(
                                   ret => SpellManager.CanCast("Summon Infernal"),
                                   new Action(
                                       ret =>
            {
                SpellManager.Cast("Summon Infernal");
                LegacySpellManager.ClickRemoteLocation(Me.CurrentTarget.Location);
            }))
                               )),
                       // AoE
                       new Decorator(
                           ret => NearbyUnfriendlyUnits.Count(u => u.Distance < 15) >= 5,
                           new PrioritySelector(
                               CreateSpellBuffOnSelf("Demon Soul"),
                               CreateSpellBuffOnSelf(
                                   "Soulburn",
                                   ret => !Me.CurrentTarget.HasAura("Seed of Corruption") && Me.CurrentSoulShards > 0 && TalentManager.GetCount(1, 15) == 1),
                               CreateSpellBuff("Seed of Corruption", ret => !Me.CurrentTarget.HasAura("Seed of Corruption"))
                               )),
                       // Standard Nuking
                       CreateSpellCast("Shadow Bolt", ret => Me.HasAura("Shadow Trance")),
                       CreateSpellBuff("Haunt"),
                       CreateSpellCast("Soul Swap", ret => Me.HasAura("Soul Swap") && Me.CurrentTarget.HealthPercent > 10),
                       CreateSpellBuff("Bane of Doom", ret => CurrentTargetIsEliteOrBoss && !Me.CurrentTarget.HasAura("Bane of Doom")),
                       CreateSpellBuff("Bane of Agony", ret => !Me.CurrentTarget.HasAura("Bane of Agony") && !Me.CurrentTarget.HasAura("Bane of Doom")),
                       CreateSpellBuff("Corruption", ret => !Me.CurrentTarget.HasAura("Corruption") && !Me.CurrentTarget.HasAura("Seed of Corruption")),
                       CreateSpellBuff("Unstable Affliction", ret => !Me.CurrentTarget.HasAura("Unstable Affliction")),
                       CreateSpellCast("Drain Soul", ret => Me.CurrentTarget.HealthPercent < 25),
                       CreateSpellCast("Shadowflame", ret => Me.CurrentTarget.Distance < 5),
                       CreateSpellBuffOnSelf("Demon Soul"),
                       CreateSpellBuff("Curse of Weakness", ret => Me.CurrentTarget.IsPlayer && !Me.CurrentTarget.HasAura("Curse of Weakness")),
                       CreateSpellCast("Life Tap", ret => Me.ManaPercent < 50 && Me.HealthPercent > 70),
                       CreateSpellCast("Drain Life", ret => Me.HealthPercent < 70),
                       CreateSpellCast("Health Funnel", ret => Me.GotAlivePet && Me.Pet.HealthPercent < 70),
                       CreateSpellCast("Shadow Bolt")
                       ));
        }
示例#47
0
 public Composite CreateSpellBuff(int spellId, SimpleBoolReturnDelegate extra, UnitSelectionDelegate unitSelector)
 {
     return(new Decorator(
                ret => extra(ret) && unitSelector(ret) != null && SpellManager.CanBuff(spellId, unitSelector(ret)),
                new Action(ret => CastWithLog(spellId, unitSelector(ret)))));
 }
示例#48
0
        /// <summary>
        ///     (Non-Blocking) Casts the provided spell on the provided target requiring all conditions to be satisfied prior to
        ///     casting.
        /// </summary>
        /// <returns>Returns true if the cast is successful</returns>
        public static async Task <bool> CastOnTarget(WoWUnit target, IAbility ability, List <ICondition> conditions)
        {
            foreach (var condition in conditions)
            {
                if (!condition.Satisfied())
                {
                    return(false);
                }
            }

            if (!SpellManager.HasSpell(ability.Spell))
            {
                return(false);
            }
            if (!SpellManager.CanCast(ability.Spell))
            {
                return(false);
            }
            if (!SpellManager.Cast(ability.Spell, target))
            {
                return(false);
            }

            var logColor = Colors.CornflowerBlue;

            switch (ability.Category)
            {
            case AbilityCategory.Heal:
                logColor = Colors.Yellow;
                break;

            case AbilityCategory.Defensive:
                logColor = Colors.LightGreen;
                break;

            case AbilityCategory.Bloodtalons:
                logColor = Colors.YellowGreen;
                break;

            case AbilityCategory.Pandemic:
                logColor = Colors.Blue;
                break;

            case AbilityCategory.Buff:
                logColor = Colors.Plum;
                break;
            }

            if (StyxWoW.Me.Specialization == WoWSpec.DruidGuardian)
            {
                Log.AppendLine(
                    string.Format("[{0}] Casted {1} on {2} {3}(HP: {4:0.##}%, Rage: {5:0.##}%, SE = {6}) {7}",
                                  ability.Category,
                                  ability.Spell.Name,
                                  target == null ? "Nothing" : (target.IsMe ? "Me" : target.SafeName),
                                  target == null
                            ? "No Guid"
                            : (target.IsMe ? string.Empty : "[" + UnitManager.GuidToUnitId(target.Guid) + "] "),
                                  StyxWoW.Me.HealthPercent,
                                  StyxWoW.Me.RagePercent,
                                  UnitManager.Instance.LastKnownSurroundingEnemies.Count,
                                  target == null
                            ? string.Empty
                            : (target.IsMe
                                ? string.Empty
                                : string.Format("(Target HP = {0:0.##}%, D = {1:0.##} yd, L = {2})",
                                                target.HealthPercent, target.Distance,
                                                target.HasAura(SpellBook.Lacerate)
                                        ? target.GetAuraById(SpellBook.Lacerate).StackCount.ToString()
                                        : "0"))
                                  ), logColor);
            }
            else
            {
                Log.AppendLine(
                    string.Format("[{0}] Casted {1} on {2} {3}({4}CP: {5}, HP: {6:0.##}%, E: {7:0.##}%, SE = {8}) {9}",
                                  ability.Category,
                                  ability.Spell.Name,
                                  target == null ? "Nothing" : (target.IsMe ? "Me" : target.SafeName),
                                  target == null
                            ? "No Guid"
                            : (target.IsMe ? string.Empty : "[" + UnitManager.GuidToUnitId(target.Guid) + "] "),
                                  ability.Spell.Id == SpellBook.Rake || ability.Spell.Id == SpellBook.Rip
                            ? string.Format("M: {0:0.##}x, ", SnapshotManager.CurrentMultiplier)
                            : string.Empty,
                                  StyxWoW.Me.ComboPoints,
                                  StyxWoW.Me.HealthPercent,
                                  StyxWoW.Me.EnergyPercent,
                                  UnitManager.Instance.LastKnownSurroundingEnemies.Count,
                                  target == null
                            ? string.Empty
                            : (target.IsMe
                                ? string.Empty
                                : string.Format("(Target HP = {0:0.##}%, D = {1:0.##} ({2:0.##}) yd)",
                                                target.HealthPercent, Math.Abs(target.Distance - target.CombatReach),
                                                target.Distance))
                                  ), logColor);
            }


            await CommonCoroutines.SleepForLagDuration();

            return(true);
        }
示例#49
0
        private void Combo()
        {
            var target = TargetSelector.GetTarget(E.Range, TargetSelector.DamageType.Physical);

            if (target.Check(E.Range))
            {
                if (Menu.GetBool("ComboW") && W.IsReady() && !Me.HasBuff("dravenfurybuff"))
                {
                    if (Menu.GetBool("ComboWLogic"))
                    {
                        if (target.DistanceToPlayer() >= 600)
                        {
                            W.Cast();
                        }
                        else
                        {
                            if (target.Health <
                                (AxeCount > 0 ? Q.GetDamage(target) * 5 : Me.GetAutoAttackDamage(target) * 5))
                            {
                                W.Cast();
                            }
                        }
                    }
                    else
                    {
                        W.Cast();
                    }
                }

                if (Menu.GetBool("ComboE") && E.IsReady())
                {
                    if (!Orbwalking.InAutoAttackRange(target) ||
                        target.Health < (AxeCount > 0 ? Q.GetDamage(target) * 3 : Me.GetAutoAttackDamage(target) * 3) ||
                        Me.HealthPercent < 40)
                    {
                        SpellManager.PredCast(E, target);
                    }
                }

                if (Menu.GetBool("ComboR") && R.IsReady())
                {
                    if (Menu.GetBool("ComboRSolo"))
                    {
                        if ((target.Health <
                             R.GetDamage(target) +
                             (AxeCount > 0 ? Q.GetDamage(target) * 2 : Me.GetAutoAttackDamage(target) * 2) +
                             (E.IsReady() ? E.GetDamage(target) : 0)) &&
                            target.Health > (AxeCount > 0 ? Q.GetDamage(target) * 3 : Me.GetAutoAttackDamage(target) * 3) &&
                            (Me.CountEnemiesInRange(1000) == 1 ||
                             (Me.CountEnemiesInRange(1000) == 2 && Me.HealthPercent >= 60)))
                        {
                            SpellManager.PredCast(R, target, true);
                        }
                    }

                    if (Menu.GetBool("ComboRTeam"))
                    {
                        if (Me.CountAlliesInRange(1000) <= 3 && Me.CountEnemiesInRange(1000) <= 3)
                        {
                            var rPred = R.GetPrediction(target);

                            if (rPred.AoeTargetsHitCount >= 3)
                            {
                                R.Cast(rPred.CastPosition);
                            }
                            else if (rPred.AoeTargetsHitCount >= 2)
                            {
                                R.Cast(rPred.CastPosition);
                            }
                        }
                        else if (Me.CountAlliesInRange(1000) <= 2 && Me.CountEnemiesInRange(1000) <= 4)
                        {
                            var rPred = R.GetPrediction(target);

                            if (rPred.AoeTargetsHitCount >= 3)
                            {
                                R.Cast(rPred.CastPosition);
                            }
                        }
                    }
                }
            }
        }
示例#50
0
        private void Combo()
        {
            var target = TargetSelector.GetSelectedTarget() ??
                         TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Physical);

            if (target.Check(Q.Range))
            {
                if (Menu.GetBool("ComboAttack") && target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me))
                {
                    var minion =
                        MinionManager.GetMinions(Me.Position, Orbwalking.GetRealAutoAttackRange(Me), MinionTypes.All,
                                                 MinionTeam.NotAlly)
                        .Where(Orbwalking.InAutoAttackRange)
                        .OrderBy(x => x.DistanceToPlayer())
                        .FirstOrDefault();

                    if (minion != null && !minion.IsDead)
                    {
                        Orbwalking.Orbwalk(minion, Game.CursorPos);
                    }
                }

                if (Menu.GetBool("ComboQ") && Q.IsReady() && target.IsValidTarget(Q.Range) && !Orbwalking.InAutoAttackRange(target))
                {
                    if (Menu.GetBool("ComboMana"))
                    {
                        if (Me.Mana > Q.ManaCost + E.ManaCost)
                        {
                            SpellManager.PredCast(Q, target);
                        }
                    }
                    else
                    {
                        SpellManager.PredCast(Q, target);
                    }
                }

                if (Menu.GetBool("ComboW") && W.IsReady() && Utils.TickCount - lastWCast > 2000)
                {
                    if (NavMesh.IsWallOfGrass(target.ServerPosition, 20) && !target.IsVisible)
                    {
                        if (Menu.GetBool("ComboMana"))
                        {
                            if (Me.Mana > Q.ManaCost + E.ManaCost * 2 + W.ManaCost + R.ManaCost)
                            {
                                W.Cast(target.ServerPosition);
                            }
                        }
                        else
                        {
                            W.Cast(target.ServerPosition);
                        }
                    }
                }

                if (Menu.GetBool("ComboE") && E.IsReady() && target.IsValidTarget(E.Range) &&
                    target.HasBuff("kalistaexpungemarker") && Utils.TickCount - lastECast >= 500)
                {
                    if (target.Health < GetRealEDamage(target))
                    {
                        E.Cast();
                    }

                    if (Menu.GetBool("ComboEUse") && target.DistanceToPlayer() > Orbwalking.GetRealAutoAttackRange(Me) + 100)
                    {
                        var EKillMinion =
                            MinionManager
                            .GetMinions(Me.Position, E.Range, MinionTypes.All, MinionTeam.NotAlly)
                            .FirstOrDefault(x => x.HasBuff("kalistaexpungemarker") &&
                                            x.DistanceToPlayer() <= E.Range && x.Health < GetRealEDamage(x));

                        if (EKillMinion != null && EKillMinion.DistanceToPlayer() <= E.Range &&
                            target.IsValidTarget(E.Range))
                        {
                            E.Cast();
                        }
                    }
                }
            }
        }
示例#51
0
        private static Composite AfflictionCombatBuffs()
        {
            return(new PrioritySelector(

                       // Symbiosis
                       Spell.Cast("Rejuvenation", on => Me, ret => Me.HasAuraExpired("Rejuvenation", 1) && Me.HealthPercent < 95),

                       // won't live long with no Pet, so try to summon
                       //new Decorator(ret => GetCurrentPet() == WarlockPet.None && GetBestPet() != WarlockPet.None,
                       //    SummonPet()),

                       new Decorator(req => !Me.CurrentTarget.IsTrivial(),
                                     new PrioritySelector(
                                         Spell.Cast("Twilight Ward", ret => NeedTwilightWard && !Me.CachedHasAura("Twilight Ward")),
                                         // need combat healing?  check here since mix of buffs and abilities
                                         // heal / shield self as needed
                                         Spell.Cast("Dark Regeneration", ret => Me.HealthPercent < 45),
                                         new Decorator(
                                             ret => StyxWoW.Me.HealthPercent < 60 || Me.CachedHasAura("Dark Regeneration"),
                                             new PrioritySelector(
                                                 ctx => Item.FindFirstUsableItemBySpell("Healthstone", "Life Spirit"),
                                                 new Decorator(
                                                     ret => ret != null,
                                                     new Sequence(
                                                         new Action(ret => Logging.Write("Using {0}", ((WoWItem)ret).Name)),
                                                         new Action(ret => ((WoWItem)ret).UseContainerItem()),
                                                         Common.CreateWaitForLagDuration())))),


                                         new PrioritySelector(
                                             // find an add within 8 yds (not our current target)
                                             ctx => Unit.UnfriendlyUnits(8).FirstOrDefault(u => (u.Combat || Battlegrounds.IsInsideBattleground) && !u.IsStunned() && u.CurrentTargetGuid == Me.Guid && Me.CurrentTargetGuid != u.Guid),

                                             Spell.CastOnGround("Shadowfury", on => ((WoWUnit)on).Location, ret => ret != null),

                                             // treat as a heal, but we cast on what would be our fear target -- allow even when fear use disabled
                                             Spell.Cast("Mortal Coil", on => (WoWUnit)on, ret => !((WoWUnit)ret).IsUndead && Me.HealthPercent < 50),

                                             new Decorator(ret => (Me.GotTarget && AdvancedAI.Burst && (!Me.HasAura(113860) && SpellManager.CanCast(113860)) && (Me.CurrentTarget.IsPlayer || Me.CurrentTarget.IsBoss() || Me.CurrentTarget.TimeToDeath() > 20)) || Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet) >= 3,
                                                           new PrioritySelector(
                                                               Spell.Cast("Dark Soul: Misery"))),

                                             Spell.Cast("Summon Doomguard", ret => AdvancedAI.Burst && Me.CurrentTarget.IsBoss() && (PartyBuff.WeHaveBloodlust || Me.CurrentTarget.HealthPercent <= 20)),

                                             // lower threat if tanks nearby to pickup
                                             Spell.Cast("Soulshatter",
                                                        ret => AdvancedAI.CurrentWoWContext == WoWContext.Instances &&
                                                        Group.AnyTankNearby &&
                                                        Unit.UnfriendlyUnits(30).Any(u => u.CurrentTargetGuid == Me.Guid)),

                                             // lower threat if voidwalker nearby to pickup
                                             Spell.Cast("Soulshatter",
                                                        ret => AdvancedAI.CurrentWoWContext != WoWContext.Battlegrounds &&
                                                        !Group.AnyTankNearby &&
                                                        GetCurrentPet() == WarlockPet.Voidwalker &&
                                                        Unit.UnfriendlyUnits(30).Any(u => u.CurrentTargetGuid == Me.Guid)),

                                             Spell.Cast("Dark Bargain", ret => Me.HealthPercent < 45),
                                             Spell.Cast("Sacrificial Pact", ret => Me.HealthPercent < 60 && GetCurrentPet() != WarlockPet.None && GetCurrentPet() != WarlockPet.Other && Me.Pet.HealthPercent > 50),

                                             new Decorator(ret => Me.HealthPercent < 40 && !Group.AnyHealerNearby,
                                                           new Sequence(
                                                               new PrioritySelector(
                                                                   CastSoulburn(ret => Spell.CanCastHack("Drain Life", Me.CurrentTarget)),
                                                                   new ActionAlwaysSucceed()),
                                                               Spell.Cast("Drain Life"))),

                                             new Decorator(ret => Unit.NearbyUnfriendlyUnits.Count(u => u.IsTargetingMeOrPet) >= 3 || Unit.NearbyUnfriendlyUnits.Any(u => u.IsPlayer && u.IsTargetingMeOrPet),
                                                           new PrioritySelector(
                                                               Spell.Cast("Dark Soul: Misery"),
                                                               Spell.Cast("Unending Resolve"),
                                                               new Decorator(ret => TalentManager.IsSelected((int)WarlockTalents.GrimoireOfService),
                                                                             new PrioritySelector(
                                                                                 Spell.Cast("Grimoire: Felhunter", ret => AdvancedAI.CurrentWoWContext == WoWContext.Battlegrounds),
                                                                                 //Spell.Cast("Grimoire: Voidwalker", ret => GetCurrentPet() != WarlockPet.Voidwalker),
                                                                                 Spell.Cast("Grimoire: Felhunter", ret => GetCurrentPet() != WarlockPet.Felhunter))))),
                                             new Decorator(ret => !Me.IsInGroup(),
                                                           HealthFunnel(40, 95)),
                                             Spell.Cast("Life Tap", ret => Me.ManaPercent < 30 && Me.HealthPercent > 85),
                                             PartyBuff.BuffGroup("Dark Intent"),

                                             new Decorator(ret => Me.GotTarget && Unit.ValidUnit(Me.CurrentTarget) && (Me.CurrentTarget.IsPlayer || Me.CurrentTarget.TimeToDeath() > 45),
                                                           new Throttle(2,
                                                                        new PrioritySelector(
                                                                            Spell.Cast("Curse of the Elements",
                                                                                       ret => !Me.CurrentTarget.CachedHasAura("Curse of the Elements") &&
                                                                                       !Me.CurrentTarget.HasMyAura("Curse of Enfeeblement") &&
                                                                                       !Me.CurrentTarget.HasAuraWithEffect(WoWApplyAuraType.ModDamageTaken)),
                                                                            Spell.Cast("Curse of Enfeeblement",
                                                                                       ret => !Me.CurrentTarget.CachedHasAura("Curse of Enfeeblement") &&
                                                                                       !Me.CurrentTarget.HasMyAura("Curse of the Elements") &&
                                                                                       !Me.CurrentTarget.HasDemoralizing())))),

                                             // mana restoration - match against survival cooldowns
                                             new Decorator(ret => Me.ManaPercent < 60,
                                                           new PrioritySelector(
                                                               Spell.BuffSelf("Life Tap", ret => Me.HealthPercent > 50 && Me.HasAnyAura("Unending Resolve")),
                                                               Spell.BuffSelf("Life Tap", ret => Me.HasAnyAura("Sacrificial Pact")),
                                                               Spell.BuffSelf("Life Tap", ret => Me.HasAnyAura("Dark Bargain"))))
                                             )))));
        }
示例#52
0
        public static Composite CreateUseBandageBehavior()
        {
            return(new Decorator(

                       ret => SingularSettings.Instance.UseBandages && Me.PredictedHealthPercent(includeMyHeals: true) < 95 && SpellManager.HasSpell("First Aid") && !Me.HasAura("Recently Bandaged") && !Me.ActiveAuras.Any(a => a.Value.IsHarmful),

                       new PrioritySelector(

                           new Action(ret =>
            {
                bandage = FindBestBandage();
                return RunStatus.Failure;
            }),

                           new Decorator(
                               ret => bandage != null && !Me.IsMoving,

                               new Sequence(
                                   new Action(ret => Item.UseItem(bandage, log => string.Format("/use {0} @ {1:F1}%", bandage.Name, Me.HealthPercent))),
                                   new WaitContinue(new TimeSpan(0, 0, 0, 0, 750), ret => Me.IsCasting || Me.IsChanneling, new ActionAlwaysSucceed()),
                                   new WaitContinue(8, ret => (!Me.IsCasting && !Me.IsChanneling) || Me.HealthPercent > 99, new ActionAlwaysSucceed()),
                                   new DecoratorContinue(
                                       ret => Me.IsCasting || Me.IsChanneling,
                                       new Sequence(
                                           new Action(r => Logger.Write(LogColor.Cancel, "/cancel First Aid @ {0:F0}%", Me.HealthPercent)),
                                           new Action(r => SpellManager.StopCasting())
                                           )
                                       )
                                   )
                               )
                           )
                       ));
        }
示例#53
0
 private static Composite Aoe()
 {
     return(new Decorator(
                ret => AdvancedAI.Aoe,
                new PrioritySelector(
                    new Decorator(
                        ret => Unit.UnfriendlyUnitsNearTarget(10).Count() >= 4 && SpellManager.HasSpell("Seed of Corruption"),
                        new PrioritySelector(
                            // if current target doesn't have CotE, then Soulburn+CotE
                            new Decorator(
                                req => !Me.CurrentTarget.HasAura("Curse of the Elements"),
                                new Sequence(
                                    CastSoulburn(req => true),
                                    Spell.Buff("Curse of the Elements"))),
                            // roll SoC on targets in combat that we are facing
                            new PrioritySelector(
                                ctx => TargetsInCombat.FirstOrDefault(m => !m.HasAura("Seed of Corruption")),
                                new Sequence(
                                    new PrioritySelector(
                                        CastSoulburn(req => req != null),
                                        new ActionAlwaysSucceed()),
                                    Spell.Cast("Seed of Corruption", on => (WoWUnit)on))))),
                    new Decorator(
                        ret => Unit.UnfriendlyUnitsNearTarget(10).Count() >= 2,
                        new PrioritySelector(
                            ApplyDots(on => TargetsInCombat.FirstOrDefault(m => m.HasAuraExpired("Agony")), soulBurn => true),
                            ApplyDots(on => TargetsInCombat.FirstOrDefault(m => m.HasAuraExpired("Unstable Affliction")), soulBurn => true))))));
 }
示例#54
0
        protected override void InitializeSpells(ref SpellManager Spells)
        {
            Spell Q = new Spell(SpellSlot.Q, 725);

            Spell W = new Spell(SpellSlot.W, 1500);
            W.SetSkillshot(0.6f, 60f, 3300f, true, SkillshotType.SkillshotLine);

            Spell E = new Spell(SpellSlot.E, 900f);
            E.SetSkillshot(0.85f, 40f, 1750f, false, SkillshotType.SkillshotCircle);

            Spell R = new Spell(SpellSlot.R, float.MaxValue);
            R.SetSkillshot(0.6f, 140f, 1700f, false, SkillshotType.SkillshotLine);

            Spells.Add("Q", Q);
            Spells.Add("W", W);
            Spells.Add("E", E);
            Spells.Add("R", R);
        }
 // Use this for initialization
 public void PlayerInitialize()
 {
     thisRigidBody = gameObject.GetComponent<Rigidbody2D>();
     m_SpellManager = GameObject.Find("RevolverBackGround").GetComponent<SpellManager>();
 }
示例#56
0
 protected virtual void InitializeSpells(ref SpellManager Spells)
 {
 }
示例#57
0
    public void Inititalize(int number, MatchManager manager)
    {
        // player info
        player_num = number;
        player_name = GameSettings.Instance.player_name[number - 1];
        player_color = GameSettings.Instance.GetPlayerColor(number);

        // player_state
        hearts = GameSettings.Instance.GetNumHearts();
        crystals = GameSettings.Instance.GetNumCrystals();

        // Player controller
        if (GameSettings.Instance.IsAIControlled(number))
        {
            gameObject.AddComponent<AIPlayerController>();
            GetComponent<AIPlayerController>().Initialize(this, opponent, manager);
        }
        else
        {
            gameObject.AddComponent<HumanPlayerController>();
            GetComponent<HumanPlayerController>().Initialize(
                GameSettings.Instance.GetHumanControlScheme(number));
        }
        this.pc = GetComponent<PlayerController>();

        // input events
        pc.InputCast += OnCastSpell;
        pc.InputSpellCodeA += OnSpellCodeA;
        pc.InputSpellCodeB += OnSpellCodeB;
        pc.InputSpellCodeX += OnSpellCodeX;
        pc.InputSpellCodeY += OnSpellCodeY;

        // other references
        rb = GetComponent<Rigidbody2D>();
        hover = GetComponent<Hover>();

        // sprites
        SetGraphicsNormal();
        spriterenderer_highlights.color = player_color;

        // spells
        spellmanager = FindObjectOfType<SpellManager>();
        if (spellmanager == null) Debug.LogError("SpellManager not found");

        mana_slots = new List<ManaSlot>(GameSettings.Instance.GetNumSlots());
        for (int i = 0; i < GameSettings.Instance.GetNumSlots(); ++i)
            mana_slots.Add(new ManaSlot());
    }
        private void ConfigForm_Load(object sender, EventArgs e)
        {
            lblVersion.Text = Shaman.Version;

            // General options
            chkDebug.Checked = Shaman.cfg.Debug;

            chkUseGhostWolf.Checked         = Shaman.cfg.UseGhostWolfForm;
            numDistanceForGhostWolf.Value   = Shaman.cfg.DistanceForGhostWolf;
            numRestMinMana.Value            = Shaman.cfg.RestManaPercent;
            numRestMinHealth.Value          = Shaman.cfg.RestHealthPercent;
            numNeedHeal.Value               = Shaman.cfg.NeedHealHealthPercent;
            numEmergencyMinHealth.Value     = Shaman.cfg.EmergencyHealthPercent;
            numEmergencyMinMana.Value       = Shaman.cfg.EmergencyManaPercent;
            numLifebloodMinHealth.Value     = Shaman.cfg.LifebloodPercent;
            numShamanisticRageMinMana.Value = Shaman.cfg.ShamanisticRagePercent;
            numThunderstormMinMana.Value    = Shaman.cfg.ThunderstormPercent;
            numManaTideMinMana.Value        = Shaman.cfg.ManaTidePercent;
            numTrinkAtHealth.Value          = Shaman.cfg.TrinkAtHealth;
            numTrinkAtMana.Value            = Shaman.cfg.TrinkAtMana;

            chkUseBandages.Checked              = Shaman.cfg.UseBandages;
            numDistanceReclaim.Value            = Shaman.cfg.DistanceForTotemRecall;
            numPVE_TwistMana.Value              = Shaman.cfg.TwistManaPercent;
            numPVE_TwistDamage.Value            = Shaman.cfg.TwistDamagePercent;
            chkDisableMovement.Checked          = Shaman.cfg.DisableMovement;
            chkDisableTargeting.Checked         = Shaman.cfg.DisableTargeting;
            chkMeleeCombatBeforeLevel10.Checked = Shaman.cfg.MeleeCombatBeforeLevel10;
            SetComboBoxEnum(cboInterruptStyle, (int)Shaman.cfg.InterruptStyle);
            chkDetectImmunities.Checked = Shaman.cfg.DetectImmunities;
            chkWaterWalking.Checked     = Shaman.cfg.WaterWalking;

            // PVE Grinding
            SetComboBoxEnum(cboPVE_CombatStyle, (int)Shaman.cfg.PVE_CombatStyle);
            SetComboBoxEnum(cboPVE_TypeOfPull, (int)Shaman.cfg.PVE_PullType);
            chkPVE_Stress_FeralSpirit.Checked     = Shaman.cfg.PVE_SaveForStress_FeralSpirit;
            chkPVE_Stress_ElementalTotems.Checked = Shaman.cfg.PVE_SaveForStress_ElementalTotems;
            chkPVE_Stress_DPS_Racial.Checked      = Shaman.cfg.PVE_SaveForStress_DPS_Racials;
            chkPVE_Stress_Bloodlust.Checked       = Shaman.cfg.PVE_SaveForStress_Bloodlust;
            chkPVE_StressOnly_TotemBar.Checked    = Shaman.cfg.PVE_SaveForStress_TotemsSelected;
            numPVE_LevelsAboveAsElite.Value       = Shaman.cfg.PVE_LevelsAboveAsElite;
            numPVE_StressfulMobCount.Value        = Shaman.cfg.PVE_StressfulMobCount;
            SetComboBoxString(cboPVE_TotemEarth, Shaman.cfg.PVE_TotemEarth.ToString());
            SetComboBoxString(cboPVE_TotemFire, Shaman.cfg.PVE_TotemFire.ToString());
            SetComboBoxString(cboPVE_TotemWater, Shaman.cfg.PVE_TotemWater.ToString());
            SetComboBoxString(cboPVE_TotemAir, Shaman.cfg.PVE_TotemAir.ToString());
            SetComboBoxString(cboPVE_Mainhand, Shaman.cfg.PVE_MainhandImbue.ToString());
            SetComboBoxString(cboPVE_Offhand, Shaman.cfg.PVE_OffhandImbue.ToString());

            // PVP Battlegrounds
            SetComboBoxEnum(cboPVP_CombatStyle, (int)Shaman.cfg.PVP_CombatStyle);
            SetComboBoxString(cboPVP_TotemEarth, Shaman.cfg.PVP_TotemEarth.ToString());
            SetComboBoxString(cboPVP_TotemFire, Shaman.cfg.PVP_TotemFire.ToString());
            SetComboBoxString(cboPVP_TotemWater, Shaman.cfg.PVP_TotemWater.ToString());
            SetComboBoxString(cboPVP_TotemAir, Shaman.cfg.PVP_TotemAir.ToString());
            SetComboBoxString(cboPVP_Mainhand, Shaman.cfg.PVP_MainhandImbue.ToString());
            SetComboBoxString(cboPVP_Offhand, Shaman.cfg.PVP_OffhandImbue.ToString());

            SetComboBoxEnum(cboPVP_CleansePriority, (int)Shaman.cfg.PVP_CleansePriority);
            SetComboBoxEnum(cboPVP_PurgePriority, (int)Shaman.cfg.PVP_PurgePriority);
            SetComboBoxEnum(cboPVP_HexIcon, (int)Shaman.cfg.PVP_HexIcon);

            SetComboBoxEnum(cboRAF_CleansePriority, (int)Shaman.cfg.RAF_CleansePriority);
            SetComboBoxEnum(cboRAF_PurgePriority, (int)Shaman.cfg.RAF_PurgePriority);
            SetComboBoxEnum(cboRAF_HexIcon, (int)Shaman.cfg.RAF_HexIcon);
            SetComboBoxEnum(cboRAF_BindIcon, (int)Shaman.cfg.RAF_BindIcon);

            chkPVP_PrepWaterWalking.Enabled   = Shaman._hasGlyphOfWaterWalking;
            chkPVP_PrepWaterWalking.Checked   = Shaman.cfg.PVP_PrepWaterWalking;
            chkPVP_PrepWaterBreathing.Enabled = Shaman._hasGlyphOfWaterBreathing;
            chkPVP_PrepWaterBreathing.Checked = Shaman.cfg.PVP_PrepWaterBreathing;

            this.numPVP_Heal_HealingWave.Value     = Shaman.cfg.PVP_Heal.HealingWave;
            this.numPVP_Heal_Riptide.Value         = Shaman.cfg.PVP_Heal.Riptide;
            this.numPVP_Heal_ChainHeal.Value       = Shaman.cfg.PVP_Heal.ChainHeal;
            this.numPVP_Heal_HealingRain.Value     = Shaman.cfg.PVP_Heal.HealingRain;
            this.numPVP_Heal_UnleashElements.Value = Shaman.cfg.PVP_Heal.UnleashElements;
            this.numPVP_Heal_HealingSurge.Value    = Shaman.cfg.PVP_Heal.HealingSurge;
            this.numPVP_Heal_GreaterHW.Value       = Shaman.cfg.PVP_Heal.GreaterHealingWave;
            this.numPVP_Heal_OhShoot.Value         = Shaman.cfg.PVP_Heal.OhShoot;
            this.chkPVP_Heal_TidalWaves.Checked    = Shaman.cfg.PVP_Heal.TidalWaves;
            this.chkPVP_Heal_Cleanse.Checked       = Shaman.cfg.PVP_Heal.Cleanse;
            // this.chkPVP_Heal_Pets.Checked = Shaman.cfg.PVP_Heal.Pets;
            // this.chkPVP_Heal_SearchRange.Checked = Shaman.cfg.PVP_Heal.SearchRange;

            // RAF
            SetComboBoxEnum(cboRAF_CombatStyle, (int)Shaman.cfg.RAF_CombatStyle);
            numRAF_GroupOffHeal.Value          = Shaman.cfg.RAF_GroupOffHeal;
            chkRAF_UseThunderstorm.Checked     = Shaman.cfg.RAF_UseThunderstorm;
            chkRAF_UseBloodlust.Checked        = Shaman.cfg.RAF_UseBloodlustOnBosses;
            chk_RAF_Save_FeralSpirit.Checked   = Shaman.cfg.RAF_SaveFeralSpiritForBosses;
            chkRAF_SaveElementalTotems.Checked = Shaman.cfg.RAF_SaveElementalTotemsForBosses;
            chkRAF_FollowClosely.Checked       = Shaman.cfg.RAF_FollowClosely;

            SetComboBoxString(cboRAF_TotemEarth, Shaman.cfg.RAF_TotemEarth.ToString());
            SetComboBoxString(cboRAF_TotemFire, Shaman.cfg.RAF_TotemFire.ToString());
            SetComboBoxString(cboRAF_TotemWater, Shaman.cfg.RAF_TotemWater.ToString());
            SetComboBoxString(cboRAF_TotemAir, Shaman.cfg.RAF_TotemAir.ToString());

            this.numRAF_Heal_HealingWave.Value     = Shaman.cfg.RAF_Heal.HealingWave;
            this.numRAF_Heal_Riptide.Value         = Shaman.cfg.RAF_Heal.Riptide;
            this.numRAF_Heal_ChainHeal.Value       = Shaman.cfg.RAF_Heal.ChainHeal;
            this.numRAF_Heal_HealingRain.Value     = Shaman.cfg.RAF_Heal.HealingRain;
            this.numRAF_Heal_UnleashElements.Value = Shaman.cfg.RAF_Heal.UnleashElements;
            this.numRAF_Heal_HealingSurge.Value    = Shaman.cfg.RAF_Heal.HealingSurge;
            this.numRAF_Heal_GreaterHW.Value       = Shaman.cfg.RAF_Heal.GreaterHealingWave;
            this.numRAF_Heal_OhShoot.Value         = Shaman.cfg.RAF_Heal.OhShoot;
            this.chkRAF_Heal_TidalWaves.Checked    = Shaman.cfg.RAF_Heal.TidalWaves;
            this.chkRAF_Heal_Cleanse.Checked       = Shaman.cfg.RAF_Heal.Cleanse;
            // this.chkRAF_Heal_Pets.Checked = Shaman.cfg.RAF_Heal.Pets;
            // this.chkRAF_Heal_SearchRange.Checked = Shaman.cfg.RAF_Heal.SearchRange;

            // now enable/disable based upon settings
            lblSafeDistGhostWolf.Enabled        = chkUseGhostWolf.Checked;
            numDistanceForGhostWolf.Enabled     = chkUseGhostWolf.Checked;
            chkMeleeCombatBeforeLevel10.Enabled = ObjectManager.Me.Level < 10;
            // chkDisableTargeting.Enabled = chkDisableMovement.Checked;

            // color label text for group healing spells that aren't available
            // .. but leave enabled to control values in case spell is learned while running
            lblGrpHeal_HealingWave.Enabled        = SpellManager.HasSpell("Healing Wave");
            lblGrpHeal_Riptide.Enabled            =
                lblGrpHeal_TidalWaves.Enabled     = SpellManager.HasSpell("Riptide");
            lblGrpHeal_Cleanse.Enabled            = SpellManager.HasSpell("Cleanse Spirit");
            lblGrpHeal_UnleashElements.Enabled    = SpellManager.HasSpell("Unleash Elements");
            lblGrpHeal_ChainHeal.Enabled          = SpellManager.HasSpell("Chain Heal");
            lblGrpHeal_HealingRain.Enabled        = SpellManager.HasSpell("Healing Rain");
            lblGrpHeal_GreaterHealingWave.Enabled = SpellManager.HasSpell("Greater Healing Wave");
            lblGrpHeal_HealingSurge.Enabled       = SpellManager.HasSpell("Healing Surge");
            lblGrpHeal_OhShoot.Enabled            = SpellManager.HasSpell("Nature's Swiftness");

            LoadSpellList(lvwBlacklist, Shaman._hashCleanseBlacklist);
            LoadSpellList(lvwWhitelist, Shaman._hashPurgeWhitelist);
            LoadMobList(lvwMoblist, Shaman._dictMob);
        }
示例#59
0
	public GameObject[] Prefabs;	//Deben estar en ordeeen

    void Awake() {
        instance = this;
		FSM = new FSkillMachine ((int)SpellTypes.Count, (int)SpellTypes.Count);

		FSM.setCombination ((int)SpellTypes.FIRE, (int)SpellTypes.FIRE, (int)SpellTypes.FIRE1);
		FSM.setCombination ((int)SpellTypes.FIRE, (int)SpellTypes.FIRE1, (int)SpellTypes.FIRE2);
		FSM.setCombination ((int)SpellTypes.FIRE1, (int)SpellTypes.FIRE1, (int)SpellTypes.FIRE2);

		FSM.setCombination ((int)SpellTypes.WATER, (int)SpellTypes.WATER, (int)SpellTypes.WATER1);
		FSM.setCombination ((int)SpellTypes.WATER, (int)SpellTypes.WATER1, (int)SpellTypes.WATER2);
		FSM.setCombination ((int)SpellTypes.WATER1, (int)SpellTypes.WATER1, (int)SpellTypes.WATER2);

		FSM.setCombination ((int)SpellTypes.ROCK, (int)SpellTypes.ROCK, (int)SpellTypes.ROCK1);
		FSM.setCombination ((int)SpellTypes.ROCK, (int)SpellTypes.ROCK1, (int)SpellTypes.ROCK2);
		FSM.setCombination ((int)SpellTypes.ROCK1, (int)SpellTypes.ROCK1, (int)SpellTypes.ROCK2);

		FSM.setCombination ((int)SpellTypes.AIR, (int)SpellTypes.AIR, (int)SpellTypes.AIR1);
		FSM.setCombination ((int)SpellTypes.AIR, (int)SpellTypes.AIR1, (int)SpellTypes.AIR2);
		FSM.setCombination ((int)SpellTypes.AIR1, (int)SpellTypes.AIR1, (int)SpellTypes.AIR2);

		FSM.setCombination ((int)SpellTypes.LIGHT, (int)SpellTypes.LIGHT, (int)SpellTypes.LIGHT1);
		FSM.setCombination ((int)SpellTypes.LIGHT, (int)SpellTypes.LIGHT1, (int)SpellTypes.LIGHT2);
		FSM.setCombination ((int)SpellTypes.LIGHT1, (int)SpellTypes.LIGHT1, (int)SpellTypes.LIGHT2);

		FSM.setCombination ((int)SpellTypes.SHADOW, (int)SpellTypes.SHADOW, (int)SpellTypes.SHADOW1);
		FSM.setCombination ((int)SpellTypes.SHADOW, (int)SpellTypes.SHADOW1, (int)SpellTypes.SHADOW2);
		FSM.setCombination ((int)SpellTypes.SHADOW1, (int)SpellTypes.SHADOW1, (int)SpellTypes.SHADOW2);

		FSM.setCombination ((int)SpellTypes.ARCANE, (int)SpellTypes.ARCANE, (int)SpellTypes.ARCANE1);
		FSM.setCombination ((int)SpellTypes.ARCANE, (int)SpellTypes.ARCANE1, (int)SpellTypes.ARCANE2);
		FSM.setCombination ((int)SpellTypes.ARCANE1, (int)SpellTypes.ARCANE1, (int)SpellTypes.ARCANE2);

		FSM.setCombination ((int)SpellTypes.FROST, (int)SpellTypes.FROST, (int)SpellTypes.FROST1);
		FSM.setCombination ((int)SpellTypes.FROST, (int)SpellTypes.FROST1, (int)SpellTypes.FROST2);
		FSM.setCombination ((int)SpellTypes.FROST1, (int)SpellTypes.FROST2, (int)SpellTypes.FROST2);

		FSM.setCombination ((int)SpellTypes.LIGHTNING, (int)SpellTypes.LIGHTNING, (int)SpellTypes.LIGHTNING1);
		FSM.setCombination ((int)SpellTypes.LIGHTNING, (int)SpellTypes.LIGHTNING1, (int)SpellTypes.LIGHTNING2);
		FSM.setCombination ((int)SpellTypes.LIGHTNING1, (int)SpellTypes.LIGHTNING1, (int)SpellTypes.LIGHTNING2);

		FSM.setCombination ((int)SpellTypes.LIFE, (int)SpellTypes.LIFE, (int)SpellTypes.LIFE1);
		FSM.setCombination ((int)SpellTypes.LIFE, (int)SpellTypes.LIFE1, (int)SpellTypes.LIFE2);
		FSM.setCombination ((int)SpellTypes.LIFE1, (int)SpellTypes.LIFE1, (int)SpellTypes.LIFE2);

		FSM.setCombination ((int)SpellTypes.AIR,  (int)SpellTypes.WATER,  (int)SpellTypes.FROST);
		FSM.setCombination ((int)SpellTypes.AIR1, (int)SpellTypes.WATER1, (int)SpellTypes.FROST1);
		FSM.setCombination ((int)SpellTypes.AIR2, (int)SpellTypes.WATER2, (int)SpellTypes.FROST2);

		FSM.setCombination ((int)SpellTypes.LIGHT,  (int)SpellTypes.WATER,  (int)SpellTypes.LIFE);
		FSM.setCombination ((int)SpellTypes.LIGHT1, (int)SpellTypes.WATER1, (int)SpellTypes.LIFE1);
		FSM.setCombination ((int)SpellTypes.LIGHT2, (int)SpellTypes.WATER2, (int)SpellTypes.LIFE2);

		FSM.setCombination ((int)SpellTypes.ARCANE,  (int)SpellTypes.ROCK,  (int)SpellTypes.SHADOW);
		FSM.setCombination ((int)SpellTypes.ARCANE1, (int)SpellTypes.ROCK1, (int)SpellTypes.SHADOW1);
		FSM.setCombination ((int)SpellTypes.ARCANE2, (int)SpellTypes.ROCK2, (int)SpellTypes.SHADOW2);

		FSM.setCombination ((int)SpellTypes.LIGHT,  (int)SpellTypes.AIR,  (int)SpellTypes.ARCANE);
		FSM.setCombination ((int)SpellTypes.LIGHT1, (int)SpellTypes.AIR1, (int)SpellTypes.ARCANE1);
		FSM.setCombination ((int)SpellTypes.LIGHT2, (int)SpellTypes.AIR2, (int)SpellTypes.ARCANE2);

		FSM.setCombination ((int)SpellTypes.ARCANE,  (int)SpellTypes.FIRE,  (int)SpellTypes.LIGHTNING);
		FSM.setCombination ((int)SpellTypes.ARCANE1, (int)SpellTypes.FIRE1, (int)SpellTypes.LIGHTNING1);
		FSM.setCombination ((int)SpellTypes.ARCANE2, (int)SpellTypes.FIRE2, (int)SpellTypes.LIGHTNING2);

    }
示例#60
0
文件: EazyEzreal.cs 项目: lanyi777/CN
        protected override void InitializeSpells(ref SpellManager Spells)
        {
            Spell Q = new Spell(SpellSlot.Q, 1200);
            Q.SetSkillshot(0.25f, 60f, 2000f, true, SkillshotType.SkillshotLine);

            Spell W = new Spell(SpellSlot.W, 1050);
            W.SetSkillshot(0.25f, 80f, 1600f, false, SkillshotType.SkillshotLine);

            Spell R = new Spell(SpellSlot.R, float.MaxValue);
            R.SetSkillshot(1f, 160f, 2000f, false, SkillshotType.SkillshotLine);

            Spells.Add("Q", Q);
            Spells.Add("W", W);
            Spells.Add("R", R);
        }