Kamras

Member
Would anyone be able to point me in the right direction if I wanted to send a different gump when someone clicks on the imbue button in the skills menu? I've found many entries in the imbue script but I'm a little lost..
 
Looks like it should be ImbuingGump

SkillInfo.Table[(int)SkillName.Imbuing].Callback = new SkillUseCallback( OnUse );

public static TimeSpan OnUse(Mobile from)
....
from.SendGump(new ImbuingGump(from));
}

But there's also ImbuingB and ImbuingC
You could always just put in a test message

from.SendGump(new ImbuingGump(from));
from.SendMessage("Test message for Imbuing skill use");
 
Ahh that is it! I looked at that line and for some reason it did not click to me. Now for the next fun part, figuring out how to get a crafting system to be called instead of a gump LOL.
 
so I made the tool to call the craft gump, which works fine. But i want the imbue action icon on the skills menu to bring up that same craft gump (i made it an actual craft system) instead of the imbue gump.
 
well the craft gump needs a tool, so you'll have to search their pack for the tool when they try to use the skill
but his is how you would send the craft gump

from.SendGump(new CraftGump(from, DefCarpentry.CraftSystem, tool, null));
 
I tried the above code and I got this error


Code:
    CS0103: Line 39: The name 'tool' does not exist in the current context
 
So I tried Adding a line to look for the tool and I got this error.

Code:
Errors:
+ Skills/Craft/Imbuing/Core/Imbuing.cs:
    CS1502: Line 41: The best overloaded method match for 'Server.Engines.Craft.CraftGump.CraftGump(Server.Mobile, Server.Engines.Craft.CraftSystem, Server.Items.BaseTool, object)' has some invalid arguments
    CS1503: Line 41: Argument 3: cannot convert from 'Server.Item' to 'Server.Items.BaseTool'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Here is the code that I Added

Code:
            Item tool = from.Backpack.FindItemByType(typeof(CarpTool));
           
            if (!from.Alive)
                from.SendLocalizedMessage(500949); //You can't do that when you're dead.
            else
            {
                from.SendGump(new CraftGump(from, DefCarpentry.CraftSystem, tool, null));
            }
 
Thank you zerodowned for your support. For the sake of follow through I have returned to this thread to post my final result. I did eventually figure this out and will post this in case anyone else is curious about changing what the imbue action icon does.

Here is the completed code I used that has worked.

This checks back pack for tool, if no tool is detected the player gets a warning. If tool is available then its used.

Code:
        public static TimeSpan OnUse(Mobile from)
        {
            if (!from.Alive)
                from.SendLocalizedMessage(500949); //You can't do that when you're dead.
            else
            {
                BaseTool tool = from.Backpack.FindItemByType( typeof( SmithHammer), true ) as SmithHammer;
                if ( tool != null )
                {
                    from.SendGump(new CraftGump(from, BlackSmithyDef.CraftSystem, tool, null));
                   
                }
                else
                    from.SendMessage( "Need Smith Hammer In BackPack..." );
            }
           
            /*
            else
            {
                from.CloseGump(typeof(ImbuingGump));
                from.SendGump(new ImbuingGump(from));
            }
            */

            return TimeSpan.FromSeconds(1.0);
        }
 

Active Shards

Donations

Total amount
$50.00
Goal
$1,000.00
Back