Little problem with Black Staff

Forum where anything UOX3-related goes - including, but not limited to: newbie-support, ideas, general questions, comments, etc and-so-forth.
Post Reply
User avatar
Cricetopeloso
UOX3 Newbie
Posts: 6
Joined: Tue Sep 25, 2007 5:07 pm
Has thanked: 0
Been thanked: 0

Little problem with Black Staff

Post by Cricetopeloso »

Hi guys, there is a question that I'm not able to answer and concerns about the black staff...
I think that the black staff is an item that every mage should equip, but I don't know why the standard item is not equipable by a mage, even though the npc-mage sells it.

The question is, how can I modify the black staff to make it equipable to a mage ?
I've read the UOX3 Guide, that is a spettacular guide that helped me to make some cool changes , but I've not found this question on it.

Thank you for the answer.
Bye ! :D
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

My first guess would be the Strenght-requirement to equip black staffs. By default it's set to STR=35 in the DFNs (specifically in DFNDATA\ITEMS\GEAR\WEAPONS\staves_polearms.dfn), and thus requires 35 strength to equip.

Lower that value to allow weaker characters (as mages usually are, especially when starting out, as they go for max int) to equip them. Note that any such change will only affect NEW staffs that enter your world. Any existing ones (that players have already bought, for instance) will have to be modified manually.
-= Ho Eyo He Hum =-
stranf
UOX3 Guru
Posts: 939
Joined: Wed Jan 04, 2006 3:59 pm
Has thanked: 0
Been thanked: 0

Post by stranf »

I think that the black staff is an item that every mage should equip
Xuri, is there anyway to make the black staff the ONLY weapon that a mage can have equipped and still cast spells? Can this be done without C++ tweaking?
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Hmmmmm no. C++ tweaking is required, it seems.

There is some code that checks for items equipped (and disallowes casting if anything other than spellbook is equipped) before the code checking for the onSpellCast JS event occurs. If that wasn't the case, AND if the onSpellCast JS event was actually working as it should (I can't get it working at all ;/), you could do something like this in your global script:

Code: Select all

function onSpellCast( pUser, spellID )
{
	var tempItem;
	if( pUser.FindItemLayer( 1 ) == null )
	{
		tempItem = pUser.FindItemLayer( 2 );
		if( tempItem != null )
		{
			if( tempItem.id == 0x0DF0 || tempItem.id == 0x0DF1 )
			{
				return -2; //allow spellcasting to proceed
			}
		}
	}
	else
	{
		pUser.SysMessage( "To cast spells you need to have a black staff equipped." );
		return -1; //do not allow any spellcasting
	}
}
-= Ho Eyo He Hum =-
Post Reply