@LabelIndex 159743
@StringIndex 20107
class 0 karul_bugbear : warrior_passive_physicalspecial {
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);
		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,3190) && gg::OwnItemCount(c1,3192) && gg::OwnItemCount(c1,3198) == 0 && gg::OwnItemCount(c1,3193) && gg::OwnItemCount(c1,3195) < 1 ) {
							if( gg::OwnItemCount(c1,3195) >= 0 ) {
								myself::GiveItem1(c1,3195,1);
								myself::SoundEffect(c1,"Itemsound.quest_middle");
							} else {
								myself::GiveItem1(c1,3195,1);
								myself::SoundEffect(c1,"Itemsound.quest_itemget");
							}
						}
					}
					break;
				}
				case 1: {
					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,3348) && gg::OwnItemCount(c1,3339) < 30 ) {
							if( gg::Rand(10) < 10 ) {
								if( gg::OwnItemCount(c1,3339) >= 28 ) {
									myself::GiveItem1(c1,3339,2);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
								} else {
									myself::GiveItem1(c1,3339,2);
									myself::SoundEffect(c1,"Itemsound.quest_itemget");
								}
							}
						}
					}
					break;
				}
				case 2: {
					myself::SetCurrentQuestID(335);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::GetLastAttacker();
						if( c1.master ) {
							c1 = c1.master;
						}
						if( ( myself::GetCurrentTick() - c1.quest_last_reward_time ) > 1 ) {
							c1.quest_last_reward_time = myself::GetCurrentTick();
							if( gg::HaveMemo(c1,335) && gg::OwnItemCount(c1,3737) && gg::OwnItemCount(c1,3779) < 30 ) {
								if( gg::Rand(100) < 60 ) {
									myself::GiveItem1(c1,3779,1);
									if( gg::OwnItemCount(c1,3779) >= 30 ) {
										myself::SoundEffect(c1,"ItemSound.quest_middle");
									} else {
										myself::SoundEffect(c1,"ItemSound.quest_itemget");
									}
								}
							}
							if( gg::HaveMemo(c1,335) && gg::OwnItemCount(c1,3747) && gg::OwnItemCount(c1,3789) < 1 ) {
								if( gg::Rand(10) < 2 ) {
									myself::CreateOnePrivate(1027164,"karul_chief_orooto",0,1);
								}
							}
						}
					}
					break;
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch (code_info.code) {
			}
		}
		super;
	}

}
