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 07-09-2007, 10:39 PM   #1 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 47
Send a message via ICQ to Ahrkan Send a message via MSN to Ahrkan
Default Insta Kill Mage

Hey, I'm trying to make a mage that stays hidden, but when a red or "evil" monster comes along (the red named monsters), he comes out of hiding, says something, kills the target, and then goes back in hiding (With a moongate appearing, to make it look like he teleported there). How could I do this? I've tried damn hard to figure out how, but I'm not sure which method's and such to use.
Ahrkan is offline   Reply With Quote
Old 07-10-2007, 01:46 AM   #2 (permalink)
Forum Master
 
Lord_Greywolf's Avatar
 
Join Date: Dec 2005
Posts: 6,753
Send a message via Yahoo to Lord_Greywolf
Default

would probably need to make a new ai for it
__________________
http://www.AoAUO.com

:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :)
Lord_Greywolf is online now   Reply With Quote
Old 07-10-2007, 04:42 AM   #3 (permalink)
Forum Novice
 
Join Date: Mar 2007
Age: 20
Posts: 208
Default

This is just fast written, and will 100% sure not work, but just to give an idea.

HandlesOnMovement.
if target is Red
Hidden = false
Say - watever.
Kill( m )
Teleport timer start - delay 2 seonds

moongate spawn
location utility.Random x ( -1, 1 ) y -1, 1 )
this direction to moongate
if direction = south, y +1, norther y -1.

mobile.hidden



just a quick list of steps I would make.
DarkViper2006 is offline   Reply With Quote
Old 07-10-2007, 04:55 AM   #4 (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

Personally I would just let go of the moongate and use a "recall spell" (words+animation) instead.
__________________
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 07-10-2007, 11:12 AM   #5 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 47
Send a message via ICQ to Ahrkan Send a message via MSN to Ahrkan
Default

I'm trying to make it look like the mage gated, to get yous more in the idea, It's like the battlemage from POL there, the guard that tele's shows a moongate, lightning bolt effect and so on.

Edit: And would I have to make a new AI, or could I just add it to the npc file.

I know I could do something like

if (target is Red)
{
Hidden = false;
Say("Whatever the hell");

m.BoltEffect(0);
m.Kill();
Hidden = true;
}

something like that, but:
a) How would I get a moongate in there, and
b) How would I define what target is and what m is?

Last edited by Ahrkan; 07-10-2007 at 11:17 AM.
Ahrkan is offline   Reply With Quote
Old 07-10-2007, 05:12 PM   #6 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Ahrkan View Post
I'm trying to make it look like the mage gated, to get yous more in the idea, It's like the battlemage from POL there, the guard that tele's shows a moongate, lightning bolt effect and so on.

Edit: And would I have to make a new AI, or could I just add it to the npc file.

I know I could do something like

if (target is Red)
{
Hidden = false;
Say("Whatever the hell");

m.BoltEffect(0);
m.Kill();
Hidden = true;
}

something like that, but:
a) How would I get a moongate in there, and
b) How would I define what target is and what m is?
your pseudo code would be target.BoltEffect(0);
target.Kill();

it's been forever since i've messed with the code but if the Attack function is overridable you could target and kill it... Take a look at the gate code and get the moongates affect stuff and just add it in... it might be an object so you might have to create a generic moongate object then delete it again in the code... I don't think you'd need a new AI for it. Guards instakill by default so your best would be to look at the guards and figure out whats done there.
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 07-11-2007, 10:23 AM   #7 (permalink)
Forum Novice
 
Join Date: Mar 2007
Age: 20
Posts: 208
Default

Well... first f all you need to know HOw you want the mage to get unhidden.

If you want it to use OnHandlesMovement( Mobile target )

that would make the victum (target), and the mage this..
DarkViper2006 is offline   Reply With Quote
Old 07-11-2007, 03:38 PM   #8 (permalink)
Forum Expert
 
vermillion2083's Avatar
 
Join Date: Jun 2005
Location: Lansing, MI
Age: 25
Posts: 1,042
Send a message via ICQ to vermillion2083 Send a message via MSN to vermillion2083
Default

Basically what you would need is alot of delayed timer callbacks to make it look realistic. First off I apologize that I can't give you a specific example beacuse sadly Im not on my own machine, but I can atleast try and point you in the right direction.

First you would need to do a OnHandlesMovement( Mobile target ) like the previous people have suggested. A good example of how to properly do this would be to look at ankh.cs ( the ankh that ressurects you ).That script look at all mobiles that approach it and look for specific terms before taking action ( being if !m.Alive ).

Now you want to do a check to see if target.Kill >= 5. If it does then do a call to something like TakeAction( target );

Then make a new method called take action like this:

Code:
TakeAction ( Mobile target )
{
   Item bob = new internalitem;  // this is the moongate. dont actually make a gate, just make a normal item that has a gate ID since it won't actaully teleport anyone anywhere.

         bob,MoveToWorld ( this.Location, this.Map );
         Timer.DelayRecall(target) // cant remember off the top of my head how to do these, but someone can tell you how.
}
Now that you have the gate spawned, make the timer delay callback like 3 seconds. Then inside that callback make it unhide your mobile then do another callback.

inside the next callback make him say something, and kill the target. then do another delay callback.

inside the next callback have it hide your mobile and delete the gate ( or make the gate have an auto delete timer that will delete itself after 30 seconds like a real gate, that way if the server crashes some reason while one of these are spawned the gate wont get stuck )

This is a very crude explination of how to accomplish your goal, but rest assure it is very very doable. Once I have access to my PC I will give you a more in depth explination of how to do this, but hopefully for now this will give you some direction, and a few things to research.

Good luck with your project, cause if done right this could be a very impressive addition to a server.
__________________
Father Time
Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "Holy Hell......What a ride!!!"

Server: UO: Extinction
ICQ: 146563794
FatherTime@UOExtinction.com
UO: Extinction homepage
UO: Extinction forum
vermillion2083 is offline   Reply With Quote
Old 07-11-2007, 10:07 PM   #9 (permalink)
Forum Newbie
 
Join Date: Dec 2005
Posts: 47
Send a message via ICQ to Ahrkan Send a message via MSN to Ahrkan
Default

Yeah, can't clearly think atm, but I'm trying to make it so the mage is hidden at all times, and walks around a little, he won't go too far of course because of the spawnpoints.. But anyways once the mage see's a red named creature or red named player, I want the gate to appear, the mage unhides, lightning bolt's the target, says something, mage hides, then gate disappears.. I'm not sure which methods to use, or how to define what 'target' is..
Ahrkan is offline   Reply With Quote
Old 07-12-2007, 12:58 AM   #10 (permalink)
Forum Expert
 
Greystar's Avatar
 
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
Default

Quote:
Originally Posted by Ahrkan View Post
Yeah, can't clearly think atm, but I'm trying to make it so the mage is hidden at all times, and walks around a little, he won't go too far of course because of the spawnpoints.. But anyways once the mage see's a red named creature or red named player, I want the gate to appear, the mage unhides, lightning bolt's the target, says something, mage hides, then gate disappears.. I'm not sure which methods to use, or how to define what 'target' is..
You might also want to move the mage to the portal when they Unhide to make them look like they came out of it (or just have it create where they are standing) then have the made move back to the original one then hide then portal disappears just for a bit of "realism". Once again for defining the Target check how the Guards find a target...
__________________
Quote:
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.
Killable Guards (GS Version)
Just a Simple Staff Tool
You can leave me messages.
Ernest Gary Gygax - Quote "I would like the world to remember me as the guy who really enjoyed playing games and sharing his knowledge and his fun pastimes with everybody else."
Greystar is offline   Reply With Quote
Old 07-12-2007, 08:24 PM   #11 (permalink)
Forum Expert
 
vermillion2083's Avatar
 
Join Date: Jun 2005
Location: Lansing, MI
Age: 25
Posts: 1,042
Send a message via ICQ to vermillion2083 Send a message via MSN to vermillion2083
Default

Hello again:

Although I am not on my pc I figured I could still give you a good enough description of what to do from memory and with a fresh RC1 download as a code reference.

The following is an example of one method you could use to accomplish your goal. So you can look where some of the code that I used came from I will list some Distro files I used as reference code.

BaseHealer.cs - this is where I got the OnMovement method
PlayerMobile.cs - this is where I got the delay timer code from
The rest was just written by hand.

Code:
		public override void OnMovement( Mobile m, Point3D oldLocation )
		{
			if ( !m.kills >= 5 && m.Alive && InRange( m, 4 ) && !InRange( oldLocation, 4 ) && InLOS( m ) )
				BeginExecution( m )
		}

		public void BeginExecution( Mobile from )
		{
			Item gate = New moongate();
			gate.MoveToWorld( this.Location, this.Map );

			Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( Reveal ), from );
		}

		private static void Reveal( object state )
		{
			Mobile from = (Mobile)state;

			this.Hidden = false;
			this.Say("I will be the death of you!");
			Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( kill ), from );
		}

		private static void kill( object state )
		{
			Mobile from = (Mobile)state;

			from.BoltEffect();
			from.Kill();
			this.Say("Ha ha ha...");

			Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( finish ), from );
		}

		private static void finish( object state )
		{
			Mobile from = (Mobile)state;

			this.Say("Pathetic, I knew you were no match for me...");
			this.Hidden = true;
		}
What will this code do? Well when a mobile ( player or monster ) with 5 murder counts ( the default murder status ) moved within 4 tiles of the mobile that has this code it will get notice instantly and the red killer will open a moongate where it stands ( at this time it is hidden ). 3 seconds later he will reveal making it look like he came out of the moongate and say " I will be your death". 3 seconds after that he will zap the murderer with lightning and kill him while laughing. 3 seconds after that he will say "I knew you were no match for me" and hide again.

Now this code was never test compiled and likely will have an error or two, but for the most part is is almost totally plug and play. However I have a few suggestions.

First is I have no idea how to make mobiles wonder around WHILE hidden and frankly if its going to be anchored to a spawner anyways I feel its WAY more difficult then it needs to be. what I would do is make this mobile: ( note the red code only below )

Code:
		[Constructable]
		public RedKiller() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
		{
			Name = "Murderer killing mage";
			Body =  400;
			BaseSoundID = 0;
			CanWalk = false;

			SetStr( 76, 100 );
			SetDex( 96, 115 );
			SetInt( 36, 60 );

			SetHits( 46, 60 );

			SetDamage( 5, 17 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 20, 30 );
			SetResistance( ResistanceType.Fire, 10, 20 );
			SetResistance( ResistanceType.Cold, 10, 20 );
			SetResistance( ResistanceType.Poison, 50, 60 );
			SetResistance( ResistanceType.Energy, 10, 20 );

			SetSkill( SkillName.Anatomy, 30.3, 75.0 );
			SetSkill( SkillName.Poisoning, 60.1, 80.0 );
			SetSkill( SkillName.MagicResist, 45.1, 60.0 );
			SetSkill( SkillName.Tactics, 65.1, 80.0 );
			SetSkill( SkillName.Wrestling, 70.1, 85.0 );

			Fame = 3500;
			Karma = -3500;
		}
So that he doesnt walk ever. the reason I suggest this is because no one will ever know if hes moving while hidden to begin with, and by doing this having him make a gate where he stands then reveal himself will make it look like he comes out of and goes into the gate. if you make him walk he will make the gate, walk away from it, then reveal making him just randomly apear somewhere, and then he will hide again somewhere other then the gates location ruining the "reentering the gate" effect. It simplifies thing and really doesnt sacrifice anything apearance wise.

The second thing I would suggest is making your own item that uses the moongate ItemID. The reason I say this is because it will look like hes opening a gate, but the gate won't function. I think this is smart because if you make a moongate without setting its destination location it will teleport the player to 0, 0, 0, coords on the internal map, anotherwords moving them to the middle of nowhere.

Also another reason I say to do this is because you can make the item have a self deleting timer, which will mimic a real moongate identically. To do this look at a script called blood.cs. Simply use that script but change the name from blood to fakegate and change the item id and the amount of time it takes to delete from 5 seconds to 30. here is the code from that script:

Code:
using System;
using Server;

namespace Server.Items
{
	public class Blood : Item
	{
		[Constructable]
		public Blood() : this( 0x1645 )
		{
		}

		[Constructable]
		public Blood( int itemID ) : base( itemID )
		{
			Movable = false;

			new InternalTimer( this ).Start();
		}

		public Blood( Serial serial ) : base( serial )
		{
			new InternalTimer( this ).Start();
		}

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

		private class InternalTimer : Timer
		{
			private Item m_Blood;

			public InternalTimer( Item blood ) : base( TimeSpan.FromSeconds( 5.0 ) )
			{
				Priority = TimerPriority.OneSecond;

				m_Blood = blood;
			}

			protected override void OnTick()
			{
				m_Blood.Delete();
			}
		}
	}
}
Also you are going to want to add the moongate sound effect right below where the gate is moved to the world to give it some realism ( make it sound like the gate is being casted ). To do this add this:

Code:
		public void BeginExecution( Mobile from )
		{
			Item gate = New moongate();
			gate.MoveToWorld( this.Location, this.Map );
			Effects.PlaySound( from.Location, from.Map, 0x20E );

			Timer.DelayCall( TimeSpan.FromSeconds( 3.0 ), new TimerStateCallback( Reveal ), from );
		}
The above is the correct sound effect ( taken from gatetravel.cs ).

I hope this is enough to get you started. Try and turn all that I have given you into a mobile and test compile it. If it works congradulations, and if not post the script you made along with any errors you recieved and I will be more than happy to assist you futher. I wish you much luck with your project and can't wait to see what you come up with.

p.s. my 3 year old nephew was whacking me with a stuffed animal during the entire writing of this so please forgive me if some areas are poorly written or make no sence at all. It's fairly hard to think and fend of a barrage of stuff animal goodness at the same time *smiles*
__________________
Father Time
Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "Holy Hell......What a ride!!!"

Server: UO: Extinction
ICQ: 146563794
FatherTime@UOExtinction.com
UO: Extinction homepage
UO: Extinction forum

Last edited by vermillion2083; 07-12-2007 at 08:31 PM.
vermillion2083 is offline   Reply With Quote
Old 07-12-2007, 08:25 PM   #12 (permalink)
Forum Expert
 
vermillion2083's Avatar
 
Join Date: Jun 2005
Location: Lansing, MI
Age: 25
Posts: 1,042
Send a message via ICQ to vermillion2083 Send a message via MSN to vermillion2083
Default

This was a double post, Sorry for the confusion.
__________________
Father Time
Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "Holy Hell......What a ride!!!"

Server: UO: Extinction
ICQ: 146563794
FatherTime@UOExtinction.com
UO: Extinction homepage
UO: Extinction forum

Last edited by vermillion2083; 07-12-2007 at 08:28 PM.
vermillion2083 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