#include "NW_O2_CONINCLUDE"
#include "NW_I0_GENERIC"

void main()
{
    // First, set up the NPC's behavior
    SetSpawnInCondition(NW_FLAG_ON_DIALOGUE_EVENT); // OPTIONAL BEHAVIOR - Fire User Defined Event 1004
    //SetSpawnInCondition(NW_FLAG_DEATH_EVENT);      // OPTIONAL BEHAVIOR - Fire User Defined Event 1007

    SetListeningPatterns();    // Sets up which shouts the NPC will listen to.
    WalkWayPoints();           // Makes the NPC walk to its waypoints.
    GenerateNPCTreasure();     // Generates a small amount of treasure on the creature.
    SignalEvent(OBJECT_SELF, EventUserDefined(5000)); // Optional, based on your design.

    // Then, set the user-defined event script for the NPC
    object oNPC = GetObjectByTag("BlackJackDealer");
    SetScript(oNPC, 5011, "cas_dealer_ud");
}
