Xenovant wrote...
If you remove the "on perception" script, the creature won't see/hear you when you are near but if you attack it, it will counterattack
Good Idea,
Going with Xenovant's thought I cam up with this.
#include "nw_i0_generic"
void main()
{
int bRiotState =GetLocalInt(GetArea(OBJECT_SELF),"RIOT_STATE");
int bMyState = GetLocalInt(OBJECT_SELF,"MY_STATE");
// Check to see if there has been a change in the mobs state.
if ( bMyState != bRiotState )
{
// There has been a change check to see wich one.
if (bMyState)
{
//MyState was true so the I was rioting and the riot is now over.
//Stop fighting and clear my state.
ClearAllActions(TRUE);
SetLocalInt(OBJECT_SELF,"MY_STATE",0);
}
else
{
//MyState was false so a riot has just started.
//Set MyState to true and make sure I start fighting enemys in the area.
SetLocalInt(OBJECT_SELF,"MY_STATE",1);
DetermineCombatRound();
}
}
// If we are in riot open our eyes, If not keep them closed.
if( bRiotState ) ExecuteScript("nw_c2_default2",OBJECT_SELF);
}
Place it in the OnPerception event of your Mob. Then inorder to start/stop the riot all you have to do is change the LocalInt "RIOT_STATE" on the area.. Set it to true and they will fight. Set it to false and the will close there eyes to enemys around them.