Esempio n. 1
0
        public static void SpawnNPC(ushort zoneId, uint templateId, ulong entityId, bool v, bool villager, int remainingEnrageTime)
        {
            if (Game.DB.MonsterDatabase.TryGetMonster(templateId, zoneId, out var m))
            {
                if (TccUtils.IsWorldBoss(zoneId, templateId))
                {
                    if (m.IsBoss)
                    {
                        var msg = ChatManager.Instance.Factory.CreateMessage(ChatChannel.WorldBoss, "System",
                                                                             $"{ChatUtils.Font(m.Name)}{ChatUtils.Font(" is nearby.", "cccccc", 15)}");
                        ChatManager.Instance.AddChatMessage(msg);
                    }
                }

                Game.NearbyNPC[entityId] = m.Name;
                FlyingGuardianDataProvider.InvokeProgressChanged();
                if (villager)
                {
                    return;
                }
                if (m.IsBoss)
                {
                    WindowManager.ViewModels.NpcVM.AddOrUpdateNpc(entityId, m.MaxHP, m.MaxHP, m.IsBoss, HpChangeSource.CreatureChangeHp, templateId, zoneId, v, remainingEnrageTime);
                }
                else
                {
                    if (App.Settings.NpcWindowSettings.HideAdds)
                    {
                        return;
                    }
                    WindowManager.ViewModels.NpcVM.AddOrUpdateNpc(entityId, m.MaxHP, m.MaxHP, m.IsBoss, HpChangeSource.CreatureChangeHp, templateId, zoneId, false, remainingEnrageTime);
                }
            }
        }