예제 #1
0
 private void Awake()
 {
     MaximumHealth           = 100;
     MaximumChi              = 100;
     CurrentChi              = MaximumChi;
     CurrentHealth           = MaximumHealth;
     ChiLoadedEventArguments = new LoadedChiEventArgs();
     ChiUsedEventArguments   = new UsedChiEventArgs();
     DamagedEventArguments   = new DamagedEventArgs();
 }
예제 #2
0
        private static void Mobile_Damaged(Mobile m, DamagedEventArgs args)
        {
            bool isFromPlayer = args.From != null && args.From.IsPlayer;

            foreach (Spellsong spellsong in Spellsong.GetAllActiveSpellsongs(m).ToArray())
            {
                if (isFromPlayer || args.Amount > Utility.Random(50))
                {
                    // Your spell song has been interrupted.
                    spellsong.InterruptSong(1115710);
                }
            }
        }
예제 #3
0
        private static void Mobile_Damaged(Mobile sender, DamagedEventArgs e)
        {
            if (!sender.Alive)
            {
                return;
            }

            var spellsong = Spellsong.GetEffectSpellsong <Tribulation>(sender);

            if (spellsong != null)
            {
                spellsong.OnDamage(sender, e.Amount);
            }
        }
예제 #4
0
        private static void Mobile_Damaged(Mobile m, DamagedEventArgs args)
        {
            var amount = args.Amount;
            var from   = args.From;

            NetState ourState = m.NetState, theirState = from?.NetState;

            if (ourState == null)
            {
                var master = m.GetDamageMaster(from);

                if (master != null)
                {
                    ourState = master.NetState;
                }
            }

            if (theirState == null && from != null)
            {
                var master = from.GetDamageMaster(m);

                if (master != null)
                {
                    theirState = master.NetState;
                }
            }

            if (amount > 0 && (ourState != null || theirState != null))
            {
                var p = Packet.Acquire(new DamagePacket(m, amount));

                if (ourState != null)
                {
                    ourState.Send(p);
                }

                if (theirState != null && theirState != ourState)
                {
                    theirState.Send(p);
                }

                Packet.Release(p);
            }
        }
예제 #5
0
        private static void Mobile_Damaged(Mobile m, DamagedEventArgs args)
        {
            int    amount = args.Amount;
            Mobile from   = args.From;

            GameClient ourState = m.Client, theirState = (from == null ? null : from.Client);

            if (ourState == null)
            {
                Mobile master = m.GetDamageMaster(from);

                if (master != null)
                {
                    ourState = master.Client;
                }
            }

            if (theirState == null && from != null)
            {
                Mobile master = from.GetDamageMaster(m);

                if (master != null)
                {
                    theirState = master.Client;
                }
            }

            if (amount > 0 && (ourState != null || theirState != null))
            {
                Packet p = Packet.Acquire(new DamagePacket(m, amount));

                if (ourState != null)
                {
                    ourState.Send(p);
                }

                if (theirState != null && theirState != ourState)
                {
                    theirState.Send(p);
                }

                Packet.Release(p);
            }
        }