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!

Arrow/bolt color change from specific monsters?

Teagan

Sorceror
I am on Final repack 2.0 client 6.0.1.10 and I scripted a humorously creative monster. The issue I have in completing this monster is that it attacks with a bow and arrow but I would like to know if there is a way to change the arrow color when this thing fires. Like a blue monster firing blue 'thorns' or a black ostard firing black 'feathers' for example.
I know I would have to create two more scripts for the arrows and bow, I just don't know how to make the bow fire the custom arrows.

Thanks for any tips.
 

boba

Sorceror
to make the bow fire the custom arrows it would be a simple change in your new bow script

Code:
    public override Type AmmoType{ get{ return typeof( Arrow ); } }
        public override Item Ammo{ get{ return new Arrow(); } }

instead of arrow make it the type of ammo your using

so if you called it BlueArrow then it would look like this

Code:
    public override Type AmmoType{ get{ return typeof( BlueArrow ); } }
        public override Item Ammo{ get{ return new BlueArrow(); } }


then your bluearrow script would look like this

Code:
using System;
namespace Server.Items
{
public class BlueArrow : Item, ICommodity
{
  int ICommodity.DescriptionNumber { get { return LabelNumber; } }
  bool ICommodity.IsDeedable { get { return False; } }
  public override double DefaultWeight
  {
  get { return 0.1; }
  }
  [Constructable]
  public BlueArrow() : this( 1 )
  {
  }
  [Constructable]
  public BlueArrow( int amount ) : base( 0xF3F )
  {
  Stackable = true;
  Amount = amount;
                        Hue = 2;  // change to whatever color
  }
  public BlueArrow( 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();
  }
}
}

blue bow script something like this

Code:
using System;
using Server.Network;
using Server.Items;
namespace Server.Items
{
[FlipableAttribute( 0x13B2, 0x13B1 )]
public class BlueBow : BaseRanged
{
  public override int EffectID{ get{ return 0xF42; } }
  public override Type AmmoType{ get{ return typeof( BlueArrow ); } }
  public override Item Ammo{ get{ return new BlueArrow(); } }
  public override WeaponAbility PrimaryAbility{ get{ return WeaponAbility.ParalyzingBlow; } }
  public override WeaponAbility SecondaryAbility{ get{ return WeaponAbility.MortalStrike; } }
  public override int AosStrengthReq{ get{ return 30; } }
  public override int AosMinDamage{ get{ return Core.ML ? 15 : 16; } }
  public override int AosMaxDamage{ get{ return Core.ML ? 19 : 18; } }
  public override int AosSpeed{ get{ return 25; } }
  public override float MlSpeed{ get{ return 4.25f; } }
  public override int OldStrengthReq{ get{ return 20; } }
  public override int OldMinDamage{ get{ return 9; } }
  public override int OldMaxDamage{ get{ return 41; } }
  public override int OldSpeed{ get{ return 20; } }
  public override int DefMaxRange{ get{ return 10; } }
  public override int InitMinHits{ get{ return 31; } }
  public override int InitMaxHits{ get{ return 60; } }
  public override WeaponAnimation DefAnimation{ get{ return WeaponAnimation.ShootBow; } }
  [Constructable]
  public BlueBow() : base( 0x13B2 )
  {
  Weight = 6.0;
            Hue = 2; // change to color you like
  Layer = Layer.TwoHanded;
  }
  public BlueBow( 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();
  if ( Weight == 7.0 )
    Weight = 6.0;
  }
}
}

hope this gets your started
 

Teagan

Sorceror
I did try to alter the arrow script for something else by changing the ItemID to make it look like another custom monster was 'throwing' something else.
Custom bow worked, everything compiled but the game still showed arrows being flung and not something else.
Is there a way to make the game show the new items being 'thrown'?
 

boba

Sorceror
Nah you have to write it in the blue arrow script

protected override void OnTarget( Mobile from, object targeted )
{
if ( m_Bluearrow.Deleted )
{
return;
}
else if ( !from.Items.Contains( m_Bluearrow ) )
{
from.SendMessage( "You must be holding that weapon to use it." );
}
else if ( targeted is Mobile )
{
Mobile m = (Mobile)targeted;

if ( m != from && from.HarmfulCheck( m ) )
{
Direction to = from.GetDirectionTo( m );

from.Direction = to;

from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );

if ( Utility.RandomDouble() >= (Math.Sqrt( m.Dex / 100.0 ) * 0.8) )
{
from.MovingEffect( m, 0x1BFE, 7, 1, false, false, 0x481, 0 );// change to the itemid you want to throw

m.Damage(Utility.Random( 5, from.Str / 10 ), from); // change to the str requirements etc


add this in the the blue arrow script and it should help with the animation of the item

hence i havent tested it
 

Teagan

Sorceror
Sorry I have not been on in a while. Had plenty of fun stuff happen on this end. I was so excited I could just sh*t myself.
One of the monsters with the custom arrow color was the Clucker (Colonel Sanders Escapee). This created a standard yumi that fired only the custom arrows which remained the OSI yellow.
http://www.runuo.com/community/threads/colonel-sanders-escapee-ruo-2-0.537041/

The second monster in question was a lady that 'threw cats' at people aptly named Crazy Cat Lady. Yet to continue working this.

The crazy cat lady gave me an idea of a gorilla 'throwing' bananas. Now that I am back, I can get to work again.

If anyone can successfully script the Crazy Cat Lady and throwing gorilla, I would love to see how they work (Final Repack 2.0 here). Here is what I have for the Cat Lady so people don't have to start from scratch if they try it.
 

Attachments

  • Crazy Cat Lady.cs
    2 KB · Views: 1
  • Kitteh.cs
    939 bytes · Views: 2
  • Kittehpault.cs
    1.8 KB · Views: 4
Top