Ryandor.com

Forums
It is currently Fri Apr 19, 2024 1:11 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Quest-type questions...
PostPosted: Tue May 02, 2006 10:19 pm 
Offline
Master
Master

Joined: Mon Jan 20, 2003 7:55 pm
Posts: 213
This thought came to mind after playing Oblivion for hours upon end.

I know that UO has done quests. But, they use those pop-up box things for interaction between players and the quest NPC's.

My questions are these:

Is there a way to script it so that the NPC will respond with his words showing above his head like they do when players talk to one another?

If so, could you write it so that certain words the NPC uses are bold or colored or something, indicating that's something else/next the player should ask about? Therefore, triggering another response from the NPC that gives additional info about the quest?

Thanks,

-Goldrush <--who's been in SUCH a mood to mod :)
*******


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 02, 2006 11:03 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
yep, its actually prety easy to have npc's react to your words, take vendors for example. There are several different ways you can script this, one using 'keywords' wich are held in the Speech.mul file (that is what vendors react to) and another is by the string defined by your script.

Having the npc's text displayed in different colors is also easy to do, although I am unsure right off, if you can actually have one word out of a sentance use a different color. I will look into that though, because I am writing a similar system like you are takling about.

Im prety tied up right now with a lot of other projects, but if I can get some time I will try to find some examples for you. Although, the vendors are a good place to look.. also, look in the RunUO Quest Mobile scripts, many of them react to words also, I think.

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 8:56 am 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
That is how quests originally worked in Ultima Online. Every NPC had a list of keywords they would respond to, such as "job" or "have you seen X" or "time" and, of course, "quest". Then, if the quest speech was multi-part, any additional keyword would be, if I remember correctly, spelled out in all capital letters.

For example:

Player: "Hello Joan, do you have a quest for me?"

Joan (NPC): "Oh yes, my DAUGHTER was kidnapped by evil ORCS!"

Player: "What can you tell me about your daughter?"

Joan (NPC): "She was last seen leaving to the east of town, after she had visited MARLA."

Player: "What about Marla?"

Joan (NPC): "Marla is an old wizard at the edge of town, you should ask her about my DAUGHTER!"

It can all be handled relatively easily by most emulators server-side. I would not use speech.mul for this, though.

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 9:43 am 
Offline
Grand Master
Grand Master

Joined: Thu Jul 17, 2003 8:54 am
Posts: 971
There is an NPC scripted by David in the RunUO forums that acts in exactly this way. I think the called it a "Conversation NPC".

_________________
-= HellRazor =-
Shattered Sosaria is coming!
http://www.shatteredsosaria.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 10:18 am 
Offline
Master
Master

Joined: Mon Jan 20, 2003 7:55 pm
Posts: 213
Good deal!

I always hated those boxes that popped up when you spoke to quest NPC's. I do remember the ones that would answer your "time" question and I think I only experienced the "where is so and so" a couple of times before they took it out of the system.

But, that way, the way described in Syd's example, is exactly what I'm talking about and seems much more personal to me. (even if you ARE technically talking to a non-person. :) )

I love quests in games. They're my favorite part. So, I'd want to have a LOT of them...very complicated ones, too...on my shard. Not a simple.. "Go here and kill this person or monster for a reward." You'd actually have to do quite a bit of footwork to FIND said target.

I'll try to find that RunUO quest thingie.

Thanks, guys.

-Goldrush
*******


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 03, 2006 11:07 pm 
Offline
Posting Whore
Posting Whore

Joined: Fri Aug 29, 2003 6:21 pm
Posts: 1434
Location: Colorado Springs, Co.
The quest boxes that are in UO now were designed to make the "majority" of players happy. They provide a written record on screen of the details involved in the quest, the progress made and the steps left to complete the quest.

The original UO Online NPC's used to drop hints for GM quest using the in game text just like players speech. The original AI was insanely better that what is currently ingame but had huge lag issues.

The problem with normal chat text is the player has to take notes thus slowing down their progress and if they make a mistake, their lost. Though this has its perks.

The problem with the boxes that I have experienced is that some are in hazardous areas where you can be attacked while your not able to see the screen due to the huge box...annoying...

Anyone think to use the in game "Chat" system to do the task? This would prevent spam by allowing the player to "Tell" the NPC and generate the script for that player specifically. This prevents griefing by other players who may like to run up and shout the key word to start the NPC all over again.

An even nicer feature would be to have the NPC's generate random quest so that each player talking to the NPC gets something totally different thus preventing the pile up at the Hedgemaze waiting to kill imps like happens in the real UO now along with those power questors who repeat them over and over for the reward.

Dev

_________________
"So...if crazy people don't know their crazy...does that mean your only sane if your know your crazy?"


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 12:50 am 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
Interesting idea, Dev.

Sydius wrote:
I would not use speech.mul for this, though.


Actually, using the speech.mul would be the best way to achieve best results for npc interaction. Why Syd would say that, i have no idea.

The Speech.mul allows a lot more room to work with, such as no worry of being case sensitive. Also, you can use wild card type settings which allows you to be able to have a keyword said by the player, within a sentence.. for instance.. "Vendor Buy the Bank for the Guards!" If you used a script that defined a string keyword, that sentence wouldnt do anything in game, because of the other words around the keyword needed. But, if "Buy" was in the speech.mul file, and used the 'wild card' option, it would trigger even though there are surrounding words before and after that word.

Might sound complicating, but I hope you understand.

Also, using the Speech.mul file will be much better performance wise, if you are after a large system overall, being the scripts will not have to use strings, but localized numbers that the text in the speech.mul file is assigned to.

Basically, if you want to create a large system of keywords, get yourself a speech editor, and start entering the words in there. The file is very small.

Hope that helps out a little more :)

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 8:24 am 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
I do not know which emulator is being used, and most emulators support keywords in the middle of sentences as well as insensitivity to case. Both operations are very trivial and a standard as far as I am aware.

I suggested against using speech.mul for a couple of reasons. Every time you add/modify a quest, players will have to download a new patch, whereas if you do it entirely server-side, it is transparent to them. In addition, players can view the speech.mul file in an editor and instantly see all of the quest words, which might not be something you want (say, for example, if they need to find a secret keyword by completing another part of a quest). Finally, any sentences containing the keywords in speech.mul are not rendered to other players (at least in the emulators I have used), so if you have many keywords floating around, it is going to become a problem to communicate about the quest. Also, I like being able to hear everything that is said, even if it may be spam -- but this is just my personal preference. I think the additional lag is very negligible.

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 9:32 am 
Offline
Master
Master

Joined: Mon Jan 20, 2003 7:55 pm
Posts: 213
Okay...another couple of questions:

I had considered the spamming thing. So, was wondering if it would be possible for the NPC's reply to show ONLY to the person talking to him/her. I never used the "chat" function in UO, so I don't know what that looks like. Is it a box, too? Or just a different "channel" like the group thing was? That, I think, would be good so that, if several people were doing the same quest those not at that stage yet wouldn't get clues before they're supposed to.

The part about altering the quest slightly for every player sounds nice, to avoid crowds at specified locations, but how complicated would that be to script? I suppose if you only had a limited number of players it wouldn't be so bad. But, if you had a hundred?

As for the player having to take notes, would there be a way to script in a "player journal", like in Oblivion, that updated as the quest went along? Something the player could reference when they needed to? And, would also mark a quest "completed" so that it couldn't be repeated over and over?

Still just thinking. :)

-Goldrush
*******


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 9:34 am 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
All possible... depending on the emulator. You using RunUO?

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 9:39 am 
Offline
Master
Master

Joined: Mon Jan 20, 2003 7:55 pm
Posts: 213
When I was actually finishing and checking my shard, I was using Sphere. I'm only just now sorta getting back into the mood to try getting it back up and running. So all this is just brainstorming at the moment.

I've never tried RunUO, since I don't know how to script the way they do things and I'm probably too old to learn new tricks at this point. ;)

Sphere scripting didn't really seem to be that difficult so I never tried any other way once I had that figured out.

-Goldrush
*******


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 9:46 am 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
Getting text to be sent only to specific players is at least possible in UOX and POL, though I am not sure about Sphere.

As for designing custom quests for everybody, what about making quests in chunks?

So that, for example, when you make a long quest, each portion of the quest can be handled in, say, 5 different ways. Then, when a player does the quest, the NPCs along the way give him one of the five hints randomly. If there are a few different stages to the quest, it could mean a good many different solutions are possible without a lot of work on your part.

One thing to consider is to also make every quest solvable in every way by every player, so that if two people wish to do the same quest together, they can.

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 2:14 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Jun 12, 2002 12:13 am
Posts: 414
Location: West Virginia, USA
[chardef c_questdude]
id=c_man
name=Quest Dude
blah
blah
tspeech=spk_questdude

[speech spk_questdude]
on=*hi*
on=*hello*
on=*hail*
say hi to you too <src.name>

on=*quest*
if (<src.tag.hasquestfromquestdude>)
say You already have my quest, why don't you go to the 'docks' like i told you?
else
say why yes, I have a quest for you <src.name>!
endif

on=*docks*
say Oh there's that grumpy old man Withers at the docks, he stole my garden hoe from me a month ago and refuses to give it back! Hey.. could you help me get it back?

on=*help*
on=*yes*will*help*
say Great! Go to the docks and get my garden hoe!
src.tag.hasquestfromquestdude=1

.............................................

SRC is the player talking to the npc, default object is the npc

If you want only the player to see it, you can do MESSAGE instead of SAY, that'll put it over their heads just like SAY does.

If you want it slightly better looking than the ugly grey you can do sayu or messageu (unicode, and a slightly lighter colored shade of text)

If you want to color it a color of your choosing, use @xx where xx is the color number... ie

message @123 hi there
sysmessage @123 hi there

On my shard when I want an npc to "whisper" someone, or I want the player to feel/think/notice something no others would, I use a sysmessage with a red color, ie -

src.sysmessage @33 Questdude leans in close to you and whispers, "I'm pretty sure you can find Old Man Withers on the east side of the docks, near the tavern."


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 12:04 pm 
Offline
Master
Master

Joined: Mon Jan 20, 2003 7:55 pm
Posts: 213
Great ideas, Sydius and Rosethorn!! Thanks, bunches.

Sorry I haven't replied in a bit. I got a trojan from the "whatever" thread (although my VP caught and deleted it), so I've been wary about returning. No biggie. It didn't mess anything up or anything. I'm just super-paranoid about stuff like that.

I mean, it may not have really been a "real" trojan, since some VP's pick up stuff that's "different" and assume it is. lol

Anyway, now I've got to plan out quests and speeches and junk. Hehe

*cuts and pastes Rose's scripts then runs off to jot down a few ideas*

Thanks, again.

-Goldrush
*******


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 12:23 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
CMS, could you possible PM me with a little more info on the trojan you mentioned? If you can remember the thread it was in, or anything else. Thanks.

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 5:03 pm 
Offline
Posting Whore
Posting Whore

Joined: Fri Aug 29, 2003 6:21 pm
Posts: 1434
Location: Colorado Springs, Co.
If you can beg, borrow or ...well I don't condon criminal activities unless it involves beer and high speed pursuit, get a copy of the original UO Guide from 1997 and script all the NPC AI's back to the original level.

Thats what I started on in UOX .70 and Sphere but never finished and then my computer died and I lost it everything. Its awesome to have NPC's that can actually hold a simple conversation with a vocabulary of 250 key words.

In Sphere you could rename the NPC and give it a seperate file for scripting their speech text, UOX as well very easily. POL can do the same but its harder to script (at least for me). RUNUO is just a pain in the ass to do much of anything so I didn't even bother wasting my time.

Dev

_________________
"So...if crazy people don't know their crazy...does that mean your only sane if your know your crazy?"


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 5:28 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Jun 12, 2002 12:13 am
Posts: 414
Location: West Virginia, USA
hehe, I've seen a couple RunUO npc scripts.. they're about the same size as my entire dynamic spellbook script that handles 3 different types of spellcasting and 300 and some odd spells/songs. Scary if they all require that much nonsense to make an npc.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 5:35 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
thats only because they.. stupidly, made one NPC script to handle ALL spell casters, one to handel ALL melee.. so, you get every stinking if, and, or but in the script for every npc there is to handel..

Thats why I redid them.. started making AI scripts that are independant to specific creatures.. rather than an entire group.

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 8:06 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Jun 12, 2002 12:13 am
Posts: 414
Location: West Virginia, USA
Nah I don't even mean a default script, which I'd assume are larger by, well default :p Take for instance (and this just happens to be first one I randomly clicked on, so if the code sucks or it's unnecessarily long, blame the scripter not me :p) THIS ONE:

Code:
Code:
/////////Script by Tanya - Admin Rhosyn- The Midnight Runners - 2005 - Thanks To Mortis For His Help////
using System;
using Server;
using Server.Misc;
using Server.Items;
using Server.Network;
using Server.Mobiles;

namespace Server.Mobiles
{
   [CorpseName( "a fire corpse" )]
   public class FireSlaver  : BaseCreature
   {
      [Constructable]
      public FireSlaver() : base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.15, 0.4 )
      {
         Name = "Fire Slaver" ;
         Body = 43;
    BaseSoundID = 357;
    Hue = 1360;

         SetStr( 851, 890 );
         SetDex( 292, 330 );
         SetInt( 51, 65 );
         SetHits( 658, 711 );

         SetDamage( 29, 35 );

         SetDamageType( ResistanceType.Physical, 70 );

         SetSkill( SkillName.Fencing, 72.5, 95.0 );
         SetSkill( SkillName.Healing, 60.3, 90.0 );
         SetSkill( SkillName.Macing, 72.5, 95.0 );
         SetSkill( SkillName.Poisoning, 60.0, 82.5 );
         SetSkill( SkillName.MagicResist, 72.5, 95.0 );
         SetSkill( SkillName.Swords, 72.5, 95.0 );
         SetSkill( SkillName.Tactics, 72.5, 95.0 );
         SetSkill( SkillName.Healing, 72.5, 95.0 );
         SetSkill( SkillName.Wrestling, 72.5, 95.0 );

         Fame = 1000;
         Karma = -1000;

         PackGold( 260, 490 );
         PackItem( new Bandage( Utility.RandomMinMax( 30, 75 ) ) );


        // if ( 0.3 > Utility.RandomDouble() )
            // PackSkillScroll();

        // if ( 0.025 > Utility.RandomDouble() )
          //   PackMinusSkillScroll();

         switch ( Utility.Random( 100 ) )
         {
            case 0: PackItem( new LeatherGorget() ); break;
            case 1: PackItem( new Candle() ); break;
            case 2: PackItem( new Bloodmoss( 50 ) ); break;
            case 3: PackItem( new Bandage() ); break;
            case 4: PackItem( new Lemon() ); break;
            case 5: PackItem( new Katana() ); break;
            case 6: PackItem( new ColdBlood() ); break;
            case 7: PackItem( new GlovesOfThePugilist() ); break;
         }
      }

      public override bool AlwaysMurderer{ get{ return true; } }
      public override bool ShowFameTitle{ get{ return false; } }
      public override bool Unprovokable{ get{ return true; } }
      public override bool BardImmune{ get{ return true; } }
      public override Poison PoisonImmune{ get{ return Poison.Deadly; } }
      public override Poison HitPoison{ get{ return Poison.Deadly; } }
      public override int TreasureMapLevel{ get{ return 5; } }

      public override bool OnBeforeDeath()
      {
                              this.SpeechHue = 33;
                              this.Say(" By the lords of fire I summon thee oh lord of the flames");

                              IMount mount = this.Mount;

                              if ( mount != null )
                              mount.Rider = null;
               if ( mount is Mobile )
               switch ( Utility.Random( 3 ))
               {
                    case 0: ((Mobile)mount).Kill(); break;
                    case 1: ((Mobile)mount).Delete(); break;
                    case 2: ((Mobile)mount).Kill(); break;
               }

         FireSteed2 ll = new FireSteed2();
         ll.Map = this.Map;
         ll.Location = (new Point3D( this.X + 3, this.Y - 3, this.Z + 4 ) );
         ll.CanSwim = false;
         ll.SpeechHue = 67;
         ll.Say( "I Bring You Fire To Purge Your Bones.");
         Effects.SendLocationEffect( Location,Map, 0x3709, 13, 0x3B2, 0 );

         Container bag = new Bag();

         switch ( Utility.Random( 9 ))
         {
            case 0: bag.DropItem( new Amber() ); break;
            case 1: bag.DropItem( new Amethyst() ); break;
            case 2: bag.DropItem( new Citrine() ); break;
            case 3: bag.DropItem( new Diamond() ); break;
            case 4: bag.DropItem( new Emerald() ); break;
            case 5: bag.DropItem( new Ruby() ); break;
            case 6: bag.DropItem( new Sapphire() ); break;
            case 7: bag.DropItem( new StarSapphire() ); break;
            case 8: bag.DropItem( new Tourmaline() ); break;
         }

         switch ( Utility.Random( 8 ))
         {
            case 0: bag.DropItem( new SpidersSilk( 3 ) ); break;
            case 1: bag.DropItem( new BlackPearl( 3 ) ); break;
            case 2: bag.DropItem( new Bloodmoss( 3 ) ); break;
            case 3: bag.DropItem( new Garlic( 3 ) ); break;
            case 4: bag.DropItem( new MandrakeRoot( 3 ) ); break;
            case 5: bag.DropItem( new Nightshade( 3 ) ); break;
            case 6: bag.DropItem( new SulfurousAsh( 3 ) ); break;
            case 7: bag.DropItem( new Ginseng( 3 ) ); break;
         }

         bag.DropItem( new Gold( 200, 300 ));
         ll.AddItem( bag );


         return true;
      }

      public override void OnDamagedBySpell( Mobile caster )
      {
         if ( caster == this )
            return;

         SpawnFireSteed2( caster );

         if ( 0.4 >= Utility.RandomDouble() )
                               caster.Damage( Utility.Random( 6, 15 ) );
                               caster.SendMessage(  0x35, "Your spell does damage the slaver but some damage is relected back to you." );

      }
      public void SpawnFireSteed2( Mobile target )
      {
                                          this.SpeechHue = 33;
                                          this.Say( " The legions of fire are on my side.");
                                          target.SpeechHue = 3;
                                          target.Say( " The git spawned a Fire Steed on me.");

         Map map = target.Map;

         if ( map == null )
            return;

         int FireSteed2s = 0;

         foreach ( Mobile m in this.GetMobilesInRange( 4 ) )
         {
            if ( m is FireSteed2 )
               ++FireSteed2s;
         }

         if ( FireSteed2s < 4 )
         {
            BaseCreature FireSteed2 = new FireSteed2();

            FireSteed2.Team = this.Team;
            FireSteed2.Map = map;
            FireSteed2.CanSwim = true;

            bool validLocation = false;

            for ( int j = 0; !validLocation && j < 10; ++j )
            {
               int x = target.X + Utility.Random( 3 ) - 1;
               int y = target.Y + Utility.Random( 3 ) - 1;
               int z = map.GetAverageZ( x, y );

               if ( validLocation = map.CanFit( x, y, this.Z, 16, false, false ) )
                  FireSteed2.Location = new Point3D( x, y, Z );
               else if ( validLocation = map.CanFit( x, y, z, 16, false, false ) )
                  FireSteed2.Location = new Point3D( x, y, z );
            }

            if ( !validLocation )
            FireSteed2.Location = target.Location;

            FireSteed2.Combatant = target;
            FireSteed2.SpeechHue = 33;
            FireSteed2.Say( "I hear and obey master.");
         }
      }
      public FireSlaver( Serial serial ) : base( serial )
      {
      }
      public override void OnGotMeleeAttack( Mobile attacker )
      {

         base.OnGotMeleeAttack( attacker );

         DoSpecialAbility( attacker );
      }

      public override void OnGaveMeleeAttack( Mobile defender )
      {

         base.OnGaveMeleeAttack( defender );
         //defender.Damage( Utility.Random( 20, 10 ), this );
         defender.Stam -= Utility.Random( 20, 10 );
         defender.Mana -= Utility.Random( 20, 10 );

         DoSpecialAbility( defender );
      }

      public void DoSpecialAbility( Mobile target )
      {
                                      if ( target.InRange( this, 10 ) ) //if a player is within 10 tiles of the NPC
                                      {
         if ( 0.5 >= Utility.RandomDouble() )
                     SpawnFireSteed2( target );

                                      else if ( target.InRange( this, 2 ) ) //if a player is within 3 tiles of the NPC
                                      {

          if ( ( target.RawStr ) > 250 )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 11, 15 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 2, 5 ) );

         else if ( ( target.RawStr ) > 225 && ( ( target.RawStr )  < 250 ) )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 10, 14 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 2, 4 ) );

         else if ( ( target.RawStr ) > 200 && ( ( target.RawStr )  < 225 ) )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 9, 13 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 2, 3 ) );

         else if ( ( target.RawStr ) > 175 && ( ( target.RawStr )  < 200 ) )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 8, 12 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 1, 3 ) );

         else if ( ( target.RawStr ) > 150 && ( ( target.RawStr )  < 175 ) )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 7, 11 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 1, 3 ) );

         else if ( ( target.RawStr ) > 125 && ( ( target.RawStr ) < 150 ) )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 6, 10 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 1, 2 ) );

         else if ( ( target.RawStr ) > 100 && ( ( target.RawStr )  < 125 ) )

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 5, 9 ) );

         if ( 0.02 >= Utility.RandomDouble() ) // 20% chance to more damage
                               target.Damage( Utility.Random( 1, 2 ) );

         if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
                               target.Damage( Utility.Random( 1, 2 ) );
            }
         }
      }
      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();
      }
   }
}


All of that to make a critter that summons fire steeds when you beat his ass? No thanks I'll stick to "limited" sphere.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 8:40 pm 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
That isn't just an AI script, it is also defining the mob.
Which would be contained in multiple scripts in Sphere (actually it usually is in RUO as well) so it isn't an apples to apples comparison.
Also it seems like there is a lot of fluff in there. Someone got overly fancy I think (again I am not a scripting expert...I mostly work on the map programs, haven't had a lot of time to mess with critter AI).

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 8:42 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Thu Aug 07, 2003 6:57 am
Posts: 472
Here's a much easier way of killing a player than spawning fire steeds on him ;)
Code:
function onUse( pUser, iUsed )
{
  pUser.TextMessage( "Hello, world!" );
  iUsed.TextMessage( "Hello, player!" );
  pUser.Kill();
}

_________________
-= Ho Eyo He Hum =-


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 8:42 pm 
Offline
Grand Master
Grand Master
User avatar

Joined: Wed Jun 12, 2002 12:13 am
Posts: 414
Location: West Virginia, USA
Here, more or less the same crap, in sphere... and yeah, i'm defining a mob here...

Code:
[chardef c_fireslaver]
id=c_man // or whatever body 43 is ;p
name=Fire Slaver
sound=357
dam=29,35
tevents=e_poison_immune
tevents=e_bard_immune
tevents=

on=@create
     brain=brain_monster // this takes care of the "always murderer" part
     Color=1360
     Str={851 890}
     Dex={292 330}
     Int={51 65}
     Maxhits={658 711}
     Fencing={72.5 95.0}
     Healing={60.3 90.0}
     Macefighting={72.5 95.0}
     Poisoning={60.0 82.5} // this takes care of the "public override poison hitpoison" nonsense
     MagicResistance={72.5 95.0}
     Swordsmanship={72.5 95.0}
     Tactics={72.5 95.0}
     Healing={72.5 95.0}
     Wrestling={72.5 95.0}
     Fame=1000
     Karma=-1000

on=@npcrestock
     newitem=i_gold,{260 490}
     newitem=i_bandage_clean,{10 15}
     newitem=i_gorget_leather
     newitem=i_candle
     newitem=i_reag_bloodmoss
     newitem=i_fruit_lemon
     newitem=i_katana
     newitem=i_coldblood // whatever that is
     newitem=i_gloves_pugilist // whatever that is x2

on=@death
     speechcolor=33
     say By the lords of fire I summon thee oh lord of the flames
     serv.newnpc=c_firesteedthingy
     new.p=<p>
     new.speechcolor=67
     new.say I bring you fire to purge your bones
     effect=0,03709,0,13,0 // i'm guessing here, but the Effects.Sendlocation part would be something like this
     dorand 3 // not really sure what it's doing there, but this is about the essence of HOW to do a random...
          kill
          remove
          kill
     enddo
     serv.newitem=i_bag
     new.p=<p> // does "DropItem" mean on the ground? if not then new.cont=<uid> or wherever you wanted it
     local.bag=<new.uid>
     serv.newitem={ i_amber 1 i_amethyst 1 i_citrine 1 i_emerald 1 i_ruby 1 i_sapphire 1 i_star_sapphire 1 i_tourmaline 1 }
     new.cont=<local.bag>
     serv.newitem={ i_reag_spidersilk 1 i_reag_black_pearl 1 i_reag_bloodmoss 1 i_reag_garlic 1 i_reag_mandrake 1 i_reag_nightshade 1 i_reag_sulfer 1 i_reag_ginseng 1 }
     new.cont=<local.bag>
     serv.newitem=i_gold
     new.amount={ 200 300 }
     new.cont=<local.bag>
     return 0 // return 1 if you don't want him to die here

on=@spelleffect
     if (<src.uid> == <uid>)
          return 0
     else
          serv.newnpc=c_firesteedthingy // i think?
          new.p=<p>
     endif
     if (rand(something) == something) // dunno what 0.4 >= randomdouble() is :p
          src.damage <eval {6 15}> <argn2> <src.uid>
          src.sysmessage Your spell does damage the slaver but some damage is reflected back to you


         
//Yeah ok, too much typing to prove a point, but anyways...

forchars 4
     // this stuf fhere will be run on all npcs/players with a distance of 4 or less
endfor
         
// i don't even wanna know why it appears his script is seeing if an npc *can fit* at a map location..
// does runuo stick npcs where they can't be normally?
// the whole for loop isn't needed in sphere from what i can tell lol, but if you really wanted to do one:
local.j=0
for 0 <local.j>
     // do crap here
     local.j += 1
endfor


//and here we have some more crap that shoulda been back up in the main part logically...

on=@gethit
     if (<src.distance> >= 10)
     doswitch rand(somenumber)
          // spawn steed again, i guess
          argn2 *= 2 // double damage
          argn2 /= 2 // half damage
          argn2 += 30 // 30 extra damage
          argn2 -= 30 // 30 less damage, can you tell i'm just giving random examples? :)
     enddo
     return 0 // allow normal combat to continue, we've just edited the damage done a bit here

on=@hit
     stam -= {10 20}
     mana -= {10 20}


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 8:55 pm 
Offline
Slayer of Fools
Slayer of Fools
User avatar

Joined: Tue Jul 02, 2002 4:54 pm
Posts: 1289
Ok, so the RUO script is about 3x as long, although I don't know if all the " if ( 0.06 >= Utility.RandomDouble() ) // 60% chance to do more damage
target.Damage( Utility.Random( 6, 10 ) ); " etc are really necessary.

_________________
This space for rent.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 8:57 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
Stormcrow wrote:
That isn't just an AI script, it is also defining the mob.
Which would be contained in multiple scripts in Sphere (actually it usually is in RUO as well) so it isn't an apples to apples comparison.
Also it seems like there is a lot of fluff in there. Someone got overly fancy I think (again I am not a scripting expert...I mostly work on the map programs, haven't had a lot of time to mess with critter AI).


Actually, that is just a single creature script. And, unfortunatly, thats an extremly poor example to use. That is just someones custom script, and a poor job of coding. look at the huge length of if statements.. thats typicall of a new scripter, trying to accomplish something complex.. not knowing much of anything about the language.

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 10, 2006 9:00 pm 
Offline
Not your daddy
Not your daddy

Joined: Mon Nov 18, 2002 2:18 am
Posts: 1224
Location: Oregon State
Quote:
dunno what 0.4 >= randomdouble() is :p


Random Double. speaks for itself, if you think about it. 'Double' an integer. if( 0.4 >= Utility.RandomDouble() ); is using the class Random.

To sum it up, that is a 40% chance.. to do whatever.

_________________
Forget what you know, know what you forget.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group