I took an item, modified it to work as something else, but now the original item still says "your wand needs a moment to recharge."

I would like to override that and have it say "your jewel needs a moment to recharge."

How would I do that?
 
I assume you modified a wand, but maintained the base type of "BaseWand", which is where that message is getting pulled from. You can override the OnDoubleClick on your new item to change the message. Around line 194 in BaseWand you'll find the override:

public override void OnDoubleClick(Mobile from)
{
if (!from.CanBeginAction(typeof(BaseWand)))
{
from.SendLocalizedMessage(1070860); // You must wait a moment for the wand to recharge.
return;
}

if (this.Parent == from)
{
if (this.Charges > 0)
this.OnWandUse(from);
else
from.SendLocalizedMessage(1019073); // This item is out of charges.
}
else
{
from.SendLocalizedMessage(502641); // You must equip this item to use it.
}
}

You can create a new override in your item, and change the localized messages by changing those lines to:

from.SendMessage("Your Message Between Quotes");

That message will be displayed as the string in quotes, and won't be localized. If you want it to be localized, you'll need to edit the clilocs, which isn't challenging, but will require you to provide a client patch to your users. Just changing to a SendMessage won't require a client patch.

Point of order: I'd copy BaseWand.cs wholesale, rename Wand to Jewel, and change the base type of your custom to BaseJewel (or whatever, that might be taken). This way you have more control over your new custom without modifying wands at the same time.
 
I took an item, modified it to work as something else, but now the original item still says "your wand needs a moment to recharge."

I would like to override that and have it say "your jewel needs a moment to recharge."

How would I do that?
if by "jewel" you mean jewelry that the player equips, then you'll definitely want to do what Anon said below. Otherwise you'll end up with issues because the jewelry will be read as a weapon.

Point of order: I'd copy BaseWand.cs wholesale, rename Wand to Jewel, and change the base type of your custom to BaseJewel (or whatever, that might be taken). This way you have more control over your new custom without modifying wands at the same time.
 
thanks all, got it working.
sorry to keep everyone in the dark, buy my co-owner wanted me to get something working, which I did, but i needed to change the message the player gets, which with all your help I did.
thx.

* * * * EDIT FEB 18, 2017 * * * *
If I wanted to do multiple messages and put a time delay between them, how?
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back