Exemple #1
0
    public override void PostInit()
    {
        base.PostInit();

        // disable god mode, since that's enabled by default in the NPC
        IsGodMode.Value = false;

        if (NPCInfo != null)
        {
            DefaultTraderID = NPCInfo.TraderID;
        }

        InvokeRepeating("DisplayStats", 0f, 60f);

        // Check if there's a loot container or not already attached to store its stuff.
        DisplayLog(" Checking Entity's Loot Container");
        if (lootContainer == null)
        {
            DisplayLog(" Entity does not have a loot container. Creating one.");
            int lootList = GetLootList();
            DisplayLog(" Loot list is: " + lootList);
            lootContainer          = new TileEntityLootContainer(null);
            lootContainer.entityId = entityId;
            lootContainer.SetContainerSize(new Vector2i(8, 6), true);

            // If the loot list is available, set the container to that size.
            if (lootList != 0)
            {
                lootContainer.SetContainerSize(LootContainer.lootList[lootList].size, true);
            }
        }

        Buffs.SetCustomVar("$waterStaminaRegenAmount", 0, false);
    }
    public override void PostInit()
    {
        base.PostInit();

        // disable god mode, since that's enabled by default in the NPC
        IsGodMode.Value = false;

        if (NPCInfo != null)
        {
            DefaultTraderID = NPCInfo.TraderID;
        }

        InvokeRepeating("DisplayStats", 0f, 60f);

        // Check if there's a loot container or not already attached to store its stuff.
        DisplayLog(" Checking Entity's Loot Container");
        if (lootContainer == null)
        {
            DisplayLog(" Entity does not have a loot container. Creating one.");
            int lootList = GetLootList();
            DisplayLog(" Loot list is: " + lootList);
            lootContainer          = new TileEntityLootContainer(null);
            lootContainer.entityId = entityId;
            lootContainer.SetContainerSize(new Vector2i(8, 6), true);

            // If the loot list is available, set the container to that size.
            if (lootList != 0)
            {
                lootContainer.SetContainerSize(LootContainer.lootList[lootList].size, true);
            }
        }

        Buffs.SetCustomVar("$waterStaminaRegenAmount", 0, false);

        SetupStartingItems();
        inventory.SetHoldingItemIdx(0);

        // Does a quick local scan to see what pathing blocks, if any, are nearby. If one is found nearby, then it'll use that code for pathing.
        SetupAutoPathingBlocks();
    }