@LabelIndex 107054
@StringIndex 0
class 0 crystalcave_zone_controller : zone_controller {
parameter:
	int	zone_type = 0;
	int	enter_type = 0;
	string	fnHi = "";

handler:
	EventHandler MENU_SELECTED(talker,ask,reply,s0,party0,i0,i1,i2,i3,c0) {
		if( ask == -1005 ) {
			if( reply == 1 ) {
				if( zone_type > -1 && enter_type > -1 ) {
					myself::InstantZone_Enter(talker,zone_type,enter_type);
				} else {
				}
			} else if( reply == 0 ) {
				myself::InstantZone_Leave(talker);
			} else if( reply == -1 ) {
				myself::InstantZone_Finish(5);
			} else {
			}
		}
	}

	EventHandler INSTANT_ZONE_ENTER_RETURNED(talker,reply,state,party0,i0,i1,i2,i3,i4,i5,i6,i7,i8,i9,c0) {
		if( state == 0 ) {
		} else if( state == 1 ) {
		}
		if( reply == 0 ) {
		} else if( reply == 1 ) {
			if( state == 0 ) {
				party0 = gg::GetParty(talker);
				if( myself::IsNullParty(party0) == 0 ) {
					i1 = party0.member_count;
					for(i0 = 0; i0 < i1; i0++) {
						c0 = myself::GetMemberOfParty(party0,i0);
						if( myself::IsNullCreature(c0) == 0 ) {
							i2 = gg::OwnItemCount(c0,9698);
							i3 = gg::OwnItemCount(c0,9699);
							i4 = gg::OwnItemCount(c0,10015);
							i5 = gg::OwnItemCount(c0,10016);
							if( i2 >= 1 ) {
								myself::DeleteItem1(c0,9698,i2);
							}
							if( i3 >= 1 ) {
								myself::DeleteItem1(c0,9699,i3);
							}
							if( i4 >= 1 ) {
								myself::DeleteItem1(c0,10015,i4);
							}
							if( i5 >= 1 ) {
								myself::DeleteItem1(c0,10016,i5);
							}
						}
					}
				}
			}
		}
	}

}
