Beispiel #1
0
 void Start()
 {
     myCharacter = GetComponent <Character>();
     abilities   = GetComponent <SpecialAbilities>();
     RegisterforMouseEvent();
     weaponSystem = GetComponent <WeaponSystem>();
 }
Beispiel #2
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            double creepChance = .20 + (.40 * spawnPercent);

            if (Utility.RandomDouble() <= creepChance)
            {
                Blood creep = new Blood();
                creep.Hue  = 2597;
                creep.Name = "creep";
                Point3D creepLocation = new Point3D(defender.X, defender.Y, defender.Z + 2);
                creep.MoveToWorld(creepLocation, defender.Map);

                int extraCreepCount = Utility.RandomMinMax(1, 2);

                for (int a = 0; a < extraCreepCount; a++)
                {
                    Blood extraCreep = new Blood();
                    extraCreep.Hue  = 2597;
                    extraCreep.Name = "creep";
                    Point3D extraCreepLocation = new Point3D(defender.X + Utility.RandomList(-1, 1), defender.Y + Utility.RandomList(-1, 1), defender.Z + 2);
                    extraCreep.MoveToWorld(extraCreepLocation, defender.Map);
                }

                Effects.PlaySound(defender.Location, defender.Map, 0x4F1);
                defender.FixedParticles(0x374A, 10, 20, 5021, 2597, 0, EffectLayer.Head);

                defender.SendMessage("You have been covered in creep, slowing your actions!");

                SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .50, 15, -1, false, "", "", "-1");
            }
        }
        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 OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() <= .2)
            {
                defender.SendMessage("The creature burrows inside of you, causing you immense pain and discomfort!");

                double damage = 30;

                if (defender is BaseCreature)
                {
                    damage *= 3;
                }

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, -1, true, "", "", "-1");

                Effects.PlaySound(Location, Map, 0x4F1);

                new Blood().MoveToWorld(new Point3D(defender.X, defender.Y, defender.Z), defender.Map);

                for (int a = 0; a < 4; a++)
                {
                    new Blood().MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), defender.Map);
                }

                Kill();
            }
        }
Beispiel #5
0
        protected override void OnTick()
        {
            if (!m_Arrow.Running)
            {
                Stop();
                return;
            }

            else if (m_From.NetState == null || !(SpecialAbilities.Exists(m_From)) || !(SpecialAbilities.Exists(m_Target)) || m_From.Map != m_Target.Map || !m_From.InRange(m_Target, m_Range) || (m_Target.AccessLevel > m_From.AccessLevel))
            {
                m_Arrow.Stop();
                Stop();

                if (m_From != null)
                {
                    m_From.SendLocalizedMessage(503177); // You have lost your quarry.
                }
                return;
            }

            if (m_LastX != m_Target.X || m_LastY != m_Target.Y)
            {
                m_LastX = m_Target.X;
                m_LastY = m_Target.Y;

                m_Arrow.Update();
            }
        }
Beispiel #6
0
    public void SetSpecialAbility(string name)
    {
        SpecialAbilities special_ability = (SpecialAbilities)System.Enum.Parse(typeof(SpecialAbilities), name.ToUpper());

        SpecialAbilitiesManager.self.current_ability = special_ability;
        SetSpecialAbility();
    }
Beispiel #7
0
        public void addAbility(Ability ability)
        {
            //Remove the ability from any list it may be in.
            if (BasicAttacks.Contains(ability))
            {
                BasicAttacks.Remove(ability);
            }
            if (SpecialAttacks.Contains(ability))
            {
                SpecialAttacks.Remove(ability);
            }
            if (SpecialAbilities.Contains(ability))
            {
                SpecialAbilities.Remove(ability);
            }

            //Add the ability to the appropriate container.
            if (ability.Type == Ability.AbilityType.Basic)
            {
                BasicAttacks.Add(ability);
            }
            if (ability.Type == Ability.AbilityType.Special)
            {
                SpecialAttacks.Add(ability);
            }
            if (ability.Type == Ability.AbilityType.Ability || ability.Type == Ability.AbilityType.Passive)
            {
                SpecialAbilities.Add(ability);
            }

            //Update the character points
            updateCharacterPoints();
        }
Beispiel #8
0
        private void SpawnZombies()
        {
            PublicOverheadMessage(Server.Network.MessageType.Emote, Hue, true, "*flaming zombies crawl out of the monster's stomach*");

            int creatures = Utility.RandomMinMax(3, 3);

            for (int a = 0; a < creatures; a++)
            {
                List <Point3D> m_Locations = SpecialAbilities.GetSpawnableTiles(Location, false, true, Location, Map, 1, 10, 1, 2, true);

                Point3D newLocation = new Point3D();

                if (m_Locations.Count > 0)
                {
                    newLocation = m_Locations[0];
                }
                else
                {
                    newLocation = Location;
                }

                FlamingZombie flamingZombie = new FlamingZombie();
                flamingZombie.MoveToWorld(newLocation, Map);

                new Blood().MoveToWorld(flamingZombie.Location, Map);
            }

            spawnedZombies = true;
        }
Beispiel #9
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (Utility.RandomDouble() < .2)
            {
                TimedStatic ichor = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5);
                ichor.Hue  = 2051;
                ichor.Name = "ichor";
                ichor.MoveToWorld(defender.Location, Map);

                for (int a = 0; a < 4; a++)
                {
                    ichor      = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5);
                    ichor.Hue  = 2051;
                    ichor.Name = "ichor";
                    ichor.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z), Map);
                }

                Effects.PlaySound(defender.Location, defender.Map, 0x580);
                defender.FixedParticles(0x374A, 10, 20, 5021, 1107, 0, EffectLayer.Head);

                defender.SendMessage("You have been covered in an evil ichor!");

                SpecialAbilities.EntangleSpecialAbility(1.0, this, defender, 1.0, 3, -1, false, "", "", "-1");
                SpecialAbilities.PierceSpecialAbility(1.0, this, defender, 50, 15, -1, false, "", "", "-1");
                SpecialAbilities.CrippleSpecialAbility(1.0, this, defender, .2, 15, -1, false, "", "", "-1");
                SpecialAbilities.DisorientSpecialAbility(1.0, this, defender, .10, 15, -1, false, "", "", "-1");
            }
        }
Beispiel #10
0
        public override void OnThink()
        {
            base.OnThink();

            if (Utility.RandomDouble() < 0.05 && DateTime.UtcNow > m_NextVanishAllowed)
            {
                if (Combatant != null && !Hidden && !Paralyzed && !IsHindered() && !BardProvoked && !BardPacified)
                {
                    TimedStatic rock = new TimedStatic(Utility.RandomList(4967, 4970, 4973), 2);
                    rock.Name = "rock";
                    rock.MoveToWorld(Location, Map);

                    for (int a = 0; a < 6; a++)
                    {
                        Point3D dirtLocation = new Point3D(Location.X + Utility.RandomList(-1, 1), Location.Y + Utility.RandomList(-1, 1), Location.Z);

                        TimedStatic dirt = new TimedStatic(Utility.RandomList(7681, 7682), 5);
                        rock.Name = "dirt";
                        SpellHelper.AdjustField(ref dirtLocation, Map, 12, false);
                        rock.MoveToWorld(dirtLocation, Map);
                    }

                    if (SpecialAbilities.VanishAbility(this, 3.0, true, -1, 3, 6, true, null))
                    {
                        Say("*tunnels*");
                    }

                    m_NextVanishAllowed = DateTime.UtcNow + NextVanishDelay;
                }
            }
        }
Beispiel #11
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            if (m_BunnyType != BunnyType.Ferocious)
            {
                return;
            }

            double effectChance = .15;

            if (Controlled && ControlMaster != null)
            {
                if (ControlMaster is PlayerMobile)
                {
                    if (defender is PlayerMobile)
                    {
                        effectChance = .02;
                    }
                    else
                    {
                        effectChance = .25;
                    }
                }
            }

            SpecialAbilities.FrenzySpecialAbility(effectChance, this, defender, .25, 10, -1, true, "", "", "*becomes frenzied!");
        }
Beispiel #12
0
        public override void OnDamagedBySpell(Mobile from)
        {
            if (m_BunnyType == BunnyType.Devious && Utility.RandomDouble() <= .33 && !digging)
            {
                if (from != null)
                {
                    if (SpecialAbilities.TeleportAbility(this, 1.0, true, -1, 5, 10, null))
                    {
                        Say("*poof*");
                    }
                }
            }

            if (m_BunnyType == BunnyType.Mysterious && Utility.RandomDouble() <= .33 && !digging)
            {
                if (from != null && Combatant != null)
                {
                    if (Combatant.Alive)
                    {
                        Point3D location = Combatant.Location;
                        Map     map      = Combatant.Map;

                        ResolveEggChance(location, map, 1.0, .2);

                        Effects.PlaySound(location, map, 0x657);
                        Effects.SendLocationParticles(EffectItem.Create(location, map, TimeSpan.FromSeconds(5)), 0x3728, 10, 10, 2023);
                    }
                }
            }

            base.OnDamagedBySpell(from);
        }
Beispiel #13
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .1;

            if (ControlMaster is PlayerMobile)
            {
                effectChance = .02;
            }

            if (Utility.RandomDouble() <= effectChance)
            {
                int healingAmount = (int)((double)HitsMax * .25);

                Hits += healingAmount;

                this.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);

                Blood blood = new Blood();
                blood.MoveToWorld(new Point3D(defender.X + Utility.RandomMinMax(-1, 1), defender.Y + Utility.RandomMinMax(-1, 1), defender.Z + 1), Map);

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, DamageMax, 8.0, 0x44D, true, "", "The creature sinks its fangs into you, healing itself and causing you to bleed!", "-1");
            }
        }
Beispiel #14
0
        public int AbilityCount()
        {
            int count = 0;

            if (MagicalAbility != MagicalAbility.None)
            {
                count++;
            }

            if (SpecialAbilities != null)
            {
                count += SpecialAbilities.Where(a => !a.NaturalAbility).Count();
            }

            if (AreaEffects != null)
            {
                count += AreaEffects.Length;
            }

            if (WeaponAbilities != null)
            {
                count += WeaponAbilities.Length;
            }

            return(count);
        }
Beispiel #15
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .25;

            if (Controlled && ControlMaster != null)
            {
                if (ControlMaster is PlayerMobile)
                {
                    effectChance = .20;
                }
            }

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, -1, true, "", "Their bite causes you to bleed!", "-1");

            effectChance = .20;

            if (Controlled && ControlMaster != null)
            {
                if (ControlMaster is PlayerMobile)
                {
                    if (defender is PlayerMobile)
                    {
                        effectChance = .05;
                    }
                    else
                    {
                        effectChance = .25;
                    }
                }
            }

            SpecialAbilities.FrenzySpecialAbility(effectChance, this, defender, .25, 10, -1, true, "", "", "*becomes frenzied*");
        }
Beispiel #16
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double spawnPercent = (double)intervalCount / (double)totalIntervals;

            double bloodlustChance = .20 + (.20 * spawnPercent);
            double bleedChance     = .20 + +(.20 * spawnPercent);

            if (Utility.RandomDouble() <= bloodlustChance && DateTime.UtcNow > m_NextBloodlustAllowed && DateTime.UtcNow > m_NextAbilityAllowed)
            {
                m_NextBloodlustAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(30 - (20 * spawnPercent));
                m_NextAbilityAllowed   = DateTime.UtcNow + TimeSpan.FromSeconds(10 - (8 * spawnPercent));

                Effects.PlaySound(Combatant.Location, Combatant.Map, 0x28a);

                SpecialAbilities.FrenzySpecialAbility(1.0, this, defender, 0.5, 30, -1, true, "", "", "*becomes consumed with bloodlust*");

                Effects.SendLocationParticles(EffectItem.Create(Location, Map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, 2117, 0, 5029, 0);

                int bloodItem = 5 + (int)(Math.Ceiling(10 * spawnPercent));

                for (int a = 0; a < bloodItem; a++)
                {
                    new Blood().MoveToWorld(new Point3D(defender.Location.X + Utility.RandomMinMax(-3, 3), defender.Location.Y + Utility.RandomMinMax(-3, 3), defender.Location.Z), Map);
                }
            }

            else
            {
                SpecialAbilities.BleedSpecialAbility(bleedChance, this, defender, DamageMax, 8.0, -1, true, "", "Their attack causes you to bleed!", "-1");
            }
        }
Beispiel #17
0
        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);
        }
Beispiel #18
0
        public override void OnThink()
        {
            base.OnThink();

            if (Utility.RandomDouble() < 1 && DateTime.UtcNow > m_NextPotionThrowAllowed && AIObject.currentCombatRange != CombatRange.Withdraw && AIObject.Action != ActionType.Flee)
            {
                Mobile combatant = this.Combatant;

                if (combatant != null && !BardPacified)
                {
                    if (combatant.Alive && this.InLOS(combatant) && this.GetDistanceToSqrt(combatant) <= 8)
                    {
                        int potionType = Utility.RandomMinMax(1, 5);

                        switch (potionType)
                        {
                        case 1: SpecialAbilities.ThrowPotionAbility(this, combatant, 1.5, 1.5, PotionAbilityEffectType.Explosion, 1, 10, 20, 1, 0, false, true); break;

                        case 2: SpecialAbilities.ThrowPotionAbility(this, combatant, 1.5, 1.5, PotionAbilityEffectType.Paralyze, 1, 5, 10, 1, 5, false, true); break;

                        case 3: SpecialAbilities.ThrowPotionAbility(this, combatant, 1.5, 1.5, PotionAbilityEffectType.Poison, 1, 5, 10, Utility.RandomMinMax(1, 2), 1, false, true); break;

                        case 4: SpecialAbilities.ThrowPotionAbility(this, combatant, 1.5, 1.5, PotionAbilityEffectType.Frost, 1, 5, 10, .2, 10, false, true); break;

                        case 5: SpecialAbilities.ThrowPotionAbility(this, combatant, 1.5, 1.5, PotionAbilityEffectType.Shrapnel, 2, 7, 15, 1, 0, true, true); break;
                        }

                        m_NextPotionThrowAllowed = DateTime.UtcNow + NextPotionThrowDelay;
                    }
                }
            }
        }
        public override void Drink(Mobile from)
        {
            if (this != null && ParentEntity != from.Backpack)
            {
                from.SendMessage("The potion must be in your pack to drink it.");
            }

            else
            {
                if (!from.CanBeginAction(typeof(UOACZLesserTruestrikePotion)))
                {
                    from.SendMessage("You must wait before drinking another potion of that type.");
                    return;
                }

                SpecialAbilities.ExpertiseSpecialAbility(1.0, from, null, .05, 120, -1, true, "You begin to strike with increased accuracy.", "", "-1");

                from.BeginAction(typeof(UOACZLesserTruestrikePotion));

                Timer.DelayCall(TimeSpan.FromSeconds(120), delegate
                {
                    from.EndAction(typeof(UOACZLesserTruestrikePotion));
                });

                Consume();
            }
        }
Beispiel #20
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);
        }
Beispiel #21
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .15;

            SpecialAbilities.BleedSpecialAbility(effectChance, this, defender, DamageMax, 8.0, -1, true, "", "Their bite causes you to bleed!", "-1");
        }
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            defender.PlaySound(0x234);

            SpecialAbilities.BleedSpecialAbility(.25, this, defender, DamageMax, 8.0, -1, true, "", "Their precise shot causes you to bleed!", "-1");
        }
Beispiel #23
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .10;

            SpecialAbilities.CrippleSpecialAbility(effectChance, this, defender, .25, 10, -1, true, "", "The creature has transfixed you with it's gaze, slowing your actions!", "-1");
        }
Beispiel #24
0
 void Start()
 {
     _character        = GetComponent <Character>();
     _health           = GetComponent <Health>();
     _weaponSystem     = GetComponent <WeaponSystem>();
     _specialAbilities = GetComponent <SpecialAbilities>();
     RegisterForMouseClick();
 }
Beispiel #25
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .1;

            SpecialAbilities.DiseaseSpecialAbility(effectChance, this, defender, 10, 60, -1, true, "", "Their bite has infected you with a horrific disease!");
        }
 private void Start()
 {
     combat    = GetComponent <CombatSystem>();
     weapons   = GetComponent <WeaponSystem>();
     abilities = GetComponent <SpecialAbilities>();
     animator  = GetComponent <Animator>();
     camera    = GetComponent <CameraController>();
 }
Beispiel #27
0
        public override void OnGotMeleeAttack(Mobile attacker)
        {
            base.OnGotMeleeAttack(attacker);

            double effectChance = .2;

            SpecialAbilities.EnrageSpecialAbility(effectChance, attacker, this, .2, 20, -1, true, "Your attack enrages the target.", "", "*becomes enraged*");
        }
Beispiel #28
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            double effectChance = .2;

            SpecialAbilities.FrenzySpecialAbility(effectChance, this, defender, 1.0, 15, -1, true, "", "", "*becomes frenzied*");
        }
Beispiel #29
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);

            base.OnGaveMeleeAttack(defender);

            double effectChance = .10;

            if (Controlled && ControlMaster != null)
            {
                if (ControlMaster is PlayerMobile)
                {
                    if (defender is PlayerMobile)
                    {
                        effectChance = .02;
                    }
                    else
                    {
                        effectChance = .25;
                    }
                }
            }

            if (Utility.RandomDouble() <= effectChance)
            {
                PublicOverheadMessage(MessageType.Regular, 0, false, "*burrows into opponent*");

                defender.SendMessage("The creature burrows inside of you, causing you immense pain and discomfort!");

                double damage = DamageMax * 5;

                SpecialAbilities.BleedSpecialAbility(1.0, this, defender, damage, 30, 0x4F1, true, "", "", "-1");

                int projectiles   = 6;
                int particleSpeed = 4;

                for (int a = 0; a < projectiles; a++)
                {
                    Point3D newLocation = SpecialAbilities.GetRandomAdjustedLocation(defender.Location, defender.Map, true, 4, false);

                    IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(defender.X, defender.Y, defender.Z + Utility.RandomMinMax(5, 10)), defender.Map);
                    IEntity effectEndLocation   = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + Utility.RandomMinMax(10, 20)), defender.Map);

                    Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(4651, 4652, 4653, 4654), particleSpeed, 0, false, false, 0, 0);
                }

                for (int a = 0; a < 4; a++)
                {
                    Point3D bloodLocation = SpecialAbilities.GetRandomAdjustedLocation(Location, Map, true, 1, false);
                    new Blood().MoveToWorld(bloodLocation, Map);
                }

                int selfDamage = 10;

                AOS.Damage(this, selfDamage, 0, 100, 0, 0, 0);
            }
        }
Beispiel #30
0
        public override void OnDamage(int amount, Mobile from, bool willKill)
        {
            if (willKill)
            {
                SpecialAbilities.MushroomExplosionAbility(this, 8, 10, 0, 4, false);
            }

            base.OnDamage(amount, from, willKill);
        }