I think there is already a comm crystal script around, but I was working on this version so I decided to drop it in anyways incase someone would want a different script for it. After all, it is somewhat different from the other comm crystal script I found.
This script is an attempt at communication crystals that are the same as the communication crystals on EA's servers.
Some properties of these crystals can be read at this old EA posting:
http://update.uo.com/design_265.html
There are some differences from EA's Comm Crystals and here they are:
- Some small speech handling differences. EA's crystals have some odd behaviours, and in some remotely possible situations don't work at all.
- EA's broadcast crystals can link to other broadcast crystals, with apparently no functionality. These crystals just don't link broadcast to broadcast.
- Hue mods on the speech coming from the crystal might be a bit off from what EA uses.
- EA vendors buy back only inactive crystals. These crystals are bought back no matter what.
- EA vendors are much less descriptive with their Comm Crystal stock display.
- EA's crystals don't refresh their display values everytime their properties change. These do.
Installation:
Plop the CommCrystal.cs file in your scripts folder.
All files are written for RunUO v1.0 -RC0.
CommCrystal.cs is all that is needed to have them function as items on your shard, but if you wish to have them sold on vendors and/or show up in the [add gump, there is more to do.
For NPC vendor functionality:
You will have to add some lines to your SBJewel.cs and GenericSell.cs.
Scripts\Mobiles\Vendors\SBInfo\SBJewel.cs
Add the following into the method InternalBuyInfo, which can be found around line 21.
Code:
Add( new GenericBuyInfo( (1046434).ToString(), typeof( ReceiverCrystal ), 6, 20, 0x1ED0 , 0 ) ); // Com Crystal (Receiver)
Add( new GenericBuyInfo( (1046435).ToString(), typeof( BroadcastCrystalFiveHundred ), 68, 20, 0x1Ed0, 0 ) ); // Com Crystal (Sender) with 500 charges
Add( new GenericBuyInfo( (1046436).ToString(), typeof( BroadcastCrystalOneThousand ), 131, 20, 0x1ED0 , 0 ) ); // Com Crystal (Sender) with 1000 charges
Add( new GenericBuyInfo( (1046437).ToString(), typeof( BroadcastCrystalTwoThousand ), 256, 20, 0x1Ed0, 0 ) ); // Com Crystal (Sender) with 2000 charges
Then add the following into the method InternalSellInfo, which is around line 41 after you have added the above code.
Code:
Add( typeof( BroadcastCrystal ), 3 );
Add( typeof( ReceiverCrystal ), 3 );
Scripts\Mobiles\Vendors\GenericSell.cs
Add the following onto the end of all of the else if's in the method GetSellPriceFor.
Code:
else if ( item is BroadcastCrystal )
{
BroadcastCrystal BC = (BroadcastCrystal)item;
price = (int)Math.Round((double)(2.66666667 + BC.Charges * 47 / 750));
}
Adding it to the [add gump requires you add the following lines inbetween what should be lines 506 and 507 of the objects.xml in the data folder that is in the RunUO directory. You might want to back up the XML file before editing, incase your first choice editor messes up the file like it did to me a few times when I first messed with XMLs.
Code:
<object type="Server.Items.BroadcastCrystal" gfx="7889" />
<object type="Server.Items.ReceiverCrystal" gfx="7889" />