Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 07-19-2004, 06:07 AM   #1 (permalink)
 
Join Date: Jun 2003
Posts: 3
Send a message via ICQ to petrock
Default Communication Crystals

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" />
Attached Files
File Type: cs CommCrystal.cs (22.3 KB, 74 views)
File Type: cs SBJewel.cs (2.2 KB, 52 views)
File Type: cs GenericSell.cs (2.8 KB, 49 views)
petrock is offline   Reply With Quote
Old 07-20-2004, 05:21 AM   #2 (permalink)
 
hudel's Avatar
 
Join Date: Oct 2003
Location: Germany
Age: 38
Posts: 508
Send a message via ICQ to hudel
Default

Nice idea. Thank you for sharing it.
hudel 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 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5