Ok people, I worked on this to the point where I am getting out of my comfort zone. What I would like to do is change the corpse stone so that it will say "Name of Location" when you moved your mouse over it, and if you double clicked on it, like the corpse stone, a gump will pop up displaying a description or whatever you want, which you can left click it and close it. In short, I need help.

Code:
/*

using System;
using Server.Items;
using Server.Gumps;
using Server.Network;
using Server.Mobiles;

namespace Server.Gumps
{
   
    public class DungeonTower : Item
    {
        [Constructable]
        public DungeonTower()
            : base(13041)
        {
            Movable = false;
            Hue = 2967;
            Name = "A Dungeon Tower";
        }

        public override void OnDoubleClick( Mobile from )
        {
            if ( from.InRange( this.GetWorldLocation(), 3 ) )
                      {   
                 from.SendGump( new ScriptDungeonTowerGump );       
                     from.CantWalk = true;   
            }
            else
            {
            from.SendMessage( "You are not close enough to use this.");
            }
        }

        public DungeonTower( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();
        }
    }
}
   
               
              

    namespace Server.Gumps
    {   
       
       
        public class ScriptDungeonTowerGump : Gump
        {   
                           
            public ScriptDungeonTowerGump : base( 150, 50 )
            {
   
                Closable = true;

                AddPage( 0 );

                AddImage( 0, 0, 3600 );

                AddImageTiled( 0, 14, 15, 200, 3603 );
                AddImageTiled( 380, 14, 14, 200, 3605 );

                AddImage( 0, 201, 3606 );

                AddImageTiled( 15, 201, 370, 16, 3607 );
                AddImageTiled( 15, 0, 370, 16, 3601 );

                AddImage( 380, 0, 3602 );

                AddImage( 380, 201, 3608 );

                AddImageTiled( 15, 15, 365, 190, 2624 );

                AddHtml( 30, 20, 360, 35, "<BASEFONT COLOR=Red>You see an entrance leading into a cavern, based on the side of a mountain.  Out of the dark hole in the earth, you hear noises. Sounds of grunts, growls, and other beastly noises echoing in the distance.  There have been stories, rumors if you will, that tell about many adventurers who have entered these hallow depths. Some, who have returned, talk about giant lizards that can breathe upon you a firery death.  Others, they come back too scared to speak of the horrors they have witnessed. While others, who they shall be remembered as the bravest of souls, have never returned.</BASEFONT>",  false, false );

                AddImage( 65, 72, 5605 );

                AddImageTiled( 80, 90, 200, 1, 9107 );
                AddImageTiled( 95, 92, 200, 1, 9157 );
   
                AddButton( 290, 175, 247, 248, 2, GumpButtonType.Reply, 0 );

                AddImageTiled( 15, 14, 365, 1, 9107 );
                AddImageTiled( 380, 14, 1, 190, 9105 );
                AddImageTiled( 15, 205, 365, 1, 9107 );
                AddImageTiled( 15, 14, 1, 190, 9105 );
                AddImageTiled( 0, 0, 395, 1, 9157 );
                AddImageTiled( 394, 0, 1, 217, 9155 );
                AddImageTiled( 0, 216, 395, 1, 9157 );
                AddImageTiled( 0, 0, 1, 217, 9155 );
            }
        }
    }
 
I'm not quite sure of what you are trying to do.
Here's how i understand it:

-Create stone,
-Edit to get ex: Deceit,
-Hover to see "Dungeon of Deceit",
-Double click and it opens a gump with a description of the dungeon,
-Close the gump and that's it.

Am i right?
 
When you hover your cursor over something in a gump and information pops up, that's a Tooltip and I believe it only supports Clilocs.
 
I'm not quite sure of what you are trying to do.
Here's how i understand it:

-Create stone,
-Edit to get ex: Deceit,
-Hover to see "Dungeon of Deceit",
-Double click and it opens a gump with a description of the dungeon,
-Close the gump and that's it.

Am i right?

yeah, right. I want to be able to edit the script itself for "dungeon name" and "description in gump".
You got it right Po0ka.
 
For the stone name, hue, and gump content, you will probably need to have an enum,
Code:
private enum Dungeons
{
	Deceit, Covetous, Destard
}

With that you would have a m_Dungeon = Dungeons.Deceit; in your stone.
Then send it out in the SendGump argument ( new ScriptDungeonTowerGump(m_Dungeon) ).
Then do checks like,
Code:
switch (dungeon)
{
	case Dungeons.Destard: writehtmlstuff(m_Descriptions[(int)dungeon]); break; //(or case Dungeons.Destard)
	other cases here...
}

For the content, hue, etc, you can do static arrays,
Code:
private static string m_Descriptions =
{
	"Deceit is a bad place full of skeletons", "Covetous......", "Destard is..."
};

Code:
private static int m_Hues = { 1102, 1683, 1206 };

And you need an accessor to set the correct stone type, which means:
Code:
public Dungeons Dungeon
{
	get{ return m_Dungeon; }
	set
	{
		m_Dungeon = value;
 		Hue = m_Hues[(int)m_Dungeon];
	}
}

If you need to see how to fix little errors you get, i suggest you to take a look at the faction stones for more informations.
 
For the stone name, hue, and gump content, you will probably need to have an enum,
Code:
private enum Dungeons
{
	Deceit, Covetous, Destard
}

With that you would have a m_Dungeon = Dungeons.Deceit; in your stone.
Then send it out in the SendGump argument ( new ScriptDungeonTowerGump(m_Dungeon) ).
Then do checks like,
Code:
switch (dungeon)
{
	case Dungeons.Destard: writehtmlstuff(m_Descriptions[(int)dungeon]); break; //(or case Dungeons.Destard)
	other cases here...
}

For the content, hue, etc, you can do static arrays,
Code:
private static string m_Descriptions =
{
	"Deceit is a bad place full of skeletons", "Covetous......", "Destard is..."
};

Code:
private static int m_Hues = { 1102, 1683, 1206 };

And you need an accessor to set the correct stone type, which means:
Code:
public Dungeons Dungeon
{
	get{ return m_Dungeon; }
	set
	{
		m_Dungeon = value;
		Hue = m_Hues[(int)m_Dungeon];
	}
}

If you need to see how to fix little errors you get, i suggest you to take a look at the faction stones for more informations.


Then would you mind posting the code with the corrections?
 
Well, i just wanted to give out directions, but if you really want me to write it all i will probably have some time tomorrow. (Sleep time)
 
There you go, attached it so it don't mess up with the indentation.
I tested it and it works, now you need to customize the gump as you wish :p
 

Attachments

  • DungeonStone.cs
    2.8 KB · Views: 4
Back