@LabelIndex 217124
@StringIndex 24545
class 0 icicle_king_umpaloopa : raid_boss_type5 {
handler:
	EventHandler MY_DYING(always_list,av_quest0,c0,c1,c2,c3,code_info,i0,i1,i2,i3,i4,i9,last_attacker,lparty,member,npc0,random1_list,target) {
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		always_list::SetInfo(0,target);
		always_list::SetInfo(0,target);
		if( gg::IsNull(lparty) == 0 ) {
			for(i9 = 0; i9 < lparty.member_count; i9++) {
				target = myself::GetMemberOfParty(lparty,i9);
				always_list::SetInfo(0,target);
			}
		}
		target = last_attacker;
		if( gg::HaveMemo(target,625) == 1 && gg::GetMemoState(target,625) >= ( ( 2 * 10 ) - 9 ) && gg::GetMemoState(target,625) <= ( ( 2 * 10 ) + 1 ) ) {
			random1_list::SetInfo(1,target);
		}
		if( gg::HaveMemo(target,625) == 1 && gg::GetMemoState(target,625) >= ( ( 2 * 10 ) - 9 ) && gg::GetMemoState(target,625) <= ( ( 2 * 10 ) + 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,625) == 1 && gg::GetMemoState(target,625) >= ( ( 2 * 10 ) - 9 ) && gg::GetMemoState(target,625) <= ( ( 2 * 10 ) + 1 ) ) {
					random1_list::SetInfo(1,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(625);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						npc0 = gg::GetNPCFromID(myself.sm.param1);
						if( gg::IsNull(npc0) == 0 ) {
							npc0.av_quest0::Exchange(0);
						}
					}
					break;
				}
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch(code_info.code) {
				case 1: {
					myself::SetCurrentQuestID(625);
					while( gg::IsNull(target = code_info::Next()) == 0 ) {
						if( myself::DistFromMe(target) <= 1500 ) {
							myself::SetCurrentQuestID(625);
							if( myself.sm.param2 == target.dbid ) {
								myself::GiveItem1(target,7210,1);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::SetFlagJournal(target,625,3);
								myself::ShowQuestMark(target,625);
								myself::SetMemoState(target,625,( ( 2 * 10 ) + 2 ));
							} else if( gg::GetMemoState(target,625) == 21 ) {
								myself::GiveItem1(target,7210,1);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::SetFlagJournal(target,625,3);
								myself::ShowQuestMark(target,625);
								myself::SetMemoState(target,625,( ( 2 * 10 ) + 2 ));
							} else if( gg::OwnItemCount(target,7209) >= 1 ) {
								myself::DeleteItem1(target,7209,1);
								myself::GiveItem1(target,7210,1);
								myself::SoundEffect(target,"ItemSound.quest_itemget");
								myself::SetFlagJournal(target,625,3);
								myself::ShowQuestMark(target,625);
								myself::SetMemoState(target,625,( ( 2 * 10 ) + 2 ));
							}
							npc0 = gg::GetNPCFromID(myself.sm.param1);
							if( gg::IsNull(npc0) == 0 ) {
								npc0.av_quest0::Exchange(0);
							}
						}
					}
					break;
				}
			}
		}
		super;
	}

	EventHandler TIMER_FIRED_EX(c0,i0,npc0,talker,timer_id) {
		myself::SetCurrentQuestID(625);
		if( timer_id == ( ( 625 * 100 ) + 1 ) ) {
			myself::Say(gg::MakeFString(62504,"","","","",""));
			npc0 = gg::GetNPCFromID(myself.sm.param1);
			if( gg::IsNull(npc0) == 0 ) {
				npc0.av_quest0::Exchange(0);
			}
			myself::Despawn();
		}
		super;
	}

	EventHandler CREATED(i0,i_quest0) {
		myself::SetCurrentQuestID(625);
		myself::AddTimerEx(( ( 625 * 100 ) + 1 ),( 1000 * 1200 ));
		myself::Say(gg::MakeFString(62503,"","","","",""));
		super;
	}

}
