|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#2 (permalink) |
|
Forum Expert
Join Date: Sep 2005
Location: A-Town Baby
Age: 19
Posts: 620
|
I found one for you [2.0 RC1] Name Change Deed that works but next time just use the search forum and it will find it for you not to be mean or anything.
__________________
![]() Now open - uo15.net - The best in Publish 15 emulation |
|
|
|
|
|
#3 (permalink) |
|
Newbie
Join Date: Jul 2008
Age: 16
Posts: 14
|
dude. ive already seen that, believe me. ive searched everything like 23984723 times. ......... i want
an ITEM rename.. not just a rename for a player mobile... like changing: a doublet to a sexy doublet? that a player can do.
__________________
|
|
|
|
|
|
#5 (permalink) |
|
Forum Novice
Join Date: Dec 2005
Posts: 608
|
jesus christ your ad campaign is even bigger than the american president campaigns.
Anyway if it doesn't exist you will have to write it. If you need help on it you can post the errors and your script and we will try to help you. Asmir gave you a good hint on where to start. But noone will make it for you if that is what you were looking for. |
|
|
|
|
|
#7 (permalink) |
|
Forum Novice
Join Date: Apr 2006
Posts: 188
|
That's the idea. Show what you have tried.
__________________
http://www.crypticrealms.com |
|
|
|
|
|
#8 (permalink) |
|
Newbie
Join Date: Jul 2008
Age: 16
Posts: 14
|
Code:
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Mobiles;
using Server.Misc;
namespace Server.Items
{
public class ItemRenameDeed : Item
{
public override string DefaultName
{
get { return "a item rename deed"; }
}
[Constructable]
public ItemRenameDeed() : base( 0x14F0 )
{
base.Weight = 1.0;
base.Name = Item Rename Deed
}
public ItemRenameDeed( 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();
}
public override void OnDoubleClick( Mobile from )
{
if ( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
}
else
{
from.SendMessage( "Enter your desired name." );
from.Prompt = new RenamePrompt( from, this );
}
}
private class RenamePrompt : Prompt
{
private Item m_from;
private Item m_deed;
public RenamePrompt( Item from, Item deed )
{
m_from = from;
m_deed = deed;
}
public override void OnResponse( Mobile from, string text )
{
BaseArmor pm = (BaseArmor) from;
text = text.Trim();
if ( !NameVerification.Validate( text, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote ) )
{
pm.SendMessage ( "Unacceptable name." );
return;
}
else
{
pm.Name = text;
pm.SendMessage( "You have named it to {0}!", text );
m_deed.Delete();
}
}
public override void OnCancel( Mobile from )
{
BaseItem pm = (BaseArmor) from;
pm.SendMessage ( "Item Rename Change cancelled." );
return;
}
}
}
}
__________________
|
|
|
|
|
|
#9 (permalink) | |
|
Forum Novice
Join Date: Sep 2007
Posts: 367
|
Quote:
The problem here is that your OnResponse method should send a message to the player asking "What item do you want to rename?" Then you need to bring up an internal target (and you will need a separate method for this). Store the response as a string in your OnResponse method, and pass it on as an argument to your target. Then, you need to add an OnTarget method that will do things to whatever target you select. In the OnTarget method you'll rename the item, not before. Look at fireball.cs as an example of how to create an InternalTarget method, how to call up an InternalTarget, how to create an OnTarget method, how to call up an OnTarget, and what kind of code can go inside an OnTarget method. You'll have to add Code:
Using Server.Targeting Last edited by Tassyon T; 08-07-2008 at 09:24 PM. |
|
|
|
|
|
|
#10 (permalink) |
|
Forum Novice
|
This is from a set of 5 i release, it's a LMC +%5 Deed... but can be changed easy to do a name change if needed...
Code:
using System;
using Server.Network;
using Server.Prompts;
using Server.Items;
using Server.Targeting;
using Server.Mobiles;
namespace Server.Items
{
publicclass LMCTarget : Target
{
private LMCDeed m_Deed;
private Mobile m_from;
public LMCTarget(LMCDeed deed) : base(1, false, TargetFlags.None)
{
m_Deed = deed;
}
protectedoverridevoid OnTarget(Mobile from, object target)
{
if (m_Deed.Deleted)
return;
if (target is BaseWeapon)
{
BaseWeapon weapon = (BaseWeapon)target;
int LMCadjust = weapon.Attributes.LowerManaCost;
if (LMCadjust >= 100)
{
from.SendMessage(0x35, "The weapons already at 100% !!!");
}
else
{
LMCadjust = LMCadjust + 5;
if (LMCadjust > 100)
{
LMCadjust = 100;
weapon.Attributes.LowerManaCost = LMCadjust;
from.SendMessage(0x35, "The weapon gets maxed out, 100% LMC obtained.");
m_Deed.Delete();
}
else
{
weapon.Attributes.LowerManaCost = LMCadjust;
from.SendMessage(0x35, "The weapon recieves an additional 5% LMC.");
m_Deed.Delete();
}
}
}
else
{
from.SendMessage( 0x35, "This deed only works on weapons.");
}
}
}
publicclass LMCDeed : Item // Create the item class which is derived from the base item class
{
[Constructable]
public LMCDeed() : base( 0x14F0 )
{
Weight = 1.0;
Name = "LMC +5% Deed";
LootType = LootType.Blessed;
Hue = 1278;
}
public LMCDeed(Serial serial) : base(serial)
{
}
publicoverridevoid Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
publicoverridevoid Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
publicoverridebool DisplayLootType{ get{ returnfalse; } }
publicoverridevoid OnDoubleClick( Mobile from )
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage(0x35, "The Deed Must Be In Your Bag To Use It");
}
else
{
from.SendMessage(0x35, "Which weapon do you want to upgrade with LMC ?");
from.Target = new LMCTarget(this);
}
}
}
}
protectedoverridevoid OnTarget(Mobile from, object target) { That's it.
__________________
![]() We can be found on joinUO.com or listUO.com, come try us out.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|