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!

Custom Golem System

Hegge

Sorceror
Custom Golem System

Summary:
Golems made by thinkers based on what ingot used.
May be a littel unbalanced so please, any idees how to make it more balanced is welcome !



Description:
I made this for my shard becouse the tamers where "alone" in their category of players.

Features:
* 9 diffrent types of golems (based on ingot type used)
* Golems now cost 500 ingots to create
* Golems bond and can be resurected using tinkering repair
* Amount of dmg to controllers mana/hp is reduced to resonable level
* Amount hp repaired on golem is based on tingering and blacksmith skills
* The golems take up 2 - 4 controll slots
* Repair timer set to 5 sec instead of 12

Tips:
* A controller still need mana and hp
* This is a beta so if you find it unbalanced post a reply with ide how to make it
better

Changes:
Fixed spelling and gramatic errors after request *;)

Installation:
Selfextractin .exe file, just target your runuo folder.
Added ordinary .zip file as well, chose what you like.

You might whant to backup this files:
Golem.cs
ClockworkAssembly.cs
Repair.cs
 

Attachments

  • CustomGolemSystem.zip
    84.1 KB · Views: 700
  • GolemSystemNoExe.zip
    22.7 KB · Views: 529

Greystar

Wanderer
Hegge said:
Summary:
Golems made by thinkers based on what ingot used.
May be a littel unbalanced so please, any idees how to make it more balanced is welcome !



Description:
I made this for my shard becouse the tamers where "alone" in their category of players.

Features:
* 9 diffrent types of golems (based on ingot type used)
* Golems now cost 500 ingots to create
* Golems bond and can be resurected using tinkering repair
* Amount of dmg to controllers mana/hp is reduced to resonable level
* Amount hp repaired on golem is based on tingering and blacksmith skills
* The golems take up 2 - 4 controll slots
* Repair timer set to 5 sec instead of 12

Tips:
* A controller still need mana and hp
* This is a beta so if you find it unbalanced post a reply with ide how to make it better


Installation:
Selfextractin .exe file, just target your runuo folder

You might whant to backup this files:
Golem.cs
ClockworkAssembly.cs
Repair.cs


Excellent I've been trying to tackle this for a while, now I can move on to other projects. Thanks for releasing this!
 

KillerBeeZ

Knight
has anyone used this to see if it wasn't a virus? I hate exe's

If its cool, then great work, but I can place the files where they need to be on my own, in fact I prefer it as I (and many others) have my own system for sorting custom files and I wont overwrite my default scripts

in light of this, could I trouble you to post the files without the exe?
 

KillerBeeZ

Knight
ok nevermind, I took a chance and it is indeed a script...

looks good

you might want to fix this tho

line 45 in ClockWorkAssembly.cs

from

from.SendMessage( "What metall do you wish to use for your golem?" );

to

from.SendMessage( "What metal do you wish to use for your golem?" );

In fact, it seems you mispelled the word Metal throughout the script, tho the above line is the only one that matters as the rest will never be seen, was this done intentionally?

and line 105 "requerd"

from

from.SendMessage("You haven't got the requerd skill for that kind of iron");

to

from.SendMessage("You haven't got the required skill for that kind of iron");

Some more cosmetic stuff...

some of the Golems need "an" instead of "a", such as

Name = "an agapite golem";

Please don't think I'm being an ass by pointing these out. Some people take offence at people pointing out errors. I don't do it to be mean, cruel or rude, I do it cause its the best way to improve scripts.

I'd expect nothing less in regards to my scripts.

Aside from the cosmetic errors, this looks like a very good script, I'll use it.
 

Hegge

Sorceror
Hmm.. you can use the exe on any dir (a temp one) then move the files to where ever you whant =)

Spelling : yhe.. im not suprised, my spelling sucks in Swedish so in Enlish it isent exactly better *;)=

I will change the spellig and i will be hoping for you to find something to change in the balancing of the system, thanks mate !
 

weaselboy246

Wanderer
I'll admit it, I dislike misspelled scripts too :D
Maybe he ment
from.SendMessage( "What metal'll do you wish to use for your golem?" );
as in 'metal will'?
Good script.
 

KillerBeeZ

Knight
Hegge said:
Hmm.. you can use the exe on any dir (a temp one) then move the files to where ever you whant =)

Spelling : yhe.. im not suprised, my spelling sucks in Swedish so in Enlish it isent exactly better *;)=

I will change the spellig and i will be hoping for you to find something to change in the balancing of the system, thanks mate !

The spelling is no big deal, its an easy fix. The balance seems ok to me, but I have yet to fully test it. as for the EXE, thats not the point, the point is that noone knows until they double click it if its a virus or not. There is no telling whats in an exe. I took a chance by opeing it in the 1st place and thankfully your not a virii pusher so its all good, but its generally not good to post these in exe form.

Well done script in any case (even with the mispellings) I would suggest though that you get a spell checker, if nothing else, it might help you when you have 10,000 lines of code.
 

KillerBeeZ

Knight
weaselboy246 said:
I'll admit it, I dislike misspelled scripts too :D
Maybe he ment
from.SendMessage( "What metal'll do you wish to use for your golem?" );
as in 'metal will'?
Good script.

um, I doubt that, its more likely he just mistyped it one time and copied and pasted it for the rest of the script

Personally I will fix misspellings when I can but I really don't care as long as the players never see it.
 

Hegge

Sorceror
KillerBeeZ said:
The spelling is no big deal, its an easy fix. The balance seems ok to me, but I have yet to fully test it. as for the EXE, thats not the point, the point is that noone knows until they double click it if its a virus or not. There is no telling whats in an exe. I took a chance by opeing it in the 1st place and thankfully your not a virii pusher so its all good, but its generally not good to post these in exe form.

Well done script in any case (even with the mispellings) I would suggest though that you get a spell checker, if nothing else, it might help you when you have 10,000 lines of code.

Hmm, suppose thats why .exe isent a supported file, still after done some supporting in #runuo irc channel i can be sure when i say that many people need a self extracting exe *;) its terrible but true. Still i added a .zip as well so now there are both.

Hmm spell checker.. naw.. on this script i just used notepad, a bit old school but it wasent that of a big script. Might get an enviroment for c# later.
 

KillerBeeZ

Knight
Hegge said:
Hmm, suppose thats why .exe isent a supported file, still after done some supporting in #runuo irc channel i can be sure when i say that many people need a self extracting exe *;) its terrible but true. Still i added a .zip as well so now there are both.

Hmm spell checker.. naw.. on this script i just used notepad, a bit old school but it wasent that of a big script. Might get an enviroment for c# later.

they don't need an exe, they need to learn how to add their scripts, otherwise they have no business running a shard.

I use notepad for all my scripts, it makes you pay more attention, but I also use MS word (or Corel Wordperfect, depending on my mood) just to make sure I didnt make any typos, however I don't write the code in the spell checker.
 

Hegge

Sorceror
KillerBeeZ said:
they don't need an exe, they need to learn how to add their scripts, otherwise they have no business running a shard.

I use notepad for all my scripts, it makes you pay more attention, but I also use MS word (or Corel Wordperfect, depending on my mood) just to make sure I didnt make any typos, however I don't write the code in the spell checker.

Hehe, well im one of those guys that think anyone would be able to run a shard on their private lan or just for their friends without realy caring to learn anything about it. I dont script becouse i whant other people to learn, I do it couse i like UO so im glad whoever plays it and i do not care how little he know about anything. Realy...

Well, hmm all my programming experience sas that if you EVER whant to make something big, you need an enviroment... but then i havent done any c# just cpp and java but they are kinda alike.
 

KillerBeeZ

Knight
Hegge said:
Hehe, well im one of those guys that think anyone would be able to run a shard on their private lan or just for their friends without realy caring to learn anything about it. I dont script becouse i whant other people to learn, I do it couse i like UO so im glad whoever plays it and i do not care how little he know about anything. Realy...


and thats a perfectly valid reason, by all means. While I agree that people should be able to run a shard for themselves or family or whatnot without "having" to learn it, its still a good idea to learn it in any case. so I'm the type that will give people all the instructions they need, but in the script itself, and generally I make them scroll down to the areas I think are important to take note of, if for no other reason than to "inspire" them to learn, I'm not saying I'd force anyone to learn, or even try to, just that it doesnt hurt one bit to get a little know how, you never know when it will come in handy.

My scripts, while trying to inspire people to learn, are still newbiefied, thats just common sence, it saves on stupid questions later, so even if they have no C# skills, they can still use it.
 

Hegge

Sorceror
KillerBeeZ said:
and thats a perfectly valid reason, by all means. While I agree that people should be able to run a shard for themselves or family or whatnot without "having" to learn it, its still a good idea to learn it in any case. so I'm the type that will give people all the instructions they need, but in the script itself, and generally I make them scroll down to the areas I think are important to take note of, if for no other reason than to "inspire" them to learn, I'm not saying I'd force anyone to learn, or even try to, just that it doesnt hurt one bit to get a little know how, you never know when it will come in handy.

My scripts, while trying to inspire people to learn, are still newbiefied, thats just common sence, it saves on stupid questions later, so even if they have no C# skills, they can still use it.

Oki, sounds kinda resonlable. Still if i put a self extracting file here it will probobly save some por guys time trying to explain to someone where to dl winzip, how to use it and where to put the files..
 

goodmojo

Wanderer
I imported the three scripts, error-free. How does a tinkerer go about crafting a golem ingame? :eek: Im a little confused.
 

iZJokersWild

Wanderer
I am guessing that if I wanted to add golems for the cusoms ores (using GD13's) I would have to edit the:
PHP:
else if ( met == 0.9 )
				{
				Name = "a valorite golem";
				SetDamageType( ResistanceType.Physical, 40 );
				SetDamageType( ResistanceType.Fire, 10 );
				SetDamageType( ResistanceType.Cold, 20 );
				SetDamageType( ResistanceType.Poison, 10 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(24*scalar), (int)(34*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(13*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Poison, (int)(13*scalar), (int)(23*scalar) );
				SetResistance( ResistanceType.Energy, (int)(23*scalar), (int)(33*scalar) );
				ControlSlots = 4;
				Hue = 2219;
				}
But then I saw at the top it is listed as else if ( met == 0.9 ), would the next 1-5 be 1.0, 1.1, and so on?
 

KillerBeeZ

Knight
iZJokersWild said:
Nevermind, I guess I got it. I edited it and loaded and got no errors! Yay! Was not changing your script, just adding to it for those that use GD13's Craft system with the custom ores. I added the Blaze, Ice, Toxic, Electrum & Platinum golems. Not really sure I did such a great job with the resist and all, just REAL basic editing since I do not know all that much about them. BUt here they are if you want them.

are you sure it works? did you actually test it and make a new golem?
 

iZJokersWild

Wanderer
No. I thought it was all good since i got no errors. Saying I lack the skills required. I went back in and edited the skill req. from Plat (starting that at 99.9) and dropped down 5.0 for each. I think I am missing something somewhere, just not sure where.
 

iZJokersWild

Wanderer
Sorry! I forgot to change a few things. If you have GD13's Craft system and want to add the extra golems here are the two scripts to replace. I tested and everything is 100% good! Might want to change the resists and stuff though still.
PHP:
using System;
using Server.Items;

namespace Server.Mobiles
{
	[CorpseName( "a golem corpse" )]
	public class Golem : BaseCreature
	{
		public override bool IsScaredOfScaryThings{ get{ return false; } }
		public override bool IsScaryToPets{ get{ return true; } }

		public override bool IsBondable{ get{ return true; } }

		[Constructable]
		public Golem() : this( 0, 1.0, 0 )
		{
		}

		[Constructable]
		public Golem( int summoned, double scalar, double met ) : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.4, 0.8 )
		{
			if ( summoned == 0 )
				{
					Name = "a golem";
					Body = 752;			
					SetStr( (int)(251*scalar), (int)(350*scalar) );
					SetDex( (int)(76*scalar), (int)(100*scalar) );
					SetInt( (int)(101*scalar), (int)(150*scalar) );

					SetHits( (int)(151*scalar), (int)(210*scalar) );

					SetDamage( (int)(13*scalar), (int)(24*scalar) );

					SetDamageType( ResistanceType.Physical, 100 );

					SetResistance( ResistanceType.Physical, (int)(35*scalar), (int)(55*scalar) );
					SetResistance( ResistanceType.Fire, (int)(100*scalar) );
					SetResistance( ResistanceType.Cold, (int)(10*scalar), (int)(30*scalar) );
					SetResistance( ResistanceType.Poison, (int)(10*scalar), (int)(25*scalar) );
					SetResistance( ResistanceType.Energy, (int)(30*scalar), (int)(40*scalar) );

					SetSkill( SkillName.MagicResist, (150.1*scalar), (190.0*scalar) );
					SetSkill( SkillName.Tactics, (60.1*scalar), (100.0*scalar) );
					SetSkill( SkillName.Wrestling, (60.1*scalar), (100.0*scalar) );
					Fame = 3500;
					Karma = -3500;

					PackItem( new IronIngot( Utility.RandomMinMax( 13, 21 ) ) );

					if ( 0.1 > Utility.RandomDouble() )
						PackItem( new PowerCrystal() );

					if ( 0.15 > Utility.RandomDouble() )
						PackItem( new ClockworkAssembly() );

					if ( 0.2 > Utility.RandomDouble() )
						PackItem( new ArcaneGem() );

					if ( 0.25 > Utility.RandomDouble() )
						PackItem( new Gears() );
					return;
				}
			
			
	
			
			Body = 752;
			

			SetStr( (int)(151*scalar), (int)(250*scalar) );
			SetDex( (int)(76*scalar), (int)(100*scalar) );
			SetInt( (int)(51*scalar), (int)(100*scalar) );

			if (met == 0.2)
				SetHits( (int)(151*(scalar+0.9)), (int)(210*(scalar+0.9)) );
			else if (met == 0.3)
				SetHits( (int)(151*(scalar+0.8)), (int)(210*(scalar+0.8)) );
			else
				SetHits( (int)(151*scalar), (int)(210*scalar) );

			if ( met == 0.1 )
				{
				Name = "an iron golem";
				SetDamageType( ResistanceType.Physical, 100 );
				SetResistance( ResistanceType.Physical, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(10*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Poison, (int)(10*scalar), (int)(25*scalar) );
				SetResistance( ResistanceType.Energy, (int)(20*scalar), (int)(30*scalar) );
				ControlSlots = 3;
				Hue = 0;
				}
			else if ( met == 0.2 )
				{
				Name = "a dull copper golem";
				SetDamageType( ResistanceType.Physical, 100 );
				SetResistance( ResistanceType.Physical, (int)(26*scalar), (int)(36*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(10*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Poison, (int)(10*scalar), (int)(25*scalar) );
				SetResistance( ResistanceType.Energy, (int)(20*scalar), (int)(30*scalar) );
				ControlSlots = 3;
				Hue = 2419;
				}
			else if ( met == 0.3 )
				{
				Name = "a shadowiron golem";
				SetDamageType( ResistanceType.Physical, 80 );
				SetDamageType( ResistanceType.Cold, 20 );
				SetResistance( ResistanceType.Physical, (int)(22*scalar), (int)(32*scalar) );
				SetResistance( ResistanceType.Fire, (int)(21*scalar), (int)(31*scalar) );
				SetResistance( ResistanceType.Cold, (int)(10*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Poison, (int)(10*scalar), (int)(25*scalar) );
				SetResistance( ResistanceType.Energy, (int)(25*scalar), (int)(35*scalar) );
				ControlSlots = 2;
				Hue = 2406;
				}
			else if ( met == 0.4 )
				{
				Name = "a copper golem";
				SetDamageType( ResistanceType.Physical, 70 );
				SetDamageType( ResistanceType.Poison, 10 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(21*scalar), (int)(31*scalar) );
				SetResistance( ResistanceType.Fire, (int)(21*scalar), (int)(31*scalar) );
				SetResistance( ResistanceType.Cold, (int)(10*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Poison, (int)(15*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Energy, (int)(22*scalar), (int)(32*scalar) );
				ControlSlots = 2;
				Hue = 2413;
				}
			else if ( met == 0.5 )
				{
				Name = "a bronze golem";
				SetDamageType( ResistanceType.Physical, 60 );
				SetDamageType( ResistanceType.Fire, 40 );
				SetResistance( ResistanceType.Physical, (int)(23*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(15*scalar), (int)(35*scalar) );
				SetResistance( ResistanceType.Poison, (int)(11*scalar), (int)(26*scalar) );
				SetResistance( ResistanceType.Energy, (int)(21*scalar), (int)(31*scalar) );
				ControlSlots = 2;
				Hue = 2418;
				}
			else if ( met == 0.6 )
				{
				Name = "a gold golem";
				SetDamageType( ResistanceType.Physical, 100 );
				SetResistance( ResistanceType.Physical, (int)(21*scalar), (int)(31*scalar) );
				SetResistance( ResistanceType.Fire, (int)(21*scalar), (int)(31*scalar) );
				SetResistance( ResistanceType.Cold, (int)(12*scalar), (int)(32*scalar) );
				SetResistance( ResistanceType.Poison, (int)(10*scalar), (int)(25*scalar) );
				SetResistance( ResistanceType.Energy, (int)(22*scalar), (int)(32*scalar) );
				ControlSlots = 2;
				Hue = 2213;
				}
			else if ( met == 0.7 )
				{
				Name = "an agapite golem";
				SetDamageType( ResistanceType.Physical, 50 );
				SetDamageType( ResistanceType.Cold, 30 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(22*scalar), (int)(32*scalar) );
				SetResistance( ResistanceType.Fire, (int)(23*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Cold, (int)(12*scalar), (int)(32*scalar) );
				SetResistance( ResistanceType.Poison, (int)(12*scalar), (int)(27*scalar) );
				SetResistance( ResistanceType.Energy, (int)(22*scalar), (int)(32*scalar) );
				ControlSlots = 3;
				Hue = 2425;
				}
			else if ( met == 0.8 )
				{
				Name = "a verite golem";
				SetDamageType( ResistanceType.Physical, 40 );
				SetDamageType( ResistanceType.Poison, 40 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(23*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Fire, (int)(23*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Cold, (int)(12*scalar), (int)(32*scalar) );
				SetResistance( ResistanceType.Poison, (int)(13*scalar), (int)(28*scalar) );
				SetResistance( ResistanceType.Energy, (int)(21*scalar), (int)(31*scalar) );
				ControlSlots = 4;
				Hue = 2207;
				}
			else if ( met == 0.9 )
				{
				Name = "a valorite golem";
				SetDamageType( ResistanceType.Physical, 40 );
				SetDamageType( ResistanceType.Fire, 10 );
				SetDamageType( ResistanceType.Cold, 20 );
				SetDamageType( ResistanceType.Poison, 10 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(24*scalar), (int)(34*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(13*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Poison, (int)(13*scalar), (int)(23*scalar) );
				SetResistance( ResistanceType.Energy, (int)(23*scalar), (int)(33*scalar) );
				ControlSlots = 4;
				Hue = 2219;
				}
			else if ( met == 1.0 )
				{
				Name = "a blaze golem";
				SetDamageType( ResistanceType.Physical, 40 );
				SetDamageType( ResistanceType.Fire, 40 );
				SetDamageType( ResistanceType.Cold, 10 );
				SetDamageType( ResistanceType.Poison, 20 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(24*scalar), (int)(34*scalar) );
				SetResistance( ResistanceType.Fire, (int)(25*scalar), (int)(35*scalar) );
				SetResistance( ResistanceType.Cold, (int)(13*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Poison, (int)(13*scalar), (int)(23*scalar) );
				SetResistance( ResistanceType.Energy, (int)(23*scalar), (int)(33*scalar) );
				ControlSlots = 4;
				Hue = 1161;
				}
			else if ( met == 1.1 )
				{
				Name = "an ice golem";
				SetDamageType( ResistanceType.Physical, 40 );
				SetDamageType( ResistanceType.Fire, 10 );
				SetDamageType( ResistanceType.Cold, 40 );
				SetDamageType( ResistanceType.Poison, 20 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(24*scalar), (int)(34*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(25*scalar), (int)(35*scalar) );
				SetResistance( ResistanceType.Poison, (int)(13*scalar), (int)(23*scalar) );
				SetResistance( ResistanceType.Energy, (int)(23*scalar), (int)(33*scalar) );
				ControlSlots = 4;
				Hue = 1152;
				}
			else if ( met == 1.2 )
				{
				Name = "a toxic golem";
				SetDamageType( ResistanceType.Physical, 40 );
				SetDamageType( ResistanceType.Fire, 10 );
				SetDamageType( ResistanceType.Cold, 20 );
				SetDamageType( ResistanceType.Poison, 40 );
				SetDamageType( ResistanceType.Energy, 20 );
				SetResistance( ResistanceType.Physical, (int)(24*scalar), (int)(34*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(13*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Poison, (int)(25*scalar), (int)(35*scalar) );
				SetResistance( ResistanceType.Energy, (int)(23*scalar), (int)(33*scalar) );
				ControlSlots = 4;
				Hue = 1272;
				}
			else if ( met == 1.3 )
				{
				Name = "an electrum golem";
				SetDamageType( ResistanceType.Physical, 50 );
				SetDamageType( ResistanceType.Fire, 10 );
				SetDamageType( ResistanceType.Cold, 20 );
				SetDamageType( ResistanceType.Poison, 10 );
				SetDamageType( ResistanceType.Energy, 40 );
				SetResistance( ResistanceType.Physical, (int)(25*scalar), (int)(35*scalar) );
				SetResistance( ResistanceType.Fire, (int)(20*scalar), (int)(30*scalar) );
				SetResistance( ResistanceType.Cold, (int)(13*scalar), (int)(33*scalar) );
				SetResistance( ResistanceType.Poison, (int)(13*scalar), (int)(23*scalar) );
				SetResistance( ResistanceType.Energy, (int)(25*scalar), (int)(35*scalar) );
				ControlSlots = 4;
				Hue = 1278;
				}
			else if ( met == 1.4 )
				{
				Name = "a platinum golem";
				SetDamageType( ResistanceType.Physical, 50 );
				SetDamageType( ResistanceType.Fire, 50 );
				SetDamageType( ResistanceType.Cold, 50 );
				SetDamageType( ResistanceType.Poison, 50 );
				SetDamageType( ResistanceType.Energy, 50 );
				SetResistance( ResistanceType.Physical, (int)(28*scalar), (int)(38*scalar) );
				SetResistance( ResistanceType.Fire, (int)(28*scalar), (int)(38*scalar) );
				SetResistance( ResistanceType.Cold, (int)(28*scalar), (int)(38*scalar) );
				SetResistance( ResistanceType.Poison, (int)(28*scalar), (int)(38*scalar) );
				SetResistance( ResistanceType.Energy, (int)(28*scalar), (int)(38*scalar) );
				ControlSlots = 4;
				Hue = 1153;
				}

			
			SetSkill( SkillName.MagicResist, (120.1*(scalar-met/2)), (160.0*(scalar-met/2)) );
			SetSkill( SkillName.Tactics, (50.1*(scalar-met/2)), (80.0*(scalar-met/2)) );
			SetSkill( SkillName.Wrestling, (50.1*scalar), (80.0*(scalar-met/2)) );
			SetSkill( SkillName.Anatomy, (40.1*scalar), (50.1*scalar) );
			
			SetDamage( (int)(13*(scalar-met*0.8)), (int)(24*(scalar-met*0.8)) );

			Fame = 10;
			Karma = 10;
						
			
		}

		public override bool DeleteOnRelease{ get{ return true; } }

		public override int GetAngerSound()
		{
			return 541;
		}

		public override int GetIdleSound()
		{
			if ( !Controled )
				return 542;

			return base.GetIdleSound();
		}

		public override int GetDeathSound()
		{
			if ( !Controled )
				return 545;

			return base.GetDeathSound();
		}

		public override int GetAttackSound()
		{
			return 562;
		}

		public override int GetHurtSound()
		{
			if ( Controled )
				return 320;

			return base.GetHurtSound();
		}

		public override bool AutoDispel{ get{ return !Controled; } }

		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( 0.2 > Utility.RandomDouble() )
				defender.Combatant = null;
		}

		public override void OnDamage( int amount, Mobile from, bool willKill )
		{
			if ( Controled || Summoned )
			{
				Mobile master = ( this.ControlMaster );

				if ( master == null )
					master = this.SummonMaster;

				if ( master != null && master.Player && master.Map == this.Map && master.InRange( Location, 20 ) )
				{
					if ( master.Mana >= (int)(amount/3) )
					{
						master.Mana -= (int)(amount/3);
					}
					else
					{
						amount -= master.Mana;
						master.Mana = 0;
						master.Damage( (int)(amount/3) );
					}
				}
			}

			base.OnDamage( (int)(amount/3), from, willKill );
		}

		public override bool BardImmune{ get{ return true; } }
		public override Poison PoisonImmune{ get{ return Poison.Lethal; } }

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

		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();
		}
	}
}

And

PHP:
using System;
using Server;
using Server.Mobiles;
using Server.Spells;
using Server.Items;
using Server.Targeting;
using Server.Engines.Craft;


namespace Server.Items
{
	public class ClockworkAssembly : Item
	{
		
		[Constructable]
		public ClockworkAssembly() : base( 0x1EA8 )
		{
			Weight = 5.0;
			Hue = 1102;
			Name = "clockwork assembly";
		}

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

		

		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				return;
			}

			double tinkerSkill = from.Skills[SkillName.Tinkering].Value;

			if ( tinkerSkill < 40.0 )
			{
				from.SendMessage( "You must have at least 40.0 skill in tinkering to construct a golem." );
				return;
			}
			
			from.SendMessage( "What metal do you wish to use for your golem?" );
			
			from.Target = new IngotTarget( this ); //This shit make the other shit work
			
			

			
			
			
		}

		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();
		}
		
		private class IngotTarget : Target
		{
			private ClockworkAssembly m_ass;

			public IngotTarget( ClockworkAssembly ass ) : base( 2, false, TargetFlags.None )
			{
			m_ass = ass;
			}
		
			protected override void OnTarget( Mobile from, Object targeted )
			{
				double tinkerSkill = from.Skills[SkillName.Tinkering].Value;
				double metal = 0;
				System.Type typ;					
				
				if ( targeted is IronIngot)
					{metal = 0.1; typ = typeof( IronIngot );}
				else if ( targeted is DullCopperIngot && tinkerSkill > 39.9)
					{metal = 0.2; typ = typeof( DullCopperIngot );}
				else if ( targeted is ShadowIronIngot && tinkerSkill > 44.9)
					{metal = 0.3; typ = typeof( ShadowIronIngot );}
				else if ( targeted is CopperIngot && tinkerSkill > 49.9)
					{metal = 0.4; typ = typeof( CopperIngot );}
				else if ( targeted is BronzeIngot && tinkerSkill > 54.9)
					{metal = 0.5; typ = typeof( BronzeIngot );}
				else if ( targeted is GoldIngot && tinkerSkill > 59.9)
					{metal = 0.6; typ = typeof( GoldIngot );}
				else if ( targeted is AgapiteIngot && tinkerSkill > 64.9)
					{metal = 0.7; typ = typeof( AgapiteIngot );}
				else if ( targeted is VeriteIngot && tinkerSkill > 69.9)
					{metal = 0.8; typ = typeof( VeriteIngot );}
				else if ( targeted is ValoriteIngot && tinkerSkill > 74.9)
					{metal = 0.9; typ = typeof( ValoriteIngot );}
				else if ( targeted is BlazeIngot && tinkerSkill > 79.9)
					{metal = 1.0; typ = typeof( BlazeIngot );}
				else if ( targeted is IceIngot && tinkerSkill > 84.9)
					{metal = 1.1; typ = typeof( IceIngot );}
				else if ( targeted is ToxicIngot && tinkerSkill > 89.9)
					{metal = 1.2; typ = typeof( ToxicIngot );}
				else if ( targeted is ElectrumIngot && tinkerSkill > 94.9)
					{metal = 1.3; typ = typeof( ElectrumIngot );}
				else if ( targeted is PlatinumIngot && tinkerSkill > 99.9)
					{metal = 1.4; typ = typeof( PlatinumIngot );}
				else 
					{
					from.SendMessage("You havent got the required skill for that kind of iron");
				 	return;
					}
				if ( metal > 0.7 && (from.Followers + 4) > from.FollowersMax )
					{
					from.SendLocalizedMessage( 1049607 ); // You have too many followers to control that creature.
					return;
					}
				else if ( ( metal == 0.6 || metal < 0.3 ) && (from.Followers + 3) > from.FollowersMax )
					{
					from.SendLocalizedMessage( 1049607 ); // You have too many followers to control that creature.
					return;
					}
				else if ( metal > 0.2 && metal < 0.7 && (from.Followers + 2) > from.FollowersMax )
					{
					from.SendLocalizedMessage( 1049607 ); // You have too many followers to control that creature.
					return;
					}
					
				double scalar;

				if ( tinkerSkill >= 100.0 )
					scalar = 1.0 + metal;
				else if ( tinkerSkill >= 90.0 )
					scalar = 0.9 + metal;
				else if ( tinkerSkill >= 80.0 )
					scalar = 0.8 + metal;
				else if ( tinkerSkill >= 70.0 )
					scalar = 0.7 + metal;
				else
					scalar = 0.6 + metal;

				Container pack = from.Backpack;
				if ( pack == null )
					return;
								
				int res = pack.ConsumeTotal(
					new Type[]
					{
						typeof( PowerCrystal ),
						typ,
						typeof( Gears )
					},
					new int[]
					{
						1,
						500,
						5,
					} );

				switch ( res )
				{
					case 0:
					{
						from.SendMessage( "You must have a power crystal to construct the golem." );
						break;
					}
					case 1:
					{
						from.SendMessage( "You must have 500 ingots to construct the golem." );
						break;
					}
					case 2:
					{
						from.SendMessage( "You must have 5 gears to construct the golem." );
						break;
					}
										
					default:
					{
						Golem g = new Golem( 1, scalar, metal );

						if ( g.SetControlMaster( from ) )
						{
							m_ass.Delete();

							g.MoveToWorld( from.Location, from.Map );
							from.PlaySound( 0x241 );
						}

						break;
					}
				}

			}
		}







	}

}
 
Top