@LabelIndex 210332
@StringIndex 24030
class 0 deinonychus_s : roamer_primeval_sp {
handler:
	EventHandler MY_DYING(always_list,code_info,i4,i9,last_attacker,lparty,member,random1_list,target) {
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		if( gg::HaveMemo(target,125) == 1 && gg::GetMemoState(target,125) == 3 ) {
			random1_list::SetInfo(0,target);
		}
		if( gg::HaveMemo(target,125) == 1 && gg::GetMemoState(target,125) == 3 ) {
			random1_list::SetInfo(0,target);
		}
		if( gg::IsNull(lparty) == 0 ) {
			for(i9 = 0; i9 < lparty.member_count; i9++) {
				target = myself::GetMemberOfParty(lparty,i9);
				if( gg::HaveMemo(target,125) == 1 && gg::GetMemoState(target,125) == 3 ) {
					random1_list::SetInfo(0,target);
				}
			}
		}
		target = last_attacker;
		if( gg::HaveMemo(target,642) == 1 ) {
			random1_list::SetInfo(1,target);
		}
		if( gg::HaveMemo(target,642) == 1 ) {
			random1_list::SetInfo(1,target);
		}
		if( gg::IsNull(lparty) == 0 ) {
			for(i9 = 0; i9 < lparty.member_count; i9++) {
				target = myself::GetMemberOfParty(lparty,i9);
				if( gg::HaveMemo(target,642) == 1 ) {
					random1_list::SetInfo(1,target);
				}
			}
		}
		target = last_attacker;
		if( gg::HaveMemo(target,111) == 1 && gg::GetMemoState(target,111) == 11 ) {
			random1_list::SetInfo(2,target);
		}
		if( gg::HaveMemo(target,111) == 1 && gg::GetMemoState(target,111) == 11 ) {
			random1_list::SetInfo(2,target);
		}
		if( gg::IsNull(lparty) == 0 ) {
			for(i9 = 0; i9 < lparty.member_count; i9++) {
				target = myself::GetMemberOfParty(lparty,i9);
				if( gg::HaveMemo(target,111) == 1 && gg::GetMemoState(target,111) == 11 ) {
					random1_list::SetInfo(2,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch (code_info.code) {
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(125);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						i4 = gg::Rand(1000);
						if( i4 < 651 && gg::OwnItemCount(target,8780) <= 1 ) {
							if( gg::OwnItemCount(target,8780) < 1 ) {
								myself::GiveItem1(target,8780,1);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
							} else if( gg::OwnItemCount(target,8780) >= 1 ) {
								myself::GiveItem1(target,8780,1);
								if( gg::OwnItemCount(target,8779) >= 2 ) {
									myself::SoundEffect(target,"ItemSound.quest_middle");
									myself::SetFlagJournal(target,125,4);
									myself::ShowQuestMark(target,125);
								}
							}
						}
					}
					break;
				}
				case 1: {
					myself::SetCurrentQuestID(642);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						i4 = gg::Rand(1000);
						if( i4 < 321 ) {
							myself::GiveItem1(target,8774,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					break;
				}
				case 2: {
					myself::SetCurrentQuestID(111);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						i4 = gg::Rand(1000);
						if( i4 < 660 && gg::OwnItemCount(target,8771) <= 9 ) {
							if( gg::OwnItemCount(target,8771) < 9 ) {
								myself::GiveItem1(target,8771,1);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
							} else if( gg::OwnItemCount(target,8771) == 9 ) {
								myself::GiveItem1(target,8771,1);
								if( gg::OwnItemCount(target,8770) >= 10 && gg::OwnItemCount(target,8772) >= 10 ) {
									myself::SoundEffect(target,"ItemSound.quest_middle");
									myself::SetFlagJournal(target,111,11);
									myself::ShowQuestMark(target,111);
									myself::SoundEffect(target,"ItemSound.quest_middle");
								}
							}
						}
					}
					break;
				}
			}
		}
		super;
	}

}
