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!

[7.0.19+]Scalis and Artis(not 100% OSI)

koluch

Sorceror
Wanted to add Scalis to the Fabled Fishing Net, so here he is with a 50-50 chance of spawning him or the Leviathan.
Included are the High Seas Artis that he and Corgul can drop - not 100% OSI but close enough for me, feel free to work them any way you want.

Scirus.jpg

High Seas Artis: http://www.uoguide.com/Artifacts_(High_Seas)

* Corguls Handbook on Mysticism was made into Corgul's Handbook on Magery since I don't have Mysticism on my server(if you do, that is an easy change, the cliloc is in the script for you)

* Choose one of the 2 Scalis to use - Scalis comes as:
1) Scalis DeathDrop.cs - he drops the artifacts on his corpse much the same was that ML bosses drop rares.
2) Scalis ArtiDrop.cs - drops the arti into the players backpack the same way the Leviathan does.

Add this section to the SpecialFishingNet.cs near the bottom where the Fabled Fishing Net is:
Code:
protected override void FinishEffect( Point3D p, Map map, Mobile from )
        {
            BaseCreature spawn;
 
                switch ( Utility.Random( 2 ) )
                {
                    default:
                    case 0: spawn = new Leviathan(); break;
                    case 1: spawn = new Scalis(); break;
                 
                }
 
                Spawn( p, map, spawn );
                spawn.Combatant = from;
            //Spawn( p, map, new Leviathan( from ) );
 
            base.FinishEffect( p, map, from );
        }

This gives you a 50/50 chance of getting either the Leviathan or Scalis.
Scalis throws SpawnedParasiticEel(file included in the Scalis Artis.zip folder)

Anyway, thought someone might like to use this. Enjoy.

Koluch

UPDATE = changed the Illustrious wand of thundering glory. please check the one you have. It was a basewand and I believe was incorrect. The new one should be ok(I have been really under the weather lately, so please double check the item, thanks :( )
 

Attachments

  • ScalisDeathDrop.cs
    4.8 KB · Views: 131
  • Scalis ArtiDrop.cs
    5.2 KB · Views: 140
  • Scalis Artis 2-28-12.rar
    8.7 KB · Views: 139

Orbit Storm

Sorceror
Just a heads up, on line 29:

Code:
public Scalis( Mobile fisher ) : base( AIType.AI_Necromage, FightMode.Closest, 10, 1, 0.2, 0.4 )

the AIType.AI_Necromage needs to be AIType.AI_NecroMage (note the capital M in Mage).

Common sense to most, but it will throw errors for anyone who uses NecroMage, not Necromage, in NecroMageAI.cs (as well as BaseAI.cs).
 

X.Amubsh.X

Traveler
I got a problem on Line 44 :| Can someone help me? Idk how to post what the errors are i cant copy in the command prompt? But its something to do with the craft and what not
 

koluch

Sorceror
Just a heads up, on line 29:

Code:
public Scalis( Mobile fisher ) : base( AIType.AI_Necromage, FightMode.Closest, 10, 1, 0.2, 0.4 )

the AIType.AI_Necromage needs to be AIType.AI_NecroMage (note the capital M in Mage).

Common sense to most, but it will throw errors for anyone who uses NecroMage, not Necromage, in NecroMageAI.cs (as well as BaseAI.cs).
Sorry I have been out sick for a good few weeks and forget to address this.
Yeah, I use Necromage, not NecroMage, just change it appropriately.

Also, X.Ambush, what script and error are you getting, write down as much as you can and will help you get it fixed.

Koluch
 

rondelin

Sorceror
Tested with gm char and no arties drop after killing 20 of each

odds should be 1 in 4 or better. on osi i only got one leviathan to not drop an arty
 

koluch

Sorceror
It wont drop with a staff character I believe, must be a player or use the DropOnDeath Scalis.
** UPDATED**
Updated the Illustrious Wand of Thundering Glory, important!(believe had a bad check in the for BaseWand!)
 

Attachments

  • IllustriousWandOfThunderingGlory.cs
    2 KB · Views: 40
Could you possibly post a copy of your modded SpecialFishingNet.cs file
or tell us `exactly` where your lines of text go in at?
i get errors with it when it recompiles.
TY
 

koluch

Sorceror
Here ya go! In code and as a file.

Code:
using System;
using Server;
using Server.Mobiles;
using Server.Multis;
using Server.Spells;
using Server.Targeting;

namespace Server.Items
{
    public class SpecialFishingNet : Item
    {
        public override int LabelNumber{ get{ return 1041079; } } // a special fishing net

        private bool m_InUse;

        [CommandProperty( AccessLevel.GameMaster )]
        public bool InUse
        {
            get{ return m_InUse; }
            set{ m_InUse = value; }
        }

        [Constructable]
        public SpecialFishingNet() : base( 0x0DCA )
        {
            Weight = 1.0;

            if ( 0.01 > Utility.RandomDouble() )
                Hue = Utility.RandomList( m_Hues );
            else
                Hue = 0x8A0;
        }

        private static int[] m_Hues = new int[]
            {
                0x09B,
                0x0CD,
                0x0D3,
                0x14D,
                0x1DD,
                0x1E9,
                0x1F4,
                0x373,
                0x451,
                0x47F,
                0x489,
                0x492,
                0x4B5,
                0x8AA
            };

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

        public override void GetProperties( ObjectPropertyList list )
        {
            base.GetProperties( list );

            AddNetProperties( list );
        }

        protected virtual void AddNetProperties( ObjectPropertyList list )
        {
            // as if the name wasn't enough..
            list.Add( 1017410 ); // Special Fishing Net
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 1 ); // version

            writer.Write( m_InUse );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_InUse = reader.ReadBool();

                    if ( m_InUse )
                        Delete();

                    break;
                }
            }

            Stackable = false;
        }

        public override void OnDoubleClick( Mobile from )
        {
            if ( m_InUse )
            {
                from.SendLocalizedMessage( 1010483 ); // Someone is already using that net!
            }
            else if ( IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1010484 ); // Where do you wish to use the net?
                from.BeginTarget( -1, true, TargetFlags.None, new TargetCallback( OnTarget ) );
            }
            else
            {
                from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
            }
        }

        public virtual bool RequireDeepWater{ get{ return true; } }

        public void OnTarget( Mobile from, object obj )
        {
            if ( Deleted || m_InUse )
                return;

            IPoint3D p3D = obj as IPoint3D;

            if ( p3D == null )
                return;

            Map map = from.Map;

            if ( map == null || map == Map.Internal )
                return;

            int x = p3D.X, y = p3D.Y, z = map.GetAverageZ( x, y ); // OSI just takes the targeted Z

            if ( !from.InRange( p3D, 6 ) )
            {
                from.SendLocalizedMessage( 500976 ); // You need to be closer to the water to fish!
            }
            else if ( !from.InLOS( obj ) )
            {
                from.SendLocalizedMessage( 500979 ); // You cannot see that location.
            }
            else if ( RequireDeepWater ? FullValidation( map, x, y ) : ( ValidateDeepWater( map, x, y ) || ValidateUndeepWater( map, obj, ref z ) ) )
            {
                Point3D p = new Point3D( x, y, z );

                if ( GetType() == typeof( SpecialFishingNet ) )
                {
                    for ( int i = 1; i < Amount; ++i ) // these were stackable before, doh
                        from.AddToBackpack( new SpecialFishingNet() );
                }

                m_InUse = true;
                Movable = false;
                MoveToWorld( p, map );

                SpellHelper.Turn( from, p );
                from.Animate( 12, 5, 1, true, false, 0 );

                Effects.SendLocationEffect( p, map, 0x352D, 16, 4 );
                Effects.PlaySound( p, map, 0x364 );

                Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.25 ), 14, new TimerStateCallback( DoEffect ), new object[]{ p, 0, from } );

                from.SendLocalizedMessage( RequireDeepWater ? 1010487 : 1074492 ); // You plunge the net into the sea... / You plunge the net into the water...
            }
            else
            {
                from.SendLocalizedMessage( RequireDeepWater ? 1010485 : 1074491 ); // You can only use this net in deep water! / You can only use this net in water!
            }
        }

        private void DoEffect( object state )
        {
            if ( Deleted )
                return;

            object[] states = (object[])state;

            Point3D p = (Point3D)states[0];
            int index = (int)states[1];
            Mobile from = (Mobile)states[2];

            states[1] = ++index;

            if ( index == 1 )
            {
                Effects.SendLocationEffect( p, Map, 0x352D, 16, 4 );
                Effects.PlaySound( p, Map, 0x364 );
            }
            else if ( index <= 7 || index == 14 )
            {
                if ( RequireDeepWater )
                {
                    for ( int i = 0; i < 3; ++i )
                    {
                        int x, y;

                        switch ( Utility.Random( 8 ) )
                        {
                            default:
                            case 0: x = -1; y = -1; break;
                            case 1: x = -1; y =  0; break;
                            case 2: x = -1; y = +1; break;
                            case 3: x =  0; y = -1; break;
                            case 4: x =  0; y = +1; break;
                            case 5: x = +1; y = -1; break;
                            case 6: x = +1; y =  0; break;
                            case 7: x = +1; y = +1; break;
                        }

                        Effects.SendLocationEffect( new Point3D( p.X + x, p.Y + y, p.Z ), Map, 0x352D, 16, 4 );
                    }
                }
                else
                {
                    Effects.SendLocationEffect( p, Map, 0x352D, 16, 4 );
                }

                if ( Utility.RandomBool() )
                    Effects.PlaySound( p, Map, 0x364 );

                if ( index == 14 )
                    FinishEffect( p, Map, from );
                else
                    this.Z -= 1;
            }
        }

        protected virtual int GetSpawnCount()
        {
            int count = Utility.RandomMinMax( 1, 3 );

            if ( Hue != 0x8A0 )
                count += Utility.RandomMinMax( 1, 2 );

            return count;
        }

        protected void Spawn( Point3D p, Map map, BaseCreature spawn )
        {
            if ( map == null )
            {
                spawn.Delete();
                return;
            }

            int x = p.X, y = p.Y;

            for ( int j = 0; j < 20; ++j )
            {
                int tx = p.X - 2 + Utility.Random( 5 );
                int ty = p.Y - 2 + Utility.Random( 5 );

                LandTile t = map.Tiles.GetLandTile( tx, ty );

                if ( t.Z == p.Z && ( (t.ID >= 0xA8 && t.ID <= 0xAB) || (t.ID >= 0x136 && t.ID <= 0x137) ) && !Spells.SpellHelper.CheckMulti( new Point3D( tx, ty, p.Z ), map ) )
                {
                    x = tx;
                    y = ty;
                    break;
                }
            }

            spawn.MoveToWorld( new Point3D( x, y, p.Z ), map );

            if ( spawn is Kraken && 0.2 > Utility.RandomDouble() )
                spawn.PackItem( new MessageInABottle( map == Map.Felucca ? Map.Felucca : Map.Trammel ) );
        }

        protected virtual void FinishEffect( Point3D p, Map map, Mobile from )
        {
            from.RevealingAction();

            int count = GetSpawnCount();

            for ( int i = 0; map != null && i < count; ++i )
            {
                BaseCreature spawn;

                switch ( Utility.Random( 4 ) )
                {
                    default:
                    case 0: spawn = new SeaSerpent(); break;
                    case 1: spawn = new DeepSeaSerpent(); break;
                    case 2: spawn = new WaterElemental(); break;
                    case 3: spawn = new Kraken(); break;
                }

                Spawn( p, map, spawn );

                spawn.Combatant = from;
            }

            Delete();
        }

        public static bool FullValidation( Map map, int x, int y )
        {
            bool valid = ValidateDeepWater( map, x, y );

            for ( int j = 1, offset = 5; valid && j <= 5; ++j, offset += 5 )
            {
                if ( !ValidateDeepWater( map, x + offset, y + offset ) )
                    valid = false;
                else if ( !ValidateDeepWater( map, x + offset, y - offset ) )
                    valid = false;
                else if ( !ValidateDeepWater( map, x - offset, y + offset ) )
                    valid = false;
                else if ( !ValidateDeepWater( map, x - offset, y - offset ) )
                    valid = false;
            }

            return valid;
        }

        private static int[] m_WaterTiles = new int[]
            {
                0x00A8, 0x00AB,
                0x0136, 0x0137
            };

        private static bool ValidateDeepWater( Map map, int x, int y )
        {
            int tileID = map.Tiles.GetLandTile( x, y ).ID;
            bool water = false;

            for ( int i = 0; !water && i < m_WaterTiles.Length; i += 2 )
                water = ( tileID >= m_WaterTiles[i] && tileID <= m_WaterTiles[i + 1] );

            return water;
        }

        private static int[] m_UndeepWaterTiles = new int[]
            {
                0x1797, 0x179C
            };

        private static bool ValidateUndeepWater( Map map, object obj, ref int z )
        {
            if ( !( obj is StaticTarget ) )
                return false;

            StaticTarget target = (StaticTarget)obj;

            if ( BaseHouse.FindHouseAt( target.Location, map, 0 ) != null )
                return false;

            int itemID = target.ItemID;

            for ( int i = 0; i < m_UndeepWaterTiles.Length; i += 2 )
            {
                if ( itemID >= m_UndeepWaterTiles[i] && itemID <= m_UndeepWaterTiles[i + 1] )
                {
                    z = target.Z;
                    return true;
                }
            }

            return false;
        }
    }

    public class FabledFishingNet : SpecialFishingNet
    {
        public override int LabelNumber{ get{ return 1063451; } } // a fabled fishing net

        [Constructable]
        public FabledFishingNet()
        {
            Hue = 0x481;
        }

        protected override void AddNetProperties( ObjectPropertyList list )
        {
        }

        protected override int GetSpawnCount()
        {
            return base.GetSpawnCount() + 4;
        }

        protected override void FinishEffect( Point3D p, Map map, Mobile from )
        {
            BaseCreature spawn;

                switch ( Utility.Random( 2 ) )
                {
                    default:
                    case 0: spawn = new Leviathan(); break;
                    case 1: spawn = new Scalis(); break;
                    
                }

                Spawn( p, map, spawn );
                spawn.Combatant = from;
            //Spawn( p, map, new Leviathan( from ) );

            base.FinishEffect( p, map, from );
        }

        public FabledFishingNet( 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();
        }
    }
}
 

Attachments

  • SpecialFishingNet.cs
    9.5 KB · Views: 32

jamesreg

Sorceror
Heres the scalis artidrop with the NecroMage thing fixed I know but easy change but good for lazy people lol
 

Attachments

  • Scalis ArtiDrop.cs
    5.2 KB · Views: 37

peepeetree

Sorceror
Code:
RunUO - [www.runuo.com] Version 2.1, Build 4272.35047
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 6 64-bit processors
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
+ Customs/Scalis Artis/CorgulsHandbookOnMagery.cs:
    CS0506: Line 44: 'Server.Items.CorgulsHandbookOnMagery.OnCraft(int, bool, Se
rver.Mobile, Server.Engines.Craft.CraftSystem, System.Type, Server.Items.BaseToo
l, Server.Engines.Craft.CraftItem, int)': cannot override inherited member 'Serv
er.Items.Spellbook.OnCraft(int, bool, Server.Mobile, Server.Engines.Craft.CraftS
ystem, System.Type, Server.Items.BaseTool, Server.Engines.Craft.CraftItem, int)'
because it is not marked virtual, abstract, or override
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

Here is the line 44 error that X.Amubsh.X was having trouble with, I am also have the same problem and can't seem to figure out what is causing it. Any help would be appreciated!
 

Dreamseeker

Sorceror
The 'public override int OnCraft(----)' is for Player crafted items, to set Resource type and bonuses etc.. I have no idea what is being called in this bit on this item (works regardless on my server) but it'd be safe to delete the whole section.

Then the book would work without affecting anything other than the crafting method. (Unless it is being used as a craftable artifact)
 

peepeetree

Sorceror
hmm it leads to a ton of other errors, if I fix those I get more errors, I will just give up on this for now. I appreciate the help Dreamseeker, especially that quickly!!
 

koluch

Sorceror
This is using a server with the MalGannis ML release, that is your error log if you can post that?
 
Top