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!

Counterfeit Script Creator 1.1

K

KevinEvans

Guest
Counterfeit Script Creator 1.3

Counterfeit Script Creator
Version 1.3
For RunUO2


This generates script with a gui.
2.2's progress:
[-----------------------] [-1%]

New 'Core'... I made it more object oriented, also changed to C# from VB.
Advanced Mobiles Completed! This includes BaseCreature attributes, Human Attributes, and Skills! =o
Added a save and open feature. It stores it as .poo files, which is just XML.
Added Containers to the menu, makes containers :3
Fixed bugs caused by improper installations of UO or installations of SE


This is an update to Rock's Script Creator, which was an update to Marak's script creator :D
Updates 5/14
- Added Quests kinda... they're kinda lame atm
- Added settings!!!!

Updates 4/26:
- Added a prompt incase UO isnt found in the registry keys (thx vorspire!)

Updates Initial:

- Fixed misc. small bugs
- Added mobile animation
- Moved Talking Mobiles to Mobiles
- Added Champion option in mobiles
- Splash screen with autoupdate check
- Added icon in windows taskbar
- Changed the form layout and colors a bit...
- Everything else is pretty much the same...

Known Bugs:
- Items can be hued multiple times... dunno how to fix this :S Postponed
- Script can still generate even if a form has errors... should be an easy fix

Future additions:
- Preventing errors in generating scripts
- Fix layout problems with Vista
- Speed up the load time >_<
- add some crap lul

You NEED to have
- Microsoft NET Framework 2.0+
- Internet connection for updates
- Ultima Online; if you dont have UO, the objects wont display >.<

Special Thanks:
- Rock
- Marak
- RunUO Community
- Combiboland Community

Download:
Since the filesize limit for the forum is really small, It's being hosted on Google Sites :/
[ Download Link ] ~7.2MiB

Files included:
- Counterfeit Script Creator
- Edited Ultima SDK


Please report all bugs!! >.<
Kevin

ps: While debugging, i left an msg that said "oh, hai" by accident -_- but it shouldnt affect anything
 
only problem i see is having to have .net 3.5

when runuo only needs 2.0

and some people will not install 3.5 (like me - installed and removed, system went to 1/2 speed, and will not even mention the previous beta version of it)

might get more users making it compatable with .net 2.0
 
K

KevinEvans

Guest
Hmm... i'll see if i can use net 2.0 D:

edit: it is 2.0 x_x
 

Vorspire

Knight
I downloaded this, it looks very sweet and easy to use. I wanted to see what all the fuss was about :D

But I encountered a problem, the same kind of error that Gump Studio throws when the application can't find your UO Install directory.

I really recommend adding a prompt for the user to select their UO Directory if it can not be found using registry keys :D

I get this problem because I have at least 4 versions of UO installed to different directories, via copy and paste, so there are no registry entries :p

Regards
 
K

KevinEvans

Guest
Vorspire;798366 said:
I downloaded this, it looks very sweet and easy to use. I wanted to see what all the fuss was about :D

But I encountered a problem, the same kind of error that Gump Studio throws when the application can't find your UO Install directory.

I really recommend adding a prompt for the user to select their UO Directory if it can not be found using registry keys :D

I get this problem because I have at least 4 versions of UO installed to different directories, via copy and paste, so there are no registry entries :p

Regards

Just fixed that :D
I just need to update something else first, and i'll update the file
 
K

KevinEvans

Guest
Ok, i fixed it.
If you go from the main menu, and press UO Dir, it will prompt you for the UO directory.
It will save the uo directory to location.lawl

i'm not really sure if this works or not, since i still have uo in the reg keys :)

[ Link ]


PS: The autoupdate will detect an update D:
 

natfoth

Sorceror
When i use it i keep gettin a "Ultima.Art" Error and it closes. I am Using xp 64bit. Anyway i can fix this?

Also my ultima online is not in the c: Directory or the program files, so yuo might want to make the browse for folder able to get to other folders.
 

Lateralus911

Sorceror
It won't show the bodies for mobiles. Says there was a problem with the initializer.

"The type initializer for 'Ultima.BodyConverter' threw an exception."
 
K

KevinEvans

Guest
natfoth;799599 said:
When i use it i keep gettin a "Ultima.Art" Error and it closes. I am Using xp 64bit. Anyway i can fix this?

Also my ultima online is not in the c: Directory or the program files, so yuo might want to make the browse for folder able to get to other folders.
Under the main menu, press UO Dir, and select your UO directory...


Lateralus911;799642 said:
It won't show the bodies for mobiles. Says there was a problem with the initializer.

"The type initializer for 'Ultima.BodyConverter' threw an exception."
Yeah... i really need to fix that >.<
 

Kiakoranus

Wanderer
I've tried creating a simple quest using the program and it wont compile properly seems like the errors are in the top 40 lines

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Gumps;
using Server.Commands;

namespace Server.Items
{
    public class 4thJulyItem : Item
    {
        [Constructable]
        public 4thJulyItem()
            : this(1)
        { }
        [Constructable]
        public 4thJulyItem(int amountFrom, int amountTo)
            : this(Utility.RandomMinMax(amountFrom, amountTo))
        { }
        [Constructable]
        public 4thJulyItem(int amount)
            : base(0x0F8E)
        {
            Name = "BritishGoldMedal";
            Hue = 0x65;
            Stackable = true;
            Weight = 0.0;
            Amount = amount;

        }
        public 4thJulyItem(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 4thJulyGump : Gump
  {
 public static void Initialize()
 {
 CommandSystem.Register("4thJulyGump", AccessLevel.GameMaster, new CommandEventHandler(4thJulyGump_OnCommand));
  }
 private static void 4thJulyGump_OnCommand(CommandEventArgs e)
 {
    e.Mobile.SendGump(new 4thJulyGump());
 }
    public 4thJulyGump()
      : base( 0, 0 )
    {
      this.Closable=true;
      this.Disposable=true;
      this.Dragable=true;
      this.Resizable=false;
      this.AddPage(0);
      this.AddBackground(228, 116, 339, 387, 9380);
      this.AddBackground(265, 203, 274, 222, 9300);
      this.AddLabel(371, 117, 0, @"Title Text");
      this.AddLabel(312, 164, 0, @"The British are coming!");
      this.AddHtml( 272, 213, 257, 203, @"Hail there.<br><br>Our town is fighting for independence<br>from Lord British's corrupt rule.<br>He 

has landed an army to the North West<br>here, hoping to suppress our cause.<br><br>We require help in thwarting this act<br>of aggression. If 

you could bring me<br>20 of the enemy soldiers gold medals<br>Then we can use those too fund our<br>own militia army too aid our 

cause<br><br>Good Luck! brave freedom fighter", (bool)false, (bool)false);
      this.AddButton(474, 440, 247, 248, (int)Buttons.Button1, GumpButtonType.Reply, 0);
      this.AddImage(270, 151, 9004);

    }
    
    public enum Buttons
    {
      Button1,
    }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
                case (int)Buttons.Button1:
                    {break;}
            }
        }
  }
}
namespace Server.Mobiles
{
    [CorpseName("4thJulyGiver's Corpse")]
    public class 4thJulyGiver : Mobile
    {
        public virtual bool IsInvulnerable { get { return true; } }
        [Constructable]
        public 4thJulyGiver()
        {
            BodyValue = 400;
            Name = "Yankee Mc Doodle";
            Title = "The Mayor";
            Hits = 10000;
            Hue = 0;
            Utility.AssignRandomHair(this);
            FeatheredHat hat = new FeatheredHat();
            hat.Hue = 0;
            AddItem(hat);
            FancyShirt torso = new FancyShirt();
            torso.Hue = 0;
            AddItem(torso);
            Kilt legs = new Kilt();
            legs.Hue = 0;
            AddItem(legs);
            ThighBoots feet = new ThighBoots();
            feet.Hue = 0;
            AddItem(feet);

            Blessed = true;
            CantWalk = true;


        }

        public 4thJulyGiver(Serial serial) : base(serial) { }
        public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
        {
            base.GetContextMenuEntries(from, list);
            list.Add(new 4thJulyGiverEntry(from, this));
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer); writer.Write((int)0);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader); int version = reader.ReadInt();
        }
        public class 4thJulyGiverEntry : ContextMenuEntry
        {
            private Mobile m_Mobile; private Mobile m_Giver;
            public 4thJulyGiverEntry(Mobile from, Mobile giver) : base(6146, 3) { m_Mobile = from; m_Giver = giver; }
            public override void OnClick()
            {
                if (!(m_Mobile is PlayerMobile))
                    return;
                PlayerMobile mobile = (PlayerMobile)m_Mobile;
                {


                    if (!mobile.HasGump(typeof(4thJulyGump)))
                    {
                        mobile.SendGump(new 4thJulyGump());
                    }
                }
            }

        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            Mobile m = from; PlayerMobile mobile = m as PlayerMobile;
            if (mobile != null)
            {


                if (dropped is 4thJulyItem)
                {
                    if (dropped.Amount != 20)
                    { this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "That is too few, remember i require twenty.", 

mobile.NetState); return false; }
                    dropped.Delete();


                    mobile.AddToBackpack(new Gold(5000));


                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Thank you! Your help brings us one step closer to gaining 

Independence", mobile.NetState);


                    return true;
                }
                else if (dropped is Whip) { this.PrivateOverheadMessage(MessageType.Regular, 1153, 1060016, mobile.NetState); return false; } 

else { this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState); }
            } return false;
        }
    }
}
 
K

KevinEvans

Guest
Kiakoranus;803033 said:
I've tried creating a simple quest using the program and it wont compile properly seems like the errors are in the top 40 lines

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Gumps;
using Server.Commands;

namespace Server.Items
{
    public class 4thJulyItem : Item
    {
        [Constructable]
        public 4thJulyItem()
            : this(1)
        { }
        [Constructable]
        public 4thJulyItem(int amountFrom, int amountTo)
            : this(Utility.RandomMinMax(amountFrom, amountTo))
        { }
        [Constructable]
        public 4thJulyItem(int amount)
            : base(0x0F8E)
        {
            Name = "BritishGoldMedal";
            Hue = 0x65;
            Stackable = true;
            Weight = 0.0;
            Amount = amount;

        }
        public 4thJulyItem(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 4thJulyGump : Gump
  {
 public static void Initialize()
 {
 CommandSystem.Register("4thJulyGump", AccessLevel.GameMaster, new CommandEventHandler(4thJulyGump_OnCommand));
  }
 private static void 4thJulyGump_OnCommand(CommandEventArgs e)
 {
    e.Mobile.SendGump(new 4thJulyGump());
 }
    public 4thJulyGump()
      : base( 0, 0 )
    {
      this.Closable=true;
      this.Disposable=true;
      this.Dragable=true;
      this.Resizable=false;
      this.AddPage(0);
      this.AddBackground(228, 116, 339, 387, 9380);
      this.AddBackground(265, 203, 274, 222, 9300);
      this.AddLabel(371, 117, 0, @"Title Text");
      this.AddLabel(312, 164, 0, @"The British are coming!");
      this.AddHtml( 272, 213, 257, 203, @"Hail there.<br><br>Our town is fighting for independence<br>from Lord British's corrupt rule.<br>He 

has landed an army to the North West<br>here, hoping to suppress our cause.<br><br>We require help in thwarting this act<br>of aggression. If 

you could bring me<br>20 of the enemy soldiers gold medals<br>Then we can use those too fund our<br>own militia army too aid our 

cause<br><br>Good Luck! brave freedom fighter", (bool)false, (bool)false);
      this.AddButton(474, 440, 247, 248, (int)Buttons.Button1, GumpButtonType.Reply, 0);
      this.AddImage(270, 151, 9004);

    }
    
    public enum Buttons
    {
      Button1,
    }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            switch (info.ButtonID)
            {
                case (int)Buttons.Button1:
                    {break;}
            }
        }
  }
}
namespace Server.Mobiles
{
    [CorpseName("4thJulyGiver's Corpse")]
    public class 4thJulyGiver : Mobile
    {
        public virtual bool IsInvulnerable { get { return true; } }
        [Constructable]
        public 4thJulyGiver()
        {
            BodyValue = 400;
            Name = "Yankee Mc Doodle";
            Title = "The Mayor";
            Hits = 10000;
            Hue = 0;
            Utility.AssignRandomHair(this);
            FeatheredHat hat = new FeatheredHat();
            hat.Hue = 0;
            AddItem(hat);
            FancyShirt torso = new FancyShirt();
            torso.Hue = 0;
            AddItem(torso);
            Kilt legs = new Kilt();
            legs.Hue = 0;
            AddItem(legs);
            ThighBoots feet = new ThighBoots();
            feet.Hue = 0;
            AddItem(feet);

            Blessed = true;
            CantWalk = true;


        }

        public 4thJulyGiver(Serial serial) : base(serial) { }
        public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
        {
            base.GetContextMenuEntries(from, list);
            list.Add(new 4thJulyGiverEntry(from, this));
        }
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer); writer.Write((int)0);
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader); int version = reader.ReadInt();
        }
        public class 4thJulyGiverEntry : ContextMenuEntry
        {
            private Mobile m_Mobile; private Mobile m_Giver;
            public 4thJulyGiverEntry(Mobile from, Mobile giver) : base(6146, 3) { m_Mobile = from; m_Giver = giver; }
            public override void OnClick()
            {
                if (!(m_Mobile is PlayerMobile))
                    return;
                PlayerMobile mobile = (PlayerMobile)m_Mobile;
                {


                    if (!mobile.HasGump(typeof(4thJulyGump)))
                    {
                        mobile.SendGump(new 4thJulyGump());
                    }
                }
            }

        }
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            Mobile m = from; PlayerMobile mobile = m as PlayerMobile;
            if (mobile != null)
            {


                if (dropped is 4thJulyItem)
                {
                    if (dropped.Amount != 20)
                    { this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "That is too few, remember i require twenty.", 

mobile.NetState); return false; }
                    dropped.Delete();


                    mobile.AddToBackpack(new Gold(5000));


                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Thank you! Your help brings us one step closer to gaining 

Independence", mobile.NetState);


                    return true;
                }
                else if (dropped is Whip) { this.PrivateOverheadMessage(MessageType.Regular, 1153, 1060016, mobile.NetState); return false; } 

else { this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState); }
            } return false;
        }
    }
}

It might because you are using a number in the name,

Instead of using 4thJuly, you should use ForthJuly
 

Vorspire

Knight
KevinEvans;803089 said:
It might because you are using a number in the name,

Instead of using 4thJuly, you should use ForthJuly

This is partially correct, yes :D

C# class names can contain all Alpha-Numeric chars including underscores:
  • a-z
  • A-Z
  • 0-9
  • _

The main problem is that it can't contain a numeric char (0-9) as the first character, because the compiler believes that you are trying to define an integer instead of a class name, it's stupid, I know... But that's Microsoft for you :D

Another thing that worries me is that the code output is not as efficient as it could be, which could cause problems later on, although it does compile, there are a few ambiguities in the syntax, especially in line-spacing.

I have checked over the code below and tidied it up somewhat, it should compile just fine, enjoy :)

Code:
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Items;
using Server.Targeting;
using Server.ContextMenus;
using Server.Gumps;
using Server.Misc;
using Server.Network;
using Server.Spells;
using Server.Gumps;
using Server.Commands;

namespace Server.Items
{
	public class July4thItem : Item
	{
		[Constructable]
		public July4thItem()
			: this(1)
		{ }

		[Constructable]
		public July4thItem(int amountFrom, int amountTo)
			: this(Utility.RandomMinMax(amountFrom, amountTo))
		{ }

		[Constructable]
		public July4thItem(int amount)
			: base(0x0F8E)
		{
			Name = "BritishGoldMedal";
			Hue = 0x65;
			Stackable = true;
			Weight = 0.0;
			Amount = amount;
		}

		public July4thItem(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 July4thGump : Gump
	{
		public static void Initialize()
		{
			CommandSystem.Register("July4thGump", AccessLevel.GameMaster, new CommandEventHandler(July4thGump_OnCommand));
		}

		private static void July4thGump_OnCommand(CommandEventArgs e)
		{
			if (e.Mobile != null && !e.Mobile.Deleted && e.Mobile.Alive)
				e.Mobile.SendGump(new July4thGump());
		}

		public July4thGump()
			: base(0, 0)
		{
			this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = false;

			this.AddPage(0);
			this.AddBackground(228, 116, 339, 387, 9380);
			this.AddBackground(265, 203, 274, 222, 9300);
			this.AddLabel(371, 117, 0, @"Title Text");
			this.AddLabel(312, 164, 0, @"The British are coming!");
			this.AddHtml(272, 213, 257, 203, @"Hail there.<br><br>Our town is fighting for independence<br>from Lord British's corrupt rule.<br He has landed an army to the North West<br>here, hoping to suppress our cause.<br><br>We require help in thwarting this act<br>of aggression. If you could bring me<br>20 of the enemy soldiers gold medals<br>Then we can use those too fund our<br>own militia army too aid our cause<br><br>Good Luck! brave freedom fighter", (bool)false, (bool)false);

			this.AddButton(474, 440, 247, 248, (int)Buttons.Button1, GumpButtonType.Reply, 0);
			this.AddImage(270, 151, 9004);
		}

		public enum Buttons
		{
			Button1,
		}

		public override void OnResponse(NetState sender, RelayInfo info)
		{
			switch (info.ButtonID)
			{
				default: { } break;
				case (int)Buttons.Button1: { } break;
			}
		}
	}
}

namespace Server.Mobiles
{
	[CorpseName("July4thGiver's Corpse")]
	public class July4thGiver : Mobile
	{
		public virtual bool IsInvulnerable { get { return true; } }

		[Constructable]
		public July4thGiver()
		{
			BodyValue = 400;
			Name = "Yankee Mc Doodle";
			Title = "The Mayor";
			Hits = 10000;
			Hue = 0;

			Utility.AssignRandomHair(this);

			FeatheredHat hat = new FeatheredHat();
			hat.Hue = 0;
			AddItem(hat);

			FancyShirt torso = new FancyShirt();
			torso.Hue = 0;
			AddItem(torso);

			Kilt legs = new Kilt();
			legs.Hue = 0;
			AddItem(legs);

			ThighBoots feet = new ThighBoots();
			feet.Hue = 0;
			AddItem(feet);

			Blessed = true;
			CantWalk = true;
		}

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

		public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
		{
			base.GetContextMenuEntries(from, list);

			list.Add(new July4thGiverEntry(from, this));
		}

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

			writer.Write((int)0);
		}

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

			int version = reader.ReadInt();
		}

		public class July4thGiverEntry : ContextMenuEntry
		{
			private Mobile
				m_Mobile,
				m_Giver;

			public July4thGiverEntry(Mobile from, Mobile giver)
				: base(6146, 3)
			{
				m_Mobile = from;
				m_Giver = giver;
			}

			public override void OnClick()
			{
				if (!(m_Mobile is PlayerMobile))
					return;

				PlayerMobile mobile = (PlayerMobile)m_Mobile;

				if (!mobile.HasGump(typeof(July4thGump)))
				{
					mobile.SendGump(new July4thGump());
				}
			}
		}

		public override bool OnDragDrop(Mobile from, Item dropped)
		{
			PlayerMobile mobile = from as PlayerMobile;

			if (mobile != null)
			{
				if (dropped is July4thItem)
				{
					if (dropped.Amount != 20)
					{
						this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "That is too few, remember, I require twenty.", mobile.NetState);
						return false;
					}

					dropped.Delete();

					mobile.AddToBackpack(new Gold(5000));

					this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Thank you! Your help brings us one step closer to gaining Independence.", mobile.NetState);

					return true;
				}
				else if (dropped is Whip)
				{
					this.PrivateOverheadMessage(MessageType.Regular, 1153, 1060016, mobile.NetState);
				}
				else
				{
					this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState);
				}
			}

			return false;
		}
	}
}
 

Kiakoranus

Wanderer
Thanks for your help Vorspire,

It doesnt indeed complie fine and thanks for teaching me a little bit more about scripting :)
 
Top