Go Back   RunUO - Ultima Online Emulation > RunUO > Script Support

Script Support Get support for modifying RunUO Scripts, or writing your own!

Reply
 
Thread Tools Display Modes
Old 07-17-2008, 12:39 PM   #1 (permalink)
Newbie
 
Join Date: Dec 2005
Posts: 29
Default Item help

What should i put into an item script, that when player change to warmode, this equiped item do some thing, for example broadcast "this item has been equiped"
_Epila_ is offline   Reply With Quote
Old 07-17-2008, 12:52 PM   #2 (permalink)
Forum Expert
 
vermillion2083's Avatar
 
Join Date: Jun 2005
Location: Lansing, MI
Age: 25
Posts: 1,042
Send a message via ICQ to vermillion2083 Send a message via MSN to vermillion2083
Default

So you want to make it so that if a person is holding a paticular item and goes into warmode with it, it broadcast to the world "PLAYERNAME has equiped ITEMNAME"?
__________________
Father Time
Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "Holy Hell......What a ride!!!"

Server: UO: Extinction
ICQ: 146563794
FatherTime@UOExtinction.com
UO: Extinction homepage
UO: Extinction forum
vermillion2083 is offline   Reply With Quote
Old 07-17-2008, 01:04 PM   #3 (permalink)
Newbie
 
Join Date: Dec 2005
Posts: 29
Default

yes, exactly that


or any Mobile.On* method like OnHelpRequest and it trhow a message "you cant request help while holding this item"

i want to learn about triggers

Last edited by _Epila_; 07-17-2008 at 01:20 PM.
_Epila_ is offline   Reply With Quote
Old 07-17-2008, 01:37 PM   #4 (permalink)
Forum Expert
 
vermillion2083's Avatar
 
Join Date: Jun 2005
Location: Lansing, MI
Age: 25
Posts: 1,042
Send a message via ICQ to vermillion2083 Send a message via MSN to vermillion2083
Default

Hmm, well WarMode is stored in Mobile.cs which is part of the core. Short of altering that script then recompiling the core that isn’t really possible (that I am aware of at this time, I haven’t had much time to research this issue).

Rather then making it send a global message every time someone goes into war mode while holding the weapon I would make it so when a person equips the item it sends the message. I would do this for three reasons

1) People tend to spam in and out of war mode when hiding to keep their opponent from revealing them by walking into them (which would result in a very annoying server spam)

2) because it makes more sense to warn the players when the person begins to wield the weapon, not when they go into war mode and intend to use it (from a role-playing perspective, because you are unaware of a persons intentions).

3) It’s a lot easier to code the on equip method then it is the entering in and out of war mode method.

To accomplish this you would add an OnEquip override into the item in question. Something like this:

Code:
		public override bool OnEquip( Mobile from )
		{
			World.Broadcast( 0x35, true, "{0} has equiped a {1}.", from.RawName.ToString(), this.Name.ToString() );
			base.OnEquip( from );
		}
The 0x35 is the hue of the text that is globally sent. The above code placed inside the item itself will result in the message (assuming the player equipping the item name is bob, and the item is named "Glacial Spear"):

"Bob has equipped a Glacial Spear".

Personally in my opinion spamming bob's every action to the entire server could get fairly annoying over time, so I would suggest having this message only be send to the people in bobs remote area, either via MobilesInRange or via Region.

I hope this was helpful, good luck with your project!
__________________
Father Time
Life's journey is not to arrive at the grave safely in a well preserved body, but rather to skid in sideways, totally worn out, shouting "Holy Hell......What a ride!!!"

Server: UO: Extinction
ICQ: 146563794
FatherTime@UOExtinction.com
UO: Extinction homepage
UO: Extinction forum

Last edited by vermillion2083; 07-17-2008 at 01:39 PM.
vermillion2083 is offline   Reply With Quote
Old 07-17-2008, 02:16 PM   #5 (permalink)
Newbie
 
Join Date: Dec 2005
Posts: 29
Default

hehe, the world broadcast is to learning pruposes, but helped a lot

when equiping the item, is possible to add some kind of "event" and in this event we override the players triggers
or i cant modify the original player trigger without modifing Mobiles.cs
_Epila_ 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