Esempio n. 1
0
    /// <summary>
    /// 创建实例
    /// </summary>
    public static CommitQuestRequest create(int id)
    {
        CommitQuestRequest re = (CommitQuestRequest)BytesControl.createRequest(dataID);

        re.id = id;
        return(re);
    }
Esempio n. 2
0
    /** 执行完成任务 */
    private void toCommitQuest(QuestData data, bool isAbs)
    {
        if (CommonSetting.isClientDriveLogic)
        {
            QuestConfig config = data.config;

            //删除任务道具
            DIntData[] questItemArr = config.questItem;
            if (questItemArr.Length > 0)
            {
                //如果需要删除任务道具
                me.bag.removeItems(questItemArr, 1, CallWayType.CommitQuest);
            }

            //执行任务完成动作组
            me.role.doRoleActions(config.completeActions, 1, CallWayType.CommitQuest);

            //有奖励
            if (data.config.rewardID > 0)
            {
                //奖励
                if (isAbs)
                {
                    me.bag.addRewardAbs(data.config.rewardID, CallWayType.CommitQuest);
                }
                else
                {
                    me.bag.addReward(data.config.rewardID, CallWayType.CommitQuest);
                }
            }

            doCommitQuest(data);
        }
        else
        {
            me.send(CommitQuestRequest.create(data.id));
        }
    }