func void ZS_MonsterReactToDamage()
{
	PrintDebug("...ZS_MonsterReactToDamage");	
	AI_TurnToNpc(self,other);
	Npc_WarnFriends(self,other);
	//if (C_AreWeStronger(self,other))
	//{
		//PrintDebug("...ZS_MonsterReactStronger");
		//if(self.guild !=GIL_GOBBO)
		//{
		//	PrintDebug("...ZS_MonsterReactStrongerGobbo");
			ZS_Attack();
		//};
	//}
	//else
	//{
	//	PrintDebug("...else");
	//
	//	AI_DoState(self,ZS_Flee,1);
	//};
};

func void ZS_MonsterFlee ()
{
	if (self.guild != GIL_ORC)
	{
		PrintDebug("...ZS_MonsterFlee");	
		AI_GotoWP(self, "ft_center"); // Hier bleib ich erst mal stehen
	}
	else
	{	
		PrintDebug("...OrcFlee");
		AI_GotoWP(self,"of_tower_entrance");
		Npc_WarnFriends(self,other);	
	};
};

func void ZS_MonsterAssessEnemy ()
{
	PrintDebug("ZS_MonsterAssessEnemy");	
	AI_TurnToNpc(self,other);

	ZS_Attack();

/* Jochens altes Skript
	PrintDebug("ZS_MonsterAssessEnemy");	
	AI_TurnToNpc(self,other);
	if (C_AreWeStronger(self,other) && self.guild != GIL_TROLL)
	{
		if ( self.guild != GIL_GOBBO)
		{	
			PrintDebug("...noGobbo");
			ZS_Attack();
		};
	}
	else if (!C_AreWeStronger (self,other))
	{
	    AI_DoState(self,ZS_MonsterFlee,7);
	}; 
*/
};
	
func void ZS_MonsterAssessThreat ()
{
	ZS_Attack();
};

func void ZS_MonsterAssessFriendsDamage ()
{
	ZS_Attack();

/*
	PrintDebug("...ZS_MonsterAssessFriendsDamage");	
	if (!C_AreWeStronger(self,other))
	{
		if (self.guild != GIL_ORC && self.guild != GIL_GOBBO)
		{
			PrintDebug("...!C_AreWeStronger");	
			ZS_Attack();
		}
		else 
		{
			AI_DoState(self,ZS_Flee,10);
		};
	}
	else
	{
		if (self.guild == GIL_ORC)
		{
			ZS_Attack();
		}
		else
		{
			AI_DoState(self,ZS_MonsterFLEE,10);
		};
	};
*/
};
func void ZS_MonsterObserveIntruder ()
{
	PrintDebug("...ZS_MonsterObserveIntruder");
	if (Npc_IsNear(self,other))
		{
		if (Npc_GetAttitude (self,other) == ATT_HOSTILE)
		{
			//if (C_AreWeStronger(self,other))
			//{
			//	if (self.guild != GIL_GOBBO)
			//	{
			//		PrintDebug("...Npc_GetAttitude (self,other) == ATT_HOSTILE+NoGobbo");	
					ZS_Attack ();
			//	};
			//}
			//else
			//{
			//	AI_DoState(self,ZS_MonsterFlee,10);
			//};
		}
		else 
		{
			PrintDebug("...else");	
			if (self.aivar[AIV_MonsterCounter] == 3)
			{
				PrintDebug("...AIV_MonsterCounter");	
				self.aivar [AIV_MonsterCounter] = 0;
			}
			else
			{
				PrintDebug("...else");	
				AI_TurnToNpc(self,other);
				self.aivar [AIV_MonsterCounter] += 1;
				if (self.aivar[AIV_MonsterCounter] == 3)
				{
					PrintDebug("...self.aivar[AIV_MonsterCounter] == 3");	
					AI_DoState(self,Zs_MonsterFlee,30);
					Npc_SetTempAttitude (self,ATT_HOSTILE);
					
				};
			};
		};
	};
};

func void ZS_TrollObserveIntruder ()
{
	if (!Npc_IsNear(self,other))
	{
		AI_TrollCallsGobbo(self);
	}
	else
	{
		PrintDebug("...ZS_TrollObserveIntruder");	
		if (Npc_GetAttitude (self,other) == ATT_HOSTILE)
		{
			PrintDebug("...Npc_GetAttitude (self,other) == ATT_HOSTILE");	
			ZS_Attack ();
		}
		else 
		{
			PrintDebug("...elseTroll");	
			if (self.aivar[AIV_TrollCounter] == 3)
			{
				PrintDebug("...AIV_TrollCounter");	
				self.aivar [AIV_TrollCounter] = 0;
			}
			else
			{
				PrintDebug("...else");	
				AI_TurnToNpc(self,other);
				self.aivar [AIV_TrollCounter] += 1;
				if (self.aivar[AIV_TrollCounter] == 3)
				{
					PrintDebug("...self.aivar[AIV_TrollCounter] == 3");	
					AI_DoState(self,Zs_MonsterFlee,30);
					Npc_SetTempAttitude (self,ATT_HOSTILE);
				};
				
			};
		};
	};
};

func void ZS_BeastReactToDamage()
{
	AI_TurnToNpc(self,other);
	Npc_WarnFriends(self,other);
	ZS_Attack();
};

func void ZS_BeastAssessEnemy ()
{
	if (C_CanIFleeFrom(self))
	{
		B_GoAway(self);
	};
};

func void ZS_BeastAssessFriendsDamage ()
{
	ZS_Attack();
};

func void ZS_BeastObserveIntruder ()
{
	if (C_CanIFleeFrom (self))
	{
		B_GoAway(self);
	}
	else
	{
		Npc_WarnFriends (self,other);
		AI_DoState (self,ZS_Attack,1);
	};
};	     

func void ZS_OWGobboObserveIntruder ()
{
	if (C_CanIFleeFrom (self))
	{
		B_GoAway(self);
	}
	else
	{
		Npc_WarnFriends (self,other);
		AI_DoState (self,ZS_Attack,1);
	};
};

func void ZS_MonsterAssessItem ()
{
	if (self.guild == GIL_GOBBO)
	{
		if (Wld_DetectItem (self,ITEM_KAT_NF)|| Wld_DetectItem (self, ITEM_KAT_FF))
		{
			AI_TakeItem (self,item);
		};
	};
};