Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 03-16-2005, 04:54 AM   #26 (permalink)
 
Join Date: Oct 2004
Age: 18
Posts: 69
Default

errr , i dont want to cast it from a scroll , i want to cast the spell on each hit with the firemace , if u think the same with ur post , please tell me where should i put the
Code:
public FlameStrikeSpell( Mobile caster, Item scroll ) : base( caster, scroll, m_Info )
thingie
Outsider is offline   Reply With Quote
Old 03-16-2005, 05:03 AM   #27 (permalink)
Forum Expert
 
Join Date: Sep 2004
Location: Florida
Age: 25
Posts: 457
Send a message via AIM to remnant
Default

Well I went and did the following and it works completely like you want it to TOO MY KNOWLEDGE lol. Test it out for yourself:

You might need to place the following at the top of the code not sure:
Code:
using Server.Spells;
using Server.Spells.Seventh;
Code:
		public override void OnHit( Mobile attacker, Mobile defender )
		{
			FlameStrikeSpell fss = new FlameStrikeSpell( attacker, null );

			if ( !attacker.CanSee( defender ) )
			{
				attacker.SendLocalizedMessage( 500237 ); // Target can not be seen.
			} else {
				SpellHelper.Turn( attacker, defender );

				SpellHelper.CheckReflect( (int)fss.Circle, attacker, ref defender );

				double damage;

				if ( Core.AOS )
				{
					damage = fss.GetNewAosDamage( 48, 1, 5, attacker.Player && defender.Player );
				}
				else
				{
					damage = Utility.Random( 27, 22 );

					if ( fss.CheckResisted( defender ) )
					{
						damage *= 0.6;

						defender.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.
					}

					damage *= fss.GetDamageScalar( defender );
				}


				defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
				defender.PlaySound( 0x208 );

				SpellHelper.Damage( fss, defender, damage, 0, 100, 0, 0, 0 );
			}
		}
Hope this helps
remnant is offline   Reply With Quote
Old 03-16-2005, 05:11 AM   #28 (permalink)
Forum Expert
 
Join Date: Sep 2004
Location: Florida
Age: 25
Posts: 457
Send a message via AIM to remnant
Default

One more note before I go to bed. Flamestrike will hit the enemy every time you hit them in this case. If you want to change that, then you would add something like:
Code:
switch( Utility.Random( 5 ) )
{
     case 0:
          	defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
	defender.PlaySound( 0x208 );
	SpellHelper.Damage( fss, defender, damage, 0, 100, 0, 0, 0 );
}
What that would do is pick a random number between 0-5 and if its 0 then it does the flame strike otherwise it doesnt. If you want to make the flamestrike occur more often, you would simply lower the number.

There may be a more efficient manner, I'm sure some of the vets know of one maybe.

Good luck.
remnant is offline   Reply With Quote
Old 03-16-2005, 05:20 AM   #29 (permalink)
 
Join Date: Oct 2004
Age: 18
Posts: 69
Default

- Error: Scripts\FireMace.cs: CS1501: (line 54, column 17) No overload for meth
od 'GetNewAosDamage' takes '4' arguments
btw that
Code:
} else {
looks weird , should it be like that or no?
Outsider is offline   Reply With Quote
Old 03-16-2005, 05:24 AM   #30 (permalink)
Forum Expert
 
Join Date: Nov 2004
Posts: 1,656
Send a message via ICQ to Murzin Send a message via AIM to Murzin Send a message via MSN to Murzin
Default

you gotta remember the problematic RNG. never put it on a case 0 if its more than say 2-3 cases.

you what you want is to have it at the bottom or top 25-33% range of your cases for accurate results.

for a case 5, put it on case 2. otherwise your results will not be accurate if you test it.
Murzin is offline   Reply With Quote
Old 03-16-2005, 06:04 AM   #31 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by Murzin
you gotta remember the problematic RNG. never put it on a case 0 if its more than say 2-3 cases.

you what you want is to have it at the bottom or top 25-33% range of your cases for accurate results.

for a case 5, put it on case 2. otherwise your results will not be accurate if you test it.
That is not accurate at all.
You have the same chance to be at a specific millisecond at ANY time you look at your watch.
You don't have more or less chances to be at the 20-30 milisecond (which is how it calclate random values btw)
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 03-16-2005, 11:57 AM   #32 (permalink)
Forum Expert
 
Join Date: Sep 2004
Location: Florida
Age: 25
Posts: 457
Send a message via AIM to remnant
Default

Quote:
Originally Posted by Outsider
- Error: Scripts\FireMace.cs: CS1501: (line 54, column 17) No overload for meth
od 'GetNewAosDamage' takes '4' arguments
I wasn't getting this error, can you paste the code you were using, perhaps you missed something in translation from the web to script. If you copy and pasted then I don't know whats going on, but this script compiled and ran fine for me. Worked great too. So post your code and we will have a look.
Quote:
Originally Posted by Outsider
btw that
Code:
} else {
looks weird , should it be like that or no?
This is just the way I do my else blocks. You could've done it anyway you wanted, but its whitespace independent so it doesnt matter. The common one I believe is:
Code:
}
else
{
Either way works as long as their isn't invalid crap between them.
remnant is offline   Reply With Quote
Old 03-21-2005, 09:24 AM   #33 (permalink)
 
Join Date: Oct 2004
Age: 18
Posts: 69
Default

Code:
using System;
using Server;
using Server.Spells;
using Server.Spells.Seventh;

namespace Server.Items
{
	public class FireMace : WarMace
	{

		public override int InitMinHits{ get{ return 255; } } 
		public override int InitMaxHits{ get{ return 255; } }
		public override int AosStrengthReq{ get{ return 100; } }
		public override int AosMinDamage{ get{ return 30; } }
		public override int AosMaxDamage{ get{ return 40; } }
		public override int AosSpeed{ get{ return 60; } }
		public override int DefHitSound{ get{ return 520; } }
		public override SkillName DefSkill{ get{ return SkillName.Macing; } }
		public override WeaponType DefType{ get{ return WeaponType.Bashing; } }
		public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.Bash1H; } }
		[Constructable]
		public FireMace()
		{
			Weight = 3.0;
            		Name = "a Fire Elemental Mace";
            		Hue = 1914;

			WeaponAttributes.HitFireArea = 20;
			Attributes.SpellChanneling = 1;

		}
				
				public override void GetDamageTypes( Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy )
		{
			phys = cold = pois = nrgy = 0;
			fire = 100;
		}
				public override void OnHit ( Mobile attacker, Mobile defender )
		{
					FlameStrikeSpell fss = new FlameStrikeSpell( attacker, null );

					if ( !attacker.CanSee( defender ) )
			{
						attacker.SendLocalizedMessage( 500237 ); // Target can not be seen.
			} 
			else 
			{
						SpellHelper.Turn( attacker, defender );

						SpellHelper.CheckReflect( (int)fss.Circle, attacker, ref defender );

						double damage;

						if ( Core.AOS )
						{
							damage = fss.GetNewAosDamage( 48, 1, 5, attacker.Player && defender.Player );
						}
						else
						{
							damage = Utility.Random( 27, 22 );
							
							if ( fss.CheckResisted( defender ) )
							{
								damage *= 0.6;

								defender.SendLocalizedMessage( 501783 ); // You feel yourself resisting magical energy.

							}
							
							damage *= fss.GetDamageScalar( defender );
						}

						defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
						defender.PlaySound( 0x208 );
					
						SpellHelper.Damage( fss, defender, damage, 0, 100, 0, 0, 0 );
			}
		}
		
		public FireMace( 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();
		}
	}
}
Outsider is offline   Reply With Quote
Old 03-21-2005, 12:12 PM   #34 (permalink)
Forum Expert
 
Join Date: Sep 2004
Location: Florida
Age: 25
Posts: 457
Send a message via AIM to remnant
Default

I added your script to my server and it compiled without error. I don't understand why you are getting one unless you have changed the GetNewAosDamage function.

*EDIT*: Are you using RC1.0? or RC0
remnant is offline   Reply With Quote
Old 03-21-2005, 12:38 PM   #35 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by remnant
I added your script to my server and it compiled without error. I don't understand why you are getting one unless you have changed the GetNewAosDamage function.

*EDIT*: Are you using RC1.0? or RC0
accessing player items while offline?
Quote:
Originally Posted by Ryan
blah

THERE IS NO RC1.

It's 1.0.0
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 03-21-2005, 12:40 PM   #36 (permalink)
 
Join Date: Nov 2003
Age: 25
Posts: 259
Send a message via MSN to Tark
Default

was wondering what RC1.0 meant...
Tark is offline   Reply With Quote
Old 03-21-2005, 12:48 PM   #37 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by Tark
was wondering what RC1.0 meant...
History on RunUO:
beta bla bla....
RunUO RC0
RunUO 1.0.0 (no rc1 crap)...
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 03-21-2005, 12:55 PM   #38 (permalink)
Forum Expert
 
Join Date: Sep 2004
Location: Florida
Age: 25
Posts: 457
Send a message via AIM to remnant
Default

Well..sorry...
just posting what I've seen others refer to it as. What does RC stand for? And why not just call it RunUO Beta rather than RC then call RunUO 1.0.0?
remnant is offline   Reply With Quote
Old 03-22-2005, 11:26 AM   #39 (permalink)
 
Join Date: Oct 2004
Age: 18
Posts: 69
Default

im using rc0 , theres teh problem..
Outsider is offline   Reply With Quote
Old 03-22-2005, 12:47 PM   #40 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by remnant
Well..sorry...
just posting what I've seen others refer to it as. What does RC stand for? And why not just call it RunUO Beta rather than RC then call RunUO 1.0.0?
I have no idea what RC means (altho I like to know that too).
It isn't called beta because the version before it was beta 36.
Quote:
Originally Posted by Outsider
im using rc0 , theres teh problem..
RC0 isn't supported anymore.
If you want help fixing problems you have to upgrade to RunUO 1.0.0, sorry
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Old 03-22-2005, 09:43 PM   #41 (permalink)
Forum Expert
 
Join Date: Sep 2004
Location: Florida
Age: 25
Posts: 457
Send a message via AIM to remnant
Default

I mustve missed RC0 altogether then lol...I was away from RunUO for a bit, came back to RunUO 1.0.0 and assumed everyone referring to RC0 just meant pre RunUO 1.0.0 lol

oh well thanks for clearing that all up for me daat99
remnant is offline   Reply With Quote
Old 03-23-2005, 04:35 AM   #42 (permalink)
RunUO Forum Moderator
 
daat99's Avatar
 
Join Date: Dec 2004
Location: Israel
Age: 27
Posts: 8,163
Send a message via ICQ to daat99 Send a message via AIM to daat99
Default

Quote:
Originally Posted by remnant
I mustve missed RC0 altogether then lol...I was away from RunUO for a bit, came back to RunUO 1.0.0 and assumed everyone referring to RC0 just meant pre RunUO 1.0.0 lol

oh well thanks for clearing that all up for me daat99
np, I'm glad I can help out
__________________
I always try to help
Sometimes, I don't know how....

My Web Page
Forum Rules
-------------------------------------------------------------
Extensive OWLTR System | Token System | World Teleporters
-------------------------------------------------------------
daat99 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5