INIT_STATE:	0

CONDITIONTABLE:
{
#sample: CONDITION cond_name	variable_type operation ref_value
NUM 12
CONDITION m_bIdle			bool EQ true
CONDITION m_bStopCapturing	bool EQ true
CONDITION m_bCapturingBase	bool EQ true
CONDITION m_bPanic			bool EQ true
CONDITION m_bGarrisonCastle	bool EQ true
CONDITION m_bDead			bool EQ true
CONDITION m_bAttackLord		bool EQ true
CONDITION m_bAttackCastle	bool EQ true
CONDITION m_bWalk			bool EQ true
CONDITION m_bWin			bool EQ true
CONDITION m_bLose			bool EQ true
CONDITION m_bSpell			bool EQ true
#CONDITION VERY_HAPPY	unsigned int GT 100
#CONDITION NotMyTower			bool NE true
#CONDITION NotAttacked			bool NE true
#CONDITION DistanceToTower		float LE 20.0
END
}

ACTIONTASKTABLE:
{
#sample: ACTIONTASK taskname
NUM 10
ACTIONTASK ChangeToIdle
ACTIONTASK ChangeToCapturingBase
ACTIONTASK ChangePanic
ACTIONTASK ChangeToGarrisonCastle
ACTIONTASK ChangeToDead
ACTIONTASK ChangeToAttackLord
ACTIONTASK ChangeToAttackCastle
ACTIONTASK ChangeToWin
ACTIONTASK ChangeToLose
ACTIONTASK ChangeToSpell
END
}

ACTIONTABLE:
{
#sample: ACTION GOTO_Idle			DO	ChangeToIdle 0.2 ChangeToIdle2 0.5 ChangeToIdle3 0.3  
NUM 10
ACTION GOTO_Idle			DO	ChangeToIdle 
ACTION GOTO_CapturingBase	DO	ChangeToCapturingBase
ACTION GOTO_Panic			DO	ChangePanic
ACTION GOTO_GarrisonCastle	DO	ChangeToGarrisonCastle
ACTION GOTO_Dead			DO	ChangeToDead
ACTION GOTO_AttackLord		DO	ChangeToAttackLord
ACTION GOTO_AttackCastle	DO	ChangeToAttackCastle
ACTION GOTO_Win				DO	ChangeToWin
ACTION GOTO_Lose			DO	ChangeToLose
ACTION GOTO_Spell			DO	ChangeToSpell
#	ACTION GOTO_WALK		DO	MOVE_WALK
END
}

TRIGGERTABLE:
{
NUM 17
TRIGGER TRIG_Idle			128 CONDITIONS m_bIdle
TRIGGER TRIG_StopCapturing	128 CONDITIONS m_bStopCapturing
TRIGGER TRIG_CapturingBase	128 CONDITIONS m_bCapturingBase
TRIGGER	TRIG_Panic			128 CONDITIONS m_bPanic
TRIGGER	TRIG_GarrisonCastle	128 CONDITIONS m_bGarrisonCastle
TRIGGER	TRIG_Dead			128 CONDITIONS m_bDead
TRIGGER	TRIG_NotDead			128 CONDITIONS !m_bDead
TRIGGER	TRIG_AttackLord		128 CONDITIONS m_bAttackLord
TRIGGER	TRIG_AttackCastle	128 CONDITIONS m_bAttackCastle
TRIGGER	TRIG_Walk			128 CONDITIONS m_bWalk
TRIGGER	TRIG_Win			128 CONDITIONS m_bWin
TRIGGER	TRIG_Lose			128 CONDITIONS m_bLose Notm_bDead
TRIGGER	TRIG_Spell			128 CONDITIONS m_bSpell
TRIGGER TRIG_NotCapturingBase	128 CONDITIONS !m_bCapturingBase
TRIGGER TRIG_Leave_AttackL	128 CONDITIONS !m_bAttackLord
TRIGGER TRIG_Leave_AttackC	128 CONDITIONS !m_bAttackCastle
TRIGGER	TRIG_Leave_Spell	128 CONDITIONS !m_bSpell
#TRIGGER	TRIG_Leave_Panic	128 CONDITIONS !m_bPanic
#TRIGGER TRIG_Leave_Walk		128 CONDITIONS !m_bWalk
#TRIGGER FAST_MOVE	100	CONDITIONS VERY_HAPPY	WANT_MOVE
#TRIGGER TRIG_CapturingBase	128 CONDITIONS DistanceToTower NotMyTower NotAttacked
#TRIGGER TRIG_NotCapturing	128 CONDITIONS Notm_bCapturingBase
END
}

STATEROUTE:
{
NUM 11

STATE Idle
{
TRY	TRIG_Win			THROW GOTO_Win
TRY	TRIG_Dead			THROW GOTO_Dead
TRY	TRIG_Lose			THROW GOTO_Lose
TRY	TRIG_Panic			THROW GOTO_Panic
TRY	TRIG_AttackLord		THROW GOTO_AttackLord
TRY	TRIG_AttackCastle	THROW GOTO_AttackCastle
TRY	TRIG_Spell			THROW GOTO_Spell
TRY	TRIG_CapturingBase	THROW GOTO_CapturingBase
END
}

STATE CapturingBase
{
TRY	TRIG_NotCapturingBase	THROW GOTO_Idle
TRY	TRIG_Win			THROW GOTO_Win
TRY	TRIG_Dead			THROW GOTO_Dead
TRY	TRIG_Lose			THROW GOTO_Lose
TRY	TRIG_Panic			THROW GOTO_Panic
#TRY	TRIG_NotCapturing		THROW GOTO_Idle
END
}

STATE Panic
{
TRY	TRIG_Leave_Panic	THROW GOTO_Idle
TRY	TRIG_Win			THROW GOTO_Win
TRY	TRIG_Lose			THROW GOTO_Lose
END
}

STATE GarrisonCastle
{
END
}

STATE Dead
{
TRY	TRIG_NotDead		THROW GOTO_Idle
TRY	TRIG_Win			THROW GOTO_Win
END
}

STATE AttackLord
{
TRY	TRIG_Win			THROW GOTO_Win
TRY	TRIG_Dead			THROW GOTO_Dead
TRY	TRIG_Lose			THROW GOTO_Lose
TRY	TRIG_Leave_AttackL	THROW GOTO_Idle
TRY	TRIG_AttackCastle	THROW GOTO_AttackCastle
TRY	TRIG_Panic			THROW GOTO_Panic
END
}

STATE AttackCastle
{
TRY	TRIG_Win			THROW GOTO_Win
TRY	TRIG_Dead			THROW GOTO_Dead
TRY	TRIG_Lose			THROW GOTO_Lose
TRY	TRIG_Leave_AttackC	THROW GOTO_Idle
TRY	TRIG_AttackLord		THROW GOTO_AttackLord
TRY	TRIG_Panic			THROW GOTO_Panic
END
}

STATE Win
{
END
}

STATE Lose
{
END
}

STATE Spell
{
TRY	TRIG_Win			THROW GOTO_Win
TRY	TRIG_Dead			THROW GOTO_Dead
TRY	TRIG_Lose			THROW GOTO_Lose
TRY	TRIG_Leave_Spell	THROW GOTO_Idle
TRY	TRIG_Panic			THROW GOTO_Panic
TRY	TRIG_AttackLord		THROW GOTO_AttackLord
TRY	TRIG_AttackCastle	THROW GOTO_AttackCastle
TRY	TRIG_CapturingBase	THROW GOTO_CapturingBase
END
}

STATE Dizzy
{
END
}

ROUTEEND
}
