RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

ninja spell tools [need help]

ArisBB

Sorceror
hi all, i trying to make a new Spell Toll (unknown author) of Ninjitsu
but i having problems in lines 143, 144, 145, 146, 147, 148, 149, 150

it says about FocusAttack (and another spells) cant be found

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Network;
using Server.Spells;
using Server.Spells.Chivalry;
using Server.Prompts;

namespace Server.Gumps
{
    public class Tools_ninja_scrollGump : Gump
    {
        private Tools_ninja_scroll m_Scroll;

        public Tools_ninja_scrollGump( Mobile from, Tools_ninja_scroll scroll ) : base( 0, 0 )
        {
            m_Scroll = scroll;

            int mN01FocusAttack = m_Scroll.mN01FocusAttack;
            int mN02DeathStrike = m_Scroll.mN02DeathStrike;
            int mN03AnimalForm = m_Scroll.mN03AnimalForm;
            int mN04KiAttack = m_Scroll.mN04KiAttack;
            int mN05SurpriseAttack = m_Scroll.mN05SurpriseAttack;
            int mN06Backstab = m_Scroll.mN06Backstab;
            int mN07ShadowJump = m_Scroll.mN07ShadowJump;
            int mN08MirrorImage = m_Scroll.mN08MirrorImage;
            //int mN07NinjaMove = m_Scroll.mN07NinjaMove;
            //int mN10SacredJourneySpell = m_Scroll.mN10SacredJourneySpell;

            this.Closable=true;
            this.Disposable=true;
            this.Dragable=true;
            this.Resizable=false;
            this.AddPage(0);
            this.AddBackground(52, 34, 160, 411, 9200);

            this.AddImage(60, 45, 20736);
            this.AddImage(60, 90, 20737);
            this.AddImage(60, 135, 20738);
            this.AddImage(60, 180, 20739);
            this.AddImage(60, 225, 20740);
            this.AddImage(60, 270, 20741);
            this.AddImage(60, 315, 20742);
            this.AddImage(60, 360, 20743);
            //this.AddImage(142, 45, 20744);
            //this.AddImage(142, 90, 20745);

            if ( mN01FocusAttack == 1 ) { this.AddButton( 110, 55,  2361, 2361, 1, GumpButtonType.Reply, 1); }
            if ( mN02DeathStrike == 1 ) { this.AddButton( 110, 100,  2361, 2361, 2, GumpButtonType.Reply, 1); }
            if ( mN03AnimalForm == 1 ) { this.AddButton( 110, 145,  2361, 2361, 3, GumpButtonType.Reply, 1); }
            if ( mN04KiAttack == 1 ) { this.AddButton( 110, 190,  2361, 2361, 4, GumpButtonType.Reply, 1); }
            if ( mN05SurpriseAttack == 1 ) { this.AddButton( 110, 235,  2361, 2361, 5, GumpButtonType.Reply, 1); }
            if ( mN06Backstab == 1 ) { this.AddButton( 110, 280,  2361, 2361, 6, GumpButtonType.Reply, 1); }
            if ( mN07ShadowJump == 1 ) { this.AddButton( 110, 325,  2361, 2361, 7, GumpButtonType.Reply, 1); }
            if ( mN08MirrorImage == 1 ) { this.AddButton( 110, 370,  2361, 2361, 8, GumpButtonType.Reply, 1); }
            //if ( mN07NinjaMove == 1 ) { this.AddButton( 110, 325,  2361, 2361, 7, GumpButtonType.Reply, 1); }
            //if ( mN10SacredJourneySpell == 1 ) { this.AddButton( 192, 100,  2361, 2361, 10, GumpButtonType.Reply, 1); }

            if ( mN01FocusAttack == 0 ) { this.AddButton( 110, 55,  2360, 2360, 1, GumpButtonType.Reply, 1); }
            if ( mN02DeathStrike == 0 ) { this.AddButton( 110, 100,  2360, 2360, 2, GumpButtonType.Reply, 1); }
            if ( mN03AnimalForm == 0 ) { this.AddButton( 110, 145,  2360, 2360, 3, GumpButtonType.Reply, 1); }
            if ( mN04KiAttack == 0 ) { this.AddButton( 110, 190,  2360, 2360, 4, GumpButtonType.Reply, 1); }
            if ( mN05SurpriseAttack == 0 ) { this.AddButton( 110, 235,  2360, 2360, 5, GumpButtonType.Reply, 1); }
            if ( mN06Backstab == 0 ) { this.AddButton( 110, 280,  2360, 2360, 6, GumpButtonType.Reply, 1); }
            if ( mN07ShadowJump == 0 ) { this.AddButton( 110, 325,  2360, 2360, 7, GumpButtonType.Reply, 1); }
            if ( mN08MirrorImage == 0 ) { this.AddButton( 110, 370,  2360, 2360, 8, GumpButtonType.Reply, 1); }
            //if ( mN07NinjaMove == 0 ) { this.AddButton( 110, 325,  2360, 2360, 7, GumpButtonType.Reply, 1); }
            //if ( mN10SacredJourneySpell == 0 ) { this.AddButton( 192, 100,  2360, 2360, 10, GumpButtonType.Reply, 1); }

            this.AddButton(149, 408, 2152, 2152, 11, GumpButtonType.Reply, 1); // TOOLBAR
            this.AddLabel(60, 412, 52, @"Open Toolbar");
        }

    public override void OnResponse( NetState state, RelayInfo info )
    {
        Mobile from = state.Mobile;

        switch ( info.ButtonID )
        {
            case 0:
            {
                break;
            }
            case 1 : { if ( m_Scroll.mN01FocusAttack == 0 ) { m_Scroll.mN01FocusAttack = 1; } else { m_Scroll.mN01FocusAttack = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 2 : { if ( m_Scroll.mN02DeathStrike == 0 ) { m_Scroll.mN02DeathStrike = 1; } else { m_Scroll.mN02DeathStrike = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 3 : { if ( m_Scroll.mN03AnimalForm == 0 ) { m_Scroll.mN03AnimalForm = 1; } else { m_Scroll.mN03AnimalForm = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 4 : { if ( m_Scroll.mN04KiAttack == 0 ) { m_Scroll.mN04KiAttack = 1; } else { m_Scroll.mN04KiAttack = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 5 : { if ( m_Scroll.mN05SurpriseAttack == 0 ) { m_Scroll.mN05SurpriseAttack = 1; } else { m_Scroll.mN05SurpriseAttack = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 6 : { if ( m_Scroll.mN06Backstab == 0 ) { m_Scroll.mN06Backstab = 1; } else { m_Scroll.mN06Backstab = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 7 : { if ( m_Scroll.mN07ShadowJump == 0 ) { m_Scroll.mN07ShadowJump = 1; } else { m_Scroll.mN07ShadowJump = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 8 : { if ( m_Scroll.mN08MirrorImage == 0 ) { m_Scroll.mN08MirrorImage = 1; } else { m_Scroll.mN08MirrorImage = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            //case 7 : { if ( m_Scroll.mN07NinjaMove == 0 ) { m_Scroll.mN07NinjaMove = 1; } else { m_Scroll.mN07NinjaMove = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            //case 10 : { if ( m_Scroll.mN10SacredJourneySpell == 0 ) { m_Scroll.mN10SacredJourneySpell = 1; } else { m_Scroll.mN10SacredJourneySpell = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 9: //aris 11
            {
                from.CloseGump( typeof( Tools_tools_ninja ) );
                from.SendGump( new Tools_tools_ninja( from, m_Scroll ) );
                break;
            }
        }
    }}

    public class Tools_tools_ninja : Gump
    {
        public static bool HasSpell( Mobile from, int spellID )
        {
            Spellbook book = Spellbook.Find( from, spellID );
            return ( book != null && book.HasSpell( spellID ) );
        }

        private Tools_ninja_scroll m_Scroll;

        public Tools_tools_ninja( Mobile from, Tools_ninja_scroll scroll ) : base( 0, 0 )
        {
            m_Scroll = scroll;
            this.Closable=false;
            this.Disposable=true;
            this.Dragable=true;
            this.Resizable=false;
            this.AddPage(0);
            this.AddImage(0, 0, 11012, 1149);
            int dby = 50;

            if ( HasSpell( from, 500 ) && m_Scroll.mN01FocusAttack == 1){this.AddButton(dby, 5, 20736, 20736, 1, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 501 ) && m_Scroll.mN02DeathStrike == 1){this.AddButton(dby, 5, 20737, 20737, 2, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 502 ) && m_Scroll.mN03AnimalForm == 1){this.AddButton(dby, 5, 20738, 20738, 3, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 503 ) && m_Scroll.mN04KiAttack == 1){this.AddButton(dby, 5, 20739, 20739, 4, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 504 ) && m_Scroll.mN05SurpriseAttack == 1){this.AddButton(dby, 5, 20740, 20740, 5, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 505 ) && m_Scroll.mN06Backstab == 1){this.AddButton(dby, 5, 20741, 20741, 6, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 506 ) && m_Scroll.mN07ShadowJump == 1){this.AddButton(dby, 5, 20742, 20742, 7, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 507 ) && m_Scroll.mN08MirrorImage == 1){this.AddButton(dby, 5, 20743, 20743, 8, GumpButtonType.Reply, 1); dby = dby + 45;}
            //if ( HasSpell( from, 500 ) && m_Scroll.mN07NinjaMove == 1){this.AddButton(dby, 5, 20742, 20742, 7, GumpButtonType.Reply, 1); dby = dby + 45;}
            //if ( HasSpell( from, 209 ) && m_Scroll.mN10SacredJourneySpell == 1){this.AddButton(dby, 5, 20745, 20745, 10, GumpButtonType.Reply, 1); dby = dby + 45;}
        }
        
        public override void OnResponse( NetState state, RelayInfo info ) 
        { 
            Mobile from = state.Mobile; 
            switch ( info.ButtonID ) 
            {
                case 0: { break; }
                case 1 : { if ( HasSpell( from, 500 ) ) { new FocusAttack( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 2 : { if ( HasSpell( from, 501 ) ) { new DeathStrike( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 3 : { if ( HasSpell( from, 502 ) ) { new AnimalForm( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 4 : { if ( HasSpell( from, 503 ) ) { new KiAttack( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 5 : { if ( HasSpell( from, 504 ) ) { new SurpriseAttack( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 6 : { if ( HasSpell( from, 505 ) ) { new Backstab( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 7 : { if ( HasSpell( from, 506 ) ) { new ShadowJump( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 8 : { if ( HasSpell( from, 507 ) ) { new MirrorImage( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                //case 7 : { if ( HasSpell( from, 506 ) ) { new NinjaMove( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                //case 10 : { if ( HasSpell( from, 209 ) ) { new SacredJourneySpell( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
            }
        }
    }
}

any idea?
 

ArisBB

Sorceror
Good! but now i have new problem

1: the spells have the chivalry icons
2: the final gump with the spells dont open

any idea? =(
 

ViWinfii

Sorceror
Did you copy/paste this script that was a spell menu for Chivalry spells? I think you need to edit lines 50 to 70 and 126 to 135 that have the function AddButton. If you look at the function AddButton in class Gump, here's what you need to send to it:

Code:
AddButton(int X, int Y, int normalID, int pressedID, int buttonID, GumpButtonType Type, int param)

You need to change the normalID and pressedID of each one of your buttons to the appropriate Ninjitsu icons. I do not know what the numbers are for those without using GumpStudio or something to search for them. That should fix the icons.

As far as your #2 problem, not sure yet until I can test your code to see what's going on. I'll be able to test it at home in a few hours if you haven't figured it out by then.
 

ViWinfii

Sorceror
ArisBB, I didn't understand how to approach your 2nd problem without having more information on the class Tools_ninja_scroll. But I did fix a few things for you that you can recreate in your version.

I've been needing to create a quick cast gump for my custom spells but I never have gotten around to it. This script should be a good starting point for me - I hope you don't mind if I use it. Here's a working quick-cast bar for Ninjitsu:

Code:
using System;
using Server;
using Server.Items;
using Server.Network;
using Server.Spells;
using Server.Spells.Ninjitsu;
using Server.Commands;
 
namespace Server.Gumps
{
    public class NinjaCast : Gump
    {
 
        public static void Initialize()
        {
            CommandSystem.Register("ninja", AccessLevel.GameMaster, new CommandEventHandler(Ninja_OnCommand));
        }
 
        [Usage("Ninja")]
        [Description("Opens or closes the Ninja quick cast bar")]
        private static void Ninja_OnCommand(CommandEventArgs e)
        {
            if (e.Mobile.HasGump( typeof(NinjaCast) ))
                e.Mobile.CloseGump( typeof(NinjaCast) );
            else
                e.Mobile.SendGump(new NinjaCast(e.Mobile));
        }
 
        public static bool HasSpell(Mobile from, int spellID)
        {
            Spellbook book = Spellbook.Find(from, spellID);
            return (book != null && book.HasSpell(spellID));
        }
 
        public NinjaCast(Mobile from)
            : base(0, 0)
        {
            this.Closable = false;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);
            this.AddImage(0, 0, 11016, 1149);
            int dby = 50;
 
            if (HasSpell(from, 500)) { this.AddButton(dby, 5, 21280, 21280, 1, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 501)) { this.AddButton(dby, 5, 21281, 21281, 2, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 502)) { this.AddButton(dby, 5, 21282, 21282, 3, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 503)) { this.AddButton(dby, 5, 21283, 21283, 4, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 504)) { this.AddButton(dby, 5, 21284, 21284, 5, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 505)) { this.AddButton(dby, 5, 21285, 21285, 6, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 506)) { this.AddButton(dby, 5, 21286, 21286, 7, GumpButtonType.Reply, 1); dby = dby + 45; }
            if (HasSpell(from, 507)) { this.AddButton(dby, 5, 21287, 21287, 8, GumpButtonType.Reply, 1); dby = dby + 45; }
        }
 
        public override void OnResponse(NetState state, RelayInfo info)
        {
            Mobile from = state.Mobile;
            switch (info.ButtonID)
            {
                case 0: { break; }
                case 1: { if (HasSpell(from, 500)) { Spells.SpecialMove.SetCurrentMove( from, new FocusAttack()); from.SendGump(new NinjaCast(from)); } break; }
                case 2: { if (HasSpell(from, 501)) { Spells.SpecialMove.SetCurrentMove(from, new DeathStrike()); from.SendGump(new NinjaCast(from)); } break; }
                case 3: { if (HasSpell(from, 502)) { new AnimalForm(from, null).Cast(); from.SendGump(new NinjaCast(from)); } break; }
                case 4: { if (HasSpell(from, 503)) { Spells.SpecialMove.SetCurrentMove(from, new KiAttack()); from.SendGump(new NinjaCast(from)); } break; }
                case 5: { if (HasSpell(from, 504)) { Spells.SpecialMove.SetCurrentMove(from, new SurpriseAttack()); from.SendGump(new NinjaCast(from)); } break; }
                case 6: { if (HasSpell(from, 505)) { Spells.SpecialMove.SetCurrentMove(from, new Backstab()); from.SendGump(new NinjaCast(from)); } break; }
                case 7: { if (HasSpell(from, 506)) { new Shadowjump(from, null).Cast(); from.SendGump(new NinjaCast(from)); } break; }
                case 8: { if (HasSpell(from, 507)) { new MirrorImage(from, null).Cast(); from.SendGump(new NinjaCast(from)); } break; }
            }
        }
    }
}

I rewrote some of the code so there's no errors, has the correct icons for the spells, and now uses a command to open and close the gump. It also requires you to have a ninjitsu spellbook in your inventory. Some of this code is unnecessary for Ninjitsu spells since all Ninjitsu spellbooks contain every ninja spell by default. But for other learned spells this quick-cast bar could be very useful.

I may have removed the feature to select which spells you want to see in the cast bar. I'm thinking this probably has to do with your previous problem and the class Tools_ninja_scroll.
 

ArisBB

Sorceror
its dont working, and i dont know because =(

Code:
using System;
using System.Collections;
using Server;
using Server.Items;
using Server.Network;
using Server.Spells;
using Server.Spells.Ninjitsu;
using Server.Prompts;

namespace Server.Gumps
{
    public class Tools_ninja_scrollGump : Gump
    {
        private Tools_ninja_scroll m_Scroll;

        public Tools_ninja_scrollGump( Mobile from, Tools_ninja_scroll scroll ) : base( 0, 0 )
        {
            m_Scroll = scroll;

            int mN01FocusAttack = m_Scroll.mN01FocusAttack;
            int mN02DeathStrike = m_Scroll.mN02DeathStrike;
            int mN03AnimalForm = m_Scroll.mN03AnimalForm;
            int mN04KiAttack = m_Scroll.mN04KiAttack;
            int mN05SurpriseAttack = m_Scroll.mN05SurpriseAttack;
            int mN06Backstab = m_Scroll.mN06Backstab;
            int mN07Shadowjump = m_Scroll.mN07Shadowjump;
            int mN08MirrorImage = m_Scroll.mN08MirrorImage;
            //int mN07NinjaMove = m_Scroll.mN07NinjaMove;
            //int mN10SacredJourneySpell = m_Scroll.mN10SacredJourneySpell;

            this.Closable=true;
            this.Disposable=true;
            this.Dragable=true;
            this.Resizable=false;
            this.AddPage(0);
            //this.AddBackground(52, 34, 160, 411, 9200);
            this.AddBackground(52, 34, 160, 206, 9200);

            this.AddImage(60, 45, 21280);
            this.AddImage(60, 90, 21281);
            this.AddImage(60, 135, 21282);
            this.AddImage(60, 180, 21283);
            this.AddImage(60, 225, 21284);
            this.AddImage(60, 270, 21285);
            this.AddImage(60, 315, 21286);
            this.AddImage(60, 360, 21287);
            //this.AddImage(142, 45, 20744);
            //this.AddImage(142, 90, 20745);

            if ( mN01FocusAttack == 1 ) { this.AddButton( 110, 55,  2361, 2361, 1, GumpButtonType.Reply, 1); }
            if ( mN02DeathStrike == 1 ) { this.AddButton( 110, 100,  2361, 2361, 2, GumpButtonType.Reply, 1); }
            if ( mN03AnimalForm == 1 ) { this.AddButton( 110, 145,  2361, 2361, 3, GumpButtonType.Reply, 1); }
            if ( mN04KiAttack == 1 ) { this.AddButton( 110, 190,  2361, 2361, 4, GumpButtonType.Reply, 1); }
            if ( mN05SurpriseAttack == 1 ) { this.AddButton( 110, 235,  2361, 2361, 5, GumpButtonType.Reply, 1); }
            if ( mN06Backstab == 1 ) { this.AddButton( 110, 280,  2361, 2361, 6, GumpButtonType.Reply, 1); }
            if ( mN07Shadowjump == 1 ) { this.AddButton( 110, 325,  2361, 2361, 7, GumpButtonType.Reply, 1); }
            if ( mN08MirrorImage == 1 ) { this.AddButton( 110, 370,  2361, 2361, 8, GumpButtonType.Reply, 1); }
            //if ( mN07NinjaMove == 1 ) { this.AddButton( 110, 325,  2361, 2361, 7, GumpButtonType.Reply, 1); }
            //if ( mN10SacredJourneySpell == 1 ) { this.AddButton( 192, 100,  2361, 2361, 10, GumpButtonType.Reply, 1); }

            if ( mN01FocusAttack == 0 ) { this.AddButton( 110, 55,  2360, 2360, 1, GumpButtonType.Reply, 1); }
            if ( mN02DeathStrike == 0 ) { this.AddButton( 110, 100,  2360, 2360, 2, GumpButtonType.Reply, 1); }
            if ( mN03AnimalForm == 0 ) { this.AddButton( 110, 145,  2360, 2360, 3, GumpButtonType.Reply, 1); }
            if ( mN04KiAttack == 0 ) { this.AddButton( 110, 190,  2360, 2360, 4, GumpButtonType.Reply, 1); }
            if ( mN05SurpriseAttack == 0 ) { this.AddButton( 110, 235,  2360, 2360, 5, GumpButtonType.Reply, 1); }
            if ( mN06Backstab == 0 ) { this.AddButton( 110, 280,  2360, 2360, 6, GumpButtonType.Reply, 1); }
            if ( mN07Shadowjump == 0 ) { this.AddButton( 110, 325,  2360, 2360, 7, GumpButtonType.Reply, 1); }
            if ( mN08MirrorImage == 0 ) { this.AddButton( 110, 370,  2360, 2360, 8, GumpButtonType.Reply, 1); }
            //if ( mN07NinjaMove == 0 ) { this.AddButton( 110, 325,  2360, 2360, 7, GumpButtonType.Reply, 1); }
            //if ( mN10SacredJourneySpell == 0 ) { this.AddButton( 192, 100,  2360, 2360, 10, GumpButtonType.Reply, 1); }

            this.AddButton(149, 408, 2152, 2152, 11, GumpButtonType.Reply, 1); // TOOLBAR
            this.AddLabel(60, 412, 52, @"Open Toolbar");
        }

    public override void OnResponse( NetState state, RelayInfo info )
    {
        Mobile from = state.Mobile;

        switch ( info.ButtonID )
        {
            case 0:
            {
                break;
            }
            case 1 : { if ( m_Scroll.mN01FocusAttack == 0 ) { m_Scroll.mN01FocusAttack = 1; } else { m_Scroll.mN01FocusAttack = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 2 : { if ( m_Scroll.mN02DeathStrike == 0 ) { m_Scroll.mN02DeathStrike = 1; } else { m_Scroll.mN02DeathStrike = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 3 : { if ( m_Scroll.mN03AnimalForm == 0 ) { m_Scroll.mN03AnimalForm = 1; } else { m_Scroll.mN03AnimalForm = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 4 : { if ( m_Scroll.mN04KiAttack == 0 ) { m_Scroll.mN04KiAttack = 1; } else { m_Scroll.mN04KiAttack = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 5 : { if ( m_Scroll.mN05SurpriseAttack == 0 ) { m_Scroll.mN05SurpriseAttack = 1; } else { m_Scroll.mN05SurpriseAttack = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 6 : { if ( m_Scroll.mN06Backstab == 0 ) { m_Scroll.mN06Backstab = 1; } else { m_Scroll.mN06Backstab = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 7 : { if ( m_Scroll.mN07Shadowjump == 0 ) { m_Scroll.mN07Shadowjump = 1; } else { m_Scroll.mN07Shadowjump = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 8 : { if ( m_Scroll.mN08MirrorImage == 0 ) { m_Scroll.mN08MirrorImage = 1; } else { m_Scroll.mN08MirrorImage = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            //case 7 : { if ( m_Scroll.mN07NinjaMove == 0 ) { m_Scroll.mN07NinjaMove = 1; } else { m_Scroll.mN07NinjaMove = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            //case 10 : { if ( m_Scroll.mN10SacredJourneySpell == 0 ) { m_Scroll.mN10SacredJourneySpell = 1; } else { m_Scroll.mN10SacredJourneySpell = 0; } from.SendGump( new Tools_ninja_scrollGump( from, m_Scroll ) ); break; }
            case 9: //aris 11
            {
                from.CloseGump( typeof( Tools_tools_ninja ) );
                from.SendGump( new Tools_tools_ninja( from, m_Scroll ) );
                break;
            }
        }
    }}

    public class Tools_tools_ninja : Gump
    {
        public static bool HasSpell( Mobile from, int spellID )
        {
            Spellbook book = Spellbook.Find( from, spellID );
            return ( book != null && book.HasSpell( spellID ) );
        }

        private Tools_ninja_scroll m_Scroll;

        public Tools_tools_ninja( Mobile from, Tools_ninja_scroll scroll ) : base( 0, 0 )
        {
            m_Scroll = scroll;
            this.Closable=false;
            this.Disposable=true;
            this.Dragable=true;
            this.Resizable=false;
            this.AddPage(0);
            this.AddImage(0, 0, 11012, 1149);
            int dby = 50;

            if ( HasSpell( from, 500 ) && m_Scroll.mN01FocusAttack == 1 )    { this.AddButton(dby, 5, 21280, 21280, 1, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 501 ) && m_Scroll.mN02DeathStrike == 1 )    { this.AddButton(dby, 5, 21281, 21281, 2, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 502 ) && m_Scroll.mN03AnimalForm == 1 )    { this.AddButton(dby, 5, 21282, 21282, 3, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 503 ) && m_Scroll.mN04KiAttack == 1 )    { this.AddButton(dby, 5, 21283, 21283, 4, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 504 ) && m_Scroll.mN05SurpriseAttack == 1 ){ this.AddButton(dby, 5, 21284, 21284, 5, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 505 ) && m_Scroll.mN06Backstab == 1 )    { this.AddButton(dby, 5, 21285, 21285, 6, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 506 ) && m_Scroll.mN07Shadowjump == 1 )    { this.AddButton(dby, 5, 21286, 21286, 7, GumpButtonType.Reply, 1); dby = dby + 45; }
            if ( HasSpell( from, 507 ) && m_Scroll.mN08MirrorImage == 1 )    { this.AddButton(dby, 5, 21287, 21287, 8, GumpButtonType.Reply, 1); dby = dby + 45; }

            /*if ( HasSpell( from, 500 ) && m_Scroll.mN01FocusAttack == 1){this.AddButton(dby, 5, 20736, 20736, 1, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 501 ) && m_Scroll.mN02DeathStrike == 1){this.AddButton(dby, 5, 20737, 20737, 2, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 502 ) && m_Scroll.mN03AnimalForm == 1){this.AddButton(dby, 5, 20738, 20738, 3, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 503 ) && m_Scroll.mN04KiAttack == 1){this.AddButton(dby, 5, 20739, 20739, 4, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 504 ) && m_Scroll.mN05SurpriseAttack == 1){this.AddButton(dby, 5, 20740, 20740, 5, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 505 ) && m_Scroll.mN06Backstab == 1){this.AddButton(dby, 5, 20741, 20741, 6, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 506 ) && m_Scroll.mN07Shadowjump == 1){this.AddButton(dby, 5, 20742, 20742, 7, GumpButtonType.Reply, 1); dby = dby + 45;}
            if ( HasSpell( from, 507 ) && m_Scroll.mN08MirrorImage == 1){this.AddButton(dby, 5, 20743, 20743, 8, GumpButtonType.Reply, 1); dby = dby + 45;}
            //if ( HasSpell( from, 500 ) && m_Scroll.mN07NinjaMove == 1){this.AddButton(dby, 5, 20742, 20742, 7, GumpButtonType.Reply, 1); dby = dby + 45;}
            //if ( HasSpell( from, 209 ) && m_Scroll.mN10SacredJourneySpell == 1){this.AddButton(dby, 5, 20745, 20745, 10, GumpButtonType.Reply, 1); dby = dby + 45;}
            */
        }
        
        public override void OnResponse( NetState state, RelayInfo info ) 
        { 
            Mobile from = state.Mobile; 
            switch ( info.ButtonID ) 
            {
                case 0: { break; }
                case 1: { if ( HasSpell( from, 500 ) ) { Spells.SpecialMove.SetCurrentMove( from, new FocusAttack()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 2: { if ( HasSpell( from, 501 ) ) { Spells.SpecialMove.SetCurrentMove( from, new DeathStrike()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 3: { if ( HasSpell( from, 502 ) ) { new AnimalForm(from, null).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 4: { if ( HasSpell( from, 503 ) ) { Spells.SpecialMove.SetCurrentMove( from, new KiAttack()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 5: { if ( HasSpell( from, 504 ) ) { Spells.SpecialMove.SetCurrentMove( from, new SurpriseAttack()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 6: { if ( HasSpell( from, 505 ) ) { Spells.SpecialMove.SetCurrentMove( from, new Backstab()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 7: { if ( HasSpell( from, 506 ) ) { new Shadowjump(from, null).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 8: { if ( HasSpell( from, 507 ) ) { new MirrorImage(from, null).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }

                /*case 0: { break; }
                case 1 : { if ( HasSpell( from, 500 ) ) { new FocusAttack(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 2 : { if ( HasSpell( from, 501 ) ) { new DeathStrike(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 3 : { if ( HasSpell( from, 502 ) ) { new AnimalForm( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 4 : { if ( HasSpell( from, 503 ) ) { new KiAttack(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 5 : { if ( HasSpell( from, 504 ) ) { new SurpriseAttack(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 6 : { if ( HasSpell( from, 505 ) ) { new Backstab(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 7 : { if ( HasSpell( from, 506 ) ) { new Shadowjump( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 8 : { if ( HasSpell( from, 507 ) ) { new MirrorImage( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                //case 7 : { if ( HasSpell( from, 506 ) ) { new NinjaMove( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                //case 10 : { if ( HasSpell( from, 209 ) ) { new SacredJourneySpell( from, null ).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                */
            }
        }
    }
}

Code:
using System;
using Server;
using Server.Network;
using Server.Gumps;

namespace Server.Items
{
    public class Tools_ninja_scroll : Item
    {
        public int mN01FocusAttack = 0;
        public int mN02DeathStrike = 0;
        public int mN03AnimalForm = 0;
        public int mN04KiAttack = 0;
        public int mN05SurpriseAttack = 0;
        public int mN06Backstab = 0;
        public int mN07Shadowjump = 0;
        public int mN08MirrorImage = 0;
        //public int mN07NinjaMove = 0;
        //public int mN10SacredJourneySpell = 0;

        [CommandProperty(AccessLevel.GameMaster)]
        public int N01FocusAttack { get { return mN01FocusAttack; } set { mN01FocusAttack = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N02DeathStrike { get { return mN02DeathStrike; } set { mN02DeathStrike = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N03AnimalForm { get { return mN03AnimalForm; } set { mN03AnimalForm = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N04KiAttack { get { return mN04KiAttack; } set { mN04KiAttack = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N05SurpriseAttack { get { return mN05SurpriseAttack; } set { mN05SurpriseAttack = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N06Backstab { get { return mN06Backstab; } set { mN06Backstab = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N07Shadowjump { get { return mN07Shadowjump; } set { mN07Shadowjump = value; } }
        [CommandProperty(AccessLevel.GameMaster)]
        public int N08MirrorImage { get { return mN08MirrorImage; } set { mN08MirrorImage = value; } }
        //[CommandProperty(AccessLevel.GameMaster)]
        //public int N07NinjaMove { get { return mN07NinjaMove; } set { mN07NinjaMove = value; } }
        //[CommandProperty(AccessLevel.GameMaster)]
        //public int N10SacredJourneySpell { get { return mN10SacredJourneySpell; } set { mN10SacredJourneySpell = value; } }

        [Constructable]
        public Tools_ninja_scroll() : base( 0x14EF )
        {
            //LootType = LootType.Blessed;
            Hue = 0xB8E;
            Name = "Ninja Abilities";
        }

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

        public override void OnDoubleClick( Mobile from )
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);
            }
            else
            {
                from.CloseGump( typeof( Tools_ninja_scrollGump ) );
                from.SendGump( new Tools_ninja_scrollGump( from, this ) );
            }
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 ); // version
            writer.Write(mN01FocusAttack);
            writer.Write(mN02DeathStrike);
            writer.Write(mN03AnimalForm);
            writer.Write(mN04KiAttack);
            writer.Write(mN05SurpriseAttack);
            writer.Write(mN06Backstab);
            writer.Write(mN07Shadowjump);
            writer.Write(mN08MirrorImage);
            //writer.Write(mN07NinjaMove);
            //writer.Write(mN10SacredJourneySpell);
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
            mN01FocusAttack = reader.ReadInt();
            mN02DeathStrike = reader.ReadInt();
            mN03AnimalForm = reader.ReadInt();
            mN04KiAttack = reader.ReadInt();
            mN05SurpriseAttack = reader.ReadInt();
            mN06Backstab = reader.ReadInt();
            mN07Shadowjump = reader.ReadInt();
            mN08MirrorImage = reader.ReadInt();
            //mN07NinjaMove = reader.ReadInt();
            //mN10SacredJourneySpell = reader.ReadInt();
        }
    }
}
 

zerodowned

Sorceror
Hi, I'm working on a Spell Toolbar script too, almost done. But I can help you with this since I'm using the same base script as you.

For the part here:

Code:
public override void OnResponse( NetState state, RelayInfo info )
        {
            Mobile from = state.Mobile;
            switch ( info.ButtonID )
            {
                case 0: { break; }
                case 1: { if ( HasSpell( from, 500 ) ) { Spells.SpecialMove.SetCurrentMove( from, new FocusAttack()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 2: { if ( HasSpell( from, 501 ) ) { Spells.SpecialMove.SetCurrentMove( from, new DeathStrike()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 3: { if ( HasSpell( from, 502 ) ) { new AnimalForm(from, null).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 4: { if ( HasSpell( from, 503 ) ) { Spells.SpecialMove.SetCurrentMove( from, new KiAttack()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 5: { if ( HasSpell( from, 504 ) ) { Spells.SpecialMove.SetCurrentMove( from, new SurpriseAttack()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 6: { if ( HasSpell( from, 505 ) ) { Spells.SpecialMove.SetCurrentMove( from, new Backstab()); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 7: { if ( HasSpell( from, 506 ) ) { new Shadowjump(from, null).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
                case 8: { if ( HasSpell( from, 507 ) ) { new MirrorImage(from, null).Cast(); from.SendGump( new Tools_tools_ninja( from, m_Scroll ) ); } break; }
              }
      }

You want to change the sections that are:
Spells.SpecialMove.SetCurrentMove( from, new Backstab());

to

NinjaMove.SetCurrentMove( from, new Backstab() );

So the whole section should look like this, except for the Case #'s, keep those as you already have them

Code:
case 215: { if ( HasSpell( from, 215 ) ) { NinjaMove.SetCurrentMove( from, new DeathStrike() ); from.SendGump( new SpellBar_BarGump( from, m_Scroll ) ); } break; }
                case 216: { if ( HasSpell( from, 216 ) ) { new AnimalForm ( from, null ).Cast(); from.SendGump( new SpellBar_BarGump( from, m_Scroll ) ); } break; }
                case 217: { if ( HasSpell( from, 217 ) )
{
NinjaMove.SetCurrentMove( from, new KiAttack() );
from.SendGump( new SpellBar_BarGump( from, m_Scroll ) );
}
break; }
                case 218: { if ( HasSpell( from, 218 ) ) { NinjaMove.SetCurrentMove( from, new SurpriseAttack() ); from.SendGump( new SpellBar_BarGump( from, m_Scroll ) ); } break; }
                case 219: { if ( HasSpell( from, 219 ) ) { NinjaMove.SetCurrentMove( from, new Backstab() ); from.SendGump( new SpellBar_BarGump( from, m_Scroll ) ); } break; }
                 case 220: { if ( HasSpell( from, 220 ) ) { new Shadowjump ( from, null ).Cast(); from.SendGump( new SpellBar_BarGump( from, m_Scroll ) ); } break; }
                case 221: { if ( HasSpell( from, 221 ) ) { new MirrorImage ( from, null ).Cast(); from.SendGump( new SpellBar
 
Top