@LabelIndex 156000
@StringIndex 19637
class 0 windsus : 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);
		target = last_attacker;
		if( gg::HaveMemo(target,335) && gg::OwnItemCount(target,3695) && gg::OwnItemCount(target,3714) < 1 ) {
			random1_list::SetInfo(4,target);
		}
		target = last_attacker;
		if( gg::HaveMemo(target,335) && gg::OwnItemCount(target,3734) && gg::OwnItemCount(target,3776) < 30 ) {
			random1_list::SetInfo(5,target);
		}
		target = last_attacker;
		if( gg::HaveMemo(target,426) == 1 ) {
			random1_list::SetInfo(6,target);
		}
		if( gg::HaveMemo(target,426) == 1 ) {
			random1_list::SetInfo(6,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(6,target);
				}
			}
		}
		while( gg::IsNull(code_info = always_list::Next()) == 0 ) {
			switch(code_info.code) {
				case 0: {
					myself::SetCurrentQuestID(217);
					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,217) && gg::GetMemoState(c1,217) == 11 && gg::OwnItemCount(c1,2756) < 10 ) {
							if( gg::Rand(2) <= 1 ) {
								if( gg::OwnItemCount(c1,2756) >= 8 ) {
									myself::GiveItem1(c1,2756,2);
									myself::SetMemoState(c1,217,12);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
									myself::SetFlagJournal(c1,217,15);
									myself::ShowQuestMark(c1,217);
								} else {
									myself::GiveItem1(c1,2756,2);
									myself::SoundEffect(c1,"Itemsound.quest_itemget");
								}
							}
						}
					}
					break;
				}
				case 1: {
					myself::SetCurrentQuestID(223);
					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,223) && gg::OwnItemCount(c1,3281) && gg::OwnItemCount(c1,3289) < 30 ) {
							if( gg::Rand(2) <= 1 ) {
								if( gg::OwnItemCount(c1,3289) >= 27 ) {
									myself::GiveItem1(c1,3289,3);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
									if( gg::OwnItemCount(c1,3287) >= 30 && gg::OwnItemCount(c1,3288) >= 30 ) {
										myself::SetFlagJournal(c1,223,7);
										myself::ShowQuestMark(c1,223);
									}
								} else {
									myself::GiveItem1(c1,3289,3);
									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,3345) < 30 ) {
							if( gg::Rand(10) < 10 ) {
								if( gg::OwnItemCount(c1,3345) >= 27 ) {
									myself::GiveItem1(c1,3345,3);
									myself::SoundEffect(c1,"Itemsound.quest_middle");
								} else {
									myself::GiveItem1(c1,3345,3);
									myself::SoundEffect(c1,"Itemsound.quest_itemget");
								}
							}
						}
					}
					break;
				}
				case 3: {
					myself::SetCurrentQuestID(228);
					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,228) && gg::OwnItemCount(c1,2847) == 1 && gg::OwnItemCount(c1,2861) == 1 && gg::OwnItemCount(c1,2852) < 10 ) {
							if( gg::Rand(100) < 50 ) {
								c1.quest_last_reward_time = myself::GetCurrentTick();
								myself::GiveItem1(c1,2852,1);
								if( gg::OwnItemCount(c1,2852) >= 10 ) {
									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) {
				case 4: {
					myself::SetCurrentQuestID(335);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(10) < 2 ) {
							myself::CreateOnePrivate(1027143,"windsus_aleph",0,1);
						}
					}
					break;
				}
				case 5: {
					myself::SetCurrentQuestID(335);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(100) < 63 ) {
							myself::GiveItem1(target,3776,1);
							if( gg::OwnItemCount(target,3776) >= 30 ) {
								myself::SoundEffect(target,"ItemSound.quest_middle");
							} else {
								myself::SoundEffect(target,"ItemSound.quest_itemget");
							}
						}
					}
					break;
				}
				case 6: {
					myself::SetCurrentQuestID(426);
					target = code_info::RandomSelectOne();
					if( gg::IsNull(target) == 0 && myself::DistFromMe(target) <= 1500 ) {
						if( gg::Rand(1000) < 335 ) {
							myself::GiveItem1(target,7586,1);
							myself::SoundEffect(target,"ItemSound.quest_itemget");
						}
					}
					break;
				}
			}
		}
		super;
	}

}
