@LabelIndex 159712
@StringIndex 20099
class 0 unicorn_elder : warrior_passive_casting_ddmagic {
handler:
	EventHandler MY_DYING(always_list,code_info,i9,last_attacker,lparty,member,random1_list,target) {
		always_list = gg::AllocCodeInfoList();
		random1_list = gg::AllocCodeInfoList();
		target = last_attacker;
		if( gg::HaveMemo(target,420) == 1 && gg::OwnItemCount(target,3817) == 1 ) {
			random1_list::SetInfo(0,target);
		}
		target = last_attacker;
		if( gg::HaveMemo(target,335) && gg::OwnItemCount(target,3764) && gg::OwnItemCount(target,3806) < 20 ) {
			random1_list::SetInfo(1,target);
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch (code_info.code) {
			}
		}
		code_info = random1_list::RandomSelectOne();
		if( gg::IsNull(code_info) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(420);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(100) < 30 ) {
							target.quest_last_reward_time = myself::GetCurrentTick();
							myself::DeleteItem1(target,3817,1);
							myself::SoundEffect(target,"ItemSound.quest_middle");
							myself::SetMemoState(target,420,10);
							myself::Say(gg::MakeFString(42048,"","","","",""));
						}
					}
					break;
				}
				case 1: {
					myself::SetCurrentQuestID(335);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(100) < 96 ) {
							target.quest_last_reward_time = myself::GetCurrentTick();
							myself::GiveItem1(target,3806,1);
							if( gg::OwnItemCount(target,3806) >= 20 ) {
								myself::SoundEffect(target,"ItemSound.quest_middle");
							} else {
								myself::SoundEffect(target,"ItemSound.quest_itemget");
							}
						}
					}
					break;
				}
			}
		}
		super;
	}

}
