@LabelIndex 210728
@StringIndex 24058
class 0 tyrannosaurus_soul : tyranno_primeval {
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i0,i1,i9,last_attacker,lparty,member,pledge0,random1_list,target) {
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		if( gg::HaveMemo(target,350) == 1 ) {
			always_list::SetInfo(0,target);
		}
		if( gg::HaveMemo(target,350) == 1 ) {
			always_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,350) == 1 ) {
					always_list::SetInfo(0,target);
				}
			}
		}
		target = last_attacker;
		random1_list::SetInfo(1,target);
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(350);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( gg::OwnItemCount(target,4651) + gg::OwnItemCount(target,4652) ) + gg::OwnItemCount(target,4653) ) + gg::OwnItemCount(target,4654) ) + gg::OwnItemCount(target,4655) ) + gg::OwnItemCount(target,4656) ) + gg::OwnItemCount(target,4657) ) + gg::OwnItemCount(target,4658) ) + gg::OwnItemCount(target,4659) ) + gg::OwnItemCount(target,4660) ) + gg::OwnItemCount(target,4661) ) + gg::OwnItemCount(target,5579) ) + gg::OwnItemCount(target,5582) ) + gg::OwnItemCount(target,5914) ) + gg::OwnItemCount(target,4629) ) + gg::OwnItemCount(target,4630) ) + gg::OwnItemCount(target,4631) ) + gg::OwnItemCount(target,4632) ) + gg::OwnItemCount(target,4633) ) + gg::OwnItemCount(target,4634) ) + gg::OwnItemCount(target,4635) ) + gg::OwnItemCount(target,4636) ) + gg::OwnItemCount(target,4637) ) + gg::OwnItemCount(target,4638) ) + gg::OwnItemCount(target,4639) ) + gg::OwnItemCount(target,5577) ) + gg::OwnItemCount(target,5580) ) + gg::OwnItemCount(target,5908) ) + gg::OwnItemCount(target,4640) ) + gg::OwnItemCount(target,4641) ) + gg::OwnItemCount(target,4642) ) + gg::OwnItemCount(target,4643) ) + gg::OwnItemCount(target,4644) ) + gg::OwnItemCount(target,4645) ) + gg::OwnItemCount(target,4646) ) + gg::OwnItemCount(target,4647) ) + gg::OwnItemCount(target,4648) ) + gg::OwnItemCount(target,4649) ) + gg::OwnItemCount(target,4650) ) + gg::OwnItemCount(target,5578) ) + gg::OwnItemCount(target,5581) ) + gg::OwnItemCount(target,5911) ) + gg::OwnItemCount(target,9571) ) + gg::OwnItemCount(target,10161) ) + gg::OwnItemCount(target,9570) ) + gg::OwnItemCount(target,10160) ) + gg::OwnItemCount(target,9572) ) + gg::OwnItemCount(target,10162) ) + gg::OwnItemCount(target,10482) ) + gg::OwnItemCount(target,10481) ) + gg::OwnItemCount(target,10480) ) + gg::OwnItemCount(target,13072) ) + gg::OwnItemCount(target,13073) ) + gg::OwnItemCount(target,13071) ) == 1 ) {
							if( gg::OwnItemCount(target,4661) == 1 ) {
								myself::DeleteItem1(target,4661,1);
								myself::GiveItem1(target,5579,1);
								gg::AddLog(6,target,5579);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::ShowSystemMessage(target,974);
								myself::BroadcastSystemMessageStr(myself.sm,1500,gg::MakeFString(35051,target.name,gg::IntToStr(11),"","",""));
							} else if( gg::OwnItemCount(target,5579) == 1 ) {
								myself::DeleteItem1(target,5579,1);
								myself::GiveItem1(target,5582,1);
								gg::AddLog(6,target,5582);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::ShowSystemMessage(target,974);
								myself::BroadcastSystemMessageStr(myself.sm,1500,gg::MakeFString(35051,target.name,gg::IntToStr(12),"","",""));
							} else if( gg::OwnItemCount(target,4639) == 1 ) {
								myself::DeleteItem1(target,4639,1);
								myself::GiveItem1(target,5577,1);
								gg::AddLog(6,target,5577);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::ShowSystemMessage(target,974);
								myself::BroadcastSystemMessageStr(myself.sm,1500,gg::MakeFString(35052,target.name,gg::IntToStr(11),"","",""));
							} else if( gg::OwnItemCount(target,5577) == 1 ) {
								myself::DeleteItem1(target,5577,1);
								myself::GiveItem1(target,5580,1);
								gg::AddLog(6,target,5580);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::ShowSystemMessage(target,974);
								myself::BroadcastSystemMessageStr(myself.sm,1500,gg::MakeFString(35052,target.name,gg::IntToStr(12),"","",""));
							} else if( gg::OwnItemCount(target,4650) == 1 ) {
								myself::DeleteItem1(target,4650,1);
								myself::GiveItem1(target,5578,1);
								gg::AddLog(6,target,5578);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::ShowSystemMessage(target,974);
								myself::BroadcastSystemMessageStr(myself.sm,1500,gg::MakeFString(35053,target.name,gg::IntToStr(11),"","",""));
							} else if( gg::OwnItemCount(target,5578) == 1 ) {
								myself::DeleteItem1(target,5578,1);
								myself::GiveItem1(target,5581,1);
								gg::AddLog(6,target,5581);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::ShowSystemMessage(target,974);
								myself::BroadcastSystemMessageStr(myself.sm,1500,gg::MakeFString(35053,target.name,gg::IntToStr(12),"","",""));
							} else if( gg::OwnItemCount(target,5582) >= 1 || gg::OwnItemCount(target,5581) >= 1 || gg::OwnItemCount(target,5580) >= 1 || gg::OwnItemCount(target,5914) >= 1 || gg::OwnItemCount(target,5911) >= 1 || gg::OwnItemCount(target,5908) >= 1 ) {
								myself::ShowSystemMessage(target,978);
							} else {
								myself::ShowSystemMessage(target,1264);
							}
						} else if( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( gg::OwnItemCount(target,4651) + gg::OwnItemCount(target,4652) ) + gg::OwnItemCount(target,4653) ) + gg::OwnItemCount(target,4654) ) + gg::OwnItemCount(target,4655) ) + gg::OwnItemCount(target,4656) ) + gg::OwnItemCount(target,4657) ) + gg::OwnItemCount(target,4658) ) + gg::OwnItemCount(target,4659) ) + gg::OwnItemCount(target,4660) ) + gg::OwnItemCount(target,4661) ) + gg::OwnItemCount(target,5579) ) + gg::OwnItemCount(target,5582) ) + gg::OwnItemCount(target,5914) ) + gg::OwnItemCount(target,4629) ) + gg::OwnItemCount(target,4630) ) + gg::OwnItemCount(target,4631) ) + gg::OwnItemCount(target,4632) ) + gg::OwnItemCount(target,4633) ) + gg::OwnItemCount(target,4634) ) + gg::OwnItemCount(target,4635) ) + gg::OwnItemCount(target,4636) ) + gg::OwnItemCount(target,4637) ) + gg::OwnItemCount(target,4638) ) + gg::OwnItemCount(target,4639) ) + gg::OwnItemCount(target,5577) ) + gg::OwnItemCount(target,5580) ) + gg::OwnItemCount(target,5908) ) + gg::OwnItemCount(target,4640) ) + gg::OwnItemCount(target,4641) ) + gg::OwnItemCount(target,4642) ) + gg::OwnItemCount(target,4643) ) + gg::OwnItemCount(target,4644) ) + gg::OwnItemCount(target,4645) ) + gg::OwnItemCount(target,4646) ) + gg::OwnItemCount(target,4647) ) + gg::OwnItemCount(target,4648) ) + gg::OwnItemCount(target,4649) ) + gg::OwnItemCount(target,4650) ) + gg::OwnItemCount(target,5578) ) + gg::OwnItemCount(target,5581) ) + gg::OwnItemCount(target,5911) ) + gg::OwnItemCount(target,9571) ) + gg::OwnItemCount(target,10161) ) + gg::OwnItemCount(target,9570) ) + gg::OwnItemCount(target,10160) ) + gg::OwnItemCount(target,9572) ) + gg::OwnItemCount(target,10162) ) + gg::OwnItemCount(target,10481) ) + gg::OwnItemCount(target,10482) ) + gg::OwnItemCount(target,10480) ) + gg::OwnItemCount(target,13072) ) + gg::OwnItemCount(target,13073) ) + gg::OwnItemCount(target,13071) ) >= 2 ) {
							myself::ShowSystemMessage(target,977);
						} else {
							myself::ShowSystemMessage(target,1265);
						}
					}
					break;
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch(code_info.code) {
				case 1: {
					myself::SetCurrentQuestID(510);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::Pledge_GetLeader(target);
						pledge0 = myself::GetPledge(target);
						if( gg::IsNull(pledge0) == 0 ) {
							if( myself::IsNullCreature(c1) == 0 && myself.i_quest0 > 0 ) {
								if( gg::HaveMemo(c1,510) == 1 && gg::GetMemoState(c1,510) == 1 && c1.is_pledge_master == 1 && myself::DistFromMe(c1) <= 1500 && pledge0.skill_level >= 5 ) {
									myself::GiveItem1(c1,8767,1);
									myself::SoundEffect(c1,"ItemSound.quest_itemget");
								}
							}
						}
					}
					break;
				}
			}
		}
		super;
	}

}
