View Single Post
Old 02.02.2006, 06:28   #1
drzoom
Архивный участник
 
Join Date: Aug 2005
Posts: 428
Default Some question on nasc... And whole ai scripting...

HI there.

This is my basic model of sa crystal level up system.

Code:
class mob_sa_quest_st_1 : default_npc
{
handler:
	EventHandler SPELLED(speller, skill_name_id, i0)
	{
		i0=0;
		if(skill_name_id == @s_soul_crystal)
		{
			i0=1;
		}
	}
	
	EventHandler ATTACKED(attacker, damage, i0, i1)
	{
		i1=0;
		if(damage>myself.sm.hp && i0==1)
		{
			i1=1;
		}
		i0=0;
			
	}
	EventHandler MY_DYING(i1)
	{	
		c1 = GetLastAttacker();
		if(i1==1)
		{
			if(OwnItemCount(c1, @red_soul_crystal_0)>1)
			{
				ShowSystemMessage(c1, 977);
			}
			if(OwnItemCount(c1, @red_soul_crystal_0)==1)
			{
				DeleteItem1(c1, @red_soul_crystal_0,1);
				GiveItem1(c1, @red_soul_crystal_1,1);
				ShowSystemMessage(c1, 974);
			}
		}
	}
}
But can a question is this:
CAN I OPERATE WITH i0 and i1 IN SUCH CONDITION?

Thanks again.
drzoom is offline