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!

Can you make a static follow a mobile?

Tremerelord

Wanderer
Ah Lord of the Rings, I believe I have an alternative for you. Makethe fire a montser, just assign a fire anim as the body, then have the Balrog summon it. I'll work on it myself probably tomorrow, I have more npc's I have to script first.
 
Code for the Balrog

Ahhh! I could make him summon it! Because in the movie he looses the flame, if i make him summon it i'll need to make it die when he dies though... Here's my codes.

[code:1]
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
[CorpseName( "Gothmog's corpse" )]
public class Gothmog : BaseCreature
{
[Constructable]
public Gothmog () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "Gothmog";
Title = "The strongest of the Demon's of Might";
Body = 40;
Hue = 0x485;
BaseSoundID = 357;

SetStr( 2500, 3500 );
SetDex( 350, 400 );
SetInt( 375, 650 );

SetHits( 750, 1000 );

SetDamage( 25, 40 );

SetDamageType( ResistanceType.Physical, 100 );
SetDamageType( ResistanceType.Fire, 100 );

SetResistance( ResistanceType.Physical, 200, 300 );
SetResistance( ResistanceType.Fire, 250, 550 );
SetResistance( ResistanceType.Cold, 0, 0 );
SetResistance( ResistanceType.Poison, 0 );
SetResistance( ResistanceType.Energy, 25, 50 );

SetSkill( SkillName.Anatomy, 50.0, 95.0 );
SetSkill( SkillName.EvalInt, 100.0, 155.0 );
SetSkill( SkillName.Magery, 100.0, 155.0 );
SetSkill( SkillName.Meditation, 25.0, 90.0 );
SetSkill( SkillName.Tactics, 100.0, 150.0 );
SetSkill( SkillName.Wrestling, 100.0, 150.0 );

Fame = 35000;
Karma = -35000;

VirtualArmor = 150;

PackGold( 5000, 10000 );
PackScroll( 15, 25 );
PackArmor( 10, 10 );
PackWeapon( 15, 15 );
PackWeapon( 15, 15 );
PackSlayer();
}

protected override void OnLocationChange( Point3D oldLocation )
{
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
m_Balrogflame.Location = base.Location;
}
public override bool CanRummageCorpses{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override int TreasureMapLevel{ get{ return 5; } }
public override int Meat{ get{ return 50; } }

public Gothmog( 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();
}
}
}
[/code:1]

[code:1]
using System;
using Server.Network;

namespace Server.Items
{

public class Balrogflame : Item
{
[Constructable]
public Balrogflame() : base( 0x36B1 )
{
Movable = false;
Name = "Balrog's Flame";
}

public Balrogflame( 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();
}
}
}
[/code:1]
 

Swaileh

Wanderer
As I've said, the code will not compile, since you have no instance of m_BalrogFlame to initializeead my above post..
 

UOT

Knight
[code:1]namespace Server.Mobiles
{
[CorpseName( "Gothmog's corpse" )]
public class Gothmog : BaseCreature
{
private Balrogflame m_Balrogflame;
[Constructable]
public Gothmog () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
m_Balrogflame = new Balrogflame();[/code:1]
 
Thanks!

Awsome! It works! Thanks a bunch!!!!! :D Thanks to all for all your help!

If you want my nice Balrog (from lord of the rings) Here they are!


[code:1]// By Azmodan, Thanks to everyone who helped me make this script!
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
[CorpseName( "Gothmog's corpse" )]
public class Gothmog : BaseCreature
{
private Balrogflame m_Balrogflame;
[Constructable]
public Gothmog () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
m_Balrogflame = new Balrogflame();
Name = "Gothmog";
Title = "The strongest of the Demon's of Might";
Body = 40;
Hue = 0x485;
BaseSoundID = 357;

SetStr( 2500, 3500 );
SetDex( 350, 400 );
SetInt( 375, 650 );

SetHits( 750, 1000 );

SetDamage( 25, 40 );

SetDamageType( ResistanceType.Physical, 100 );
SetDamageType( ResistanceType.Fire, 100 );

SetResistance( ResistanceType.Physical, 200, 300 );
SetResistance( ResistanceType.Fire, 250, 550 );
SetResistance( ResistanceType.Cold, 0, 0 );
SetResistance( ResistanceType.Poison, 0 );
SetResistance( ResistanceType.Energy, 25, 50 );

SetSkill( SkillName.Anatomy, 50.0, 95.0 );
SetSkill( SkillName.EvalInt, 100.0, 155.0 );
SetSkill( SkillName.Magery, 100.0, 155.0 );
SetSkill( SkillName.Meditation, 25.0, 90.0 );
SetSkill( SkillName.Tactics, 100.0, 150.0 );
SetSkill( SkillName.Wrestling, 100.0, 150.0 );

Fame = 35000;
Karma = -35000;

VirtualArmor = 150;

PackGold( 5000, 10000 );
PackScroll( 15, 25 );
PackArmor( 10, 10 );
PackWeapon( 15, 15 );
PackWeapon( 15, 15 );
PackSlayer();
}

protected override void OnLocationChange( Point3D oldLocation )
{
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
m_Balrogflame.Location = base.Location;
}
public override bool CanRummageCorpses{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override int TreasureMapLevel{ get{ return 5; } }
public override int Meat{ get{ return 50; } }

public Gothmog( 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();
}
}
}[/code:1]



[code:1]using System;
using Server.Network;

namespace Server.Items
{

public class Balrogflame : Item
{
[Constructable]
public Balrogflame() : base( 0x36B1 )
{
Movable = false;
Name = "Balrog's Flame";
}

public Balrogflame( 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();
}
}
}[/code:1]


There ya go! Have fun!
 

Ceday

Page
Opss, try this one:
[code:1]
protected override void OnLocationChange( Point3D oldLocation )
{
base.OnLocationChange(oldLocation);
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
m_Balrogflame.Location = this.Location;


}
[/code:1]
 
Can't add gothmog!

Now i can't add Gothmog (my mobile) It just says

[code:1]
Usage: Gothmog[/code:1]

on the screen in the game. like a localised message.
 

UOT

Knight
When it gives you that message look on the console there should be the exception error. Paste it here.
 
Noo!

Nonono... it's IN the game... it compiles on runuo and everything! But when i do [add Gothmog and click it just says as a local message (bottem left) [code:1]Usage:
Gothmog[/code:1]

And it dosen't add him! What's wrong! :(
 

UOT

Knight
I know that happens in game but if you switch to your console window it'll have an exception in there.
 
Ohh! So it does! Well i'll be damned! lol... *copy's it*
Here ya go.

[code:1]
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling VB.net scripts...no files found.
Scripts: Verifying...done (1583 items, 375 mobiles)
World: Loading...done (38015 items, 1273 mobiles) (6.9 seconds)
Regions: Loading...done
Address: 127.0.0.1:2593
Address: 192.168.1.100:2593

System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at Server.Mobiles.Gothmog.OnLocationChange(Point3D oldLocation)
at Server.Mobile.SetLocation(Point3D newLocation, Boolean isTeleport)
at Server.Mobile.set_Location(Point3D value)
at Server.Scripts.Commands.Add.Build(Mobile from, Point3D start, Point3D end,
ConstructorInfo ctor, Object[] values)
[/code:1]

There ya go!

Please help!
 

UOT

Knight
Not sure what else you added to your script but I just tested it with only a small change because you forgot to set the map for the flame and it worked fine.
[code:1]// By Azmodan, Thanks to everyone who helped me make this script!
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
[CorpseName( "Gothmog's corpse" )]
public class Gothmog : BaseCreature
{
private Balrogflame m_Balrogflame;
[Constructable]
public Gothmog () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
m_Balrogflame = new Balrogflame();
Name = "Gothmog";
Title = "The strongest of the Demon's of Might";
Body = 40;
Hue = 0x485;
BaseSoundID = 357;

SetStr( 2500, 3500 );
SetDex( 350, 400 );
SetInt( 375, 650 );

SetHits( 750, 1000 );

SetDamage( 25, 40 );

SetDamageType( ResistanceType.Physical, 100 );
SetDamageType( ResistanceType.Fire, 100 );

SetResistance( ResistanceType.Physical, 200, 300 );
SetResistance( ResistanceType.Fire, 250, 550 );
SetResistance( ResistanceType.Cold, 0, 0 );
SetResistance( ResistanceType.Poison, 0 );
SetResistance( ResistanceType.Energy, 25, 50 );

SetSkill( SkillName.Anatomy, 50.0, 95.0 );
SetSkill( SkillName.EvalInt, 100.0, 155.0 );
SetSkill( SkillName.Magery, 100.0, 155.0 );
SetSkill( SkillName.Meditation, 25.0, 90.0 );
SetSkill( SkillName.Tactics, 100.0, 150.0 );
SetSkill( SkillName.Wrestling, 100.0, 150.0 );

Fame = 35000;
Karma = -35000;

VirtualArmor = 150;

PackGold( 5000, 10000 );
PackScroll( 15, 25 );
PackArmor( 10, 10 );
PackWeapon( 15, 15 );
PackWeapon( 15, 15 );
PackSlayer();
}

protected override void OnLocationChange( Point3D oldLocation )
{
base.OnLocationChange(oldLocation);
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
{
m_Balrogflame.Location = Location;
m_Balrogflame.Map = Map;
}
}
public override bool CanRummageCorpses{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override int TreasureMapLevel{ get{ return 5; } }
public override int Meat{ get{ return 50; } }

public Gothmog( 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();
}
}
}[/code:1]
 
New Balron (Balrog) Great Evil, Monster

Awsome! I got it working! And i made it work with 2 statics! Here ya go.






GOTHMOG



[code:1]// By Azmodan, Thanks to everyone who helped me make this script!
using System;
using Server;
using Server.Items;

namespace Server.Mobiles
{
[CorpseName( "Gothmog's corpse" )]
public class Gothmog : BaseCreature
{
private Balrogflame m_Balrogflame;
private BalrogflameColumn m_BalrogflameColumn;
[Constructable]
public Gothmog () : base( AIType.AI_Mage, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
m_Balrogflame = new Balrogflame();
m_BalrogflameColumn = new BalrogflameColumn();
Name = "Gothmog";
Title = "The strongest of the Demon's of Might";
Body = 40;
Hue = 0x485;
BaseSoundID = 357;

SetStr( 2500, 3500 );
SetDex( 350, 400 );
SetInt( 375, 650 );

SetHits( 750, 1000 );

SetDamage( 25, 40 );

SetDamageType( ResistanceType.Physical, 100 );
SetDamageType( ResistanceType.Fire, 100 );

SetResistance( ResistanceType.Physical, 200, 300 );
SetResistance( ResistanceType.Fire, 250, 550 );
SetResistance( ResistanceType.Cold, 0, 0 );
SetResistance( ResistanceType.Poison, 0 );
SetResistance( ResistanceType.Energy, 25, 50 );

SetSkill( SkillName.Anatomy, 50.0, 95.0 );
SetSkill( SkillName.EvalInt, 100.0, 155.0 );
SetSkill( SkillName.Magery, 100.0, 155.0 );
SetSkill( SkillName.Meditation, 25.0, 90.0 );
SetSkill( SkillName.Tactics, 100.0, 150.0 );
SetSkill( SkillName.Wrestling, 100.0, 150.0 );

Fame = 35000;
Karma = -35000;

VirtualArmor = 150;

PackGold( 5000, 10000 );
PackScroll( 15, 25 );
PackArmor( 10, 10 );
PackWeapon( 15, 15 );
PackWeapon( 15, 15 );
PackSlayer();
}

protected override void OnLocationChange( Point3D oldLocation )
{
base.OnLocationChange(oldLocation);
if ( m_BalrogflameColumn != null && !m_BalrogflameColumn.Deleted )
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
m_BalrogflameColumn.Location = this.Location;
m_Balrogflame.Location = this.Location;
m_BalrogflameColumn.Map = Map;
m_Balrogflame.Map = Map;
}
public override bool CanRummageCorpses{ get{ return true; } }
public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
public override int TreasureMapLevel{ get{ return 5; } }
public override int Meat{ get{ return 50; } }

public Gothmog( 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();
}
}
}[/code:1]







FIRE 1



[code:1]using System;
using Server.Network;

namespace Server.Items
{

public class Balrogflame : Item
{
[Constructable]
public Balrogflame() : base( 0x36BD )
{
Movable = false;
Name = "Balrog's Flame";
}
public Balrogflame( 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();
}
}
}[/code:1]






FIRE 2



[code:1]using System;
using Server.Network;

namespace Server.Items
{

public class BalrogflameColumn : Item
{
[Constructable]
public BalrogflameColumn() : base( 0x3709 )
{
Movable = false;
Name = "Balrog's Flame";
}

public BalrogflameColumn( 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();
}
}
}[/code:1]
 

Ceday

Page
thats okay but this is more appropriate..
[code:1]
protected override void OnLocationChange( Point3D oldLocation )
{
base.OnLocationChange(oldLocation);
if ( m_BalrogflameColumn != null && !m_BalrogflameColumn.Deleted )
{ m_BalrogflameColumn.Map = Map;
m_Balrogflame.Map = Map;
}
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
{
m_BalrogflameColumn.Location = this.Location;
m_Balrogflame.Location = this.Location;
}
[/code:1]
 
New idea for Gothmog, the balrog!

Hmm... I wanna make my BalrogflameColumn to go around my balrog... hmm... how can i show this... OH! k... From a top view...

B is the Balrog (Gothmog)
@ is the Fire column (Balrogflamecolumn)

@@@
@B@
@@@


Like that!

So i'd like need to set it to balrog's location but x and y differen't by 1

It would be like... for all the flames i need they would be positioned like this (B being the balrog's position, and X and Y being the coordinate axis):
x-1 y +1
x=B y+1
x+1 y+1
x-1 y=B
x=B y=B
x+1 y=B
x-1 y-1
x=B y-1
x+1 y-1

Well.. that woulden't be the code... but i'd need to set the flames like that. I don't know how... Can anyone help?
 

Ceday

Page
you can define a new flame with 8 balrogflame or just add them to the creature script directly..

there are properties: Location.X, Location.Y, Location.Z

a.Location=this.Location is same as
a.Location.X=this.Location.X;
a.Location.Y=this.Location.Y;
a.Location.Z=this.Location.Z;
 
A little help? Moving statics to follow a mobile

[code:1] protected override void OnLocationChange( Point3D oldLocation )
{
base.OnLocationChange(oldLocation);
if ( m_BalrogflameColumn != null && !m_BalrogflameColumn.Deleted )
if ( m_Balrogflame != null && !m_Balrogflame.Deleted )
m_BalrogflameColumn.Location = (this.Location.X - 1, (this.Location.Y + 1), this.Location.Z); // Top level (left)
m_BalrogflameColumn.Location = (this.Location.X, (this.Location.Y + 1), this.Location.Z); // Top level (Middle)
m_BalrogflameColumn.Location = (this.Location.X + 1, (this.Location.Y + 1), this.Location.Z); // Top level (right)
m_BalrogflameColumn.Location = (this.Location.X - 1, (this.Location.Y), this.Location.Z); // Middle level (left)
//There is no middle... It is going to be the explosion graphics in the middle... i might swap them later if it looks bad. (middle)
m_BalrogflameColumn.Location = (this.Location.X + 1, (this.Location.Y), this.Location.Z); // Middle level (right)
m_BalrogflameColumn.Location = (this.Location.X - 1, (this.Location.Y - 1), this.Location.Z); // Bottem level (left)
m_BalrogflameColumn.Location = (this.Location.X, (this.Location.Y - 1), this.Location.Z); // Bottem level (Middle)
m_BalrogflameColumn.Location = (this.Location.X + 1, (this.Location.Y - 1), this.Location.Z); // Bottem level (right)
m_Balrogflame.Location = this.Location;
m_BalrogflameColumn.Map = Map;
m_Balrogflame.Map = Map;[/code:1]

It get's error's... i don't get this... and i can't find it in my C book... lol
Well in the end i'll know how to make this... then i might make something more-so usefull! :D
 
Top