Exemplo n.º 1
0
        public override void OnThink()
        {
            base.OnThink();

            if (DateTime.UtcNow > m_NextBoatChewAllowed && BoatOccupied != null)
            {
                if (BoatOccupied.Deleted || BoatOccupied.m_SinkTimer != null)
                {
                    return;
                }

                Say("*chews on the ship*");

                SpecialAbilities.HinderSpecialAbility(1.0, this, this, 1.0, 3, true, 0, false, "", "", "-1");

                m_NextBoatChewAllowed = DateTime.UtcNow + NextBoatChewDelay;

                Point3D location = Location;
                Map     map      = Map;

                for (int a = 0; a < 3; a++)
                {
                    Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate
                    {
                        if (this == null)
                        {
                            return;
                        }
                        if (Deleted || !Alive)
                        {
                            return;
                        }

                        LastCombatTime = LastCombatTime + TimeSpan.FromSeconds(1);

                        BoatOccupied.ReceiveDamage(this, null, Utility.RandomMinMax(5, 10), DamageType.Hull);

                        Animate(1, 6, 1, true, false, 0);
                        Effects.PlaySound(location, map, Utility.RandomList(0x134, 0x133));
                    });
                }
            }
        }
Exemplo n.º 2
0
        public override void OnThink()
        {
            base.OnThink();

            if (Utility.RandomDouble() < .05 && DateTime.UtcNow > m_NextBoatChewAllowed && BoatOccupied != null)
            {
                if (BoatOccupied.Deleted)
                {
                    return;
                }
                if (BoatOccupied.m_SinkTimer != null)
                {
                    return;
                }

                BoatOccupied.ReceiveDamage(this, null, Utility.RandomMinMax(10, 20), DamageType.Hull);

                Say("*chews on the ship*");
                SpecialAbilities.HinderSpecialAbility(1.0, this, this, 1.0, 1, true, Utility.RandomList(0x134, 0x133), false, "", "", "-1");

                m_NextBoatChewAllowed = DateTime.UtcNow + NextBoatChewDelay;
            }
        }