@LabelIndex 147240
@StringIndex 18886
class 0 tyrant : warrior_passive {
handler:
	EventHandler MY_DYING(always_list,c1,code_info,i9,last_attacker,lparty,member,random1_list,target) {
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		always_list::SetInfo(0,target);
		target = last_attacker;
		always_list::SetInfo(1,target);
		target = last_attacker;
		always_list::SetInfo(2,target);
		target = last_attacker;
		always_list::SetInfo(3,target);
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(219);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::GetLastAttacker();
						if( c1.master ) {
							c1 = c1.master;
						}
						if( gg::HaveMemo(c1,219) && gg::OwnItemCount(c1,3177) && gg::OwnItemCount(c1,3181) < 10 ) {
							if( gg::Rand(2) <= 1 ) {
								if( gg::OwnItemCount(c1,3181) == 9 ) {
									myself::GiveItem1(c1,3181,1);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
									if( gg::OwnItemCount(c1,3178) >= 10 && gg::OwnItemCount(c1,3179) >= 10 && gg::OwnItemCount(c1,3180) >= 10 && gg::OwnItemCount(c1,3182) >= 10 ) {
										myself::SetFlagJournal(c1,219,7);
										myself::ShowQuestMark(c1,219);
									}
								} else {
									myself::GiveItem1(c1,3181,1);
									myself::SoundEffect(c1,"Itemsound.quest_itemget");
								}
							}
						}
					}
					break;
				}
				case 1: {
					myself::SetCurrentQuestID(220);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::GetLastAttacker();
						if( c1.master ) {
							c1 = c1.master;
						}
						if( gg::HaveMemo(c1,220) && gg::OwnItemCount(c1,3204) && gg::OwnItemCount(c1,3206) < 10 ) {
							if( gg::Rand(20) < 20 ) {
								if( gg::OwnItemCount(c1,3206) == 9 ) {
									myself::GiveItem1(c1,3206,1);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
									if( gg::OwnItemCount(c1,3205) >= 10 && gg::OwnItemCount(c1,3207) >= 10 ) {
										myself::SetFlagJournal(c1,220,2);
										myself::ShowQuestMark(c1,220);
									}
								} else {
									myself::GiveItem1(c1,3206,1);
									myself::SoundEffect(c1,"Itemsound.quest_itemget");
								}
							}
						}
					}
					break;
				}
				case 2: {
					myself::SetCurrentQuestID(230);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::GetLastAttacker();
						if( c1.master ) {
							c1 = c1.master;
						}
						if( gg::HaveMemo(c1,230) && gg::OwnItemCount(c1,3352) == 0 && gg::OwnItemCount(c1,3350) && gg::OwnItemCount(c1,3343) < 30 ) {
							if( gg::Rand(10) < 10 ) {
								if( gg::OwnItemCount(c1,3343) >= 27 ) {
									myself::GiveItem1(c1,3343,3);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
								} else {
									myself::GiveItem1(c1,3343,3);
									myself::SoundEffect(c1,"Itemsound.quest_itemget");
								}
							}
						}
					}
					break;
				}
				case 3: {
					myself::SetCurrentQuestID(334);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::GetLastAttacker();
						if( c1.master ) {
							c1 = c1.master;
						}
						if( gg::HaveMemo(c1,334) && gg::OwnItemCount(c1,3680) && gg::OwnItemCount(c1,3681) && gg::OwnItemCount(c1,3690) == 0 ) {
							if( gg::Rand(10) == 0 ) {
								if( ( myself::GetCurrentTick() - c1.quest_last_reward_time ) > 1 ) {
									c1.quest_last_reward_time = myself::GetCurrentTick();
									myself::GiveItem1(c1,3690,1);
									if( gg::OwnItemCount(c1,3684) >= 1 && gg::OwnItemCount(c1,3685) >= 1 && gg::OwnItemCount(c1,3686) >= 1 && gg::OwnItemCount(c1,3687) >= 1 && gg::OwnItemCount(c1,3688) >= 1 && gg::OwnItemCount(c1,3689) >= 1 && gg::OwnItemCount(c1,3689) >= 1 && gg::OwnItemCount(c1,3691) >= 1 ) {
										myself::SetJournal(c1,334,4);
										myself::ShowQuestMark(c1,334);
										myself::SoundEffect(c1,"ItemSound.quest_middle");
									} else {
										myself::SoundEffect(c1,"ItemSound.quest_itemget");
									}
								}
							}
						}
					}
					break;
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch (code_info.code) {
			}
		}
		super;
	}

}
