Пример #1
0
 /// <summary>
 /// Removes all ranks of this talent.
 /// </summary>
 internal void Remove(bool update)
 {
     Rank = -1;
     if (update)
     {
         TalentHandler.SendTalentGroupList(Talents);
     }
 }
Пример #2
0
 /// <summary>Removes all ranks of this talent.</summary>
 internal void Remove(bool update)
 {
     this.Rank = -1;
     if (!update)
     {
         return;
     }
     TalentHandler.SendTalentGroupList(this.Talents);
 }
Пример #3
0
        /// <summary>
        /// Removes the given amount of arbitrarily selected talents (always removes higher level talents first)
        /// </summary>
        public void RemoveTalents(int count)
        {
            var trees = Trees;

            // TODO: Remove depth-first, instead of breadth-first
            for (var i = 0; i < trees.Length; i++)
            {
                var tree = trees[i];
                while (m_treePoints[i] > 0 && count > 0)
                {
                    for (var r = tree.TalentTable.Length - 1; r >= 0; r--)
                    {
                        var row = tree.TalentTable[r];
                        foreach (var entry in row)
                        {
                            if (entry != null)
                            {
                                var talent = GetTalent(entry.Id);
                                if (talent != null)
                                {
                                    if (count >= talent.ActualRank)
                                    {
                                        count -= talent.ActualRank;
                                        talent.Remove();
                                    }
                                    else
                                    {
                                        talent.ActualRank -= count;
                                        count              = 0;
                                        TalentHandler.SendTalentGroupList(this);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            TalentHandler.SendTalentGroupList(this);
        }
Пример #4
0
 /// <summary>
 /// Called within Map Context.
 /// Sends initial packets
 /// </summary>
 private void OnLogin()
 {
     InstanceHandler.SendDungeonDifficulty(this);
     CharacterHandler.SendVerifyWorld(this);
     AccountDataHandler.SendAccountDataTimes(m_client);
     VoiceChatHandler.SendSystemStatus(this, VoiceSystemStatus.Disabled);
     // SMSG_GUILD_EVENT
     // SMSG_GUILD_BANK_LIST
     CharacterHandler.SendBindUpdate(this, BindLocation);
     TutorialHandler.SendTutorialFlags(this);
     SpellHandler.SendSpellsAndCooldowns(this);
     CharacterHandler.SendActionButtons(this);
     FactionHandler.SendFactionList(this);
     // SMSG_INIT_WORLD_STATES
     // SMSG_EQUIPMENT_SET_LIST
     AchievementHandler.SendAchievementData(this);
     // SMSG_EXPLORATION_EXPERIENCE
     CharacterHandler.SendTimeSpeed(this);
     TalentHandler.SendTalentGroupList(m_talents);
     AuraHandler.SendAllAuras(this);
     // SMSG_PET_GUIDS
 }
Пример #5
0
        /// <summary>
        /// Removes the given amount of arbitrarily selected talents (always removes higher level talents first)
        /// </summary>
        public void RemoveTalents(int count)
        {
            TalentTree[] trees = Trees;
            for (int index1 = 0; index1 < trees.Length; ++index1)
            {
                TalentTree talentTree = trees[index1];
                while (m_treePoints[index1] > 0 && count > 0)
                {
                    for (int index2 = talentTree.TalentTable.Length - 1; index2 >= 0; --index2)
                    {
                        foreach (TalentEntry talentEntry in talentTree.TalentTable[index2])
                        {
                            if (talentEntry != null)
                            {
                                Talent talent = GetTalent(talentEntry.Id);
                                if (talent != null)
                                {
                                    if (count >= talent.ActualRank)
                                    {
                                        count -= talent.ActualRank;
                                        talent.Remove();
                                    }
                                    else
                                    {
                                        talent.ActualRank -= count;
                                        count              = 0;
                                        TalentHandler.SendTalentGroupList(this);
                                        return;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            TalentHandler.SendTalentGroupList(this);
        }
Пример #6
0
        /// <summary>
        /// Sends Item-information and Talents to the given Character and keeps them updated until they
        /// are out of range.
        /// </summary>
        /// <param name="chr"></param>
        public void AddObserver(Character chr)
        {
            if (m_observers == null)
            {
                m_observers = new HashSet <Character>();
            }

            if (!m_observers.Contains(chr))
            {
                // only send item creation if Character wasn't already observing
                for (var i = InventorySlot.Bag1; i < InventorySlot.Bank1; i++)
                {
                    var item = m_inventory[i];
                    if (item != null)
                    {
                        item.WriteObjectCreationUpdate(chr);
                    }
                }

                m_observers.Add(chr);
            }

            TalentHandler.SendInspectTalents(chr);
        }