Server.Mobiles.BaseCreature.DoHarmful C# (CSharp) Méthode

DoHarmful() public méthode

public DoHarmful ( Mobile target, bool indirect ) : void
target Mobile
indirect bool
Résultat void
        public override void DoHarmful( Mobile target, bool indirect )
        {
            base.DoHarmful( target, indirect );

            if ( target == this || target == m_ControlMaster || target == m_SummonMaster || (!Controlled && !Summoned) )
                return;

            List<AggressorInfo> list = this.Aggressors;

            for ( int i = 0; i < list.Count; ++i )
            {
                AggressorInfo ai = list[i];

                if ( ai.Attacker == target )
                    return;
            }

            list = this.Aggressed;

            for ( int i = 0; i < list.Count; ++i )
            {
                AggressorInfo ai = list[i];

                if ( ai.Defender == target )
                {
                    if ( m_ControlMaster != null && m_ControlMaster.Player && m_ControlMaster.CanBeHarmful( target, false ) )
                        m_ControlMaster.DoHarmful( target, true );
                    else if ( m_SummonMaster != null && m_SummonMaster.Player && m_SummonMaster.CanBeHarmful( target, false ) )
                        m_SummonMaster.DoHarmful( target, true );

                    return;
                }
            }
        }

Usage Example

Exemple #1
0
        public override void DoEffect(BaseCreature creature, Mobile m)
        {
            AuraDefinition def = AuraDefinition.GetDefinition(creature);

            if (def.Damage > 0)
            {
                AOS.Damage(
                    m,
                    creature,
                    def.Damage,
                    def.Physical,
                    def.Fire,
                    def.Cold,
                    def.Poison,
                    def.Energy,
                    def.Chaos,
                    def.Direct,
                    DamageType.SpellAOE);

                creature.DoHarmful(m); // Need to re-look at this.
                m.RevealingAction();
            }

            if (creature is IAuraCreature auraCreature)
            {
                auraCreature.AuraEffect(m);
            }
        }
All Usage Examples Of Server.Mobiles.BaseCreature::DoHarmful
BaseCreature