Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 02-18-2007, 02:32 PM   #1 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default Linked Gates

Linked Gates
by Lokai


What is it?

It's a bag that contains 2 Moongates. Each Moongate is 'Mated' to the other. Where ever you put them, each one will send you to the other without regard to the "target" settings.

How do you use it?

[add LinkedGateBag
The Gates come with the name "Alpha" by default. You can change the name to reflect the destination if you wish, or make the names match so you know which Gate is married to the other.
"[m set name Beta" for example, then click both Gates.

Installation?

Drop in and restart server.

Troubles?

It's brand new, so there might be issues I have not thought of. Please post here with any problems.

Thanks!
Attached Files
File Type: zip LinkedGates.zip (1.9 KB, 488 views)
Lokai is offline   Reply With Quote
Old 02-18-2007, 02:32 PM   #2 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

I am reserving this post in case I make a change log, updates, etc.
Lokai is offline   Reply With Quote
Old 02-18-2007, 02:38 PM   #3 (permalink)
Forum Expert
 
mordero's Avatar
 
Join Date: Nov 2003
Location: Illinois, USA
Age: 23
Posts: 2,911
Default

Cool release
mordero is offline   Reply With Quote
Old 02-18-2007, 02:42 PM   #4 (permalink)
Forum Novice
 
Protius73's Avatar
 
Join Date: Mar 2004
Location: Jax FL USA
Age: 36
Posts: 269
Default

Thanks man saves me the trouble of writing them lol. I used them extensively on my old shard.

Good Job!
__________________
Evil is as Evil does ... Guess im just an Evil motherf....
*sniffs air * That fear i smell??

www.darkgenesiscafe.com
Protius73 is offline   Reply With Quote
Old 07-31-2007, 09:57 AM   #5 (permalink)
Newbie
 
Thadeus's Avatar
 
Join Date: Jul 2006
Location: Tampa, FL
Age: 27
Posts: 74
Send a message via AIM to Thadeus
Question Linked Gates.

Try as I might, I can't figure out how to get one of the gates to appear differently. I'd like one of them to appear as a house teleporter.

What I tried was copying the folder that contained the 2 scripts to another folder and attempted to replace some occurrences of the word "linked" with the word "house" as well as set the ItemID of the house teleporter.
I was hoping to to end up with 2 bags. One with matching moongates and one with a moongate linked to a house teleporter that I could place anywhere. What I got was the error below:

Code:
Errors:
 + Custom/House Gates/HouseGateBag.cs:
    CS0029: Line 26: Cannot implicitly convert type 'Server.Lokai.LinkedGate' to
 'Server.Lokai.HouseGate'
I also got the same error in reference to "Custom/House Gates/HouseGate.cs" about every other time I tried to compile.


Any help with this would be greatly appreciated.
tia
Thadeus is offline   Reply With Quote
Old 07-31-2007, 03:00 PM   #6 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Sounds interesting. Post it, so I can have a look?
Lokai is offline   Reply With Quote
Old 08-01-2007, 10:11 AM   #7 (permalink)
Newbie
 
Thadeus's Avatar
 
Join Date: Jul 2006
Location: Tampa, FL
Age: 27
Posts: 74
Send a message via AIM to Thadeus
Question What I've done.

Quote:
Originally Posted by Lokai
Sounds interesting. Post it, so I can have a look?
This, from what I understand, would also require LinkedGate.cs from the first post. Keep in mind I have no idea what I'm doing.


Housegate.cs
Code:
using System;
using Server;
using Server.Mobiles;
using Server.Items;
using System.Collections;
using System.Reflection;
using Server.Network;

namespace Server.Lokai
{
    public class HouseGate : Moongate
    {
        private HouseGate mateGate;
        [CommandProperty(AccessLevel.GameMaster)]
        public HouseGate MateGate { get { return mateGate; } set { mateGate = value; } }

        private Point3D m_Target;
        private Map m_TargetMap;

        private bool showWarning;
        [CommandProperty(AccessLevel.GameMaster)]
        public bool ShowWarning { get { return showWarning; } set { showWarning = value; } }

        [Constructable]
        public HouseGate()
            : base(false)
        {
            Movable = true;
            Visible = true;
            ShowWarning = false;
            Hue = 0x2D1;
			ItemID = 0x1822;  //  give the apearance of a house teleporter.
            Light = LightType.Circle300;
        }

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

        public override void DelayCallback(Mobile from, int range)
        {
            BeginConfirmation(from);
        }

        public override void BeginConfirmation(Mobile from)
        {
            if (ShowWarning && (IsInTown(from.Location, from.Map) && !IsInTown(MateGate.Location, MateGate.Map)
                    || (from.Map != Map.Felucca && MateGate.Map == Map.Felucca && ShowFeluccaWarning)))
            {
                from.Send(new PlaySound(0x20E, from.Location));
                from.CloseGump(typeof(MoongateConfirmGump));
                from.SendGump(new MoongateConfirmGump(from, this));
            }
            else
            {
                EndConfirmation(from);
            }
        }

        public override void UseGate(Mobile m)
        {
            if (MateGate == null || MateGate.Deleted)
            {
                Console.WriteLine("The Gate at {0} is missing it's mate", this.Location.ToString());
                return;
            }
            m_Target = MateGate.Location;
            m_TargetMap = MateGate.Map;

            int flags = m.NetState == null ? 0 : m.NetState.Flags;

            if (Factions.Sigil.ExistsOn(m))
            {
                m.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (m_TargetMap == Map.Felucca && m is PlayerMobile && ((PlayerMobile)m).Young)
            {
                m.SendLocalizedMessage(1049543); // You decide against traveling to Felucca while you are still young.
            }
            else if ((m.Kills >= 5 && m_TargetMap != Map.Felucca) || (m_TargetMap == Map.Tokuno && (flags & 0x10) == 0) || (m_TargetMap == Map.Malas && (flags & 0x8) == 0) || (m_TargetMap == Map.Ilshenar && (flags & 0x4) == 0))
            {
                m.SendLocalizedMessage(1019004); // You are not allowed to travel there.
            }
            else if (m.Spell != null)
            {
                m.SendLocalizedMessage(1049616); // You are too busy to do that at the moment.
            }
            else if (m_TargetMap != null && m_TargetMap != Map.Internal)
            {
                BaseCreature.TeleportPets(m, m_Target, m_TargetMap);

                m.MoveToWorld(m_Target, m_TargetMap);

                m.PlaySound(0x1FE);

                OnGateUsed(m);
            }
            else
            {
                m.SendMessage("This moongate does not seem to go anywhere.");
            }
        }

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

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

            writer.Write(showWarning);
            writer.Write(mateGate);
        }

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

            int version = reader.ReadInt();

            switch (version)
            {
                case 2:
                    {
                        showWarning = reader.ReadBool();
                        goto case 1;
                    }
                case 1:
                    {
                        mateGate = reader.ReadItem() as HouseGate;
                        break;
                    }
            }
        }
    }
}
HouseGateBag.cs
Code:
using System;
using Server;
using Server.Items;
using Server.Lokai;

namespace Server.Items
{
    public class HouseGateBag : Bag
    {
        public override string DefaultName
        {
            get { return "a Bag of House Gates"; }
        }

        [Constructable]
        public HouseGateBag()
            : this("Alpha")
        {
            Movable = true;
            Hue = 0x105;
        }

        [Constructable]
        public HouseGateBag(string name)
        {
            HouseGate gateA = new HouseGate();
            HouseGate gateB = new LinkedGate();
            gateA.MateGate = gateB;
            gateB.MateGate = gateA;
            gateA.Name = name;
            gateB.Name = name;
            DropItem(gateA);
            DropItem(gateB);
        }

        public HouseGateBag(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();
        }
    }
}
Convinced I have no clue what I'm doing yet? lol
tia for any input. 8)
Thadeus is offline   Reply With Quote
Old 08-01-2007, 12:58 PM   #8 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

This one is wrong, for obvious reasons. One type cannot be another:

Code:
HouseGate gateB = new LinkedGate();
I think if you change that to be HouseGate instead, you might be closer to having this thing done. Let me know.
Lokai is offline   Reply With Quote
Old 08-01-2007, 05:23 PM   #9 (permalink)
Newbie
 
Thadeus's Avatar
 
Join Date: Jul 2006
Location: Tampa, FL
Age: 27
Posts: 74
Send a message via AIM to Thadeus
Default

As you can see I have no idea what I'm doing.
I just assumed I would have to use HouseGate() and LinkedGate() because I want one of each in the bag.
My understanding was that HouseGate() was a moongate that looks like a house teleporter and LinkedGate was a regular moongate.

If I change them both to HouseGate... won't I end up with a bag that contains 2 house teleporters? Or am I way off?
Thadeus is offline   Reply With Quote
Old 08-01-2007, 10:23 PM   #10 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

I didn't have time before to really put much thought into what you were trying to do. Here, I put these together, I think it's what you were looking for.
Attached Files
File Type: zip HouseGateLinks.zip (3.3 KB, 77 views)
Lokai is offline   Reply With Quote
Old 08-01-2007, 11:30 PM   #11 (permalink)
Newbie
 
Thadeus's Avatar
 
Join Date: Jul 2006
Location: Tampa, FL
Age: 27
Posts: 74
Send a message via AIM to Thadeus
Default

Wow, thanks. That's exactly what I was looking for.
I see now that the LinkedGate.cs and HouseGate.cs had to reference the mate function of each other. Still no clue how, but I suppose I learned a little.

thanks a lot. 8)
Thadeus is offline   Reply With Quote
Old 12-18-2007, 01:32 AM   #12 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Lokia is there any way to adjust the delay from going from 1 gate to the other?
IE: Gate 1 you walk in and instant teleport but Gate 2 you walk in and just stand there for a few seconds before being teleported..
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 12-18-2007, 02:29 AM   #13 (permalink)
Forum Expert
 
Alex21's Avatar
 
Join Date: Jul 2007
Location: Australia, Queensland, Sunshine Coast
Age: 17
Posts: 1,334
Send a message via MSN to Alex21
Default

You've given me an awesome idea!
__________________
Advertise Your Server On JoinUO!
JoinUO @ - joinuo.com
Alex21 is offline   Reply With Quote
Old 12-26-2007, 05:30 PM   #14 (permalink)
Newbie
 
Join Date: Nov 2007
Location: USA, Ohio
Age: 45
Posts: 80
Default Decaying

I would like to place these out in the world however they are set to decay.. I tried changing this setting but it says that that attribute is read-only. How do I get around this?
Shakhan is offline   Reply With Quote
Old 12-26-2007, 06:19 PM   #15 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Tried [set movable false ?
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 02-27-2008, 11:24 PM   #16 (permalink)
Newbie
 
Jedi Faggus's Avatar
 
Join Date: Feb 2008
Location: Launceston
Age: 18
Posts: 39
Send a message via MSN to Jedi Faggus
Default

thanks had no problems with script
__________________
Looking For Staff. Log on Shadowsofagesuo.no-ip.biz with Razor or AIM ME. ShadowsOfAgesUO
Jedi Faggus is offline   Reply With Quote
Old 03-31-2009, 08:25 PM   #17 (permalink)
Lurker
 
Join Date: Nov 2006
Age: 32
Posts: 5
Default zip file wont open

Keeps saying invalid or corrupted
xxviperh202xx is offline   Reply With Quote
Old 04-01-2009, 11:44 AM   #18 (permalink)
Lurker
 
Join Date: Nov 2006
Age: 32
Posts: 5
Default Little Help

Does anyone know where i can get this file. its one of the last few i need to complete my shard this one keeps saying corrupt zip file and i cant open it.
xxviperh202xx is offline   Reply With Quote
Old 04-01-2009, 11:51 AM   #19 (permalink)
Forum Novice
 
Join Date: Jul 2006
Age: 30
Posts: 746
Default

Quote:
Originally Posted by xxviperh202xx View Post
Does anyone know where i can get this file. its one of the last few i need to complete my shard this one keeps saying corrupt zip file and i cant open it.
Here ya go
Attached Files
File Type: rar LinkedGates.rar (1.7 KB, 20 views)
__________________
Friends Come and go but Enemies accumulate
oiii88 is offline   Reply With Quote
Old 05-05-2009, 09:52 AM   #20 (permalink)
Lurker
 
Join Date: Apr 2009
Age: 40
Posts: 9
Default Sweeeet

TY, I have already place about 50 gates
Tugboat is offline   Reply With Quote
Old 10-28-2009, 03:58 AM   #21 (permalink)
Newbie
 
Join Date: Oct 2009
Age: 36
Posts: 26
Send a message via Yahoo to beebee
Smile hi

thanks for this release its really cool save the trouble of rewriting scripts which i know nothing of ....but thanx this is awsome...
beebee is offline   Reply With Quote
Old 12-30-2009, 02:41 PM   #22 (permalink)
Lurker
 
Join Date: Jul 2008
Age: 18
Posts: 17
Default what directory

what directory, wich is what part of the runuo folder i paste the gate link files ?
sk8danger is offline   Reply With Quote
Old 12-30-2009, 02:55 PM   #23 (permalink)
Forum Novice
 
Join Date: Apr 2006
Age: 41
Posts: 308
Default

The best place to install custom scripts is in your Customs folder. If you have not created one simply make a new folder in your Scripts directory and rename it to Customs.

Typically when a script release says "drop in", it means there are no distro edits and you place the script(s) in your Customs folder.
__________________
http://www.crypticrealms.com
homergz is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5