Example #1
0
        public override void Init(ServerNPC owner, WarMsgParam param)
        {
            parent = owner;
            ConsoleEx.DebugLog(parent.name);
            wmMgr    = WarServerManager.Instance;
            UniqueId = wmMgr.npcMgr.SignID(this);
            Camp     = Camp.set(owner.Camp);
            WarSrcAnimParam wp = param as WarSrcAnimParam;

            if (wp != null)
            {
                SelfDescribed sd     = wp.described;
                EndResult     result = sd.srcEnd;
                lifeTime = result.param8;
            }
            inited = true;
        }
Example #2
0
        /// <summary>
        /// Init the specified owner and param.
        /// </summary>
        /// <param name="owner">Owner.</param>
        /// <param name="param">Parameter.</param>
        public override void Init(ServerNPC owner, WarMsgParam param)
        {
            parent = owner;
            tran   = transform;
            wmMgr  = WarServerManager.Instance;
            Camp   = Camp.set(parent.Camp);

            WarSrcAnimParam srcParam = param as WarSrcAnimParam;

            if (srcParam != null)
            {
                SelfDescribed sd = srcParam.described;
                if (sd != null)
                {
                    EndResult result      = sd.targetEnd;
                    int       effectIndex = result.param2;
                    targetIndex = result.param5;
                    if (targetIndex > 0)
                    {
                        if (wmMgr != null)
                        {
                            target = wmMgr.npcMgr.GetNPCByUniqueID(targetIndex);
                        }
                    }
                    EffectConfigData effect = Core.Data.getIModelConfig <EffectModel>().get(effectIndex);
                    if (effect != null)
                    {
                        effectID      = effectIndex;
                        speed         = effect.Param3 / 1000f;
                        maxDis        = effect.Param4 / 1000;
                        damageType    = effect.Param8;
                        disappearType = effect.Param5;
                    }
//                    string msg = string.Format("[effect:{0} speed:{1} maxDis:{2} disappearType:{3} damageType:{4}]", effectID, speed, maxDis, disappearType, damageType);
//                    Debug.Log(msg);
                }
                inited = true;
            }
        }