func void B_AssessMagic()
{
var string concatText;
concatText = ConcatStrings("B_AssessMagic, spell: ",IntToString(Npc_GetLastHitSpellID(self)));
PrintScreen(concatText,10,30,FONT_ScreenSmall,1);
if(Npc_GetLastHitSpellCat(self) == SPELL_BAD)
{
Npc_SendPassivePerc(self,PERC_ASSESSFIGHTSOUND,self,other);
};
if(Npc_GetLastHitSpellID(self) == SPL_Whirlwind)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_Whirlwind,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_SuckEnergy)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_SuckEnergy,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_GreenTentacle)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_Greententacle,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_Swarm)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_Swarm,0,"");
return;
};
if((Npc_GetLastHitSpellID(self) == SPL_IceCube) || (Npc_GetLastHitSpellID(self) == SPL_IceWave))
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
if(Hlp_GetInstanceID(self) == Hlp_GetInstanceID(hero))
{
DAMAGEFREEZE = TRUE;
};
AI_StartState(self,ZS_MagicFreeze,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_ChargeZap)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_ShortZapped,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_Fear)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
Npc_SetTarget(self,other);
if((self.guild < GIL_SEPERATOR_HUM) && (self.guild != GIL_KDF) && (self.guild != GIL_GUR) && (self.guild != GIL_KDW) && (self.guild != GIL_PAL))
{
AI_StartState(self,ZS_MagicFlee,0,"");
return;
}
else if((self.guild > GIL_SEPERATOR_HUM) && (self.guild != GIL_DRAGON) && (self.guild != GIL_TROLL) && (self.guild != GIL_STONEGOLEM) && (self.guild != GIL_ICEGOLEM) && (self.guild != GIL_FIREGOLEM))
{
AI_StartState(self,ZS_MM_Flee,0,"");
return;
};
};
if(Npc_GetLastHitSpellID(self) == SPL_Firerain)
{
Npc_ClearAIQueue(self);
AI_StartState(self,ZS_MagicBurnShort,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_FIRELIGHT)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,ZS_Pyro,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_CONTROL)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,zs_controlled,0,"");
return;
};
if(Npc_GetLastHitSpellID(self) == SPL_TELEKINESIS)
{
Npc_ClearAIQueue(self);
B_ClearPerceptions(self);
AI_StartState(self,zs_telekinesis,0,"");
return;
};
};