コード例 #1
0
    public void TryActivate()
    {
        if (info == null)
        {
            return;
        }

        info.SetInactive();
        bActive = false;
        if (TalentMgr.QAvailablePoints())
        {
            if (nActivationLevel <= getTotalPoints())
            {
                if (!talent.QIsMaxLevel())
                {
                    info.SetActive();
                    bActive     = true;
                    plusOneText = "+1";
                }
                else
                {
                    plusOneText = "Max Level";
                }
            }
            else
            {
                plusOneText = "Required " + nActivationLevel + "points";
            }
        }
    }
コード例 #2
0
        public static void WriteAll()
        {
            DBSetup.Initialize();
            World.EnsureMapDataLoaded();
            SpellHandler.Initialize();
            FactionMgr.Initialize();
            SkillHandler.Initialize();
            TalentMgr.Initialize();

            WriteZoneEnum();
            WriteMapEnum();
            WriteSkillEnums();
            WriteRangeEnum();
            WriteFactionEnums();
            WriteSpellFocusEnum();
            WriteSpellId();
            WriteSpellMechanicEnum();
            WriteTalentEnums();
            WriteItemId();
            WriteItemSetId();
            WriteNpcId();
            WriteGOEntryId();
            WriteRealmCategory();

            NPCMgr.ForceInitialize();
            WriteRideEnum();
        }
コード例 #3
0
ファイル: SpellHandler.cs プロジェクト: NecroSharper/WCell
        public static void LoadSpells(bool init)
        {
            if (!loaded)
            {
                InitEffectHandlers();
                LoadOtherDBCs();

                SpellEffect.InitMiscValueTypes();
                loaded = true;
                Spell.InitDbcs();
                new DBCReader <Spell.SpellDBCConverter>(RealmServerConfiguration.GetDBCFile(WCellConstants.DBC_SPELL));

                ContentMgr.Load <SpellLearnRelation>();
                InitSummonHandlers();
                SkillHandler.Initialize();
                TalentMgr.Initialize();

                SpellLines.InitSpellLines();

                ContentMgr.Load <SpellProcEventEntry>();
                ProcEventHelper.PatchSpells(ById);
            }

            if (init)
            {
                Initialize2();
            }
        }
コード例 #4
0
ファイル: TalentPanelBtnMgr.cs プロジェクト: skarow/ChD
 public void TryActivate()
 {
     textAvailableTalenPoints.text = TalentMgr.GetAvailablePoints().ToString();
     foreach (var knButtonPair in talentButtons)
     {
         knButtonPair.Value.TryActivate();
     }
 }
コード例 #5
0
 public void IncreaseTalentLevel()
 {
     talent.IncreaseLevel();
     talent.Save();
     TalentMgr.UsePoint();
     TalentInfo_.Info.SetActive(false);
     TalentPanelBtnMgr.Instance.TryActivate();
     Init();
 }
コード例 #6
0
ファイル: SpellCommands.cs プロジェクト: NecroSharper/WCell
        public static Spell[] RetrieveSpells(CmdTrigger <RealmServerCmdArgs> trigger)
        {
            var ids    = trigger.Text.Remainder.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries);
            var spells = new List <Spell>(ids.Length);

            foreach (var id in ids)
            {
                // try SpellId
                SpellId sid;
                Spell   spell = null;
                if (EnumUtil.TryParse(id, out sid))
                {
                    spell = SpellHandler.Get(sid);
                }

                if (spell == null)
                {
                    // try SpellLine name
                    SpellLineId lineid;
                    if (EnumUtil.TryParse(id, out lineid))
                    {
                        var line = lineid.GetLine();
                        if (line != null)
                        {
                            spell = line.HighestRank;
                        }
                    }

                    if (spell == null)
                    {
                        // try talent name
                        var talentId = trigger.Text.NextEnum(TalentId.None);
                        var talent   = TalentMgr.GetEntry(talentId);
                        if (talent != null && talent.Spells != null && talent.Spells.Length > 0)
                        {
                            spell = talent.Spells[talent.Spells.Length - 1];                             // add highest rank
                        }

                        if (spell == null)
                        {
                            continue;
                        }
                    }
                }
                spells.Add(spell);
            }
            return(spells.ToArray());
        }
コード例 #7
0
ファイル: SpellGetCommand.cs プロジェクト: 0xFh/Asda2-Project
        public static Spell[] RetrieveSpells(CmdTrigger <RealmServerCmdArgs> trigger)
        {
            string[] strArray = trigger.Text.Remainder.Split(new string[1]
            {
                ","
            }, StringSplitOptions.RemoveEmptyEntries);
            List <Spell> spellList = new List <Spell>(strArray.Length);

            foreach (string input in strArray)
            {
                Spell   spell = null;
                SpellId result1;
                if (EnumUtil.TryParse(input, out result1))
                {
                    spell = SpellHandler.Get(result1);
                }
                if (spell == null)
                {
                    SpellLineId result2;
                    if (EnumUtil.TryParse(input, out result2))
                    {
                        SpellLine line = result2.GetLine();
                        if (line != null)
                        {
                            spell = line.HighestRank;
                        }
                    }

                    if (spell == null)
                    {
                        TalentEntry entry = TalentMgr.GetEntry(trigger.Text.NextEnum(TalentId.None));
                        if (entry != null && entry.Spells != null && entry.Spells.Length > 0)
                        {
                            spell = entry.Spells[entry.Spells.Length - 1];
                        }
                        if (spell == null)
                        {
                            continue;
                        }
                    }
                }

                spellList.Add(spell);
            }

            return(spellList.ToArray());
        }
コード例 #8
0
ファイル: TalentPanelBtnMgr.cs プロジェクト: skarow/ChD
 void Start()
 {
     CreateKnightTalents();
     InitTalentButtons();
     textAvailableTalenPoints.text = TalentMgr.GetAvailablePoints().ToString();
 }