Author Sticky: Post Working Scripts Here
Ziggi Posted: Thursday, 27 June 02:20AM
Creature Proc
by ziggi

Creature will cast a fireball ( you can change this to other spells) every few rounds(this can also be adjusted by adjusting the counter values).

apply to your creatures onHeartbeat.

I am a scripting noob so there maybe easier ways to do this but this is what I came up with so here you go.

NWScript:
int iCounter = GetLocalInt(OBJECT_SELF, "m_iCounter"); //counter set to zero

    object oTarget = GetLastAttacker();

    if(iCounter <= 2)

    {

        iCounter = iCounter + 1;   //add one to counter until it reaches 3

    }

    else  //runs when counter = 3

    {

        ClearAllActions();

        ActionDoCommand(ActionSpeakString( "Die!" ));

        ActionDoCommand(ActionCastSpellAtObject(SPELL_FIREBALL, oTarget, METAMAGIC_NONE, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));

        iCounter = 0; //set counter back to zero

    }

    //save the local int

    SetLocalInt(OBJECT_SELF, "m_iCounter", iCounter);