Ejemplo n.º 1
0
        public void Target( RecallRune rune )
        {
            if ( !Caster.CanSee( rune ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
            {
            }
            else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, false ) )
            {
                Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
            }
            else if ( !rune.IsChildOf( Caster.Backpack ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
            }
            else if ( Caster.Region.IsPartOf( typeof( Jail ) ) )
            {
                Caster.SendMessage( "You cannot mark a rune while in jail." );
            }
            else if ( CheckSequence() )
            {
                rune.Mark( Caster );

                Caster.PlaySound( 0x1FA );
                Effects.SendLocationEffect( Caster, Caster.Map, 14201, 16 );
            }

            FinishSequence();
        }
Ejemplo n.º 2
0
        public void Target(RecallRune rune)
        {
            if (!this.Caster.CanSee(rune))
            {
                this.Caster.SendLocalizedMessage(500237); // Target can not be seen.
            }
            else if (!SpellHelper.CheckTravel(this.Caster, TravelCheckType.Mark))
            {
            }
            else if (SpellHelper.CheckMulti(this.Caster.Location, this.Caster.Map, !Core.AOS))
            {
                this.Caster.SendLocalizedMessage(501942); // That location is blocked.
            }
            else if (!rune.IsChildOf(this.Caster.Backpack))
            {
                this.Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422); // You must have this rune in your backpack in order to mark it.
            }
            else if (this.CheckSequence())
            {
                rune.Mark(this.Caster);

                this.Caster.PlaySound(0x1FA);
                Effects.SendLocationEffect(this.Caster, this.Caster.Map, 14201, 16);
            }

            this.FinishSequence();
        }
Ejemplo n.º 3
0
		public void Target(RecallRune rune)
		{
			if (!Caster.CanSee(rune))
			{
				Caster.SendLocalizedMessage(500237); // Target can not be seen.
			}
			else if (!SpellHelper.CheckTravel(Caster, TravelCheckType.Mark))
			{ }
			else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map, !Caster.EraAOS))
			{
				Caster.SendLocalizedMessage(501942); // That location is blocked.
			}
			else if (!rune.IsChildOf(Caster.Backpack))
			{
				Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422);
					// You must have this rune in your backpack in order to mark it.
			}
			else if (Caster.Map != Map.Felucca)
			{
				Caster.SendMessage("A magical field prevents you from marking a rune here.");
			}
			else if (CheckSequence())
			{
				rune.Mark(Caster);

				Caster.PlaySound(0x1FA);
				Effects.SendLocationEffect(Caster, Caster.Map, 14201, 16);
			}

			FinishSequence();
		}
Ejemplo n.º 4
0
        public void Target( RecallRune rune )
        {
            if ( !Caster.CanSee( rune ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
            {
            }
            else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
            {
                Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
            }
            else if ( !rune.IsChildOf( Caster.Backpack ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
            }
            else if ( CheckSequence() )
            {
                rune.Mark( Caster );
                Caster.FixedParticles( 0x376A, 9, 32, 0x13AF, EffectLayer.Waist );
                Caster.PlaySound( 0x1FA );
            }

            FinishSequence();
        }
Ejemplo n.º 5
0
		public void Target( RecallRune rune )
		{
			if( !Caster.CanSee( rune ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
			{
			}

            else if (SpellHelper.CheckMulti(Caster.Location, Caster.Map, !Core.AOS))
            {
                Caster.SendMessage("That location is blocked.");
            }

            else if (!CheckAltar(Caster.Location, Caster.Map))
            {
                Caster.SendMessage("You must be on an altar to preform this spell.");
            }

            else if (!rune.IsChildOf(Caster.Backpack))
            {
                Caster.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1062422); // You must have this rune in your backpack in order to mark it.
            }

            else if (CheckSequence())
            {
                rune.Mark(Caster);

                Caster.PlaySound(0x1FA);
                Effects.SendLocationEffect(Caster, Caster.Map, 14201, 16);
            }

			FinishSequence();
		}
Ejemplo n.º 6
0
		public void Target( RecallRune rune )
		{
			if ( !Caster.CanSee( rune ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( !SpellHelper.CheckTravel( Caster, TravelCheckType.Mark ) )
			{
                //Caster.SendAsciiMessage("ros");
			}
			else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
			{
				Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
			}
			else if ( !rune.IsChildOf( Caster.Backpack ) )
			{
				Caster.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1062422 ); // You must have this rune in your backpack in order to mark it.
			}
			else if ( CheckSequence() )
			{
                if (Caster.Region is Regions.HouseRegion || (Caster.Region is Regions.CustomRegion && ((Regions.CustomRegion)Caster.Region).Controller.IsRestrictedSpell(this)))
                    Caster.SendAsciiMessage("You can't mark here.");
                else if (Caster.Region is Regions.GreenAcres && Caster.AccessLevel == AccessLevel.Player)
                    Caster.SendAsciiMessage("You cannot mark runes in Green Acres");
                else
                {
                    rune.Mark(Caster);

                    Caster.PlaySound(Sound);
                }
			}

			FinishSequence();
		}
        public void AddRune(Mobile from, RecallRune dropped)
        {
            if (Entries.Count < 16)
            {
                RecallRune rune = dropped;

                if (rune.Marked && rune.TargetMap != null)
                {
                    Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House));

                    dropped.Delete();

                    from.Send(new PlaySound(0x42, GetWorldLocation()));

                    string desc = rune.Description;

                    if (desc == null || (desc = desc.Trim()).Length == 0)
                        desc = "(nondescript)";

                    from.SendMessage(desc);
                }
                else
                {
                    from.SendLocalizedMessage(502409); // This rune does not have a marked location.
                }
            }
            else
            {
                from.SendLocalizedMessage(502401); // This runebook is full.
            }
        }
Ejemplo n.º 8
0
 private void MarkRune(RecallRune r, Mobile from)
 {
     r.Marked = true;
     r.TargetMap = from.Map;
     r.Target = from.Location;
     r.House = null;
     from.PlaySound(0x1FA);
     if (r.IsChildOf(from.Backpack))
     {
         Effects.SendLocationEffect(from, from.Map, 14201, 16);
     }
     else
     {
         Effects.SendLocationEffect(r, r.Map, 14201, 16);
     }
 }
Ejemplo n.º 9
0
        public void Target( RecallRune rune )
        {
            if ( !Caster.CanSee( rune ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( !SpellHelper.CheckTravel( Caster, Caster.Location, Caster.Map, TravelType.Mark ) && Caster.AccessLevel == AccessLevel.Player )
            {
                Caster.PlaySound( 0x5C );
            }
            else if ( SpellHelper.CheckMulti( Caster.Location, Caster.Map, !Core.AOS ) )
            {
                Caster.SendLocalizedMessage( 501942 ); // That location is blocked.
            }
            else if ( CheckSequence() )
            {
                rune.Mark( Caster );

                Caster.PlaySound( 0x1FA );
                Effects.SendLocationEffect( Caster, Caster.Map, 14201, 16 );
            }

            FinishSequence();
        }
Ejemplo n.º 10
0
		public override void OnResponse(NetState state, RelayInfo info)
		{
			if(info.ButtonID == 1)
			{
				Mobile from = state.Mobile;
				
				if(from.InRange(m_Sign.Location, 2))
				{
					if(!Banker.Withdraw(from, PlotSign.RuneCost))
					{
						from.SendMessage("You must have {0} gold in your bankbox to purchase a recall rune to this plot.", PlotSign.RuneCost);
						return;
					}
					
					RecallRune rune = new RecallRune();
					rune.Target = from.Location;
					rune.TargetMap = from.Map;
					rune.Description = String.Format("Lot: {0}", m_Sign.Plot.PlotDef.ID);
					rune.Marked = true;
					
					if(from.Backpack == null || !from.Backpack.TryDropItem(from, rune, false))
					{
						from.BankBox.DropItem(rune);
                        from.SendMessage("An item has been placed in your bankbox.");
					}
					else
                        from.SendLocalizedMessage(1153657); // An item has been placed in your backpack.
				}
				else
					from.SendMessage("You must be withing 2 tiles of the stall sign to mark a rune.");
			}
		}
Ejemplo n.º 11
0
 public RenamePrompt(RecallRune rune)
 {
     m_Rune = rune;
 }
Ejemplo n.º 12
0
		public void DropRune( Mobile from, RunebookEntry e, int index )
		{
            if (CheckAccess(from))
            {
                if (m_DefaultIndex > index)
                    m_DefaultIndex -= 1;
                else if (m_DefaultIndex == index)
                    m_DefaultIndex = -1;

                m_Entries.RemoveAt(index);

                RecallRune rune = new RecallRune();

                rune.Target = e.Location;
                rune.TargetMap = e.Map;
                rune.Description = e.Description;
                rune.House = e.House;
                rune.Marked = true;
                rune.ChargesLeft = e.ChargesLeft;

                from.AddToBackpack(rune);

                from.SendLocalizedMessage(502421); // You have removed the rune.
            }

            else
            {
                from.SendLocalizedMessage(502413); // That cannot be done while the book is locked down.
            }
		}
Ejemplo n.º 13
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is RecallRune)
            {
                if (!CheckAccess(from))
                {
                    from.SendLocalizedMessage(502413);                       // That cannot be done while the book is locked down.
                }
                else if (IsOpen(from))
                {
                    from.SendLocalizedMessage(1005571);                       // You cannot place objects in the book while viewing the contents.
                }
                else if (m_Entries.Count < 16)
                {
                    RecallRune rune = (RecallRune)dropped;

                    if (rune.Marked && rune.TargetMap != null)
                    {
                        m_Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House));

                        dropped.Delete();

                        from.Send(new PlaySound(0x42, GetWorldLocation()));

                        string desc = rune.Description;

                        if (desc == null || (desc = desc.Trim()).Length == 0)
                        {
                            desc = "(indescript)";
                        }

                        from.SendMessage(desc);

                        return(true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502409);                           // This rune does not have a marked location.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502401);                       // This runebook is full.
                }
            }
            else if (dropped is RecallScroll)
            {
                if (m_CurCharges < m_MaxCharges)
                {
                    from.Send(new PlaySound(0x249, GetWorldLocation()));

                    int amount = dropped.Amount;

                    if (amount > (m_MaxCharges - m_CurCharges))
                    {
                        dropped.Consume(m_MaxCharges - m_CurCharges);
                        m_CurCharges = m_MaxCharges;
                    }
                    else
                    {
                        m_CurCharges += amount;
                        dropped.Delete();

                        return(true);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502410);                       // This book already has the maximum amount of charges.
                }
            }

            return(false);
        }
Ejemplo n.º 14
0
		public void DropRune( Mobile from, RunebookEntry e, int index )
		{
			if ( m_DefaultIndex == index )
				m_DefaultIndex = -1;

			m_Entries.RemoveAt( index );

			RecallRune rune = new RecallRune();

			rune.Target = e.Location;
			rune.TargetMap = e.Map;
			rune.Description = e.Description;
			rune.House = e.House;
			rune.Marked = true;

			from.AddToBackpack( rune );

            //al: fix for default rune changing
            if (index == m_DefaultIndex)
            {
                //case 1: default rune removed => disable default rune.
                m_DefaultIndex = -1;
            }
            else if (index < m_DefaultIndex)
            {
                //case 2: index of removed rune < m_DefaultIndex => fix m_DefaultIndex
                m_DefaultIndex--;
            }
            //--
			from.SendLocalizedMessage( 502421 ); // You have removed the rune.
		}
Ejemplo n.º 15
0
        public void OnTarget(IPoint3D p)
        {
            if (this.Parent == null || !(this.Parent is Mobile))
            {
                return;
            }

            Mobile m = (Mobile)this.Parent;

            if (m.Mana >= 10)
            {
                Map map = m.Map;

                if (p is RecallRune)
                {
                    RecallRune rune = p as RecallRune;

                    if (rune.Marked)
                    {
                        m.MoveToWorld(rune.Target, rune.TargetMap);
                        m.SendMessage("You have been moved to the rune's location.");
                    }
                    else
                    {
                        rune.Mark(m);

                        m.SendMessage("You use the ring's power to etch your location into the rune.");
                    }
                }
                else if (map == null || !map.CanSpawnMobile(p.X, p.Y, p.Z))
                {
                    m.SendMessage("The ring rejects your command to travel.");
                }
                else if (m.Hidden)
                {
                    int armorRating = Server.SkillHandlers.Stealth.GetArmorRating(m);

                    if (m.CheckSkill(SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2)))
                    {
                        _lastUsed = DateTime.Now;

                        m.Mana -= 10;
                        m.MoveToWorld(new Point3D(p), map);

                        m.SendMessage("You manage to silently use the ring's power.");
                    }
                    else
                    {
                        _lastUsed = DateTime.Now;

                        m.Mana -= 10;
                        m.RevealingAction();
                        m.MoveToWorld(new Point3D(p), map);
                        m.SendMessage("You fail in your attempt to travel silently.");

                        Effects.PlaySound(p, map, 0x20E);
                        Effects.SendLocationParticles(m, 0x1FCB, 10, 10, 2023);
                        Effects.SendLocationParticles(EffectItem.Create(new Point3D(p), map, EffectItem.DefaultDuration), 0x1FCB, 10, 10, 5023);
                    }
                }
                else
                {
                    _lastUsed = DateTime.Now;

                    m.Mana -= 10;
                    m.MoveToWorld(new Point3D(p), map);

                    Effects.PlaySound(p, map, 0x20E);
                    Effects.SendLocationParticles(m, 0x1FCB, 10, 10, 2023);
                    Effects.SendLocationParticles(EffectItem.Create(new Point3D(p), map, EffectItem.DefaultDuration), 0x1FCB, 10, 10, 5023);
                }
            }
            else
            {
                m.PublicOverheadMessage(Server.Network.MessageType.Regular, m.EmoteHue, true, "*the ring becomes warm, emitting a soft glow, but it is unable to function.*");
                m.SendMessage("You do not have enough mana to channel the power of the ring.");
                m.RevealingAction();
                m.PlaySound(0x5BF);
            }
        }
Ejemplo n.º 16
0
        public void DropRune( Mobile from, RunebookEntry e, int index )
        {
            if ( m_DefaultIndex == index )
                m_DefaultIndex = -1;

            m_Entries.RemoveAt( index );

            RecallRune rune = new RecallRune();

            rune.Target = e.Location;
            rune.TargetMap = e.Map;
            rune.Description = e.Description;
            rune.House = e.House;
            rune.Marked = true;

            from.AddToBackpack( rune );

            from.SendAsciiMessage( "You have removed the rune." );
        }
Ejemplo n.º 17
0
        public void DropRune(Mobile from, RunebookEntry e, int index)
        {
            if (this.m_DefaultIndex > index)
                this.m_DefaultIndex -= 1;
            else if (this.m_DefaultIndex == index)
                this.m_DefaultIndex = -1;

            this.m_Entries.RemoveAt(index);

            if (e.Galleon != null)
            {
                if (e.Galleon.Deleted)
                {
                    from.SendMessage("You discard the rune as the galleon is no longer available.");
                    return;
                }
                else
                {
                    ShipRune rune = new ShipRune(e.Galleon);
                    from.AddToBackpack(rune);
                }
            }
            else
            {
                RecallRune rune = new RecallRune();

                rune.Target = e.Location;
                rune.TargetMap = e.Map;
                rune.Description = e.Description;
                rune.House = e.House;
                rune.Marked = true;

                from.AddToBackpack(rune);
            }

            from.SendLocalizedMessage(502421); // You have removed the rune.
        }
Ejemplo n.º 18
0
		public virtual bool AddRune(Mobile m, RecallRune rune, RuneCodexCategory cat, bool message)
		{
			if (m == null || m.Deleted || rune == null || rune.Deleted || !rune.IsAccessibleTo(m))
			{
				return false;
			}

			PlayerMobile pm = m as PlayerMobile;

			if (cat == null)
			{
				cat = pm != null && Users.ContainsKey(pm)
						  ? (Users[pm].Category ?? Categories[Users[pm].CategoryPoint.X, Users[pm].CategoryPoint.Y])
						  : Categories[0, 0];
			}

			Point2D loc = pm != null && Users.ContainsKey(pm) ? Users[pm].EntryPoint : Point2D.Zero;

			if (!rune.Marked || rune.Target == Point3D.Zero || rune.TargetMap == Map.Internal)
			{
				if (message)
				{
					m.SendMessage("That rune is blank.");
				}

				return false;
			}

			if (cat != null)
			{
				if (cat.Entries.Count >= cat.Entries.Capacity)
				{
					if (message)
					{
						m.SendMessage("The rune codex category \"{0}\" can't hold more runes.", cat.Description);
					}

					return false;
				}

				if (cat.SetRune(m, rune, loc, message))
				{
					InvalidateProperties();
					return true;
				}
			}

			return false;
		}
Ejemplo n.º 19
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is RecallRune || dropped is ShipRune)
            {
                if (this.IsLockedDown && from.AccessLevel < AccessLevel.GameMaster)
                {
                    from.SendLocalizedMessage(502413, null, 0x35); // That cannot be done while the book is locked down.
                }
                else if (this.IsOpen(from))
                {
                    from.SendLocalizedMessage(1005571); // You cannot place objects in the book while viewing the contents.
                }
                else if (this.m_Entries.Count < MaxEntries)
                {
                    if (dropped is RecallRune)
                    {
                        RecallRune rune = (RecallRune)dropped;

                        if (rune.Marked && rune.TargetMap != null)
                        {
                            this.m_Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House));

                            dropped.Delete();

                            from.Send(new PlaySound(0x42, this.GetWorldLocation()));

                            string desc = rune.Description;

                            if (desc == null || (desc = desc.Trim()).Length == 0)
                            {
                                desc = "(indescript)";
                            }

                            from.SendMessage(desc);

                            return(true);
                        }
                        else
                        {
                            from.SendLocalizedMessage(502409); // This rune does not have a marked location.
                        }
                    }
                    else if (dropped is ShipRune)
                    {
                        ShipRune rune = (ShipRune)dropped;

                        if (rune.Galleon != null && !rune.Galleon.Deleted)
                        {
                            m_Entries.Add(new RunebookEntry(Point3D.Zero, null, rune.Galleon.ShipName, null, rune.Galleon));

                            dropped.Delete();

                            from.Send(new PlaySound(0x42, GetWorldLocation()));

                            string desc = rune.Galleon.ShipName;

                            if (desc == null || (desc = desc.Trim()).Length == 0)
                            {
                                desc = "an unnamed ship";
                            }

                            from.SendMessage(desc);

                            return(true);
                        }
                        else
                        {
                            if (rune.DockedBoat != null)
                            {
                                from.SendMessage("You cannot place a rune to a docked boat in the runebook.");
                            }
                            else
                            {
                                from.SendLocalizedMessage(502409); // This rune does not have a marked location.
                            }
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502401); // This runebook is full.
                }
            }
            else if (dropped is RecallScroll)
            {
                if (this.m_CurCharges < this.m_MaxCharges)
                {
                    from.Send(new PlaySound(0x249, this.GetWorldLocation()));

                    int amount = dropped.Amount;

                    if (amount > (this.m_MaxCharges - this.m_CurCharges))
                    {
                        dropped.Consume(this.m_MaxCharges - this.m_CurCharges);
                        this.m_CurCharges = this.m_MaxCharges;
                    }
                    else
                    {
                        this.m_CurCharges += amount;
                        dropped.Delete();

                        return(true);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502410); // This book already has the maximum amount of charges.
                }
            }

            return(false);
        }
 public RenamePrompt( RecallRune rune )
 {
     m_Rune = rune;
 }
Ejemplo n.º 21
0
        public RuneLibraryTMapsTrammel(Mobile from)
        {
            library = new ArrayList();

            readLine();
            Runebook rb        = new Runebook(0);
            int      nameStart = 1;
            int      nameEnd   = 1;

            for (int i = 0; i < size; i++)
            {
                if (rb.Entries.Count == 16)
                {
                    rb.Name = "Treasure Hunting Maps Trammel " + nameStart + " - " + (nameEnd - 1);
                    library.Add(rb);
                    rb        = new Runebook(0);
                    nameStart = nameEnd;
                }
                int        x    = int.Parse(xs[i]);
                int        y    = int.Parse(ys[i]);
                int        z    = int.Parse(zs[i]);
                Point3D    targ = new Point3D(x, y, z);
                RecallRune rr   = new RecallRune();
                rr.Target      = targ;
                rr.TargetMap   = Map.Trammel;
                rr.Description = mapNums[i] + " " + mapNames[i];
                rr.House       = null;
                rr.Marked      = true;
                rb.OnDragDrop(from, rr);
                nameEnd++;
            }
            rb.Name = "Treasure Hunting Maps Trammel " + nameStart + " - " + (nameEnd - 1);
            library.Add(rb);

            int height = 6;
            int offx;
            int offy;
            int offz;

            for (int p = 0; p < library.Count; p++)
            {
                Runebook librarybook = (Runebook)library[p];
                librarybook.Movable    = false;
                librarybook.MaxCharges = 12;
                librarybook.CurCharges = 12;
                if (p < 4)
                {
                    offx = from.Location.X - 1;
                    offy = from.Location.Y - 1;
                    offz = from.Location.Z + height;
                }
                else if (p >= 4 && p < 5)
                {
                    offx    = from.Location.X;
                    offy    = from.Location.Y - 1;
                    offz    = from.Location.Z + height + 2;
                    height += 2;
                }
                else if (p >= 5 && p < 9)
                {
                    offx = from.Location.X;
                    offy = from.Location.Y - 1;
                    offz = from.Location.Z + height;
                }
                else
                {
                    offx = from.Location.X + 1;
                    offy = from.Location.Y - 1;
                    offz = from.Location.Z + height;
                }
                Point3D loc = new Point3D(offx, offy, offz);
                librarybook.MoveToWorld(loc, from.Map);
                if (height == 0)
                {
                    height = 8;
                }
                height -= 2;
            }
        }
Ejemplo n.º 22
0
		public void Mark( RecallRune rune )
		{
			if ( TargetMap != null )
			{
				rune.Marked = true;
				rune.TargetMap = m_TargetMap;
				rune.Target = m_Target;
				rune.Description = m_Description;
				rune.House = null;
			}
		}
		public RuneLibraryDungeonsTrammel (Mobile from)
		{
			library = new ArrayList();

			readLine();
			Runebook rb = new Runebook(0);
			int nameStart = 1;
			int nameEnd = 1;
			for( int i=0; i<size; i++ )
			{
				if( rb.Entries.Count == 16 )
				{
					rb.Name = "Dungeons Trammel " + nameStart + " - " + (nameEnd-1);
					library.Add(rb);
					rb = new Runebook(0);
					nameStart = nameEnd;
				}
				int x = int.Parse(xs[i]);
				int y = int.Parse(ys[i]);
				int z = int.Parse(zs[i]);
				Point3D targ = new Point3D(x, y, z);
				RecallRune rr = new RecallRune();
				rr.Target = targ;
				rr.TargetMap = Map.Trammel;
				rr.Description = mapNums[i] + " " + mapNames[i];
				rr.House = null;
				rr.Marked = true;		
				rb.OnDragDrop(from, rr );
				nameEnd++;
			}
			rb.Name = "Dungeons Trammel " + nameStart + " - " + (nameEnd-1);
			library.Add(rb);

			int height = 6;
			int offx;
			int offy;
			int offz;
			for(int p=0; p<library.Count; p++)
			{
				Runebook librarybook = (Runebook)library[p];
				librarybook.Movable = false;
				librarybook.MaxCharges = 12;
				librarybook.CurCharges = 12;
				if(p < 4)
				{
					offx = from.Location.X-1;
					offy = from.Location.Y-1;
					offz = from.Location.Z+height;
				}
				else if(p >= 4 && p < 5)
				{
					offx = from.Location.X;
					offy = from.Location.Y-1;
					offz = from.Location.Z+height+2;
					height += 2;
				}
				else if(p >= 5 && p < 9)
				{
					offx = from.Location.X;
					offy = from.Location.Y-1;
					offz = from.Location.Z+height;
				}
				else
				{
					offx = from.Location.X+1;
					offy = from.Location.Y-1;
					offz = from.Location.Z+height;
				}
				Point3D loc = new Point3D(offx, offy, offz);
				librarybook.MoveToWorld(loc, from.Map);
				if( height == 0 )
					height = 8;
				height -= 2;
			}
		}
Ejemplo n.º 24
0
		public bool AddRune(Mobile m, RecallRune rune, bool message)
		{
			if (m == null || m.Deleted || rune == null || rune.Deleted)
			{
				return false;
			}

			if (!rune.Marked || rune.Target == Point3D.Zero || rune.TargetMap == Map.Internal)
			{
				if (message)
				{
					m.SendMessage("That rune is blank.");
				}

				return false;
			}

			if (Entries.Count >= Entries.Capacity)
			{
				if (message)
				{
					m.SendMessage("The category \"{0}\" can't hold more runes.", _Name);
				}

				return false;
			}

			Entries.ForEach(
				(e, x, y) =>
				{
					if (e != null || rune.Deleted)
					{
						return;
					}

					Entries.SetContent(x, y, new RuneCodexEntry(rune.Name, rune.Description, rune.Target.ToMapPoint(rune.TargetMap)));
					rune.Delete();
				});

			if (message)
			{
				m.SendMessage("You add the rune to the rune codex category \"{0}\".", _Name);
			}

			return true;
		}
Ejemplo n.º 25
0
        public bool TryMarkRune(RecallRune rune, Mobile from)
        {
            ShipRune newRune = new ShipRune(this);
            Container c = rune.Parent as Container;
            newRune.Location = rune.Location;

            if (c != null)
                c.AddItem(newRune);
            else
                c.MoveToWorld(from.Location, from.Map);

            rune.Delete();
            return true;
        }
Ejemplo n.º 26
0
        public void DropRune(Mobile from, RunebookEntry e, int index)
        {
            if (this.m_DefaultIndex > index)
                this.m_DefaultIndex -= 1;
            else if (this.m_DefaultIndex == index)
                this.m_DefaultIndex = -1;

            this.m_Entries.RemoveAt(index);

            RecallRune rune = new RecallRune();

            rune.Target = e.Location;
            rune.TargetMap = e.Map;
            rune.Description = e.Description;
            rune.House = e.House;
            rune.Marked = true;

            from.AddToBackpack(rune);

            from.SendLocalizedMessage(502421); // You have removed the rune.
        }
Ejemplo n.º 27
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is RecallScroll)
            {
                Item scrolls = dropped as Item;
                int  amount  = scrolls.Amount;

                if (amount <= 0)
                {
                    return(false); //amount should not be zero, but better safe than sorry.
                }
                int count = 0;     //this keeps track of the count of scrolls added to each runebook
                int total = 0;     //this keeps track of the total added to all runebooks
                for (int x = 0; x < 51; x++)
                {
                    if (Books[x].Entries.Count < 16)                   //check each runebook
                    {
                        if (Books[x].CurCharges < Books[x].MaxCharges) //if there is space for more charges...
                        {
                            from.Send(new PlaySound(0x249, from.Location));

                            if (amount > (Books[x].MaxCharges - Books[x].CurCharges))  //if the amount of scrolls is > than space free
                            {
                                count = Books[x].MaxCharges - Books[x].CurCharges;
                                scrolls.Consume(count);
                                Books[x].CurCharges = Books[x].MaxCharges;
                                total  += count;
                                amount -= count;
                            }
                            else  //otherwise we just add/delete whatever scrolls are left
                            {
                                Books[x].CurCharges += amount;
                                scrolls.Delete();
                                total += amount;
                                amount = 0;
                            }
                        }
                    }
                    if (amount <= 0)
                    {
                        from.SendMessage("{0} Recall Scrolls were added.", total.ToString());
                        return(true);
                    }
                }
            }
            else
            if (dropped is RecallRune)
            {
                for (int x = 0; x < 51; x++)
                {
                    if (Books[x].Entries.Count < 16)
                    {
                        RecallRune rune = (RecallRune)dropped;

                        if (rune.Marked && rune.TargetMap != null)
                        {
                            Books[x].Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House));

                            dropped.Delete();

                            from.Send(new PlaySound(0x42, GetWorldLocation()));

                            string desc = rune.Description;

                            if (desc == null || (desc = desc.Trim()).Length == 0)
                            {
                                desc = "(indescript)";
                            }

                            from.SendMessage(desc);

                            return(true);
                        }
                        else
                        {
                            from.SendLocalizedMessage(502409);     // This rune does not have a marked location.
                        }
                    }
                }
                from.SendLocalizedMessage(502401);     // This runebook is full.
            }
            else
            if (dropped is Runebook)
            {
                for (int x = 0; x < 51; x++)
                {
                    if (Books[x].Entries.Count == 0)
                    {
                        Runebook rb = dropped as Runebook;
                        for (int y = 0; y < rb.Entries.Count; y++)
                        {
                            RunebookEntry rune = rb.Entries[y] as RunebookEntry;
                            Books[x].Entries.Add(new RunebookEntry(rune.Location, rune.Map, rune.Description, rune.House));
                        }
                        Books[x].Name = rb.Name;
                        dropped.Delete();
                        return(true);
                    }
                }
                from.SendLocalizedMessage(502401);         // This runebook is full.
            }

            return(false);
        }