View Single Post
Old 22.02.2006, 04:59   #1
Truffe
Архивный участник
 
Join Date: May 2005
Posts: 944
Default Little issues with AI

I'm trying to create a npc who trades a few items for another one, (don't say "use multisell" :shock: ) so I wrote this :

Code:
class blehblehbleh : default_npc
{
parameter:
	string fnNoItem = "";

handler:				
	EventHandler MENU_SELECTED(talker, ask ,reply)			
	{			
		if(ask == -6)		
		{		
			if(OwnItemCount(talker, @small_sword) >= 1 && OwnItemCount(talker, @long_sword) >= 3 && OwnItemCount(talker, @broad_sword) >= 3)
			{	
				DeleteItem1(talker, @long_sword, 3);
				DeleteItem1(talker, @broad_sword, 3);
				GiveItem1(talker, @club, 1);
			}	
			else	
			{	
				ShowPage(talker, fnNoItem);
			}
		}	
	}		
}
It compiles fine,
But it gives an "Invalid Class[0]" error
Once I managed to get rid of that error, but this NPC's AI still wasn't working :?

So...Any ideas on what's wrong with it ? :?
Truffe is offline