Exemplo n.º 1
0
 private void AddOrUpdateNpc(S_SPAWN_NPC spawn, Monster npcData)
 {
     Dispatcher.InvokeAsync(() =>
     {
         var visibility = npcData.IsBoss && TccUtils.IsFieldBoss(npcData.ZoneId, npcData.TemplateId);
         var boss       = GetOrAddNpc(spawn.EntityId, npcData.ZoneId, npcData.TemplateId, npcData.IsBoss, visibility);
         SetHP(boss, npcData.MaxHP, npcData.MaxHP, HpChangeSource.CreatureChangeHp);
         SetEnrageTime(spawn.EntityId, spawn.RemainingEnrageTime);
         if (boss.Visible == visibility)
         {
             return;
         }
         boss.Visible = visibility;
         NpcListChanged?.Invoke();
     });
 }