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!

How do I make a monster say random quotes?

Prozac

Sorceror
How do I make a monster say random quotes?

I just got a really good idea, and am working on this "OSI Dungeon".. It'll include these mongbat base monsters, with bodyvalue 987, and named OSI GMs. I want them to walk around spamming "I cannot help you with that." or "Please visit uo.com for more information".. just dumb useless shit responses you get from OSI gms, but I'm not sure how to make them say stuff. Help me out? Thanks. ;-)
 

Lazyburn

Wanderer
switch ( Utility.Random( 4 ))
{
case 0: <whatever code 1>; break;
case 1: <whatever code 2>; break;
case 2: <whatever code 3>; break;
case 3: <whatever code 4>; break;
}

I just grabbed this from an earlier post about dealing with random things. Maybe this will help you some =\
 

Lazyburn

Wanderer
Well thats just a little snippet of code that I thought would maybe help you with your random message part. You would have to change some stuff to get it to work.

Agamemnon
 

Neon

Sorceror
You could use something like this:

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

namespace Server.Mobiles
{
[CorpseName( "a mongbat corpse" )]
public class OSIGM : BaseCreature
{
[Constructable]
public OSIGM() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
{
Name = "an OSI GM";
Body = 987;
Hue = 0x8026;
BaseSoundID = 422;

SetStr( 6, 10 );
SetDex( 26, 38 );
SetInt( 6, 14 );

SetHits( 4, 6 );
SetMana( 0 );

SetDamage( 1, 2 );

SetDamageType( ResistanceType.Physical, 100 );

SetResistance( ResistanceType.Physical, 5, 10 );

SetSkill( SkillName.MagicResist, 5.1, 14.0 );
SetSkill( SkillName.Tactics, 5.1, 10.0 );
SetSkill( SkillName.Wrestling, 5.1, 10.0 );

Fame = 150;
Karma = -150;

VirtualArmor = 10;

Tamable = true;
ControlSlots = 1;
MinTameSkill = -18.9;

PackGold( 1, 25 );
}

public override void OnMovement( Mobile from, Point3D oldLocation )
{
if ( Utility.InRange( Location, from.Location, 12 ) )
{
switch ( Utility.Random( 9 ))
{
case 0: this.Say( "I'm sorry I cannot help you with that." ); break;
case 1: this.Say( "I do not understand what you are asking." ); break;
case 2: this.Say( "Let me check the manual for the answer to your question." ); break;
case 3: this.Say( "Please be more descriptive." ); break;
case 4: break;
case 5: break;
case 6: break;
case 7: break;
case 8: break;
}
}
}

public override int Meat{ get{ return 1; } }
public override FoodType FavoriteFood{ get{ return FoodType.Meat; } }

public OSIGM( 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]
 

Lazyburn

Wanderer
Im just wondering why you have this?
case 4: break;
case 5: break;
case 6: break;
case 7: break;
case 8: break;

Why all these extra cases that just break?

Agamemnon
 

Tru

Knight
for extra sayings im guessing but i added some and got and error where case4 started....so i edited them out
 

David

Moderate
this would work as well, a few less lines is all.
[code:1] switch ( Utility.Random( 9 ))
{
case 0: this.Say( "I'm sorry I cannot help you with that." ); break;
case 1: this.Say( "I do not understand what you are asking." ); break;
case 2: this.Say( "Let me check the manual for the answer to your question." ); break;
case 3: this.Say( "Please be more descriptive." ); break;
default: break;
}
[/code:1]

Then set the Random up as high as you need it...
 

chocobutter

Traveler
how would i edit one for damage instead of movment .... its getting really confusing i dont need whole thing just the first line everything i try just errors because i suck at scripts but im great if im just editing but i wanna make a new boss that is six true forms and each one i want at 10% health to say somthing just cant work it if no one knows than all well... :) just a nice thaught
 

pooka01

Sorceror
public override void OnDamage( int amount, Mobile from, bool willKill )
{
base.OnDamage( amount, from, willKill );
}

pretty old thread tho. lol
 
Top