public static Pathea.Replicator GetReplicator()
    {
        Pathea.PeEntity e = Pathea.PeCreature.Instance.mainPlayer;
        if (null == e)
        {
            return(null);
        }

        Pathea.ReplicatorCmpt c = e.GetCmpt <Pathea.ReplicatorCmpt>();
        if (null == c)
        {
            return(null);
        }

        return(c.replicator);
    }
    //学习合成技能
    void RPC_S2C_MergeSkillList(uLink.BitStream stream, uLink.NetworkMessageInfo info)
    {
        int[] skillIdList = stream.Read <int[]>();
        if (PlayerNetwork.mainPlayer == null || PlayerNetwork.mainPlayer.entity == null)
        {
            return;
        }
        Pathea.ReplicatorCmpt cmpt = PlayerNetwork.mainPlayer.entity.GetCmpt <Pathea.ReplicatorCmpt>();
        if (null != cmpt)
        {
            foreach (int id in skillIdList)
            {
                cmpt.replicator.AddFormula(id);
            }
        }

        //for (int i = 0; i < skillIdList.Length;i++ )
        //    PlayerFactory.mMainPlayer.AddPrescriptionID(skillIdList[i]);
    }
Beispiel #3
0
        bool LearnReplicatorFormula(ItemAsset.ReplicatorFormula formula, bool bLearn = true)
        {
            if (null == formula || formula.formulaId == null || formula.formulaId.Length <= 0)
            {
                return(false);
            }

            ReplicatorCmpt replicatorCmpt = Entity.GetCmpt <ReplicatorCmpt>();

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

            Replicator replicator = replicatorCmpt.replicator;

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

            if (bLearn)
            {
                bool ret = false;
                for (int i = 0; i < formula.formulaId.Length; i++)
                {
                    if (replicator.AddFormula(formula.formulaId [i]))
                    {
                        ret = true;
                    }
                }
                if (ret == false)
                {
                    new PeTipMsg(PELocalization.GetString(4000001), PeTipMsg.EMsgLevel.Warning);
                    return(ret);
                }
            }

            LearnEffectAndSound();
            return(true);
        }