Welcome
Welcome to <strong>SunUO</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Captain Morgan, Cursed Pirate

Release your custom scripts to the public. By posting your scripts here it is automatically licensed under the terms of the GPL.

Captain Morgan, Cursed Pirate

Postby Argo on Thu Aug 16, 2007 12:29 pm

This is a simple pirate I hacked together. I think I based it on a Khaldun Zealot but it's been over 2 years since I did it. I had a pirate ship static and he was on the deck.

Code: Select all
using System;
using Server.Misc;
using Server.Network;
using System.Collections;
using Server.Items;
using Server.Targeting;

namespace Server.Mobiles
{
   public class captainmorgan : BaseCreature
   {

     private static bool m_Talked; // flag to prevent spam

      string[] kfcsay = new string[] // things to say while greating
      {
       "Arrr, you dare t' scalwags my ship Ye'll ne'er get me booty!",
       "You be paying with yer head for comin 'er",
       "Ahoy, you want t' steal my treasure Gar, Where can I find a bottle o'rum?",
       "Arrr, repel the boarders they want t' steal our treasure A pence for an old man o'de sea?",
      };

      public override bool ClickTitle{ get{ return false; } }
      public override bool ShowFameTitle{ get{ return false; } }

      [Constructable]
      public captainmorgan(): base( AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4 )
      {
         Body = 0x190;
         Name = "Captain Morgan";
         Title = "The Cursed Pirate";
         Hue = Utility.RandomMinMax( 0x8596, 0x8599 );
         AddItem( new LongPants( Utility.RandomNeutralHue() ) );
         AddItem( new FancyShirt( Utility.RandomNeutralHue() ) );
         AddItem( new TricorneHat( Utility.RandomNeutralHue() ) );
         AddItem( new Boots() );
         AddItem( new Cutlass() );


         SetStr( 351, 400 );
         SetDex( 151, 165 );
         SetInt( 76, 100 );

         SetHits( 448, 470 );

         SetDamage( 15, 25 );

         SetDamageType( ResistanceType.Physical, 75 );
         SetDamageType( ResistanceType.Cold, 25 );

         SetResistance( ResistanceType.Physical, 35, 45 );
         SetResistance( ResistanceType.Fire, 25, 30 );
         SetResistance( ResistanceType.Cold, 50, 60 );
         SetResistance( ResistanceType.Poison, 25, 35 );
         SetResistance( ResistanceType.Energy, 25, 35 );

         SetSkill( SkillName.Wrestling, 70.1, 80.0 );
         SetSkill( SkillName.Swords, 120.1, 130.0 );
         SetSkill( SkillName.Anatomy, 120.1, 130.0 );
         SetSkill( SkillName.MagicResist, 90.1, 100.0 );
         SetSkill( SkillName.Tactics, 90.1, 100.0 );

         Fame = 10000;
         Karma = -10000;
         VirtualArmor = 40;
         

      }

      public override int GetIdleSound()
      {
         return 0x184;
      }

      public override int GetAngerSound()
      {
         return 0x286;
      }

      public override int GetDeathSound()
      {
         return 0x288;
      }

      public override int GetHurtSound()
      {
         return 0x19F;
      }

      public override bool AlwaysMurderer{ get{ return true; } }
      public override bool Unprovokable{ get{ return true; } }
      public override Poison PoisonImmune{ get{ return Poison.Deadly; } }

      public captainmorgan( Serial serial ) : base( serial )
      {
      }

      public override bool OnBeforeDeath()
      {
         BoneKnight rm = new BoneKnight();
         rm.Team = this.Team;
         rm.Combatant = this.Combatant;
         rm.NoKillAwards = true;

         if ( rm.Backpack == null )
         {
            Backpack pack = new Backpack();
            pack.Movable = false;
            rm.AddItem( pack );
         }

         for ( int i = 0; i < 2; i++ )
         {
            LootPack.FilthyRich.Generate( this, rm.Backpack, true, LootPack.GetLuckChanceForKiller( this ) );
            LootPack.FilthyRich.Generate( this, rm.Backpack, false, LootPack.GetLuckChanceForKiller( this ) );
         }

         Effects.PlaySound(this, Map, GetDeathSound());
         Effects.SendLocationEffect( Location, Map, 0x3709, 30, 10, 0x835, 0 );
         rm.MoveToWorld( Location, Map );

         Delete();
         return false;
      }

     public override void OnMovement( Mobile m, Point3D oldLocation )
               {                                                   
       if( m_Talked == false )
         {
            if ( m.InRange( this, 3 ) )
            {               
               m_Talked = true;
               SayRandom( kfcsay, this );
               this.Move( GetDirectionTo( m.Location ) );
                  // Start timer to prevent spam
               SpamTimer t = new SpamTimer();
               t.Start();
            }
       }
     }

      private class SpamTimer : Timer
      {
         public SpamTimer() : base( TimeSpan.FromSeconds( 6 ) )
         {
         Priority = TimerPriority.OneSecond;
         }

         protected override void OnTick()
         {
            m_Talked = false;
         }
     }

     private static void SayRandom( string[] say, Mobile m )
     {
       m.Say( say[Utility.Random( say.Length )] );
     }



      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();
      }
   }
}
Argo
Site Admin
 
Posts: 46
Joined: Wed Aug 15, 2007 12:41 pm

Postby malign on Tue Aug 21, 2007 1:53 pm

Cool script, Argo. It works like a charm and is good for a laugh. =)

Regards,
malign
malign
 
Posts: 15
Joined: Tue Aug 21, 2007 7:44 am


Return to Script Releases

Who is online

Users browsing this forum: No registered users and 0 guests