protected internal override void OnMinionLeftMap(NPC minion) { base.OnMinionLeftMap(minion); if (minion == m_activePet) { if (m_activePet.PetRecord != null) { m_activePet.UpdatePetData(m_record); ((ActiveRecordBase)m_activePet.PetRecord).SaveLater(); } } else if (minion.Entry.Type == CreatureType.Totem) { if (m_totems != null) { var index = minion.GetTotemIndex(); if (m_totems[index] == minion) { m_totems[index] = null; } } } else if (m_minions != null) { m_minions.Remove(minion); } }
protected internal override void OnMinionEnteredMap(NPC minion) { base.OnMinionEnteredMap(minion); if (minion.Entry.Type == CreatureType.Totem) { if (m_totems == null) { m_totems = new NPC[PetMgr.MaxTotemSlots]; } var index = minion.GetTotemIndex(); if (m_totems[index] != null) { m_totems[index].Delete(); } m_totems[index] = minion; } else if (minion != m_activePet) { if (m_minions == null) { m_minions = new NPCCollection(); } m_minions.Add(minion); } }