Ejemplo n.º 1
0
        };                                                                       //技能释放顺序表
        public bool SelectSpell()
        {
            if (mCurrSpellNode >= mSpellSNodes.Count())
            {
                mCurrSpellNode = 0;
            }

            int          spellId = SkillMgr.getElementByIndex(mSpellSNodes[mCurrSpellNode] - 1).ID;
            ASkillObject skbase  = mSkillMgr.GetSkill(spellId);

            if (skbase == null)
            {
                return(false);
            }

            var sk = skbase as SkillActive;

            if (sk == null)
            {
                return(false);
            }

            if (!sk.SkillCD.IsCoolDown() || !SkillCD.IsCoolDown())
            {
                return(false);
            }

            mCurrentSpellID = spellId;
            CSTable.SkillActiveData skillTplData = sk.Data as CSTable.SkillActiveData;
            mCastSpellDistance = skillTplData.range;

            return(true);
        }
Ejemplo n.º 2
0
        protected virtual bool InitTplData(IActorInitBase initBase)
        {
            var init = initBase as NpcInit;

            if (null == init)
            {
                return(false);
            }

            mNpcData.TemplateId = init.Data.tid;
            if (null == NPCData.Template)
            {
                return(false);
            }

            mNpcData.RoleName = NPCData.Template.name;
            mDeadBodyTime     = mNpcData.Template.deadBodyTime;
            SkillMgr.Init(this, mNpcData);

            mCurrentSpellID    = SkillMgr.getElementByIndex(0).ID;
            mCastSpellDistance = NPCData.Template.distance;
            mSpellType         = (ushort)eSkillTargetType.Enemy;

            BaseGameLogic <INPCLogic> bgLogic = (BaseGameLogic <INPCLogic>)GameLogicManager.Instance.GetGameLogic(eGameLogicType.NPCLogic, (short)mNpcData.Template.logic);

            if (null != bgLogic)
            {
                mLogic = bgLogic.Logic;
            }

            mState = eNPCState.Idle;

            return(true);
        }