@LabelIndex 114331
@StringIndex 14099
class 0 cruma_ev_1st : warrior_basic {
parameter:
	int	SaySpawn_Id = 1800176;
	int	SpawnSkill = -1;

handler:
	EventHandler CREATED() {
		myself.i_ai0 = 0;
		myself.i_ai1 = 0;
		myself.i_ai2 = 0;
		myself.i_ai3 = 0;
		myself::AddUseSkillDesire(myself.sm,SpawnSkill,1,1,1000000);
		myself::Say(gg::MakeFString(SaySpawn_Id,"","","","",""));
		myself::LookNeighbor(2000);
		myself::AddTimerEx(2021,( 40 * 1000 ));
	}

	EventHandler TIMER_FIRED_EX(timer_id) {
		if( timer_id == 2021 ) {
			myself::LookNeighbor(2000);
			myself.i_ai2 = 1;
			myself::AddTimerEx(2022,( 5 * 1000 ));
			myself::AddTimerEx(2021,( 40 * 1000 ));
		}
		if( timer_id == 2022 && myself.i_ai2 == 1 ) {
			if( myself.i_ai3 == 0 ) {
				myself::Despawn();
			} else {
				myself.i_ai2 = 0;
				myself.i_ai3 = 0;
			}
		}
	}

	EventHandler SEE_CREATURE(creature) {
		if( myself.i_ai0 == 1 && myself.i_ai2 == 1 ) {
			if( myself::InMyTerritory(creature) == 1 && creature.is_pc == 1 ) {
				if( creature.alive == 1 ) {
					myself.i_ai1 = 1;
				} else {
					myself.i_ai1 = 0;
				}
			} else {
				myself.i_ai1 = 0;
			}
			myself.i_ai3 = ( myself.i_ai3 + myself.i_ai1 );
		}
		myself.i_ai0 = 1;
		super;
	}

}
