Esempio n. 1
0
    public void Player_UseSkill(int idSkill)
    {
        CActionItem pAction = (CActionItem)CActionSystem.Instance.GetAction_SkillID(idSkill);

        if (pAction == null)
        {
            return;
        }

        //取得技能数据
        SCLIENT_SKILL pSkill = (SCLIENT_SKILL)pAction.GetImpl();

        if (pSkill == null)
        {
            return;
        }

        CAI_Base pMySelfAI = CObjectManager.Instance.getPlayerMySelf().CharacterLogic_GetAI();

        //发送消息
        SCommand_AI cmdTemp = new SCommand_AI();

        cmdTemp.m_wID = (int)AICommandDef.AIC_USE_SKILL;
        cmdTemp.SetValue(0, pSkill.m_pDefine.m_nID);
        cmdTemp.SetValue(1, pSkill.m_nLevel);
        cmdTemp.SetValue(2, MacroDefine.INVALID_ID);
        cmdTemp.SetValue(3, -1.0f);
        cmdTemp.SetValue(4, -1.0f);
        cmdTemp.SetValue(5, -1.0f);
        cmdTemp.SetValue(6, MacroDefine.INVALID_GUID);
        pMySelfAI.PushCommand(cmdTemp);

        //发送事件
        CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_ON_SKILL_ACTIVE, idSkill);
    }
        internal void Player_UseSkill(CActionItem_Skill skillAction, Vector3 pos)
        {
            //CActionItem pAction = (CActionItem)CActionSystem.Instance.GetAction_SkillID(skillDefineId);
            if (skillAction == null)
            {
                return;
            }

            CAI_Base pMySelfAI = CObjectManager.Instance.getPlayerMySelf().CharacterLogic_GetAI();

            SCLIENT_SKILL pSkill = (SCLIENT_SKILL)skillAction.GetImpl();

            if (pSkill == null)
            {
                return;
            }

            //发送消息
            SCommand_AI cmdTemp = new SCommand_AI();

            cmdTemp.m_wID = (int)AICommandDef.AIC_USE_SKILL;
            cmdTemp.SetValue <int>(0, pSkill.m_pDefine.m_nID);
            cmdTemp.SetValue <byte>(1, pSkill.m_nLevel);
            cmdTemp.SetValue <int>(2, MacroDefine.INVALID_ID);
            cmdTemp.SetValue <float>(3, pos.x);
            cmdTemp.SetValue <float>(4, pos.z);
            cmdTemp.SetValue <float>(5, -1);
            cmdTemp.SetValue <uint>(6, MacroDefine.INVALID_GUID);
            pMySelfAI.PushCommand(cmdTemp);

            //发送事件
            CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_ON_SKILL_ACTIVE, skillAction.GetDefineID());
        }
        internal void Player_AddCMDAfterMove(CMD_AFTERMOVE_TYPE type, int id, Vector2 PosTarget)
        {
            CAI_Base pMySelfAI = CObjectManager.Instance.getPlayerMySelf().CharacterLogic_GetAI();

            SCommand_AI cmdAfterMove = new SCommand_AI();

            cmdAfterMove.m_wID = (int)AICommandDef.AIC_CMD_AFTERMOVE;
            cmdAfterMove.SetValue(0, type);
            cmdAfterMove.SetValue(1, id);
            // 保存目的地信息 [6/1/2011 ivan edit]
            cmdAfterMove.SetValue(2, PosTarget);
            pMySelfAI.PushCommand(cmdAfterMove);
        }
Esempio n. 4
0
    public void Player_UseSkill(int idSkill, float fDir)
    {
        //判断是否为合法的范围技能
        CActionItem pAction = (CActionItem)CActionSystem.Instance.GetAction_SkillID(idSkill);

        if (pAction != null)
        {
            return;
        }

        //取得技能数据
        SCLIENT_SKILL pSkill = (SCLIENT_SKILL)pAction.GetImpl();

        if (pSkill != null)
        {
            return;
        }


        //检测目标是否合法

        //	if(!(pSkill->IsValidTarget(idObj))) return;


        CAI_Base pMySelfAI = CharacterLogic_GetAI();

        //发送消息
        SCommand_AI cmdTemp = new SCommand_AI();

        cmdTemp.m_wID = (int)AICommandDef.AIC_USE_SKILL;
        cmdTemp.SetValue(0, pSkill.m_pDefine.m_nID);
        cmdTemp.SetValue(1, pSkill.m_nLevel);
        cmdTemp.SetValue(2, MacroDefine.INVALID_ID);
        cmdTemp.SetValue(3, -1.0f);
        cmdTemp.SetValue(4, -1.0f);
        cmdTemp.SetValue(5, fDir);
        cmdTemp.SetValue(6, -1.0f);
        cmdTemp.SetValue(7, MacroDefine.INVALID_GUID);
        pMySelfAI.PushCommand(cmdTemp);

        //发送事件
        CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_ON_SKILL_ACTIVE, idSkill);
    }
        //使用生活技能,配方合成
        internal void Player_UseLifeAbility(int idPrescription, int nMakeCount, uint uFlag)
        {
            // 暂不实现自动重复制作的功能
            if (nMakeCount < 1)
            {
                return;
            }

            //判断是否满足使用技能之条件
            CAI_Base pMySelfAI = CObjectManager.Instance.getPlayerMySelf().CharacterLogic_GetAI();

            //发送消息
            SCommand_AI cmdTemp = new SCommand_AI();

            cmdTemp.m_wID = (int)AICommandDef.AIC_COMPOSE_ITEM;
            cmdTemp.SetValue <int>(0, idPrescription);
            cmdTemp.SetValue <uint>(1, uFlag);
            pMySelfAI.PushCommand(cmdTemp);
        }
        internal void Player_UseSkill(CActionItem_Skill skillAction, float dir)
        {
            //判断是否为合法的范围技能
            //CActionItem pAction = (CActionItem)CActionSystem.Instance.GetAction_SkillID(idSkill);

            if (skillAction == null)
            {
                return;
            }

            //取得技能数据
            SCLIENT_SKILL pSkill = (SCLIENT_SKILL)skillAction.GetImpl();

            if (pSkill == null)
            {
                return;
            }


            //检测目标是否合法

            //	if(!(pSkill->IsValidTarget(idObj))) return;


            CAI_Base pMySelfAI = CObjectManager.Instance.getPlayerMySelf().CharacterLogic_GetAI();
            //发送消息
            SCommand_AI cmdTemp = new SCommand_AI();

            cmdTemp.m_wID = (int)AICommandDef.AIC_USE_SKILL;
            cmdTemp.SetValue <int>(0, pSkill.m_pDefine.m_nID);
            cmdTemp.SetValue <byte>(1, pSkill.m_nLevel);
            cmdTemp.SetValue <int>(2, MacroDefine.INVALID_ID);
            cmdTemp.SetValue <float>(3, -1.0f);
            cmdTemp.SetValue <float>(4, -1.0f);
            cmdTemp.SetValue <float>(5, dir);
            cmdTemp.SetValue <uint>(6, MacroDefine.INVALID_GUID);
            pMySelfAI.PushCommand(cmdTemp);

            //发送事件
            CEventSystem.Instance.PushEvent(GAME_EVENT_ID.GE_ON_SKILL_ACTIVE, skillAction.GetDefineID());
        }