@LabelIndex 423941
@StringIndex 63876
class 1 immo_tumor_maker : immo_basic_maker {
parameter:
	int	TM_sboss_spawn_delay = 78079;
	int	TIME_sboss_spawn_delay = 180;
	int	FieldCycle = 3;
	int	FieldCycle_Quantity1 = 1500;
	int	FieldCycle_Quantity2 = -1000;
	int	FieldCycle_Quantity3 = 100;

handler:
	EventHandler ON_INSTANT_ZONE_EVENT(reply,i0,def0) {
		myself.enabled = reply;
		if( reply == 1 ) {
			myself.i_ai0 = 0;
			myself.i_ai1 = 0;
			if( zone == 3 && tide == 0 && room == 304 ) {
				def0 = myself::GetSpawnDefine(2);
				if( gg::IsNull(def0) == 0 ) {
					if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
						def0::Spawn2(def0.total,0,0);
					}
				}
			}
		}
	}

	EventHandler ON_SCRIPT_EVENT(script_event_arg1,script_event_arg2,script_event_arg3,def0,i0,i1) {
		if( script_event_arg1 == 78010067 ) {
			def0 = myself::GetSpawnDefine(tide);
			if( gg::IsNull(def0) == 0 ) {
				if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
					def0::Spawn2(def0.total,0,0);
				}
			}
			if( zone == 3 && script_event_arg2 != 0 ) {
				if( babble_mode == 1 ) {
					gg::Announce("3  ˆ !");
				}
				if( room == 304 ) {
					myself.i_ai0 = script_event_arg2;
				} else {
					myself.i_ai0 = ( script_event_arg2 + 1 );
				}
				myself::AddTimerEx(TM_sboss_spawn_delay,( TIME_sboss_spawn_delay * 1000 ));
			}
		} else if( script_event_arg1 == 78010063 || script_event_arg1 == 78010062 ) {
			def0 = myself::GetSpawnDefine(1);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(script_event_arg1,script_event_arg2,script_event_arg3);
			}
		} else if( script_event_arg1 == 989804 && script_event_arg2 != 99 ) {
			def0 = myself::GetSpawnDefine(0);
			if( gg::IsNull(def0) == 0 ) {
				def0::SendScriptEvent(script_event_arg1,script_event_arg2,script_event_arg3);
			}
		} else if( script_event_arg1 == 1000 && zone == 3 ) {
			if( babble_mode == 1 ) {
				gg::Announce(" ");
			}
			myself.enabled = 0;
			def0 = myself::GetSpawnDefine(myself.i_ai0);
			if( gg::IsNull(def0) == 0 && def0.npc_count > 0 ) {
				def0::Despawn();
			}
		}
	}

	EventHandler ON_NPC_CREATED(created_def) {
		if( created_def == myself::GetSpawnDefine(0) && myself.i_ai1 == 1 && myself.enabled == 1 ) {
			if( gg::IsNull(created_def) == 0 ) {
				if( babble_mode == 1 ) {
					gg::Announce(" HP  !");
				}
				created_def::SendScriptEvent(989804,99,0);
			}
		}
	}

	EventHandler ON_NPC_DELETED(deleted_def,died,i0,i1,i2,def0,maker0,reply) {
		if( deleted_def == myself::GetSpawnDefine(0) && myself.enabled == 1 ) {
			def0 = myself::GetSpawnDefine(1);
			if( gg::IsNull(def0) == 0 ) {
				if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
					def0::Spawn2(def0.total,0,0);
				}
			}
			myself.i_ai1 = 0;
			if( inzone_type_param == 119 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z2_a_dispatcher_maker);
			} else if( inzone_type_param == 120 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z2_d_dispatcher_maker);
			} else if( inzone_type_param == 121 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z3_a_dispatcher_maker);
			} else if( inzone_type_param == 122 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z3_d_dispatcher_maker);
			}
			if( gg::IsNull(maker0) == 0 ) {
				gg::SendMakerScriptEvent(maker0,78010053,1,room);
			}
			i0 = gg::GetStep_FieldCycle(FieldCycle);
			i1 = FieldCycle_Quantity1;
			i2 = ( 0 - FieldCycle_Quantity1 );
			if( i0 >= 1 && i0 <= 2 ) {
				gg::AddPointWithoutActor_FieldCycle(FieldCycle,i1,5);
			} else if( i0 >= 3 && i0 <= 6 ) {
				gg::AddPointWithoutActor_FieldCycle(FieldCycle,i2,5);
			}
		} else if( deleted_def == myself::GetSpawnDefine(1) && myself.enabled == 1 ) {
			def0 = myself::GetSpawnDefine(0);
			if( gg::IsNull(def0) == 0 ) {
				if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
					def0::Spawn2(def0.total,0,0);
				}
			}
			myself.i_ai1 = 1;
			if( inzone_type_param == 119 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z2_a_dispatcher_maker);
			} else if( inzone_type_param == 120 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z2_d_dispatcher_maker);
			} else if( inzone_type_param == 121 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z3_a_dispatcher_maker);
			} else if( inzone_type_param == 122 ) {
				maker0 = gg::InstantZone_GetNpcMaker(myself::GetInZoneID(),z3_d_dispatcher_maker);
			}
			if( gg::IsNull(maker0) == 0 ) {
				gg::SendMakerScriptEvent(maker0,78010053,0,room);
			}
			i0 = gg::GetStep_FieldCycle(FieldCycle);
			i1 = FieldCycle_Quantity2;
			i2 = ( 0 - FieldCycle_Quantity2 );
			if( i0 >= 1 && i0 <= 2 ) {
				gg::AddPointWithoutActor_FieldCycle(FieldCycle,i1,5);
			} else if( i0 >= 3 && i0 <= 6 ) {
				gg::AddPointWithoutActor_FieldCycle(FieldCycle,i2,5);
			}
		} else if( deleted_def == myself::GetSpawnDefine(2) && room == 304 && myself.enabled == 1 ) {
			myself.i_ai1 = 1;
		} else if( died == 1 && myself.enabled == 1 ) {
			i0 = gg::GetStep_FieldCycle(FieldCycle);
			i1 = FieldCycle_Quantity3;
			i2 = ( 0 - FieldCycle_Quantity3 );
			if( i0 >= 1 && i0 <= 2 ) {
				gg::AddPointWithoutActor_FieldCycle(FieldCycle,i1,5);
			} else if( i0 >= 3 && i0 <= 6 ) {
				gg::AddPointWithoutActor_FieldCycle(FieldCycle,i2,5);
			}
		}
	}

	EventHandler ON_TIMER(timer_id,i0,i1,i2,maker0,def0) {
		if( timer_id == TM_sboss_spawn_delay && myself.enabled == 1 ) {
			if( babble_mode == 1 ) {
				gg::Announce("ˆ !");
			}
			def0 = myself::GetSpawnDefine(myself.i_ai0);
			if( gg::IsNull(def0) == 0 ) {
				if( myself::AtomicIncreaseTotal(def0,def0.total,1) ) {
					def0::Spawn2(def0.total,0,0);
				}
			}
		}
	}

}
