@LabelIndex 142747
@StringIndex 18525
class 0 sukar_wererat_leader : warrior_aggressive {
handler:
	EventHandler MY_DYING(always_list,c1,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,316) == 1 ) {
			random1_list::SetInfo(0,target);
		}
		if( gg::HaveMemo(target,316) == 1 ) {
			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,316) == 1 ) {
					random1_list::SetInfo(0,target);
				}
			}
		}
		target = last_attacker;
		always_list::SetInfo(1,target);
		target = last_attacker;
		if( gg::HaveMemo(target,426) == 1 ) {
			random1_list::SetInfo(2,target);
		}
		if( gg::HaveMemo(target,426) == 1 ) {
			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,426) == 1 ) {
					random1_list::SetInfo(2,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch(code_info.code) {
				case 1: {
					myself::SetCurrentQuestID(408);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						c1 = myself::GetLastAttacker();
						if( gg::HaveMemo(myself.c_quest0,408) != 0 && gg::OwnItemCount(myself.c_quest0,1274) != 0 && gg::OwnItemCount(myself.c_quest0,1225) < 2 && myself.i_quest0 == 1 && gg::Rand(100) < 40 ) {
							myself::GiveItem1(myself.c_quest0,1225,1);
							if( gg::OwnItemCount(myself.c_quest0,1225) == 2 ) {
								myself::SoundEffect(myself.c_quest0,"ItemSound.quest_middle");
							} else {
								myself::SoundEffect(myself.c_quest0,"ItemSound.quest_itemget");
							}
						}
					}
					break;
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(316);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(10) > 5 ) {
							myself::GiveItem1(target,1042,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					break;
				}
				case 2: {
					myself::SetCurrentQuestID(426);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(100) < 10 ) {
							myself::GiveItem1(target,7586,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					break;
				}
			}
		}
		super;
	}

	EventHandler ATTACKED(attacker,damage) {
		myself::SetCurrentQuestID(408);
		if( gg::HaveMemo(attacker,408) ) {
			switch(myself.i_quest0) {
				case 0: {
					myself.i_quest0 = 1;
					if( attacker.master ) {
						myself.c_quest0 = attacker.master;
					} else {
						myself.c_quest0 = attacker;
					}
					break;
				}
				case 1: {
					if( attacker.master ) {
						if( myself.c_quest0 != attacker.master ) {
							myself.i_quest0 = 2;
						}
					} else if( myself.c_quest0 != attacker ) {
						myself.i_quest0 = 2;
					}
					break;
				}
				case 2: {
					break;
				}
			}
		}
		super;
	}

}
