Пример #1
0
        public void ApplyLevelBuff_AuthorityHandler(ConfigAbilityAction actionConfig, ActorAbility instancedAbility, ActorModifier instancedModifier, BaseAbilityActor target, BaseEvent evt, ref RecordInvokeEntryContext context)
        {
            LevelBuffSide  overrideCurSide;
            ApplyLevelBuff config    = (ApplyLevelBuff)actionConfig;
            float          duration  = base._Internal_CalculateApplyLevelBuffDuration(config, instancedAbility, evt);
            uint           runtimeID = instancedAbility.caster.runtimeID;

            if (config.UseOverrideCurSide)
            {
                overrideCurSide = config.OverrideCurSide;
            }
            else
            {
                overrideCurSide = base.CalculateLevelBuffSide(instancedAbility.caster.runtimeID);
            }
            MPSendPacketContainer pc = Singleton <MPManager> .Instance.CreateSendPacket <Packet_Level_RequestLevelBuff>();

            Packet_Level_RequestLevelBuff.StartPacket_Level_RequestLevelBuff(pc.builder);
            Packet_Level_RequestLevelBuff.AddLevelBuffType(pc.builder, (byte)config.LevelBuff);
            Packet_Level_RequestLevelBuff.AddEnteringSlow(pc.builder, config.EnteringTimeSlow);
            Packet_Level_RequestLevelBuff.AddAllowRefresh(pc.builder, config.LevelBuffAllowRefresh);
            Packet_Level_RequestLevelBuff.AddSide(pc.builder, (byte)overrideCurSide);
            Packet_Level_RequestLevelBuff.AddOwnerRuntimeID(pc.builder, runtimeID);
            Packet_Level_RequestLevelBuff.AddNotStartEffect(pc.builder, config.NotStartEffect);
            Packet_Level_RequestLevelBuff.AddDuration(pc.builder, duration);
            Packet_Level_RequestLevelBuff.AddInstancedAbilityID(pc.builder, (byte)instancedAbility.instancedAbilityID);
            Packet_Level_RequestLevelBuff.AddActionLocalID(pc.builder, (byte)config.localID);
            pc.Finish <Packet_Level_RequestLevelBuff>(Packet_Level_RequestLevelBuff.EndPacket_Level_RequestLevelBuff(pc.builder));
            Singleton <MPManager> .Instance.SendReliableToPeer(0x21800001, 1, pc);

            Singleton <MPLevelManager> .Instance.levelActor.GetPlugin <MPLevelAbilityHelperPlugin>().AttachPendingModifiersToNextLevelBuff(config, base._owner.runtimeID, instancedAbility.instancedAbilityID, (target != null) ? target.runtimeID : 0);
        }
Пример #2
0
        private void CreateLevelBuffEffect(LevelBuffType type, uint ownerID, int instancedAbilityID, int actionLocalID)
        {
            ApplyLevelBuff buff = this.LocateApplyLevelBuffConfig(ownerID, instancedAbilityID, actionLocalID);

            if ((buff != null) && !string.IsNullOrEmpty(buff.AttachLevelEffectPattern))
            {
                Singleton <EffectManager> .Instance.CreateUniqueIndexedEffectPattern(buff.AttachLevelEffectPattern, type.ToString(), Singleton <LevelManager> .Instance.levelEntity);
            }
        }
Пример #3
0
        public void AttachPendingModifiersToNextLevelBuff(ApplyLevelBuff config, uint ownerID, int instancedAbilityID, uint otherTargetID)
        {
            PendingApplyModifierEntry item = new PendingApplyModifierEntry {
                config             = config,
                ownerID            = ownerID,
                instancedAbilityID = instancedAbilityID,
                otherTargetID      = otherTargetID
            };

            this._pendingApplyLevelBuffs.Add(item);
        }