Ejemplo n.º 1
0
        public override void OnCast()
        {
            ChampionSpawnRegion r = Caster.Region.GetRegion <ChampionSpawnRegion>();

            if (r == null || !Caster.InRange(r.ChampionSpawn, Range))
            {
                Caster.SendLocalizedMessage(1072111); // You are not in a valid exorcism region.
            }
            else if (CheckSequence())
            {
                Map map = Caster.Map;

                if (map != null)
                {
                    IEnumerable <Mobile> targets = r.ChampionSpawn.GetMobilesInRange(Range).Where(IsValidTarget);

                    foreach (Mobile m in targets)
                    {
                        // Surprisingly, no sparkle type effects
                        m.Location = GetNearestShrine(m);
                    }
                }
            }

            FinishSequence();
        }
Ejemplo n.º 2
0
        public override void OnCast()
        {
            ChampionSpawnRegion r = Caster.Region.GetRegion(typeof(ChampionSpawnRegion)) as ChampionSpawnRegion;

            if (r == null || !Caster.InRange(r.ChampionSpawn, Range))
            {
                Caster.SendLocalizedMessage(1072111);                   // You are not in a valid exorcism region.
            }
            else if (CheckSequence())
            {
                /* Creates a withering frost around the Caster,
                 * which deals Cold Damage to all valid targets in a radius of 5 tiles.
                 */

                Map map = Caster.Map;

                if (map != null)
                {
                    ArrayList targets = new ArrayList();

                    foreach (Mobile m in r.ChampionSpawn.GetMobilesInRange(Range))
                    {
                        if (IsValidTarget(m))
                        {
                            targets.Add(m);
                        }
                    }

                    //Effects.PlaySound( Caster.Location, map, 0x1FB );
                    //Effects.PlaySound( Caster.Location, map, 0x10B );
                    //Effects.SendLocationParticles( EffectItem.Create( Caster.Location, map, EffectItem.DefaultDuration ), 0x37CC, 1, 40, 97, 3, 9917, 0 );

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = (Mobile)targets[i];

                        //m.FixedParticles( 0x374A, 1, 15, 9502, 97, 3, (EffectLayer)255 );

                        //Suprisingly, no effects

                        m.Location = GetNearestShrine(m);
                    }
                }
            }

            FinishSequence();
        }
Ejemplo n.º 3
0
        public override void OnCast()
        {
            ChampionSpawnRegion r = Caster.Region.GetRegion(typeof(ChampionSpawnRegion)) as ChampionSpawnRegion;

            if (r == null || !Caster.InRange(r.ChampionSpawn, Range))
            {
                Caster.SendLocalizedMessage(1072111); // You are not in a valid exorcism region.
            }
            else if (CheckSequence())
            {
                Map map = Caster.Map;

                if (map != null)
                {
                    List <Mobile>     targets = new List <Mobile>();
                    IPooledEnumerable eable   = r.ChampionSpawn.GetMobilesInRange(Range);

                    foreach (Mobile m in eable)
                    {
                        if (IsValidTarget(m))
                        {
                            targets.Add(m);
                        }
                    }

                    eable.Free();

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        //Suprisingly, no sparkle type effects
                        Point3D p = GetNearestShrine(m, ref map);

                        m.MoveToWorld(p, map);
                    }
                }
            }

            FinishSequence();
        }
Ejemplo n.º 4
0
        public override void OnCast()
        {
            ChampionSpawnRegion r = this.Caster.Region.GetRegion(typeof(ChampionSpawnRegion)) as ChampionSpawnRegion;

            if (r == null || !this.Caster.InRange(r.ChampionSpawn, Range))
            {
                this.Caster.SendLocalizedMessage(1072111); // You are not in a valid exorcism region.
            }
            else if (this.CheckSequence())
            {
                Map map = this.Caster.Map;

                if (map != null)
                {
                    List <Mobile> targets = new List <Mobile>();

                    foreach (Mobile m in r.ChampionSpawn.GetMobilesInRange(Range))
                    {
                        if (this.IsValidTarget(m))
                        {
                            targets.Add(m);
                        }
                    }

                    for (int i = 0; i < targets.Count; ++i)
                    {
                        Mobile m = targets[i];

                        //Suprisingly, no sparkle type effects

                        m.Location = GetNearestShrine(m);
                    }
                }
            }

            this.FinishSequence();
        }
Ejemplo n.º 5
0
            private bool IsHerdable(BaseCreature bc)
            {
                if (bc.IsParagon)
                {
                    return(false);
                }

                if (bc.Tamable)
                {
                    return(true);
                }

                Map map = bc.Map;

                ChampionSpawnRegion region = Region.Find(bc.Home, map) as ChampionSpawnRegion;

                if (region != null)
                {
                    ChampionSpawn spawn = region.ChampionSpawn;

                    if (spawn != null && spawn.IsChampionSpawn(bc))
                    {
                        Type t = bc.GetType();

                        foreach (Type type in m_ChampTamables)
                        {
                            if (type == t)
                            {
                                return(true);
                            }
                        }
                    }
                }

                return(false);
            }
Ejemplo n.º 6
0
        public Corpse(Mobile owner, HairInfo hair, FacialHairInfo facialhair, List <Item> equipItems)
            : base(0x2006)
        {
            // To supress console warnings, stackable must be true
            Stackable = true;
            Amount    = owner.Body;          // protocol defines that for itemid 0x2006, amount=body
            Stackable = false;

            Movable   = false;
            Hue       = owner.Hue;
            Direction = owner.Direction;
            Name      = owner.Name;

            BaseCreature bc = owner as BaseCreature;

            m_Owner = owner;

            m_CorpseName = GetCorpseName(owner);

            m_TimeOfDeath = DateTime.Now;

            m_AccessLevel = owner.AccessLevel;
            m_Guild       = owner.Guild as Guild;
            m_Kills       = bc != null && bc.AlwaysMurderer ? 100 : owner.Kills;
            SetFlag(CorpseFlag.Criminal, owner.Criminal);

            m_Hair       = hair;
            m_FacialHair = facialhair;

            // This corpse does not turn to bones if: the owner is not a player
            SetFlag(CorpseFlag.NoBones, !owner.Player);
            m_BloodHue = owner.BloodHue;

            m_Looters    = new List <Mobile>();
            m_EquipItems = equipItems;

            m_Aggressors = new List <Mobile>(owner.Aggressors.Count + owner.Aggressed.Count);
            bool addToAggressors = bc == null;

            TimeSpan lastTime = TimeSpan.MaxValue;

            for (int i = 0; i < owner.Aggressors.Count; ++i)
            {
                AggressorInfo info = owner.Aggressors[i];

                if ((DateTime.Now - info.LastCombatTime) < lastTime)
                {
                    m_Killer = info.Attacker;
                    lastTime = (DateTime.Now - info.LastCombatTime);
                }

                if (addToAggressors && !info.CriminalAggression)
                {
                    m_Aggressors.Add(info.Attacker);
                }
            }

            for (int i = 0; i < owner.Aggressed.Count; ++i)
            {
                AggressorInfo info = owner.Aggressed[i];

                if ((DateTime.Now - info.LastCombatTime) < lastTime)
                {
                    m_Killer = info.Defender;
                    lastTime = (DateTime.Now - info.LastCombatTime);
                }

                if (addToAggressors)
                {
                    m_Aggressors.Add(info.Defender);
                }
            }

            if (!addToAggressors)
            {
                Mobile master = bc.GetMaster();
                if (master != null)
                {
                    m_Aggressors.Add(master);
                }

                List <DamageStore> rights = BaseCreature.GetLootingRights(bc.DamageEntries, bc.HitsMax);
                for (int i = 0; i < rights.Count; ++i)
                {
                    DamageStore ds = rights[i];

                    if (ds.m_HasRight)
                    {
                        m_Aggressors.Add(ds.m_Mobile);
                    }
                }
            }

            TimeSpan decayTime = m_DefaultDecayTime;

            if (bc != null)
            {
                ChampionSpawnRegion region = Region.Find(Location, Map) as ChampionSpawnRegion;

                if (region != null)
                {
                    ChampionSpawn spawn = region.Spawn;

                    if (spawn != null && spawn.IsChampionSpawn(bc))
                    {
                        decayTime = spawn.DecayTime;
                    }
                }
            }

            BeginDecay(decayTime);

            DevourCorpse();
        }
Ejemplo n.º 7
0
        public override bool Move(Direction d)
        {
            ChampionSpawnRegion oldRegion = this.Region as ChampionSpawnRegion;

            if (oldRegion != null && (this.Direction & Direction.Mask) == (d & Direction.Mask))
            {
                Point3D newLocation = this.Location;
                Point3D oldLocation = newLocation;

                int x = oldLocation.X, y = oldLocation.Y;
                int oldX = x, oldY = y;
                int oldZ = oldLocation.Z;

                int newZ;

                if (CheckMovement(d, out newZ))
                {
                    switch (d & Direction.Mask)
                    {
                    case Direction.North:
                        --y;
                        break;

                    case Direction.Right:
                        ++x;
                        --y;
                        break;

                    case Direction.East:
                        ++x;
                        break;

                    case Direction.Down:
                        ++x;
                        ++y;
                        break;

                    case Direction.South:
                        ++y;
                        break;

                    case Direction.Left:
                        --x;
                        ++y;
                        break;

                    case Direction.West:
                        --x;
                        break;

                    case Direction.Up:
                        --x;
                        --y;
                        break;
                    }

                    newLocation.X = x;
                    newLocation.Y = y;
                    newLocation.Z = newZ;

                    if (Region.Find(newLocation, this.Map) != oldRegion)
                    {
                        return(false);
                    }
                }
            }

            return(base.Move(d));
        }
Ejemplo n.º 8
0
        public void Effect(Point3D loc, Map map, bool checkMulti)
        {
            ChampionSpawnRegion champregion  = Region.Find(loc, map).GetRegion(typeof(ChampionSpawn)) as ChampionSpawnRegion;
            CustomRegion        customRegion = Region.Find(loc, map) as CustomRegion;

            if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            //else if ( map == null || (!Core.AOS && Caster.Map != map) )
            //	Caster.SendLocalizedMessage( 1005569 ); // You can not recall to another facet.
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.RecallFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, loc, TravelCheckType.RecallTo))
            {
            }
            else if (SpellHelper.IsWind(loc, map) && Caster.Skills[SkillName.Magery].Base < 70.0)
            {
                Caster.SendLocalizedMessage(503382); // You are not worthy of entrance to the city of Wind!
            }
            else if (Caster.Criminal)
            {
                Caster.SendLocalizedMessage(1005561, "", 0x22); // Thou'rt a criminal and cannot escape so easily.
            }
            else if (SpellHelper.CheckCombat(Caster))
            {
                Caster.SendLocalizedMessage(1005564, "", 0x22); // Wouldst thou flee during the heat of battle??
            }
            else if ((Region.Find(loc, map).IsPartOf(typeof(GuardedRegion))) && Caster.InCombat(TimeSpan.FromSeconds(60.0)) && Caster.Kills >= 5 && Faction.Find(Caster) != null && Caster.AccessLevel == AccessLevel.Player)
            {
                Caster.SendMessage(54, "You cannot enter town as a murderer and having recently been in combat!");
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move.
            }
            else if (!map.CanSpawnMobile(loc.X, loc.Y, loc.Z, false))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if ((checkMulti && SpellHelper.CheckMulti(loc, map)))
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if ((!Caster.Alive || (Caster is PlayerMobile && ((PlayerMobile)Caster).Young)) && champregion != null && !champregion.CanSpawn())
            {
                Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (m_Book != null && m_Book.CurCharges <= 0)
            {
                Caster.SendLocalizedMessage(502412); // There are no charges left on that item.
            }
            else if (customRegion != null && customRegion.Controller != null && customRegion.Controller.NoMounts && Caster.Mounted)
            {
                Caster.SendMessage("You cannot travel there while mounted!");
            }
            else if (customRegion != null && customRegion.Controller != null && customRegion.Controller.NoPets && Caster.Followers > 0)
            {
                Caster.SendMessage("Sorry, but no pets are allowed in that region at this time (including your mount).");
            }
            else if (CheckSequence())
            {
                BaseCreature.TeleportPets(Caster, loc, map, true);

                if (m_Book != null)
                {
                    --m_Book.CurCharges;
                }

                Caster.PlaySound(0x1FC);
                Caster.MoveToWorld(loc, map);
                Caster.PlaySound(0x1FC);
            }

            FinishSequence();
        }
Ejemplo n.º 9
0
        public void Target(IPoint3D p)
        {
            IPoint3D orig = p;
            Map      map  = Caster.Map;

            SpellHelper.GetSurfaceTop(ref p);

            var player = Caster as PlayerMobile;

            Point3D from = Caster.Location;
            Point3D to   = new Point3D(p);

            ChampionSpawnRegion champregion = Region.Find(new Point3D(p), map).GetRegion(typeof(ChampionSpawn)) as ChampionSpawnRegion;

            CustomRegion customRegion     = Region.Find(new Point3D(p), map) as CustomRegion;
            CustomRegion customRegionFrom = Region.Find(new Point3D(Caster), map) as CustomRegion;

            if (customRegion != null && customRegion.Controller != null && (!customRegion.Controller.CanEnter || customRegion.Controller.IsRestrictedSpell(this)))
            {
                Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (customRegionFrom != null && customRegionFrom.Controller != null && customRegionFrom.Controller.IsRestrictedSpell(this))
            {
                Caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (Factions.Sigil.ExistsOn(Caster))
            {
                Caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
            }
            else if (Server.Misc.WeightOverloading.IsOverloaded(Caster))
            {
                Caster.SendLocalizedMessage(502359, "", 0x22);                   // Thou art too encumbered to move.
            }
            else if (player != null && player.PokerGame != null)
            {
                player.SendMessage(61, "You cannot cast this spell whilst playing poker.");
            }
            else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.TeleportFrom))
            {
            }
            else if (!SpellHelper.CheckTravel(Caster, map, to, TravelCheckType.TeleportTo))
            {
            }
            else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (SpellHelper.CheckMulti(to, map))
            {
                Caster.SendLocalizedMessage(502831);                   // Cannot teleport to that spot.
            }
            else if (Region.Find(to, map).GetRegion(typeof(HouseRegion)) != null)
            {
                Caster.SendLocalizedMessage(502829);                   // Cannot teleport to that spot.
            }
            else if (customRegion != null && customRegion.m_Controller.IsSafeZone && Caster.InCombat(TimeSpan.FromSeconds(60.0)) && Caster.AccessLevel == AccessLevel.Player)
            {
                Caster.SendMessage(54, "You cannot enter a safe zone after recently having been in combat!");
            }
            else if ((!Caster.Alive || (Caster is PlayerMobile && ((PlayerMobile)Caster).Young)) && champregion != null && !champregion.CanSpawn())
            {
                Caster.SendLocalizedMessage(501942);                   // That location is blocked.
            }
            else if (CheckSequence())
            {
                SpellHelper.Turn(Caster, orig);

                Mobile m = Caster;

                m.Location = to;
                m.ProcessDelta();

                if (m.Player)
                {
                    Effects.SendLocationParticles(EffectItem.Create(from, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(to, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);
                }
                else
                {
                    m.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist);
                }

                m.PlaySound(0x1FE);

                IPooledEnumerable eable = m.GetItemsInRange(0);

                foreach (Item item in eable)
                {
                    if (item is Server.Spells.Sixth.ParalyzeFieldSpell.InternalItem || item is Server.Spells.Fifth.PoisonFieldSpell.InternalItem || item is Server.Spells.Fourth.FireFieldSpell.FireFieldItem)
                    {
                        item.OnMoveOver(m);
                    }
                }

                eable.Free();
            }

            FinishSequence();
        }