Tibialyzer.Hunt.RefreshLootCreatures C# (CSharp) Method

RefreshLootCreatures() public method

public RefreshLootCreatures ( ) : List
return List
        public List<TibiaObject> RefreshLootCreatures()
        {
            List<TibiaObject> creatureObjects = new List<TibiaObject>();
            lock (huntLock) {
                this.lootCreatures.Clear();
                string[] creatures = this.trackedCreatures.Split('\n');
                foreach (string cr in creatures) {
                    string name = cr.ToLower();
                    Creature cc = StorageManager.getCreature(name);
                    if (cc != null && !creatureObjects.Contains(cc)) {
                        creatureObjects.Add(cc);
                        this.lootCreatures.Add(name);
                    } else if (cc == null) {
                        HuntingPlace hunt = StorageManager.getHunt(name);
                        if (hunt != null) {
                            foreach (int creatureid in hunt.creatures) {
                                cc = StorageManager.getCreature(creatureid);
                                if (cc != null && !creatureObjects.Any(item => item.GetName() == name)) {
                                    creatureObjects.Add(cc);
                                    this.lootCreatures.Add(cc.GetName());
                                }
                            }
                        }
                    }
                }
            }
            return creatureObjects;
        }

Usage Example

Example #1
0
 public static List<TibiaObject> refreshLootCreatures(Hunt h)
 {
     return h.RefreshLootCreatures();
 }
All Usage Examples Of Tibialyzer.Hunt::RefreshLootCreatures