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 09-29-2008, 05:31 AM   #1 (permalink)
Lurker
 
Join Date: Oct 2006
Age: 23
Posts: 2
Default spellweaving / dryadallure

Hello, I try modifing the default script, to use this spell on all slayer, or all monsters. But the script is not working.

Code:
public static bool IsValidTarget( BaseCreature bc )
		{
			if ( bc == null || bc.IsParagon || ( bc.Controlled && !bc.Allured ) || bc.Summoned )
				return false;
				
			 SlayerEntry slayer = ( SlayerGroup.GetEntryByName ( SlayerName.Repond ) ) || ( SlayerGroup.GetEntryByName( SlayerName.Silver ) );
			
			if ( slayer != null && slayer.Slays( bc ) )
				return true;
			
			return false;
		}
the operator || I can't use.

Code:
public static bool IsValidTarget( BaseCreature bc )
		{
			if ( bc == null || bc.IsParagon || ( bc.Controlled && !bc.Allured ) || bc.Summoned )
				return false;
				
			 SlayerEntry slayer = SlayerGroup.GetEntryByName ( SlayerName.Repond );
                         SlayerEntry slayer = SlayerGroup.GetEntryByName ( SlayerName.Silver );
			
			if ( slayer != null && slayer.Slays( bc ) )
				return true;
			
			return false;
		}
This isn't working, becoese:
Line 106: A local variable named "slayer" is already defined in this scope

pls how can I make that?
dikomix is offline   Reply With Quote
Old 09-29-2008, 05:39 AM   #2 (permalink)
Forum Novice
 
Soteric's Avatar
 
Join Date: Aug 2006
Location: Russia, Rostov-on-Don
Posts: 763
Send a message via ICQ to Soteric
Default

Code:
SlayerEntry slayer = SlayerGroup.GetEntryByName ( SlayerName.Repond );
SlayerEntry slayer2 = SlayerGroup.GetEntryByName ( SlayerName.Silver );
			
if ( (slayer != null && slayer.Slays( bc )) || (slayer2 != null && slayer2.Slays( bc )) )
	return true;

Last edited by Soteric; 09-29-2008 at 09:18 AM.
Soteric is offline   Reply With Quote
Old 09-29-2008, 08:37 AM   #3 (permalink)
Lurker
 
Join Date: Oct 2006
Age: 23
Posts: 2
Default

Quote:
Originally Posted by Soteric View Post
Code:
SlayerEntry slayer = SlayerGroup.GetEntryByName ( SlayerName.Repond );
SlayerEntry slayer2 = SlayerGroup.GetEntryByName ( SlayerName.Silver );
			
if ( (slayer != null && slayer.Slays( bc )) || (slayer2 != null && slayer2.Slays( bc )) )
	return true;
It's working, very thanks. And is easy to modifing a name the Allure NPC to readonly? Ogre, skeleton, can not change by player.

Last edited by dikomix; 09-29-2008 at 09:04 AM.
dikomix 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