Beispiel #1
0
        public void MassiveBreath()
        {
            if (!SpecialAbilities.Exists(this))
            {
                return;
            }

            double totalDelay = 3;

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

            Effects.PlaySound(Location, Map, GetAngerSound());

            Direction direction = Utility.GetDirection(Location, Combatant.Location);

            PublicOverheadMessage(MessageType.Regular, 0, false, "*takes massive breath*");

            m_NextMassiveBreathAllowed = DateTime.UtcNow + NextMassiveBreathDelay + TimeSpan.FromSeconds(totalDelay);
            m_NextAbilityAllowed       = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay);

            AbilityInProgress = true;

            Timer.DelayCall(TimeSpan.FromSeconds(3), delegate
            {
                if (SpecialAbilities.Exists(this))
                {
                    AbilityInProgress = false;
                }
            });

            SpecialAbilities.DoMassiveBreathAttack(this, Location, direction, MassiveBreathRange, true, BreathType.Electricity, false);
        }
        public static bool DoMassiveIceBreathAttack(BaseCreature creature)
        {
            if (creature == null)
            {
                return(false);
            }
            if (creature.Deleted)
            {
                return(false);
            }

            if (creature.Combatant == null)
            {
                return(false);
            }
            if (!creature.Combatant.Alive)
            {
                return(false);
            }

            Direction direction = creature.GetDirectionTo(creature.Combatant);

            creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*");

            SpecialAbilities.DoMassiveBreathAttack(creature, creature.Location, direction, creature.MassiveBreathRange, true, BreathType.Ice, true);

            return(true);
        }
        public static bool DoMassiveFireBreathAttack(BaseCreature creature)
        {
            if (creature == null)
            {
                return(false);
            }
            if (creature.Combatant == null)
            {
                return(false);
            }
            if (!creature.Combatant.Alive)
            {
                return(false);
            }

            Direction direction = creature.GetDirectionTo(creature.Combatant);
            Point3D   newPoint  = creature.GetPointByDirection(creature.Location, direction);

            SpellHelper.AdjustField(ref newPoint, creature.Map, 12, false);

            creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*");

            SpecialAbilities.DoMassiveBreathAttack(creature, creature.Location, direction, creature.MassiveBreathRange, true, BreathType.Fire, true);

            return(true);
        }
Beispiel #4
0
        public override void OnThink()
        {
            base.OnThink();

            if (Combatant != null && DateTime.UtcNow >= m_NextAbilityAllowed && !Frozen && !IsHindered())
            {
                if (DateTime.UtcNow >= m_NextMassiveBreathAllowed && AICombatEpicAction.CanDoMassiveIceBreathAttack(this))
                {
                    double totalDelay = 3;

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

                    Effects.PlaySound(Location, Map, GetAngerSound());

                    Direction direction = Utility.GetDirection(Location, Combatant.Location);

                    SpecialAbilities.DoMassiveBreathAttack(this, Location, direction, MassiveBreathRange, true, BreathType.Ice, true);

                    m_NextMassiveBreathAllowed = DateTime.UtcNow + NextMassiveBreathDelay + TimeSpan.FromSeconds(totalDelay);
                    m_NextAbilityAllowed       = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay);

                    LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(totalDelay + 2);
                    NextSpellTime = DateTime.UtcNow + TimeSpan.FromSeconds(totalDelay + 2);

                    return;
                }

                if (DateTime.UtcNow >= m_NextBreathAllowed && AICombatSpecialAction.CanDoIceBreathAttack(this))
                {
                    AICombatSpecialAction.DoIceBreathAttack(this, Combatant);

                    m_NextBreathAllowed  = DateTime.UtcNow + NextBreathDelay;
                    m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay;

                    LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(4);
                    NextSpellTime = DateTime.UtcNow + TimeSpan.FromSeconds(4);

                    return;
                }
            }
        }
        public static bool DoMassivePlantBreathAttack(BaseCreature creature)
        {
            if (creature == null)
            {
                return(false);
            }
            if (creature.Combatant == null)
            {
                return(false);
            }
            if (!creature.Combatant.Alive)
            {
                return(false);
            }

            Direction direction = creature.GetDirectionTo(creature.Combatant);

            creature.PublicOverheadMessage(MessageType.Regular, 0, false, "*gathers nearby plantlife*");

            SpecialAbilities.DoMassiveBreathAttack(creature, creature.Location, direction, creature.MassiveBreathRange, true, BreathType.Plant, true);

            return(true);
        }
Beispiel #6
0
        public void BreathSpin()
        {
            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            int rotations = 1;

            if (spawnPercent >= .33)
            {
                rotations = 2;
            }

            if (spawnPercent >= .66)
            {
                rotations = 3;
            }

            double totalDelay = 1.5 + ((double)rotations * 1.5);

            Combatant = null;

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

            AbilityInProgress        = true;
            DamageIntervalInProgress = true;
            m_NextAbilityAllowed     = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(.5);

            Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate
            {
                if (!SpecialAbilities.Exists(this))
                {
                    return;
                }

                AbilityInProgress        = false;
                DamageIntervalInProgress = false;
                m_NextAbilityAllowed     = DateTime.UtcNow + NextAbilityDelay;
            });

            Effects.PlaySound(Location, Map, GetAngerSound());

            SpecialAbilities.DoMassiveBreathAttack(this, Location, Direction, 5, true, BreathType.Electricity, false);

            PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*");

            for (int a = 0; a < rotations; a++)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(1.5 + (a * 1.5)), delegate
                {
                    if (!SpecialAbilities.Exists(this))
                    {
                        return;
                    }

                    int newDirectionValue = (int)Direction;
                    newDirectionValue    += Utility.RandomList(-3, -4, -5, 3, 4, 5);

                    if (newDirectionValue > 7)
                    {
                        newDirectionValue = 0 + (newDirectionValue - 8);
                    }

                    else if (newDirectionValue < 0)
                    {
                        newDirectionValue = 8 + newDirectionValue;
                    }

                    Direction nextDirection = (Direction)(newDirectionValue);

                    SpecialAbilities.DoMassiveBreathAttack(this, Location, nextDirection, MassiveBreathRange, true, BreathType.Electricity, false);
                });
            }
        }
        public void FireBreathSpin()
        {
            double maxRotations = 4;
            int    rotations    = (int)(Math.Ceiling(maxRotations * m_SpawnPercent));

            double totalDelay = 1.5 + ((double)rotations * 1.5);

            Combatant = null;

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

            m_AbilityInProgress  = true;
            m_NextAbilityAllowed = DateTime.UtcNow + GetNextAbilityDelay();

            m_HealthIntervalAbilityInProgress = true;

            Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate
            {
                if (!SpecialAbilities.Exists(this))
                {
                    return;
                }

                m_AbilityInProgress  = false;
                m_NextAbilityAllowed = DateTime.UtcNow + GetNextAbilityDelay();

                m_HealthIntervalAbilityInProgress = false;
            });

            Effects.PlaySound(Location, Map, GetAngerSound());

            SpecialAbilities.DoMassiveBreathAttack(this, Location, Direction, 5, true, BreathType.Fire, false);

            PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*");

            for (int a = 0; a < rotations; a++)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(1.5 + (a * 1.5)), delegate
                {
                    if (!SpecialAbilities.Exists(this))
                    {
                        return;
                    }

                    int newDirectionValue = (int)Direction;
                    newDirectionValue    += Utility.RandomList(-3, -4, -5, 3, 4, 5);

                    if (newDirectionValue > 7)
                    {
                        newDirectionValue = 0 + (newDirectionValue - 8);
                    }

                    else if (newDirectionValue < 0)
                    {
                        newDirectionValue = 8 + newDirectionValue;
                    }

                    Direction nextDirection = (Direction)(newDirectionValue);

                    SpecialAbilities.DoMassiveBreathAttack(this, Location, nextDirection, MassiveBreathRange, true, BreathType.Fire, false);
                });
            }
        }