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!

Monster Contract Dealer

Monster Contract Dealer

I take no credit for this script. All I have done is translated it into english where needed. It is fairly drag and drop.

As an addition I added a quick and dirty for Red Thorns. As well as a Salamander to drop the Monster Contract BOD Books.
 

Attachments

  • [ReVisited]Monster Contract Dealer & Monster Contract.rar
    10.5 KB · Views: 216
  • RedThorns.cs
    17.4 KB · Views: 154
  • Salamander.cs
    3 KB · Views: 156
Lord_Greywolf;823368 said:
looks interesting,

maybe some more details or link to origional

I am assuming it is like BS bod's but for monsters?

The original was in French. Or Portugeise. I ferget.

There is a Monster Contract Dealer who hands out contracts. Slightly bugged in that you get the contract whether you hit OKAY or not.

There are Monster contracts. You kill the creatures target the corpse and when full hit the button on the contract to redeem.

Some are very lucrative. I have a small but growing player base and a few folks love these so I can't well remove it now. But most average enough to make it worth doing. Cash rewards only.

There is a Monster Contract Book. It holds the contracts and they can be used and accessed directly from the book.

There are red thorns that work much like green thorns. But instead of spawning vorpal bunnies they spawn the Salamander that has a loot drop of a monster contract book. So the thorns can be used as a loot drop on something in game allowing players to use them to sumon a salamander or one of the other options. I revised the script down because on my shard there are other creatures that can be spawned outside the Salamander that are custom and I didn't wish to upload yet.

Only bug I found with the throns was a message I am assuming is client side that says green thron on usage. Could not find it anywhere in the scripts.

Good Lucks. Drag and Drop. Fairly error free.
 
ok - i have this all ready, just with out the bod book and salamander then

but adding the extras is good :) will be adding them in then too
 
Found a small flaw in this script and worked at finding a fix here....

http://www.runuo.com/community/threads/adding-a-check.507462/

This will result in all previous Monster Bods being deleted but if you can live with that it seems to work under testing without throwing any errors.

Simple change....

open MonsterContract.cs and paste the following...

Code:
using System;
using Server;
using Server.Gumps;
using Server.Mobiles;
namespace Server.Items
{
 [Flipable( 0x14EF, 0x14F0 )]
 public class MonsterContract : Item
 {
  private int m_AmountCur, m_AmountMax;//////3-6-12
  private int m_monster;
  private int reward;
  private int m_amount;
  private int m_killed;
  
  [CommandProperty( AccessLevel.GameMaster )]
  public int Monster
  {
   get{ return m_monster; }
   set{ m_monster = value; }
  }
  
  [CommandProperty( AccessLevel.GameMaster )]
  public int Reward
  {
   get{ return reward; }
   set{ reward = value; }
  }
  
  [CommandProperty( AccessLevel.GameMaster )]
  public int AmountToKill
  {
   get{ return m_amount; }
   set{ m_amount = value; }
  }
  
  [CommandProperty( AccessLevel.GameMaster )]
  public int AmountKilled
  {
   get{ return m_killed; }
   set{ m_killed = value; }
  }
  [CommandProperty( AccessLevel.GameMaster )]
  public int AmountCur{ get{ return m_AmountCur; } set{ m_AmountCur = value; InvalidateProperties(); } }//////3-6-12
  [CommandProperty( AccessLevel.GameMaster )]
  public int AmountMax{ get{ return m_AmountMax; } set{ m_AmountMax = value; InvalidateProperties(); } }//////3-6-12
  [CommandProperty( AccessLevel.GameMaster )]
  public bool Complete{ get{ return ( m_AmountCur == m_AmountMax ); } }//////3-6-12
  
  [Constructable]
  public MonsterContract() : base( 0x14EF )
  {
   Weight = 1;
   Movable = true;
   LootType = LootType.Blessed;
   Monster = MonsterContractType.Random();
   AmountToKill = Utility.Random( 10 ) + 5;
   int price = MonsterContractType.Get[Monster].Rarety;
   double scalar = Utility.RandomDouble();
   if(scalar < 0.6)scalar = 0.6;
   Reward = (int)((price * (price/2)) * scalar) * AmountToKill;
   Name = "Contract: " + AmountToKill + " " + MonsterContractType.Get[Monster].Name;
   AmountKilled = 0;
  }
  
  [Constructable]
  public MonsterContract( int monster, int atk, int gpreward ) : base( 0x14F0 )
  {
   Weight = 1;
   Movable = true;
   LootType = LootType.Blessed;
   Monster = monster;
   AmountToKill = atk;
   Reward = gpreward;
   Name = "Contract: " + AmountToKill + " " + MonsterContractType.Get[Monster].Name;
   AmountKilled = 0;
  }
  
  [Constructable]
  public MonsterContract( int monster, int ak, int atk, int gpreward ) : this( monster,atk,gpreward )
  {
   AmountKilled = ak;
  }
  
  public override void OnDoubleClick( Mobile from )
  {
   if( IsChildOf( from.Backpack ) )
   {
    from.SendGump( new MonsterContractGump( from, this ) );
   }
   else
   {
    from.SendLocalizedMessage( 1047012 ); // This contract must be in your backpack to use it
   }
  }
  public void BeginCombine( Mobile from )
  {
   if ( m_AmountCur < m_AmountMax )
    from.Target = new MonsterCorpseTarget( this );
   else
    from.SendLocalizedMessage( 1045166 ); // The maximum amount of requested items have already been combined to this deed.
  }//////3-6-12
  
  public MonsterContract( Serial serial ) : base( serial )
  {
  }
  public override void Serialize( GenericWriter writer )
  {
   base.Serialize( writer );
   writer.Write( (int) 0 ); // version
   
   writer.Write( m_AmountCur );//////3-6-12
   writer.Write( m_AmountMax );/////3-6-12
   writer.Write( m_monster );
   writer.Write( reward );
   writer.Write( m_amount );
   writer.Write( m_killed );
  }
  public override void Deserialize( GenericReader reader )
  {
   base.Deserialize( reader );
   int version = reader.ReadInt();
   
   m_AmountCur = reader.ReadInt();//////3-6-12
          m_AmountMax = reader.ReadInt();/////3-6-12
   m_monster = reader.ReadInt();
   reward = reader.ReadInt();
   m_amount = reader.ReadInt();
   m_killed = reader.ReadInt();
   LootType = LootType.Blessed;
  }
 }
}

Special thanks go to Hammerhand for showing me where I could find an example and pointers.
 
Top