|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Newbie
|
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.
|
|
|
|
|
|
#2 (permalink) |
|
Forum Master
|
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 ..... :) |
|
|
|
|
|
#3 (permalink) |
|
Forum Novice
Join Date: Mar 2007
Age: 20
Posts: 208
|
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. |
|
|
|
|
|
#4 (permalink) |
|
RunUO Forum Moderator
|
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 ------------------------------------------------------------- |
|
|
|
|
|
#5 (permalink) |
|
Forum Newbie
|
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. |
|
|
|
|
|
#6 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
Quote:
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:
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." |
||
|
|
|
|
|
#8 (permalink) |
|
Forum Expert
|
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.
}
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 |
|
|
|
|
|
#9 (permalink) |
|
Forum Newbie
|
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..
|
|
|
|
|
|
#10 (permalink) | ||
|
Forum Expert
Join Date: Mar 2004
Location: NorthCentral IL, USA
Age: 35
Posts: 3,848
|
Quote:
__________________
Quote:
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." |
||
|
|
|
|
|
#11 (permalink) |
|
Forum Expert
|
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;
}
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;
}
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();
}
}
}
}
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 );
}
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. |
|
|
|
|
|
#12 (permalink) |
|
Forum Expert
|
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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|