Example #1
0
        public static double GetItemDamage(this Obj_AI_Hero source, uint itemID, Obj_AI_Hero target)
        {
            if (!source.HasItem(itemID) || !source.CanUseItem(itemID) ||
                source.IsDead || target == null || !target.IsValidTarget())
            {
                return(0d);
            }

            switch (itemID)
            {
            case 3153:     //BladeoftheRuinedKing 破败
                return(source.CalculateDamage(target, DamageType.Magical, 100));

            case 3030:     //HextechGLP800 冰冻枪
                var GLP800DMG = 100 + source.Level * 5.5 + 0.35 * source.FlatMagicDamageMod + 1;
                return(source.CalculateDamage(target, DamageType.Magical, GLP800DMG));

            case 3144:     //BilgewaterCutlass 比尔沃特吉弯刀
                return(source.CalculateDamage(target, DamageType.Magical, 100));

            case 3146:     //HextechGunblade 科技枪
                var HexGunDMG = 175 + source.Level * 4.1 + 0.30 * source.FlatMagicDamageMod + 1;
                return(source.CalculateDamage(target, DamageType.Magical, HexGunDMG));

            case 3152:     //HextechProtobelt01 推推棒
                var HexProDMG = 150 + 0.25 * source.FlatMagicDamageMod;
                return(source.CalculateDamage(target, DamageType.Magical, HexProDMG));

            default:
                return(0d);
            }
        }
Example #2
0
        internal static void UseItem(this Obj_AI_Hero source, string itemName)
        {
            if (source == null || string.IsNullOrEmpty(itemName))
            {
                return;
            }

            var slot = source.GetItemSlot(itemName);

            if (slot != SpellSlot.Unknown && source.CanUseItem(itemName))
            {
                source.SpellBook.CastSpell(slot);
            }
        }
Example #3
0
        public static void UseItem(this Obj_AI_Hero source, Obj_AI_Hero target, string itemName)
        {
            if (source == null || target == null || !target.IsValidTarget() || string.IsNullOrEmpty(itemName))
            {
                return;
            }

            var slot = source.GetItemSlot(itemName);

            if (slot != SpellSlot.Unknown && source.CanUseItem(itemName))
            {
                source.SpellBook.CastSpell(slot, target);
            }
        }
Example #4
0
        public static void UseItem(this Obj_AI_Hero source, Vector3 position, string itemName)
        {
            if (source == null || position == Vector3.Zero || string.IsNullOrEmpty(itemName))
            {
                return;
            }

            var slot = source.GetItemSlot(itemName);

            if (slot != SpellSlot.Unknown && source.CanUseItem(itemName))
            {
                source.SpellBook.CastSpell(slot, position);
            }
        }
Example #5
0
        public static bool UseItem(this Obj_AI_Hero source, uint itemID)
        {
            if (source == null)
            {
                return(false);
            }

            var slot = source.GetItemSlot(itemID);

            if (slot != SpellSlot.Unknown && source.CanUseItem(itemID))
            {
                return(source.SpellBook.CastSpell(slot));
            }

            return(false);
        }
Example #6
0
        public static bool UseItem(this Obj_AI_Hero source, uint itemID, Vector3 position)
        {
            if (source == null || position == Vector3.Zero)
            {
                return(false);
            }

            var slot = source.GetItemSlot(itemID);

            if (slot != SpellSlot.Unknown && source.CanUseItem(itemID))
            {
                return(source.SpellBook.CastSpell(slot, position));
            }

            return(false);
        }
Example #7
0
        public static bool UseItem(this Obj_AI_Hero source, uint itemID, Obj_AI_Base target)
        {
            if (source == null || target == null || !target.IsValidTarget())
            {
                return(false);
            }

            var slot = source.GetItemSlot(itemID);

            if (slot != SpellSlot.Unknown && source.CanUseItem(itemID))
            {
                return(source.SpellBook.CastSpell(slot, target));
            }

            return(false);
        }