Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Release Archive

Custom Script Release Archive This is a pre-script database archive of what our users had released.

 
 
Thread Tools Display Modes
Old 10-29-2005, 05:48 PM   #1 (permalink)
Forum Newbie
 
Join Date: Nov 2003
Location: MA
Posts: 26
Send a message via Yahoo to Korbas
Default Halloween Mask

Hey,

I made a gift for my players today and thought I would pass it on. It's a random colored HalloweenMask with nightsight and stam regen. You don't need a flashlight and you are running on a sugar high

I don't know the 'proper way' to add a new item to a player's pack so I just add a few lines to PlayerMobile.cs Serialize routine. It takes a couple of [restarts but it works:

Code:
			
                        HalloweenMask HMask = new HalloweenMask();
			HMask.Name = this.Name + "'s Halloween Mask";

			AddToBackpack( HMask );


			base.Serialize( writer );...
Here is the mask itself:

Code:
/*
 10/29/05
 by Korbas

 Beefed up tribal mask.
 No need for a flashlight!  
 Enough sugar energy to keep going all night long!
*/

using System;
using Server.Items;

namespace Server.Items
{
	public class HalloweenMask : BaseHat
	{
		public override int BasePhysicalResistance{ get{ return 7; } }
		public override int BaseFireResistance{ get{ return 7; } }
		public override int BaseColdResistance{ get{ return 7; } }
		public override int BasePoisonResistance{ get{ return 7; } }
		public override int BaseEnergyResistance{ get{ return 7; } }

		[Constructable]
		public HalloweenMask() : base( 0x154B )
		{
		 // Big 6 colors: Black, Ice, Blaze, Toxic, Electrum and Platinum
		 int[] Hues = { 0x0001, 0x0480, 0x0489, 0x04F8, 0x04FE, 0x0481 };

			Name = "Halloween Mask";
			Weight = 1.0;
			Hue = Hues[ Utility.Random ( Hues.Length ) ];
			LootType = LootType.Blessed;
			Attributes.NightSight = 1;
			Attributes.RegenStam = 2;
	
		}

		public HalloweenMask( 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();
		}
	}
}
Korbas is offline  
Old 10-29-2005, 06:15 PM   #2 (permalink)
Forum Expert
 
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
Default

Great script, you could do. addtopack or addtobank. lol
keep em coming loven it so far. "
WonderlandADnc is offline  
Old 10-29-2005, 10:13 PM   #3 (permalink)
Forum Expert
 
Packer898's Avatar
 
Join Date: Dec 2004
Location: Tulsa, Oklahoma
Age: 35
Posts: 2,378
Send a message via ICQ to Packer898 Send a message via MSN to Packer898
Default

Sorry, but that is absolutely a horrible way to add this item for players. Please dont suggest stuff like that. If you want to know how to add gifts then look up GiftGiver.cs or do a forum search. Adding this into PLayermobile.cs this way is not something you should tell people to do. It will cause more errors and headaches then you can imagine.
Packer898 is offline  
Old 10-30-2005, 11:40 AM   #4 (permalink)
Forum Expert
 
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
Default

ok well, ive told other people and others told me, and other have supported me. but there you go. i no nothing you no that more then anyone. i was just trying to help. trying to be a good runuo'er.
WonderlandADnc is offline  
Old 10-30-2005, 01:05 PM   #5 (permalink)
Forum Expert
 
Join Date: Oct 2004
Location: San Diego, CA
Age: 39
Posts: 281
Send a message via AIM to dracana Send a message via MSN to dracana
Default

I don't think he was saying that addtobank/addtopack were bad, but the method Korbas recommended was not the way to do it (modifying playermobile.cs!). At least I hope he wasn't referring to your post ...

Using addtobank or addto pack is perfectly fine if you want to do it manually and especially fine for small shards. Obviously though, scripting it like giftgiver is even better

Quote:
Originally Posted by WonderlandADnc
ok well, ive told other people and others told me, and other have supported me. but there you go. i no nothing you no that more then anyone. i was just trying to help. trying to be a good runuo'er.
dracana is offline  
Old 10-30-2005, 05:33 PM   #6 (permalink)
Forum Expert
 
Join Date: Sep 2005
Location: UK
Age: 29
Posts: 781
Default

oh lol i am soryy. i will read the post right,. sorry. i think it was just i saw packer898s post and was thinking it was a attack. i do say im sorry again.
WonderlandADnc is offline  
Old 11-01-2005, 12:48 AM   #7 (permalink)
Forum Novice
 
Join Date: May 2005
Age: 36
Posts: 175
Default

I tried [addtobank and it says not a valid command
PoolMan is offline  
Old 11-01-2005, 01:05 AM   #8 (permalink)
Forum Expert
 
Packer898's Avatar
 
Join Date: Dec 2004
Location: Tulsa, Oklahoma
Age: 35
Posts: 2,378
Send a message via ICQ to Packer898 Send a message via MSN to Packer898
Default

Quote:
Originally Posted by PoolMan
I tried [addtobank and it says not a valid command
You didnt do something right then.

[global addtobank halloweenmask where playermobile - Adds item to bankboxes for any characters already created on your shard online or off.
[global addtopack halloweenmask where palyermobile - Adds item to backpacks for any characters already created on your shard online or off.

[addtopack halloweenmask - Lets you target a specific player to add into their backpack
[addtobank halloweenmask - Lets you target a specific player to add into the bankbox

[global online addtopack halloweenmask where playermobile - Adds the item to backpacks for any characters that are online currently.
[global online addtobank halloweenmask where playermobile - Adds the item to bankboxes for any characters that are online currently.
Packer898 is offline  
Old 11-01-2005, 01:23 AM   #9 (permalink)
Forum Expert
 
Khaz's Avatar
 
Join Date: Mar 2003
Location: where I belong
Posts: 1,787
Default

AddToBank is not a distribution command. Don't suggest it without referencing the download URL.
__________________
"Misfortune shows those who are not really friends." -Aristotle
"A multitude of words is no proof of a prudent mind." -Thales
Khaz is offline  
Old 11-01-2005, 02:17 AM   #10 (permalink)
Forum Expert
 
Packer898's Avatar
 
Join Date: Dec 2004
Location: Tulsa, Oklahoma
Age: 35
Posts: 2,378
Send a message via ICQ to Packer898 Send a message via MSN to Packer898
Default

lol you are right. I had forgot I added that command. =)-
Packer898 is offline  
 

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 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5