Ejemplo n.º 1
0
        private static void DropItems(IEnumerable<string> drop, Ensage.Item ignore = null)
        {
            var hero = ObjectMgr.LocalHero;
            var items = hero.Inventory.Items.ToList();

            foreach (var item in items.Where(item => !item.Equals(ignore) && item.AbilityData.Any(x => drop.Any(x.Name.Contains)))) {
                hero.DropItem(item, hero.NetworkPosition, true);
            }
        }
Ejemplo n.º 2
0
        private static void ChangePt(Ensage.Item pt, Ensage.Attribute atrb)
        {
            // okay this shit function is really bad
            if (pt == null)
                return;

            //var ptNow = (int) ((Ensage.Items.PowerTreads) pt).ActiveAttribute + 1;
            //var ptTo = (int) atrb + 1;

            var ptNow = 0;
            var ptTo = 0;

            //some random fixes
            switch (((Ensage.Items.PowerTreads) pt).ActiveAttribute) {
                case Ensage.Attribute.Intelligence: // agi
                    ptNow = 3;
                break;
                case Ensage.Attribute.Strength:
                    ptNow = 1;
                break;
                case Ensage.Attribute.Agility:  // int
                    ptNow = 2;
                break;
            }

            // more fixes
            switch (atrb) {
                case Ensage.Attribute.Intelligence:
                ptTo = 2;
                break;
                case Ensage.Attribute.Strength:
                ptTo = 1;
                break;
                case Ensage.Attribute.Agility:
                ptTo = 3;
                break;
            }

            if (ptNow == ptTo)
                return;

            var change = ptTo - ptNow % 3;

            if (ptNow == 2 && ptTo == 1) // another fix
                change = 2;

            for (var i = 0; i < change; i++)
                pt.ToggleAbility(true);

            _ptChanged = true;
        }
Ejemplo n.º 3
0
        public Ability(Ensage.Ability ability)
        {
            Source = ability;
            Name = ability.Name;
            Texture = Drawing.GetTexture("materials/ensage_ui/spellicons/" + Name);
            Handle = ability.Handle;

            var towerDamageReduction = 0;
            if (AbilityAdjustments.TowerDamageAbilities.TryGetValue(Name, out towerDamageReduction))
            {
                DoesTowerDamage = true;
                TowerDamageReduction = towerDamageReduction;
            }
        }