コード例 #1
0
        public static SpellCheckCastResult SPELL_EFFECT_SCHOOL_DAMAGE(SpellCast Spell, List <WorldObject> Targets, int Index, Item Item)
        {
            int damage  = 0;
            int current = 0;

            foreach (WorldObject t in Targets)
            {
                if (!t.IsTypeOf(ObjectTypes.TYPE_UNIT))
                {
                    continue;
                }

                Unit u = (Unit)t;
                damage = Spell.GetValue(u, Index);

                if (current > 0)
                {
                    damage *= 1 ^ current;
                }

                u.DealSpellDamage(Spell, damage, SpellDamageType.SPELL_TYPE_NONMELEE, Index);
            }

            return(SpellCheckCastResult.SPELL_CAST_OK);
        }
コード例 #2
0
        public static SpellCheckCastResult SPELL_EFFECT_HEAL(SpellCast Spell, List <WorldObject> Targets, int Index, Item Item)
        {
            int damage  = 0;
            int current = 0;

            foreach (WorldObject obj in Targets)
            {
                if (!obj.IsTypeOf(ObjectTypes.TYPE_UNIT))
                {
                    continue;
                }

                damage = Spell.GetValue((Unit)obj, Index);
                if (current > 0)
                {
                    damage *= 1 ^ current;
                }

                ((Unit)obj).DealSpellDamage(Spell, damage, SpellDamageType.SPELL_TYPE_HEAL, Index);
            }

            return(SpellCheckCastResult.SPELL_CAST_OK);
        }