class 1 b_small_adult_gourd : default_npc
{
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i0,i1,i9,i_quest4,last_attacker,lparty,member,random1_list,target)
	{
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		always_list::SetInfo(0,target);
		while( gg::IsNull(code_info = always_list::Next()) == 0 )
		{
			if( code_info.code == 0 )
			{
				myself::SetCurrentQuestID(997);
				target = code_info::RandomSelectOne();
				if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 )
				{
					c1 = myself::GetLastAttacker();
					i0 = gg::Rand(10);
					i0 = ( 99770 + i0 );
					myself::Say(myself::MakeFString(i0,"","","","",""));
					if( gg::Rand(10000) < 2500 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,1461,1,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 2500 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,1374,5,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 3125 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,1375,2,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 3125 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,6036,2,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 3750 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,1540,1,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 125 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,4647,1,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 125 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,4636,1,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 125 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						myself::DropItem2(myself.sm,4658,1,myself.sm.summoner_id);
					}
					if( gg::Rand(10000) < 1 )
					{
						myself.i_quest4 = ( myself.i_quest4 + 1 );
						i1 = gg::Rand(3);
						if( i1 == 0 )
						{
							myself::DropItem2(myself.sm,5578,1,myself.sm.summoner_id);
						}
						if( i1 == 1 )
						{
							myself::DropItem2(myself.sm,5577,1,myself.sm.summoner_id);
						}
						if( i1 == 2 )
						{
							myself::DropItem2(myself.sm,5579,1,myself.sm.summoner_id);
						}
					}
					if( myself.i_quest4 < 1 )
					{
						myself::DropItem2(myself.sm,1461,1,myself.sm.summoner_id);
					}
					myself::SoundEffect(myself.sm,"ItemSound.quest_middle");
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 )
		{
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage,i0,i1)
	{
		myself::SetCurrentQuestID(997);
		switch(myself.i_quest0)
		{
			case 0:
			{
				i0 = gg::Rand(10);
				i0 = ( 99780 + i0 );
				myself::Say(myself::MakeFString(i0,"","","","",""));
				myself.i_quest0 = 1;
				break;
			}
			case 1:
			{
				if( gg::Rand(2) == 0 )
				{
					i0 = gg::Rand(10);
					i0 = ( 99780 + i0 );
					myself::Say(myself::MakeFString(i0,"","","","",""));
				}
				break;
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(i0,talker,timer_id)
	{
		myself::SetCurrentQuestID(997);
		if( timer_id == 99703 )
		{
			i0 = ( 99745 + gg::Rand(5) );
			myself::Say(myself::MakeFString(i0,"","","","",""));
			myself::Despawn();
		}
		if( timer_id == 99714 )
		{
			myself::Say(myself::MakeFString(99740,"","","","",""));
			myself::AddTimerEx(99715,( 1000 * 10 ));
		}
		if( timer_id == 99715 )
		{
			myself::Say(myself::MakeFString(99741,"","","","",""));
			myself::AddTimerEx(99716,( 1000 * 10 ));
		}
		if( timer_id == 99716 )
		{
			myself::Say(myself::MakeFString(99742,"","","","",""));
			myself::AddTimerEx(99703,( 1000 * 10 ));
		}
		super;
	}

	EventHandler CREATED(i0,i1)
	{
		myself::SetCurrentQuestID(997);
		myself.sm.summoner_id = myself.sm.param1;
		myself::AddTimerEx(99714,( 1000 * 60 ));
		super;
	}

}
