|
||
|
|||||||
| 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. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
|
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! |
|
|
|
|
|
#3 (permalink) |
|
Forum Expert
Join Date: Nov 2003
Location: Illinois, USA
Age: 23
Posts: 2,911
|
Cool release
![]()
__________________
Useful links (Use them or die in a fire!!!): Ultimate Little Guide, C# Tutorials & Docs, RunUO Basic Scripts, Run UO How to..., Configure server for connections, Scripting for Dummies, Common Problem Solutions, FAQ Forum, RunUO Wiki, Basic Generics, Xml Tutorial |
|
|
|
|
|
#4 (permalink) |
|
Forum Novice
Join Date: Mar 2004
Location: Jax FL USA
Age: 36
Posts: 269
|
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 |
|
|
|
|
|
#5 (permalink) |
|
Newbie
|
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'
Any help with this would be greatly appreciated. tia |
|
|
|
|
|
#7 (permalink) | |
|
Newbie
|
Quote:
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;
}
}
}
}
}
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();
}
}
}
tia for any input. 8) |
|
|
|
|
|
|
#9 (permalink) |
|
Newbie
|
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? |
|
|
|
|
|
#12 (permalink) |
|
Forum Novice
Join Date: Jul 2006
Age: 30
Posts: 746
|
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 |
|
|
|
|
|
#23 (permalink) |
|
Forum Novice
Join Date: Apr 2006
Age: 41
Posts: 308
|
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|