const int find_next = 1;
const int finc_stop = 0;
func int PerceptionCheckItems(var C_NPC npc,var C_item itm)
{
if(Hlp_IsItem(itm,ItfoApple))
{
if(npc.guild == GIL_SCAVENGER)
{
Npc_PercDisable(npc,PERC_ASSESSITEM);
Npc_ClearAIQueue(npc);
AI_StartState (npc, ZS_MM_EatItem, 0 ,"");
};
return finc_stop;
};
if(Hlp_IsItem(itm,ItFoLoaf))
{
if(npc.guild == GIL_SCAVENGER)
{
Npc_PercDisable(npc,PERC_ASSESSITEM);
Npc_ClearAIQueue(npc);
AI_StartState (npc, ZS_MM_EatItem, 0 ,"");
};
return finc_stop;
};
if(Hlp_IsItem(itm,ItfoMutton))
{
if((npc.guild == GIL_WOLF) || (npc.guild == GIL_SHADOWBEAST) || (npc.guild == GIL_ORCDOG) || (npc.guild == GIL_SNAPPER) || (npc.guild == GIL_SCAVENGER) || (npc.guild == GIL_LURKER))
{
Npc_PercDisable(npc,PERC_ASSESSITEM);
Npc_ClearAIQueue(npc);
AI_StartState (npc, ZS_MM_EatItem, 0 ,"");
};
return finc_stop;
};
if(Hlp_IsItem(itm,ItfoMuttonRaw))
{
if((npc.guild == GIL_WOLF) || (npc.guild == GIL_SHADOWBEAST) || (npc.guild == GIL_ORCDOG) || (npc.guild == GIL_SNAPPER) || (npc.guild == GIL_SCAVENGER) || (npc.guild == GIL_LURKER))
{
Npc_PercDisable(npc,PERC_ASSESSITEM);
Npc_ClearAIQueue(npc);
AI_StartState (npc, ZS_MM_EatItem, 0 ,"");
};
return finc_stop;
};
if(Hlp_IsItem(itm,ItFo_mutton_01))
{
if((npc.guild == GIL_WOLF) || (npc.guild == GIL_SHADOWBEAST) || (npc.guild == GIL_ORCDOG) || (npc.guild == GIL_SNAPPER) || (npc.guild == GIL_SCAVENGER) || (npc.guild == GIL_LURKER))
{
Npc_PercDisable(npc,PERC_ASSESSITEM);
Npc_ClearAIQueue(npc);
AI_StartState (npc, ZS_MM_EatItem, 0 ,"");
};
return finc_stop;
};
return find_next;
};
func void B_MM_AssessItem()
{
PerceptionCheckItems(self,item);
};
// ----------------------------------------------------------------------------
func void ZS_MM_EatItem()
{
Npc_PercEnable (self, PERC_ASSESSDAMAGE, B_MM_ReactToDamage);
Npc_PercEnable (self, PERC_ASSESSMAGIC, B_AssessMagic);
Npc_PercEnable (self, PERC_ASSESSENEMY, B_MM_AssessEnemy);
Npc_PercEnable (self, PERC_ASSESSWARN, B_MM_AssessWarn);
PrintScreen(item.name,-1,-1,"font_old_20_white.tga",3);
if(Hlp_IsItem(item,ItfoApple) || Hlp_IsItem(item,ItfoMutton) || Hlp_IsItem(item,ItFoLoaf) || Hlp_IsItem(item,ItfoMuttonRaw) || Hlp_IsItem(item,ItFo_mutton_01))
{
AI_SetWalkmode (self, NPC_RUN);
AI_PlayAni (self, "T_PERCEPTION");
AI_GotoItem (self, item);
AI_PlayAni (self, "T_STAND_2_EAT");
}
else
{
Npc_ClearAIQueue(self);
Npc_PercDisable (self,PERC_ASSESSITEM);
Npc_PercEnable(self,PERC_ASSESSITEM,B_MM_AssessItem);
};
};
func int ZS_MM_EatItem_loop()
{
if(Hlp_IsItem(item,ItfoApple) || Hlp_IsItem(item,ItfoMutton) || Hlp_IsItem(item,ItFoLoaf) || Hlp_IsItem(item,ItfoMuttonRaw) || Hlp_IsItem(item,ItFo_mutton_01))
{
if (Npc_GetStateTime(self) > 10)
{
PrintScreen("ok",-1,-1,"font_old_20_white.tga",3);
return 1;
};
if (!Hlp_IsValidItem(item)) //Item weg
{
return 1;
};
return 0;
};
return 1;
};
func void ZS_MM_EatItem_end()
{
if(Hlp_IsItem(item,ItfoApple) || Hlp_IsItem(item,ItfoMutton) || Hlp_IsItem(item,ItFoLoaf) || Hlp_IsItem(item,ItfoMuttonRaw) || Hlp_IsItem(item,ItFo_mutton_01))
{
if (Hlp_IsValidItem (item))
{
Wld_RemoveItem (item);
};
AI_PlayAni (self, "T_EAT_2_STAND");
// AI_StartState (self,ZS_MM_SummonedByPC, 0 ,"");
};
};