Пример #1
0
    // 技能动画表aa
    protected void CreateSkill_Action(int job)
    {
        // 被动Action表aa
        Hashtable passive = sdConfDataMgr.Instance().GetTable("passiveaction");

        foreach (DictionaryEntry de1 in passive)
        {
            int         id           = int.Parse(de1.Key as string);
            Hashtable   animation    = de1.Value as Hashtable;
            sdBaseState passiveState = new sdBaseState();
            passiveState.id       = id;
            passiveState.info     = animation[job.ToString()] as string;
            passiveState.name     = animation["strName"] as string;
            passiveState.bPassive = true;

            logicTSM.AddActionState(passiveState);
        }

        // 主动Action表aa
        skillTree = sdSkillTree.createSkillTree(this, job);             //< 技能表aa

        Hashtable lstAction = sdConfDataMgr.Instance().m_vecJobSkillAction[job];

        if (lstAction != null)
        {
            skillIDRange range = sdConfDataMgr.Instance().m_JobSkillRange[job];
            for (int index = range.min; index <= range.max; ++index)
            {
                foreach (DictionaryEntry de in lstAction)
                {
                    int id = (int)de.Key;
                    if (id == index)
                    {
                        Hashtable action  = (Hashtable)de.Value;
                        int       pid     = (int)action["ParentID"];
                        int       skillid = pid / 100;
                        sdSkill   s       = skillTree.getSkill(skillid);
                        if (s == null)
                        {
                            continue;
                        }
                        sdBaseState state = s.AddAction(id, action);
                        logicTSM.AddActionState(state);
                        break;
                    }
                }
            }
        }

        sdTransitGraph.loadAndLinkActionState(this, job);
    }
Пример #2
0
    // 鍔犺浇鎶€鑳藉姩鐢昏〃aa
    //	1.琚?姩Action琛╝a
    //	2.鎶€鑳戒俊鎭?〃aa
    //	3.鎶€鑳紸ction琛╝a
    protected void CreateSkill_Action(ulong ulTemplateID)
    {
        {
            sdBaseState kPassiveDeathState = new sdBaseState();
            kPassiveDeathState.id       = 100;
            kPassiveDeathState.info     = "death01";
            kPassiveDeathState.name     = "death01";
            kPassiveDeathState.bPassive = true;

            sdBaseState kPassiveIdleState = new sdBaseState();
            kPassiveIdleState.id       = 101;
            kPassiveIdleState.info     = "idle01";
            kPassiveIdleState.name     = "idle01";
            kPassiveIdleState.bPassive = true;

            sdBaseState kPassiveKnockState = new sdBaseState();
            kPassiveKnockState.id       = 102;
            kPassiveKnockState.info     = "death01";
            kPassiveKnockState.name     = "death01";
            kPassiveKnockState.bPassive = true;

            sdBaseState kPassiveWalkState = new sdBaseState();
            kPassiveWalkState.id       = 103;
            kPassiveWalkState.info     = "walk01";
            kPassiveWalkState.name     = "walk01";
            kPassiveWalkState.bPassive = true;

            sdBaseState kPassiveStunState = new sdBaseState();
            kPassiveStunState.id       = 104;
            kPassiveStunState.info     = "stun01";
            kPassiveStunState.name     = "stun01";
            kPassiveStunState.bPassive = true;

            logicTSM.AddActionState(kPassiveDeathState);
            logicTSM.AddActionState(kPassiveIdleState);
            logicTSM.AddActionState(kPassiveKnockState);
            logicTSM.AddActionState(kPassiveWalkState);
            logicTSM.AddActionState(kPassiveStunState);
        }


        skillTree = new sdSkillTree();

        // 鏅?€氭敾鍑绘妧鑳絘a
        {
            int iDfSkillId = (int)Property["DfSkill"];

            Hashtable kSkillInfo   = sdConfDataMgr.Instance().m_MonsterSkillInfo[iDfSkillId] as Hashtable;
            Hashtable kSkillAction = sdConfDataMgr.Instance().m_MonsterSkillAction[iDfSkillId] as Hashtable;
            if (kSkillInfo != null)
            {
                int    iTemplateId = (int)kSkillInfo["dwTemplateID"];
                int    iPassive    = (int)kSkillInfo["byIsPassive"];
                string name        = kSkillInfo["strName"] as string;

                sdSkill kSkill = new sdSkill(name, iPassive == 1, iTemplateId);
                skillTree.Add(kSkill);
                kSkill.skillProperty = kSkillInfo;
                if (kSkillAction != null)
                {
                    sdBaseState kState = kSkill.AddAction(iDfSkillId, kSkillAction);
                    logicTSM.AddActionState(kState);
                    kState.SetInfo(kSkillAction, this);
                }
            }
        }

        // 瀹犵墿澶ф嫑aa
        if (GetActorType() == ActorType.AT_Pet)
        {
            int iSpSkillId = (int)Property["SpSkill"];

            Hashtable kSkillInfo   = sdConfDataMgr.Instance().m_MonsterSkillInfo[iSpSkillId] as Hashtable;
            Hashtable kSkillAction = sdConfDataMgr.Instance().m_MonsterSkillAction[iSpSkillId] as Hashtable;
            if (kSkillInfo != null)
            {
                int    iTemplateId = (int)kSkillInfo["dwTemplateID"];
                int    iPassive    = (int)kSkillInfo["byIsPassive"];
                string name        = kSkillInfo["strName"] as string;

                sdSkill kSkill = new sdSkill(name, iPassive == 1, iSpSkillId);
                skillTree.Add(kSkill);
                kSkill.skillProperty = kSkillInfo;
                if (kSkillAction != null)
                {
                    sdBaseState kState = kSkill.AddAction(iSpSkillId, kSkillAction);
                    logicTSM.AddActionState(kState);
                    kState.SetInfo(kSkillAction, this);
                }
            }
        }

        // 瀹犵墿鍜屾€?墿瑙﹀彂鎶€鑳絘a
        {
            int iSkillNum = 10;
            if (GetActorType() == ActorType.AT_Pet)
            {
                iSkillNum = 4;
            }

            for (int iIndex = 1; iIndex <= iSkillNum; ++iIndex)
            {
                string kSkillKey = "Skill" + iIndex.ToString();
                int    iSkillId  = (int)Property[kSkillKey];
                if (iSkillId > 0)
                {
                    Hashtable kSkillInfo   = sdConfDataMgr.Instance().m_MonsterSkillInfo[iSkillId] as Hashtable;
                    Hashtable kSkillAction = sdConfDataMgr.Instance().m_MonsterSkillAction[iSkillId] as Hashtable;
                    if (kSkillInfo != null)
                    {
                        int    iTemplateId = (int)kSkillInfo["dwTemplateID"];
                        int    iPassive    = (int)kSkillInfo["byIsPassive"];
                        string name        = kSkillInfo["strName"] as string;

                        sdSkill kSkill = new sdSkill(name, iPassive == 1, iSkillId);
                        skillTree.Add(kSkill);
                        kSkill.skillProperty = kSkillInfo;
                        if (kSkillAction != null)
                        {
                            sdBaseState kState = kSkill.AddAction(iSkillId, kSkillAction);
                            logicTSM.AddActionState(kState);
                            kState.SetInfo(kSkillAction, this);
                        }
                    }
                }
            }
        }
    }