Exemple #1
0
        public uint Execute(PacketDistributed ipacket)
        {
            CG_ASK_SPECIALAWARD packet = (CG_ASK_SPECIALAWARD )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
    void OnProcessEvent(int OptionIndex)
    {
        if (m_NpcDialogInfo != null)
        {
            DialogEventType _EventType = (DialogEventType)m_NpcDialogInfo.OptionDialogType;
            switch (_EventType)
            {
            case DialogEventType.EVENT_BLACKMARKET:
                if (OptionIndex == 1)
                {
                    //选项一
                    UIManager.ShowUI(UIInfo.BlackMarket);
                }
                break;

            case DialogEventType.EVENT_CANGKU:
                if (OptionIndex == 1)
                {
                    //选项一
                    UIManager.ShowUI(UIInfo.CangKu);
                }
                break;

            case DialogEventType.EVENT_AWARD:
                if (OptionIndex == 1)
                {
                    bool bRet = GameManager.gameManager.PlayerDataPool.CommonData.GetCommondFlag((int)USER_COMMONFLAG.CF_CYFANS_AWARD_FLAG);
                    if (!bRet)
                    {
                        CG_ASK_SPECIALAWARD Pack = (CG_ASK_SPECIALAWARD)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_SPECIALAWARD);
                        Pack.Awardid = (int)USER_COMMONFLAG.CF_CYFANS_AWARD_FLAG;
                        Pack.SendPacket();
                    }
                    else if (Singleton <ObjManager> .GetInstance().MainPlayer)
                    {
                        Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{3271}");
                    }
                }
                break;

            case DialogEventType.EVENT_RECOVER:
                if (OptionIndex == 1)
                {
                    DoRecover();
                }
                break;

            case DialogEventType.EVENT_CHANGENAME:
                if (OptionIndex == 1)
                {
                    OnChangeNameForCombineServer();
                }
                break;

            case DialogEventType.EVENT_PAOSHANG:
            {
                DoAcceptPaoShang(OptionIndex);
            }
            break;

            case DialogEventType.EVENT_MARRYRING:
            {
                MarryRootLogic.RepairMarryRing();
            }
            break;

            case DialogEventType.EVENT_NORMALVILLAIN:
            {
                if (OptionIndex == 1)
                {
                    OpenVillainCopyScene(1);
                }
            }
            break;

            case DialogEventType.EVENT_SUPERVILLAIN:
            {
                if (OptionIndex == 1)
                {
                    OpenVillainCopyScene(2);
                }
            }
            break;

            case DialogEventType.EVENT_NIANSHOU:
            {
                if (OptionIndex == 1)
                {
                    OpenNianShouCopyScene();
                }
            }
            break;

            case DialogEventType.EVENT_GONGJISHOP:
            {
                if (OptionIndex == 1)
                {
                    // 显示 UI
                    UIManager.ShowUI(UIInfo.GongJiShopRoot);
                }
            }
            break;

            default:
                break;
            }
            OnCloseClick();
        }
    }